1、通过信号驱动树节点渲染参数界面;

feature/struct-menu-20241023
simonyan 2 weeks ago
parent 64a0e6facf
commit 75fd950ebf

@ -1,4 +1,4 @@
#include "CFDStructDataManager.h"
#include "CFDStructDataManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CFDStructDataSolverBasicModelManager.h"
@ -11,6 +11,8 @@
#include "CFDStructDataSolverReferenceQuantityManager.h"
#include "CFDStructDataSolverComputingControlManager.h"
#include "CFDStructDataSolverMonitorResidualManager.h"
#include "CFDStructDataSolverMonitorAerodynamicManager.h"
#include "CFDStructDataSolverMonitorImpellerManager.h"
#include "CUIProperty/CUIConfig.h"
@ -22,44 +24,42 @@ CFDStructDataManager::CFDStructDataManager()
CFDStructDataManager *CFDStructDataManager::getInstance()
{
if (m_instance == nullptr)
{
if (m_instance == nullptr) {
m_instance = new CFDStructDataManager;
}
return m_instance;
}
CUIConfig *CFDStructDataManager::getActionParamUIConfig(QString s)
{
if (s == "actionTimeModeEdit")
CUIConfig *CFDStructDataManager::getActionParamUIConfig(SolutionAnalysisModuleProperty sig, QVariant idx)
{
qDebug("DataManager create TimeMode CUIConfig");
switch (sig) {
case SolutionAnalysisModuleProperty::Time_Mode:
return m_solverTimeModeManager->getParamUIConfig();
}
if (s == "actionBasicModelEdit")
case SolutionAnalysisModuleProperty::Basic_Model:
return m_solverBasicModeManager->getParamUIConfig();
if (s == "actionViscosityModelEdit")
case SolutionAnalysisModuleProperty::Viscosity_Model:
return m_solverKvislManager->getParamUIConfig();
if (s == "actionNumericalMethodsEdit")
case SolutionAnalysisModuleProperty::NUumerical_Methods:
return m_solverNumericalMethodManager->getParamUIConfig();
// 运动属性
if (s == "actionMotionPropertiesEdit")
case SolutionAnalysisModuleProperty::Motion_Properties:
return m_solverSportsAttributesManager->getParamUIConfig();
// Pressure-Inlet
if (s == "actionPressureInletEdit")
case SolutionAnalysisModuleProperty::Boundary_Conditions:
return m_solverBoundaryConditionManager->getParamUIConfig();
// 初始化
if (s == "actionInitializationEdit")
case SolutionAnalysisModuleProperty::Initialization:
return m_solverInitializationManager->getParamUIConfig();
// 参考量
if (s == "actionReferenceQuantityEdit")
case SolutionAnalysisModuleProperty::Computational_Control_Reference_Quantity:
return m_solverReferenceQuantityManager->getParamUIConfig();
// 计算控制
if (s == "actionComputationalControlEdit")
case SolutionAnalysisModuleProperty::Computational_Control:
return m_solverComputingControlManager->getParamUIConfig();
if (s == "actionComputationalMonitorsResidual")
case SolutionAnalysisModuleProperty::Monitors_Residual:
return m_solverMonitorResidualManager->getParamUIConfig();
case SolutionAnalysisModuleProperty::Monitors_AerodynamicForce:
return m_solverMonitorAerodynamicForceManager->getParamUIConfig();
case SolutionAnalysisModuleProperty::Monitors_Tubomachinery_Performance:
return m_solverMonitorTubomachineryPerformanceManager->getParamUIConfig();
default:
break;
}
qDebug() << "DataManager return null CUIConfig";
return nullptr;
}
@ -70,12 +70,12 @@ void CFDStructDataManager::initDataManagers()
m_solverBasicModeManager = new CFDStructDataSolverBasicModelManager;
m_solverKvislManager = new CFDStructDataSolverKvislManager;
m_solverNumericalMethodManager = new CFDStructDataSolverNumericalMethodManager;
m_solverSportsAttributesManager = new CFDStructDataSolverSportsAttributesManager;
m_solverBoundaryConditionManager = new CFDStructDataSolverBoundaryConditionManager;
m_solverInitializationManager = new CFDStructDataSolverInitializationManager;
m_solverReferenceQuantityManager = new CFDStructDataSolverReferenceQuantityManager;
m_solverComputingControlManager = new CFDStructDataSolverComputingControlManager;
m_solverMonitorResidualManager = new CFDStructDataSolverMonitorResidualManager;
m_solverMonitorAerodynamicForceManager = new CFDStructDataSolverMonitorAerodynamicManager;
m_solverMonitorTubomachineryPerformanceManager = new CFDStructDataSolverMonitorImpellerManager;
}

