You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolv...

52 lines
2.0 KiB
C++

#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/CUI.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;
}
// QString name = "";
// if (sig == SolutionAnalysisModuleProperty::KVISL)
// name = "actionViscosityModelEdit";
CUIConfig* uiConfig = CFDStructDataManager::getInstance()->getActionParamUIConfig(sig, idx);
// uiConfig->printConfig();
QWidget* widget = new CUI(nullptr, uiConfig);
propertyWidget->setWidget(widget);
return;
});
}
CFDStructOperatorsModelSolverProperty *CFDStructOperatorsModelSolverProperty::getInstance()
{
if (m_instance == nullptr) {
m_instance = new CFDStructOperatorsModelSolverProperty;
}
return m_instance;
}