|
|
|
|
#include "CFDStructOperatorsModelSolverProperty.h"
|
|
|
|
|
#include "CFDStructOperatorsModelSolverProperty.h"
|
|
|
|
|
|
|
|
|
|
#include "GUIFrame/MainWindow.h"
|
|
|
|
|
#include "GUIFrame/PropertyWidget.h"
|
|
|
|
|
|
|
|
|
|
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
|
|
|
|
|
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
|
|
|
|
|
#include "CFDStruct/CUIProperty/CUIPropertyWidget.h"
|
|
|
|
|
#include "CUIProperty/CUIConfig.h"
|
|
|
|
|
#include "CFDStructDataManager/CFDStructDataManager.h"
|
|
|
|
|
#include "CFDStructDataManager/CFDStructSigsCenter.h"
|
|
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
CFDStructOperatorsModelSolverProperty* CFDStructOperatorsModelSolverProperty::m_instance = nullptr;
|
|
|
|
|
CFDStructOperatorsModelSolverProperty::CFDStructOperatorsModelSolverProperty(QObject *parent) : QObject(parent)
|
|
|
|
|
{
|
|
|
|
|
CFDStructSigsCenter* sigsCenter = CFDStructSigsCenter::getInstance();
|
|
|
|
|
connect(sigsCenter, &CFDStructSigsCenter::sig_solverModuleProperty, this, [ = ](SolutionAnalysisModuleProperty sig, QVariant idx) {
|
|
|
|
|
if (sig == SolutionAnalysisModuleProperty::UNKNOW) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_module = sig;
|
|
|
|
|
GUI::MainWindow* mainWindow = dynamic_cast<GUI::MainWindow*>(FITKAPP->getGlobalData()->getMainWindow());
|
|
|
|
|
if (mainWindow == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GUI::PropertyWidget* propertyWidget = mainWindow->getPropertyWidget();
|
|
|
|
|
if (propertyWidget == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CUIConfig* uiConfig = CFDStructDataManager::getInstance()->getActionParamUIConfig(sig, idx);
|
|
|
|
|
QWidget* widget = new CUIPropertyWidget(nullptr, uiConfig);
|
|
|
|
|
if(widget != nullptr)
|
|
|
|
|
propertyWidget->setWidget(widget);
|
|
|
|
|
return;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFDStructOperatorsModelSolverProperty *CFDStructOperatorsModelSolverProperty::getInstance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == nullptr) {
|
|
|
|
|
m_instance = new CFDStructOperatorsModelSolverProperty;
|
|
|
|
|
}
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructOperatorsModelSolverProperty::CFDStructOperatorsModeSolverSaveData()
|
|
|
|
|
{
|
|
|
|
|
CFDStructSigsCenter* sigsCenter = CFDStructSigsCenter::getInstance();
|
|
|
|
|
connect(sigsCenter, &CFDStructSigsCenter::sig_solverSaveData, this, [ = ]() {
|
|
|
|
|
CFDStructDataManager::getInstance()->updateJson();
|
|
|
|
|
CFDStructDataManager::getInstance()->printJson();
|
|
|
|
|
});
|
|
|
|
|
}
|