@ -1,7 +1,8 @@
#ifndef CFDSTRUCTDATAMANAGER_H
#ifndef CFDSTRUCTDATAMANAGER_H
#define CFDSTRUCTDATAMANAGER_H
#include "CFDStructDataManager_global.h"
#include "CFDStructMain/CFDStructDefine.h"
class CFDStructDataSolverSportsAttributesManager;
class CFDStructDataSolverBoundaryConditionManager;
@ -14,6 +15,8 @@ class CFDStructDataSolverBasicModelManager;
class CFDStructDataSolverKvislManager;
class CFDStructDataSolverNumericalMethodManager;
class CFDStructDataSolverMonitorResidualManager;
class CFDStructDataSolverMonitorAerodynamicManager;
class CFDStructDataSolverMonitorImpellerManager;
class CUIConfig;
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataManager
@ -23,7 +26,7 @@ public:
static CFDStructDataManager *getInstance();
// 获取一个action的参数设置配置
CUIConfig *getActionParamUIConfig(QString s);
CUIConfig *getActionParamUIConfig(SolutionAnalysisModuleProperty sig, QVariant idx);
private:
void initDataManagers();
@ -48,6 +51,10 @@ private:
CFDStructDataSolverComputingControlManager *m_solverComputingControlManager;
// 监控-残差曲线
CFDStructDataSolverMonitorResidualManager *m_solverMonitorResidualManager;
// 监控-气动力曲线
CFDStructDataSolverMonitorAerodynamicManager *m_solverMonitorAerodynamicForceManager;
// 监控-叶轮机械性能曲线
CFDStructDataSolverMonitorImpellerManager *m_solverMonitorTubomachineryPerformanceManager;
};
#endif // CFDSTRUCTDATAMANAGER_H

@ -1,4 +1,4 @@
#include "CFDStructDataSolverKvislManager.h"
#include "CFDStructDataSolverKvislManager.h"
#include "CUIProperty/CUIConfig.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
@ -7,7 +7,7 @@ CFDStructDataSolverKvislManager::CFDStructDataSolverKvislManager(QObject *parent
{
m_uiConfig = nullptr;
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) {
if (semaphore == (int)SolutionAnalysisModuleProperty::KVISL) {
if (semaphore == (int)SolutionAnalysisModuleProperty::Viscosity_Model) {
emit CFDStructSigsCenter::getInstance()->sig_solverKvislDataChanged();
}
});
@ -34,23 +34,23 @@ CUIConfig *CFDStructDataSolverKvislManager::getParamUIConfig()
if(m_Model == 4) {
return genCLESUIConfig();
}
return this->genInviscidUIConfig();
}
CUIConfig *CFDStructDataSolverKvislManager::genInviscidUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{new CUIConfig({
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -59,23 +59,26 @@ CUIConfig *CFDStructDataSolverKvislManager::genInviscidUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})})});
{"name", tr("CLES")}})
})
});
return nullptr;
}
CUIConfig *CFDStructDataSolverKvislManager::genLaminarUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{new CUIConfig({
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -84,24 +87,26 @@ CUIConfig *CFDStructDataSolverKvislManager::genLaminarUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})})});
{"name", tr("CLES")}})
})
});
return nullptr;
}
CUIConfig *CFDStructDataSolverKvislManager::genRANSSAUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -110,46 +115,50 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSSAUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})}),
{"name", tr("CLES")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:RANS模型
{"name", tr("RANS Model")},
{"widget", "GroupBox"},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{"name", tr("S-A")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:Menters's κ-ω(两方程)
{"name", tr("Menters's κ-ω")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:κ-ε(两方程)
{"name", tr("κ-ε")}})}),
{"name", tr("κ-ε")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:S-A类型
{"name", tr("S-A Type")},
{"widget", "GroupBox"},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:standard
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:standard
{"name", tr("standard")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:Edwards
{"name", tr("Edwards")}})}),
{"name", tr("Edwards")}})
}),
});
return nullptr;
}
CUIConfig *CFDStructDataSolverKvislManager::genRANSUIMentersConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -158,18 +167,21 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSUIMentersConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})}),
{"name", tr("CLES")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:RANS模型
{"name", tr("RANS Model")},
{"widget", "GroupBox"},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{"name", tr("S-A")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:Menters's κ-ω(两方程)
{"name", tr("Menters's κ-ω")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:κ-ε(两方程)
{"name", tr("κ-ε")}})}),
{"name", tr("κ-ε")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:κ-ω类型
{"name", tr("κ-ω Type")},
@ -186,17 +198,17 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSUIMentersConfig()
CUIConfig *CFDStructDataSolverKvislManager::genRANSKEUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -205,18 +217,21 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSKEUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})}),
{"name", tr("CLES")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:RANS模型
{"name", tr("RANS Model")},
{"widget", "GroupBox"},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程)
{"name", tr("S-A")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:Menters's κ-ω(两方程)
{"name", tr("Menters's κ-ω")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:κ-ε(两方程)
{"name", tr("κ-ε")}})}),
{"name", tr("κ-ε")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:κ-ε类型
{"name", tr("κ-ε Type")},
@ -232,19 +247,18 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSKEUIConfig()
CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -253,7 +267,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})}),
{"name", tr("CLES")}})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:DES
{"name", tr("DES Model")},
@ -292,17 +307,17 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig()
CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{
new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:层流
{"name", tr("Laminar")}}),
@ -311,7 +326,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig()
new CUIConfig({{"type", "RadioButton"}, // 按钮:分离涡模拟
{"name", tr("DES")}}),
new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")}})}),
{"name", tr("CLES")}})
}),
new CUIConfig({{"type", "RadioComponent"}, // 组:DES
{"name", tr("DES Model")},
{"widget", "GroupBox"}},
@ -346,17 +362,17 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig()
CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({
{
new CUIConfig({
{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")},
}),
@ -375,7 +391,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig()
new CUIConfig({
{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")},
})}),
})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:RANS模型
{"name", tr("RANS Model")},
@ -396,33 +413,34 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig()
{"name", tr("S-A Type")},
{"widget", "GroupBox"},
},
{new CUIConfig({
{
new CUIConfig({
{"type", "RadioButton"}, // 按钮:standard
{"name", tr("standard")},
}),
new CUIConfig({
{"type", "RadioButton"}, // 按钮:Edwards
{"name", tr("Edwards")},
})}),
})
}),
});
return nullptr;
}
CUIConfig *CFDStructDataSolverKvislManager::genCLESMentersUIConfig()
{
return new CUIConfig(
{{"type", "Widget"}},
{
{{"type", "Widget"}}, {
new CUIConfig({
{"type", "RadioComponent"}, // 组:模型
{"name", tr("Model")},
{"widget", "GroupBox"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_Model)},
{"semaphore", (int)SolutionAnalysisModuleProperty::KVISL},
{"semaphore", (int)SolutionAnalysisModuleProperty::Viscosity_Model},
},
{new CUIConfig({
{
new CUIConfig({
{"type", "RadioButton"}, // 按钮:无粘
{"name", tr("Inviscid")},
}),
@ -441,7 +459,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESMentersUIConfig()
new CUIConfig({
{"type", "RadioButton"}, // 按钮:约束大涡模型
{"name", tr("CLES")},
})}),
})
}),
new CUIConfig({
{"type", "RadioComponent"}, // 组:RANS模型
{"name", tr("RANS Model")},

@ -1,4 +1,4 @@
#include "CFDStructDataSolverTimeModeManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CUIProperty/CUIConfig.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
@ -9,9 +9,7 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *
{
m_uiConfig = nullptr;
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) {
if (semaphore == (int)SolutionAnalysisModuleProperty::TIME_MODE) {
emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged();
}
emit CFDStructSigsCenter::getInstance()->sig_solverModuleProperty((SolutionAnalysisModuleProperty)semaphore);
});
}
@ -46,7 +44,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig()
{"name", "Time Mode"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_runtype)},
{"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE},
{"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode},
}, {
new CUIConfig({
{"type", "Item"},
@ -75,7 +73,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig()
{"name", "Time Mode"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_runtype)},
{"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE},
{"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode},
}, {
new CUIConfig({
{"type", "Item"},

@ -1,4 +1,4 @@
#ifndef CFDSTRUCTDEFINE_H
#ifndef CFDSTRUCTDEFINE_H
#define CFDSTRUCTDEFINE_H
#include <QObject>
@ -49,8 +49,18 @@ Q_DECLARE_METATYPE(SolutionAnalysisTreeEnum)
// 属性变化信号
enum class SolutionAnalysisModuleProperty {
TIME_MODE,
KVISL,
Time_Mode,
Basic_Model,
Viscosity_Model,
NUumerical_Methods,
Motion_Properties,
Boundary_Conditions,
Initialization,
Computational_Control_Reference_Quantity,
Computational_Control,
Monitors_Residual,
Monitors_AerodynamicForce,
Monitors_Tubomachinery_Performance,
UNKNOW,
};

@ -1,4 +1,4 @@
#include "CFDTreeWidget.h"
#include "CFDTreeWidget.h"
#include "GUIFrame/MainWindow.h"
#include "GUIFrame/PropertyWidget.h"
@ -47,16 +47,11 @@ namespace GUI
void CFDTreeWidget::updateTree(QString s)
{
this->clear();
if (s == "SolutionAnalysis")
{
if (s == "SolutionAnalysis") {
addTreeSolutionAnalysis();
}
else if (s == "Postprocessing")
{
} else if (s == "Postprocessing") {
addTreePostprocessing();
}
else if (s == "Preprocessing")
{
} else if (s == "Preprocessing") {
addTreePreprocessing();
}
setItemsExpandable(true);
@ -219,91 +214,96 @@ namespace GUI
void CFDTreeWidget::onItemClicked(QTreeWidgetItem *item, int column)
{
EventOper::TreeEventOperator *treeOper = Core::FITKOperatorRepo::getInstance()->getOperatorT<EventOper::TreeEventOperator>("ModelTreeEvent");
if (treeOper == nullptr)
{
if (treeOper == nullptr) {
return;
}
EventOper::GraphEventOperator *graphOper = FITKOPERREPO->getOperatorT<EventOper::GraphEventOperator>("GraphPreprocess");
if (graphOper == nullptr)
{
if (graphOper == nullptr) {
return;
}
graphOper->clearHighlight();
if (item == nullptr)
{
if (item == nullptr) {
return;
}
int objID = item->data(1, 0).toInt();
SolutionAnalysisTreeEnum treeType = item->data(2, 0).value<SolutionAnalysisTreeEnum>();
Interface::FITKGeoEnum::FITKGeometryComType geometryType = item->data(3, 0).value<Interface::FITKGeoEnum::FITKGeometryComType>();
QString name = "";
SolutionAnalysisModuleProperty sig = SolutionAnalysisModuleProperty::UNKNOW;
switch (treeType)
{
// QMap<SolutionAnalysisTreeEnum, SolutionAnalysisModuleProperty> treeNodeToModuleProperty = {
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel, SolutionAnalysisModuleProperty::Basic_Model}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMotionProperties, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditionsPressureInlet, SolutionAnalysisModuleProperty::Time_Mode}
// {SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization, SolutionAnalysisModuleProperty::Time_Mode}
// };
switch (treeType) {
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode:
name = "actionTimeModeEdit";
sig = SolutionAnalysisModuleProperty::Time_Mode;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel:
name = "actionBasicModelEdit";
sig = SolutionAnalysisModuleProperty::Basic_Model;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel:
name = "actionViscosityModelEdit";
sig = SolutionAnalysisModuleProperty::KVISL;
sig = SolutionAnalysisModuleProperty::Viscosity_Model;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods:
name = "actionNumericalMethodsEdit";
sig = SolutionAnalysisModuleProperty::NUumerical_Methods;
break;
//---------------------------------------------------------------------------------------
// 运动属性
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMotionProperties:
name = "actionMotionPropertiesEdit";
sig = SolutionAnalysisModuleProperty::Motion_Properties;
break;
// Pressure-Inlet
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditionsPressureInlet:
name = "actionPressureInletEdit";
sig = SolutionAnalysisModuleProperty::Boundary_Conditions;
break;
// 初始化
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization:
name = "actionInitializationEdit";
sig = SolutionAnalysisModuleProperty::Initialization;
break;
// 参考量
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity:
name = "actionReferenceQuantityEdit";
sig = SolutionAnalysisModuleProperty::Computational_Control_Reference_Quantity;
break;
// 计算控制
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl:
name = "actionComputationalControlEdit";
sig = SolutionAnalysisModuleProperty::Computational_Control;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsResidual:
name = "actionComputationalMonitorsResidual";
sig = SolutionAnalysisModuleProperty::Monitors_Residual;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsAerodynamicForce:
sig = SolutionAnalysisModuleProperty::Monitors_AerodynamicForce;
break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsTurbomachineryPerformance:
sig = SolutionAnalysisModuleProperty::Monitors_Tubomachinery_Performance;
break;
default:
name = "";
break;
}
qDebug() << name << (int)sig;
qDebug() << (int)sig;
if (sig != SolutionAnalysisModuleProperty::UNKNOW) {
emit CFDStructSigsCenter::getInstance()->sig_solverModuleProperty(sig);
return;
}
if (!name.isEmpty())
{
QObject sender;
sender.setObjectName(name);
auto acOper = Core::FITKOperatorRepo::getInstance()->getOperatorT<Core::FITKActionOperator>(name);
if (acOper == nullptr)
{
qDebug("acOper is nullptr");
return;
}
acOper->setEmitter(&sender);
acOper->setArgs("objID", objID);
acOper->actionTriggered();
}
else
{
treeOper->moveProcessToStep(0);
}
// if (!name.isEmpty()) {
// QObject sender;
// sender.setObjectName(name);
// auto acOper = Core::FITKOperatorRepo::getInstance()->getOperatorT<Core::FITKActionOperator>(name);
// if (acOper == nullptr) {
// qDebug("acOper is nullptr");
// return;
// }
// acOper->setEmitter(&sender);
// acOper->setArgs("objID", objID);
// acOper->actionTriggered();
// } else {
// treeOper->moveProcessToStep(0);
// }
}
}

@ -1,4 +1,4 @@
#include "CFDStructOperatorsModelSolverProperty.h"
#include "CFDStructOperatorsModelSolverProperty.h"
#include "CFDStructOperatorsModelSolverProperty.h"
#include "GUIFrame/MainWindow.h"
@ -19,10 +19,10 @@ CFDStructOperatorsModelSolverProperty::CFDStructOperatorsModelSolverProperty(QOb
{
CFDStructSigsCenter* sigsCenter = CFDStructSigsCenter::getInstance();
connect(sigsCenter, &CFDStructSigsCenter::sig_solverModuleProperty, this, [ = ](SolutionAnalysisModuleProperty sig, QVariant idx) {
if (sig == SolutionAnalysisModuleProperty::UNKNOW)
if (sig == SolutionAnalysisModuleProperty::UNKNOW) {
return;
}
m_module = sig;
GUI::MainWindow* mainWindow = dynamic_cast<GUI::MainWindow*>(FITKAPP->getGlobalData()->getMainWindow());
if (mainWindow == nullptr) {
return;
@ -31,15 +31,14 @@ CFDStructOperatorsModelSolverProperty::CFDStructOperatorsModelSolverProperty(QOb
if (propertyWidget == nullptr) {
return;
}
QString name = "";
if (sig == SolutionAnalysisModuleProperty::KVISL)
name = "actionViscosityModelEdit";
CUIConfig* uiConfig = CFDStructDataManager::getInstance()->getActionParamUIConfig(name);
// 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;
});
}
@ -48,6 +47,5 @@ CFDStructOperatorsModelSolverProperty *CFDStructOperatorsModelSolverProperty::ge
if (m_instance == nullptr) {
m_instance = new CFDStructOperatorsModelSolverProperty;
}
return m_instance;
}

Loading…
Cancel
Save