diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp index 8e4c689..34b3c53 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp @@ -22,7 +22,6 @@ CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager() CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig() { - qDebug()<<"m_FluidProperties: "<genFluidPropertiesOffUIConfig(); if(m_FluidProperties == 1) @@ -67,7 +66,10 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig() {"name", tr("Multistage Turbomachinery")}})}), new CUIConfig({// 方形勾选:重叠网络 {"type", "CheckBox"}, - {"name", tr("Overlay Network")}}), + {"name", tr("Overlay Network")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin",QVA_GLOBAL(&m_OverlayNetwork)}, + }), new CUIConfig({// 方形选择按钮:流体属性 {"type", "CheckBox"}, {"name", tr("Fluid Properties")}, @@ -92,7 +94,10 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() })}), new CUIConfig({// 下拉框:流动模型 {"type", "ComboBox"}, - {"name", tr("Flow Model")}}, + {"name", tr("Flow Model")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin",QVA_GLOBAL(&m_FlowModel)}, + }, {new CUIConfig({// 选项:外流 {"type", "Item"}, {"name", tr("Internal Flow")}}), @@ -105,6 +110,8 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() new CUIConfig({// 方形勾选:重叠网络 {"type", "CheckBox"}, {"name", tr("Overlay Network")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin",QVA_GLOBAL(&m_OverlayNetwork)}, }), new CUIConfig({// 圆形选择按钮:流体属性 {"type", "CheckBox"}, @@ -119,18 +126,33 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() { new CUIConfig({// 气体成分 {"type", "LineEdit"}, - {"name", tr("Gas Composition")}}), + {"name", tr("Gas Composition")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin",QVA_GLOBAL(&m_GasComposition)}, + }), new CUIConfig({// 气体常数 {"type", "LineEdit"}, - {"name", tr("rgasmean")}}), + {"name", tr("rgasmean")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin",QVA_GLOBAL(&m_Rgasmean)}, + }), new CUIConfig({// 比热比 {"type", "LineEdit"}, - {"name", tr("gmean")}}), + {"name", tr("gmean")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin",QVA_GLOBAL(&m_Gmean)}, + }), new CUIConfig({// 层流普朗特数 {"type", "LineEdit"}, - {"name", tr("prlmean")}}), + {"name", tr("prlmean")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin",QVA_GLOBAL(&m_Prlmean)}, + }), new CUIConfig({// 湍流普朗特数 {"type", "LineEdit"}, - {"name", tr("prtmean")}}), + {"name", tr("prtmean")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin",QVA_GLOBAL(&m_Prtmean)}, + }), })}); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp index fca928d..e3cd198 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp @@ -11,7 +11,6 @@ CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditio m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { - qDebug() << semaphore << " ========================"; emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } @@ -27,16 +26,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() delete m_uiConfig; m_uiConfig = nullptr; } - // // 如果是定常 - // if (m_runtype == 0) { - // m_uiConfig = this->genSteadyModeUIConfig(); - // qDebug() << " steady ============"; - // } else { - // // 如果是非定常 - // m_uiConfig = this->genUnsteadyModeUIConfig(); - // qDebug() << " unsteady ============"; - // } - // m_uiConfig->printConfig(); + m_uiConfig = this->genFarFieldModeUIConfig(); return m_uiConfig; } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp index bc85f4e..ea03ef8 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp @@ -10,9 +10,7 @@ CFDStructDataSolverComputingControlManager::CFDStructDataSolverComputingControlM { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) - { - qDebug() << semaphore << " ========================"; - emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); + { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); } CFDStructDataSolverComputingControlManager::~CFDStructDataSolverComputingControlManager() @@ -64,8 +62,8 @@ CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() {"type", "CheckButton"}, // MPI库 {"name", tr("MPI library")}, }), - //TODO 数值计算核数 - //TODO 网格组装核数 + // TODO 数值计算核数 + // TODO 网格组装核数 }), }); return nullptr; diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp index 8fdc5ea..e01f63a 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -10,7 +10,6 @@ CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManag { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { - qDebug() << semaphore << " ========================"; emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.cpp index c3e4f08..0ae0986 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.cpp @@ -1,9 +1,16 @@ #include "CFDStructDataSolverKvislManager.h" #include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" CFDStructDataSolverKvislManager::CFDStructDataSolverKvislManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { + if (semaphore == (int)SolutionAnalysisModuleProperty::KVISL) { + emit CFDStructSigsCenter::getInstance()->sig_solverKvislDataChanged(); + } + }); } CFDStructDataSolverKvislManager::~CFDStructDataSolverKvislManager() @@ -12,7 +19,22 @@ CFDStructDataSolverKvislManager::~CFDStructDataSolverKvislManager() CUIConfig *CFDStructDataSolverKvislManager::getParamUIConfig() { - qDebug()<<"problem!!!"; + if(m_Model == 0){ + return genInviscidUIConfig(); + } + if(m_Model == 1){ + return genLaminarUIConfig(); + } + if(m_Model == 2){ + return genRANSSAUIConfig(); + } + if(m_Model == 3){ + return genDESSAUIConfig(); + } + if(m_Model == 4){ + return genCLESUIConfig(); + } + return this->genInviscidUIConfig(); } @@ -20,10 +42,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genInviscidUIConfig() { return new CUIConfig( {{"type", "Widget"}}, - {new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")}, - {"widget","GroupBox"}, - }, + {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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -41,10 +67,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genLaminarUIConfig() { return new CUIConfig( {{"type", "Widget"}}, - {new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")}, - {"widget","GroupBox"}, - }, + {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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -63,10 +93,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSSAUIConfig() return new CUIConfig( {{"type", "Widget"}}, { - new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")}, - {"widget","GroupBox"}, - }, + 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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -77,20 +111,22 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSSAUIConfig() {"name", tr("DES")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")}, - {"widget","GroupBox"}, - }, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, {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("κ-ε")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:S-A类型 - {"name", tr("S-A Type")}, - {"widget","GroupBox"}, - }, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:S-A类型 + {"name", tr("S-A Type")}, + {"widget", "GroupBox"}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:standard {"name", tr("standard")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:Edwards @@ -105,10 +141,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSUIMentersConfig() return new CUIConfig( {{"type", "Widget"}}, { - new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")}, - {"widget","GroupBox"}, - }, + 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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -119,19 +159,22 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSUIMentersConfig() {"name", tr("DES")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")}, - {"widget","GroupBox"}, - }, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, {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("κ-ε")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:κ-ω类型 - {"name", tr("κ-ω Type")}, - {"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:κ-ω类型 + {"name", tr("κ-ω Type")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({{"type", "RadioButton"}, // 按钮:standard {"name", tr("standard")}}), @@ -145,8 +188,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSKEUIConfig() return new CUIConfig( {{"type", "Widget"}}, { - new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")},{"widget","GroupBox"},}, + 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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -157,16 +206,22 @@ CUIConfig *CFDStructDataSolverKvislManager::genRANSKEUIConfig() {"name", tr("DES")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, {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("κ-ε")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:κ-ε类型 - {"name", tr("κ-ε Type")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:κ-ε类型 + {"name", tr("κ-ε Type")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({{"type", "RadioButton"}, // 按钮:standard {"name", tr("standard")}}), @@ -181,8 +236,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig() return new CUIConfig( {{"type", "Widget"}}, { - new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")},{"widget","GroupBox"},}, + 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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -193,8 +254,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig() {"name", tr("DES")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}})}), - new CUIConfig({{"type", "RadioComponent"}, // 组:DES - {"name", tr("DES Model")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:DES + {"name", tr("DES Model")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({{"type", "RadioButton"}, // 按钮:DES {"name", tr("DES")}}), @@ -203,8 +267,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig() new CUIConfig({{"type", "RadioButton"}, // 按钮:IDDES(两方程) {"name", tr("IDDES")}}), }), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程) {"name", tr("S-A")}}), @@ -212,7 +279,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESSAUIConfig() {"name", tr("Menters's κ-ω")}}), }), new CUIConfig({{"type", "RadioComponent"}, // 组:S-A类型 - {"name", tr("S-A Type")},{"widget","GroupBox"}}, + {"name", tr("S-A Type")}, + {"widget", "GroupBox"}}, { new CUIConfig({{"type", "RadioButton"}, // 按钮:standard {"name", tr("standard")}}), @@ -226,8 +294,14 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig() return new CUIConfig( {{"type", "Widget"}}, { - new CUIConfig({{"type", "RadioComponent"}, // 组:模型 - {"name", tr("Model")},{"widget","GroupBox"}}, + 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}, + }, {new CUIConfig({{"type", "RadioButton"}, // 按钮:无粘 {"name", tr("Inviscid")}}), new CUIConfig({{"type", "RadioButton"}, // 按钮:层流 @@ -239,7 +313,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig() new CUIConfig({{"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}})}), new CUIConfig({{"type", "RadioComponent"}, // 组:DES - {"name", tr("DES Model")},{"widget","GroupBox"}}, + {"name", tr("DES Model")}, + {"widget", "GroupBox"}}, { new CUIConfig({{"type", "RadioButton"}, // 按钮:DES {"name", tr("DES")}}), @@ -249,7 +324,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig() {"name", tr("IDDES")}}), }), new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")},{"widget","GroupBox"}}, + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}}, { new CUIConfig({{"type", "RadioButton"}, // 按钮:S-A(一方程) {"name", tr("S-A")}}), @@ -257,7 +333,8 @@ CUIConfig *CFDStructDataSolverKvislManager::genDESMentersUIConfig() {"name", tr("Menters's κ-ω")}}), }), new CUIConfig({{"type", "RadioComponent"}, // 组:κ-ω类型 - {"name", tr("κ-ω Type")},{"widget","GroupBox"}}, + {"name", tr("κ-ω Type")}, + {"widget", "GroupBox"}}, { new CUIConfig({{"type", "RadioButton"}, // 按钮:SST {"name", tr("SST")}}), @@ -274,7 +351,10 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig() new CUIConfig({ {"type", "RadioComponent"}, // 组:模型 {"name", tr("Model")}, - {"widget","GroupBox"}, + {"widget", "GroupBox"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_Model)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::KVISL}, }, {new CUIConfig({ {"type", "RadioButton"}, // 按钮:无粘 @@ -296,9 +376,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig() {"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}, })}), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")}, - {"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({ {"type", "RadioButton"}, // 按钮:S-A(一方程) @@ -309,9 +391,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESUIConfig() {"name", tr("Menters's κ-ω")}, }), }), - new CUIConfig({{"type", "RadioComponent"}, // 组:S-A类型 - {"name", tr("S-A Type")}, - {"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:S-A类型 + {"name", tr("S-A Type")}, + {"widget", "GroupBox"}, + }, {new CUIConfig({ {"type", "RadioButton"}, // 按钮:standard {"name", tr("standard")}, @@ -333,7 +417,10 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESMentersUIConfig() new CUIConfig({ {"type", "RadioComponent"}, // 组:模型 {"name", tr("Model")}, - {"widget","GroupBox"}, + {"widget", "GroupBox"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_Model)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::KVISL}, }, {new CUIConfig({ {"type", "RadioButton"}, // 按钮:无粘 @@ -355,8 +442,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESMentersUIConfig() {"type", "RadioButton"}, // 按钮:约束大涡模型 {"name", tr("CLES")}, })}), - new CUIConfig({{"type", "RadioComponent"}, // 组:RANS模型 - {"name", tr("RANS Model")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:RANS模型 + {"name", tr("RANS Model")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({ {"type", "RadioButton"}, // 按钮:S-A(一方程) @@ -367,8 +457,11 @@ CUIConfig *CFDStructDataSolverKvislManager::genCLESMentersUIConfig() {"name", tr("Menters's κ-ω")}, }), }), - new CUIConfig({{"type", "RadioComponent"}, // 组:κ-ω类型 - {"name", tr("κ-ω Type")},{"widget","GroupBox"},}, + new CUIConfig({ + {"type", "RadioComponent"}, // 组:κ-ω类型 + {"name", tr("κ-ω Type")}, + {"widget", "GroupBox"}, + }, { new CUIConfig({ {"type", "RadioButton"}, // 按钮:SST diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.h index 7579b74..a226726 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverKvislManager.h @@ -46,17 +46,25 @@ private: signals: private: - // // 鏃堕棿妯″紡 - // int m_runtype = 0; - // // 杩唬姝ユ暟锛>=1锛屽畾甯告椂锛氳凯浠f鏁帮紝闈炲畾甯革細鍐呰凯浠f鏁 int m_mcyc = 1000; - // // 姝ラ暱妯″紡锛屽浐瀹氾紝涓嶅彲淇敼 - // double m_alf0 = 1.0; - // // 鏃堕棿姝ラ暱锛0 - // double m_realdt = 1.0; - // // 鏃堕棿姝ユ暟锛=1 - // double m_nstep = 10; - // // 鏃跺潎缁熻閲忔暟鎹噰鏍0,1 - // int m_timeaverage = 0; + + //模型:0_无粘;1_层流;2_雷诺平均;3_分离涡模拟;4_约束大涡模拟; + int m_Model = 0; + + //RNS模型:0_S-A(一方程);1_Menters's κ-ω(两方程);2_κ-ε(两方程); + int m_RNSModel = 0; + + //S-A类型:0_standard;1_Edwards + int m_SAType = 0; + + //κ-ω类型:0_standard + int m_kwType = 0; + + //κ-ε类型:0_standard + int m_keType = 0; + + //DES模型:0_DES;1_DDES;2_IDDES + int m_DESModel = 0; + CUIConfig* m_uiConfig = nullptr; }; diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp index 0d6cc26..4d5b936 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp @@ -11,7 +11,6 @@ CFDStructDataSolverReferenceQuantityManager::CFDStructDataSolverReferenceQuantit m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { - qDebug() << semaphore << " ========================"; emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp index a9a87c3..5599944 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -9,10 +9,7 @@ CFDStructDataSolverSportsAttributesManager::CFDStructDataSolverSportsAttributesManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; - // connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { - // qDebug() << semaphore << " ========================"; - // emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); - // }); + } CFDStructDataSolverSportsAttributesManager::~CFDStructDataSolverSportsAttributesManager() diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h index 58cb6f2..6495e28 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -5,6 +5,38 @@ #include "CFDStructDataManager_global.h" class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverSportsAttributesItemManager(QObject *parent = nullptr); + ~CFDStructDataSolverSportsAttributesItemManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成运动坐标系的界面配置 + CUIConfig* genMovingFrameModeUIConfig(); + // 生成刚体的界面配置 + CUIConfig* genRigidBodyModeUIConfig(); +signals: + +private: + // // 时间模式:定常0,非定常1 + // int m_runtype = 0; + // // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + // int m_mcyc = 1000; + // // 步长模式 >=1 + // double m_alf0 = 1.0; + // // 时间步长 >0 + // double m_realdt = 1.0; + // // 时间步数 >=1 + // int m_nstep = 10; + // // 时均统计量数据采样:0 | 1 + // int m_timeaverage = 0; +}; + class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : public CFDStructDataManagerBase { Q_OBJECT @@ -19,9 +51,14 @@ private: CUIConfig* genMovingFrameModeUIConfig(); // 生成刚体的界面配置 CUIConfig* genRigidBodyModeUIConfig(); + + void add(); + void delte(int index); + signals: private: + QVector m_itemList; // // 时间模式:定常0,非定常1 // int m_runtype = 0; // // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 @@ -34,6 +71,7 @@ private: // int m_nstep = 10; // // 时均统计量数据采样:0 | 1 // int m_timeaverage = 0; + }; #endif // CFDSTRUCTDATASOLVERSPORTSATTRIBUTESMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp index 020d3c9..7cca0ef 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp @@ -9,8 +9,9 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { - qDebug() << semaphore << " ========================"; - emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); + if (semaphore == (int)SolutionAnalysisModuleProperty::TIME_MODE) { + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); + } }); } @@ -28,11 +29,9 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() // 如果是定常 if (m_runtype == 0) { m_uiConfig = this->genSteadyModeUIConfig(); - qDebug() << " steady ============"; } else { // 如果是非定常 m_uiConfig = this->genUnsteadyModeUIConfig(); - qDebug() << " unsteady ============"; } // m_uiConfig->printConfig(); return m_uiConfig; @@ -47,7 +46,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() {"name", "Time Mode"}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_origin", QVA_GLOBAL(&m_runtype)}, - {"semaphore", 1}, + {"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE}, }, { new CUIConfig({ {"type", "Item"}, @@ -76,7 +75,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() {"name", "Time Mode"}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_origin", QVA_GLOBAL(&m_runtype)}, - {"semaphore", 1}, + {"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE}, }, { new CUIConfig({ {"type", "Item"}, diff --git a/CFDStruct/CFDStructDataManager/CFDStructSigsCenter.h b/CFDStruct/CFDStructDataManager/CFDStructSigsCenter.h index 5bcd82a..875d182 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructSigsCenter.h +++ b/CFDStruct/CFDStructDataManager/CFDStructSigsCenter.h @@ -3,6 +3,8 @@ #include #include "CFDStructDataManager_global.h" +#include "CFDStructMain/CFDStructDefine.h" +#include class CFDSTRUCTDATAMANAGER_EXPORT CFDStructSigsCenter : public QObject { @@ -12,6 +14,8 @@ public: static CFDStructSigsCenter* getInstance(); signals: void sig_solverTimeModeDataChanged(); + void sig_solverKvislDataChanged(); + void sig_solverModuleProperty(SolutionAnalysisModuleProperty, QVariant idx = QVariant::Invalid); private: static CFDStructSigsCenter* m_instance; }; diff --git a/CFDStruct/CFDStructMain/CFDMainTreeWidget.cpp b/CFDStruct/CFDStructMain/CFDMainTreeWidget.cpp index 424007e..f063eb7 100644 --- a/CFDStruct/CFDStructMain/CFDMainTreeWidget.cpp +++ b/CFDStruct/CFDStructMain/CFDMainTreeWidget.cpp @@ -10,11 +10,6 @@ namespace GUI{ { this->m_PropertyWidget = prowidget; // this->setWidget(_treeWidget); - - if(this->m_PropertyWidget == NULL) - qDebug()<<"?????"; - - init(); } diff --git a/CFDStruct/CFDStructMain/CFDStructDefine.h b/CFDStruct/CFDStructMain/CFDStructDefine.h index 970f49f..cc212e0 100644 --- a/CFDStruct/CFDStructMain/CFDStructDefine.h +++ b/CFDStruct/CFDStructMain/CFDStructDefine.h @@ -47,5 +47,12 @@ enum class SolutionAnalysisTreeEnum { }; Q_DECLARE_METATYPE(SolutionAnalysisTreeEnum) +// 属性变化信号 +enum class SolutionAnalysisModuleProperty { + TIME_MODE, + KVISL, + UNKNOW, +}; + #endif // CFDSTRUCTDEFINE_H diff --git a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp index 9dd10b8..999760c 100644 --- a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp +++ b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp @@ -24,24 +24,14 @@ #include #include "CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h" - - - -//CFDStructMainWindow::CFDStructMainWindow() : GUI::MainWindow() -//{ -// qDebug()<<"new CFSStructMainWindow"; -//} -// -//void CFDStructMainWindow::initCentralWidget() { -// qDebug() << "CFDStruct iniCentralWidget"; -// -//} +#include "CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.h" using namespace GUI; CFDStructMainWindow::CFDStructMainWindow() { qDebug() << "new Empty CFDStructMainWindow"; + CFDStructOperatorsModelSolverProperty::getInstance(); initMainWindowMenu(); initCentralWidget(); initPropertyWidget(); diff --git a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp index b3ff2b1..e49867d 100644 --- a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp +++ b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp @@ -30,6 +30,8 @@ #include #include +#include "CFDStructDataManager/CFDStructSigsCenter.h" + namespace GUI { @@ -177,9 +179,6 @@ namespace GUI void CFDTreeWidget::addTreePostprocessing() { - // _treePostprocessing = new TreeWidget(this); - // tabWidget->addTab(_treePostprocessing,tr("Postprocessing")); - // qDebug()<<"!!!"; QTreeWidgetItem *PostProcessingItem = new QTreeWidgetItem(); PostProcessingItem->setText(0, tr("Post-processing")); PostProcessingItem->setData(1, 0, -1); @@ -239,6 +238,7 @@ namespace GUI SolutionAnalysisTreeEnum treeType = item->data(2, 0).value(); Interface::FITKGeoEnum::FITKGeometryComType geometryType = item->data(3, 0).value(); QString name = ""; + SolutionAnalysisModuleProperty sig = SolutionAnalysisModuleProperty::UNKNOW; switch (treeType) { case SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode: @@ -249,6 +249,7 @@ namespace GUI break; case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel: name = "actionViscosityModelEdit"; + sig = SolutionAnalysisModuleProperty::KVISL; break; case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods: name = "actionNumericalMethodsEdit"; @@ -278,7 +279,12 @@ namespace GUI default: name = ""; } - qDebug() << name; + qDebug() << name << (int)sig; + if (sig != SolutionAnalysisModuleProperty::UNKNOW) { + emit CFDStructSigsCenter::getInstance()->sig_solverModuleProperty(sig); + return; + } + if (!name.isEmpty()) { QObject sender; diff --git a/CFDStruct/CFDStructMain/CFDTreeWidget.h b/CFDStruct/CFDStructMain/CFDTreeWidget.h index b01bbd6..2a79bad 100644 --- a/CFDStruct/CFDStructMain/CFDTreeWidget.h +++ b/CFDStruct/CFDStructMain/CFDTreeWidget.h @@ -6,6 +6,7 @@ #include "CFDStructDefine.h" #include #include +#include "CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h" class MainWindow; class QTabWidget; diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModel.pri b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModel.pri index f4a22ac..aec7c6f 100644 --- a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModel.pri +++ b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModel.pri @@ -1,7 +1,7 @@ HEADERS += \ $$PWD/CFDStructOperatorsModelAPI.h \ - $$PWD/CFDStructOperatorsTimeModeManager.h + $$PWD/CFDStructOperatorsModelSolverProperty.h SOURCES += \ - $$PWD/CFDStructOperatorsTimeModeManager.cpp + $$PWD/CFDStructOperatorsModelSolverProperty.cpp diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.cpp b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.cpp new file mode 100644 index 0000000..5fd46a4 --- /dev/null +++ b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.cpp @@ -0,0 +1,53 @@ +#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 +#include + +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(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(name); +// 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; +} diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.h b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.h new file mode 100644 index 0000000..419b8e0 --- /dev/null +++ b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsModelSolverProperty.h @@ -0,0 +1,22 @@ +#ifndef CFDSTRUCTOPERATORSMODELSOLVERPROPERTY_H +#define CFDSTRUCTOPERATORSMODELSOLVERPROPERTY_H + +#include +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructOperatorsModelAPI.h" + +class CFDStructOperatorsModelAPI CFDStructOperatorsModelSolverProperty : public QObject +{ + Q_OBJECT +public: + explicit CFDStructOperatorsModelSolverProperty(QObject *parent = nullptr); + static CFDStructOperatorsModelSolverProperty* getInstance(); + +private: + static CFDStructOperatorsModelSolverProperty* m_instance; + SolutionAnalysisModuleProperty m_module = SolutionAnalysisModuleProperty::UNKNOW; +signals: + +}; + +#endif // CFDSTRUCTOPERATORSMODELSOLVERPROPERTY_H diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.cpp b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.cpp deleted file mode 100644 index 0822ca5..0000000 --- a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "CFDStructOperatorsTimeModeManager.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 -#include - -namespace ModelOper -{ - CFDStructOperatorsTimeModeManager::CFDStructOperatorsTimeModeManager() - { - qDebug() << "build Time Mode Manager"; - CFDStructSigsCenter* sigsCenter = CFDStructSigsCenter::getInstance(); - connect(sigsCenter, &CFDStructSigsCenter::sig_solverTimeModeDataChanged, this, [ = ]() { - QObject sender; - sender.setObjectName("actionTimeModeEdit"); - this->setEmitter(&sender); - this->execGUI(); - }); - } - - CFDStructOperatorsTimeModeManager::~CFDStructOperatorsTimeModeManager() - { - } - - bool CFDStructOperatorsTimeModeManager::execGUI() - { - QWidget* widget = nullptr; - GUI::MainWindow* mainWindow = dynamic_cast(FITKAPP->getGlobalData()->getMainWindow()); - if (mainWindow == nullptr) { - return false; - } - GUI::PropertyWidget* propertyWidget = mainWindow->getPropertyWidget(); - if (propertyWidget == nullptr) { - return false; - } - qDebug() << " ---------------------- senderName: " << _senderName; - qDebug() << "Time Mode Manager11111111111"; - widget = new QLabel("Time Mode Manager11111"); - - //------------------------------------------------------------------------------ -// if (_senderName == "actionTimeModeEdit") { -// CUIConfig* uiConfig = CFDStructDataManager::getInstance()->getActionParamUIConfig(1); -// // uiConfig->printConfig(); -// widget = new CUI(nullptr, uiConfig); -// } - //------------------------------------------------------------------------------- - - CUIConfig* uiConfig = CFDStructDataManager::getInstance()->getActionParamUIConfig(_senderName); - - if(uiConfig!=nullptr) - { - uiConfig->printConfig(); - widget = new CUI(nullptr,uiConfig); - } - else{ - qDebug()<<"Operators cant get uiconfig"; - } - - propertyWidget->setWidget(widget); - return false; - } - - bool CFDStructOperatorsTimeModeManager::execProfession() - { - return true; - } -} diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h deleted file mode 100644 index c88bc1f..0000000 --- a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _CFDStructOperatorsTimeModeManager_H -#define _CFDStructOperatorsTimeModeManager_H - -#include "OperatorsModel/OperManagerBase.h" -#include "CFDStructOperatorsModelAPI.h" - -namespace ModelOper -{ - - class CFDStructOperatorsModelAPI CFDStructOperatorsTimeModeManager : public OperManagerBase - { - Q_OBJECT; - public: - /** - * @brief Construct a new Operators Mesh Base Manager object - */ - CFDStructOperatorsTimeModeManager(); - /** - * @brief Destroy the Operators Mesh Base Manager object - */ - ~CFDStructOperatorsTimeModeManager(); - /** - * @brief 执行 - * @return true 成功 - * @return false 失败 - */ - virtual bool execGUI(); - /** - * @brief 执行结果处理 - * @return true 成功 - * @return false 失败 - */ - virtual bool execProfession(); - }; - - // 按钮注册相关操作 - Register2FITKOPeratorRepo(actionTimeModeEdit, CFDStructOperatorsTimeModeManager); - Register2FITKOPeratorRepo(actionBasicModelEdit, CFDStructOperatorsTimeModeManager); - Register2FITKOPeratorRepo(actionViscosityModelEdit, CFDStructOperatorsTimeModeManager); - Register2FITKOPeratorRepo(actionNumericalMethodsEdit, CFDStructOperatorsTimeModeManager); - //运动属性 - Register2FITKOPeratorRepo(actionMotionPropertiesEdit, CFDStructOperatorsTimeModeManager); - //Pressure-Inlet - Register2FITKOPeratorRepo(actionPressureInletEdit, CFDStructOperatorsTimeModeManager); - //初始化 - Register2FITKOPeratorRepo(actionInitializationEdit, CFDStructOperatorsTimeModeManager); - //参考量 - Register2FITKOPeratorRepo(actionReferenceQuantityEdit, CFDStructOperatorsTimeModeManager); - //计算控制 - Register2FITKOPeratorRepo(actionComputationalControlEdit, CFDStructOperatorsTimeModeManager); -} - -#endif diff --git a/CFDStruct/CUIProperty/CUI.cpp b/CFDStruct/CUIProperty/CUI.cpp index 2261841..122164d 100644 --- a/CFDStruct/CUIProperty/CUI.cpp +++ b/CFDStruct/CUIProperty/CUI.cpp @@ -22,8 +22,9 @@ CUI::CUI(QWidget *parent, CUIConfig *conf): QWidget(parent) { this->conf = conf; - qDebug() << "----------------------"; buildUI(); + if(conf->getPropertyValue("type") == "Widget") + qDebug()<<"new a Widget"; } /** @@ -41,7 +42,6 @@ void CUI::buildUI() } else if(type == "GroupBox") { widget = new CUIGroupBox(conf, subCUI); } else if(type == "LineEdit") { - qDebug()<<"new CUILineEdit"; widget = new CUILineEdit(conf, subCUI); } else if(type == "TabWidget") { widget = new CUITabWidget(conf, subCUI); @@ -59,17 +59,12 @@ void CUI::buildUI() widget = new CUIRadioComponent(conf,subCUI); } if (widget) { - qDebug() << "----------- ui widget is not null"; QVBoxLayout *layout = new QVBoxLayout; layout->setSpacing(0); layout->setMargin(0); layout->addWidget(widget); this->setLayout(layout); -// QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); -// layout->addSpacerItem(verticalSpacer); - } else { - qDebug() << "----------- ui widget is null"; } } diff --git a/CFDStruct/CUIProperty/CUIButtonBox.cpp b/CFDStruct/CUIProperty/CUIButtonBox.cpp index a8b885a..61513c1 100644 --- a/CFDStruct/CUIProperty/CUIButtonBox.cpp +++ b/CFDStruct/CUIProperty/CUIButtonBox.cpp @@ -31,11 +31,7 @@ void CUIButtonBox::iniUI(QVector &subCUI) m_groupBox->setTitle(conf->getPropertyValue("name")); m_layout = this->getLayout(conf); m_groupBox->setLayout(m_layout); - qDebug() << this->conf->getSub().size(); for(auto conf : this->conf->getSub()) { -// CUI* tmp = new CUI(nullptr, conf); -// subCUI.push_back(tmp); -// m_layout->addWidget(tmp->getUI()); QRadioButton* radio = new QRadioButton(conf->getPropertyValue("name")); m_layout->addWidget(radio); } diff --git a/CFDStruct/CUIProperty/CUICheckBox.cpp b/CFDStruct/CUIProperty/CUICheckBox.cpp index 5be1df8..8924827 100644 --- a/CFDStruct/CUIProperty/CUICheckBox.cpp +++ b/CFDStruct/CUIProperty/CUICheckBox.cpp @@ -21,7 +21,6 @@ void CUICheckBox::iniUI(QVector &subCUI) } connect(this, QOverload::of(&QCheckBox::clicked),[ = ](bool sign){ - qDebug()<<"CheckBox is clicked"<<' '<conf->setValue((int)sign); }); } diff --git a/CFDStruct/CUIProperty/CUIComboBox.cpp b/CFDStruct/CUIProperty/CUIComboBox.cpp index 36aed06..a460ad3 100644 --- a/CFDStruct/CUIProperty/CUIComboBox.cpp +++ b/CFDStruct/CUIProperty/CUIComboBox.cpp @@ -49,19 +49,11 @@ void CUIComboBox::iniUI(QVector &subCUI) this->setLayout(layout); layout->addWidget(label); layout->addWidget(comboBox); -// layout->setStretchFactor(label,1); layout->setStretchFactor(comboBox, 1); -// comboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); -// comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); -// label->setMinimumWidth(114); - qDebug() << label->minimumSizeHint() << " combobox"; - + iniComoboBox(); - qDebug()<<"finish create Combobox"; - connect(comboBox, QOverload::of(&QComboBox::activated), [ = ](int idx) { - qDebug() << comboBox->itemData(idx); this->conf->setValue(idx); }); } @@ -74,7 +66,6 @@ void CUIComboBox::iniComoboBox() for(auto cui : conf->getSub()) { QString type = cui->getPropertyValue("type"); if(type != "Item") { - qDebug() << "wrong type!!!"; return; } CUI* temp = new CUI(nullptr, cui); @@ -86,14 +77,12 @@ void CUIComboBox::iniComoboBox() } else { comboBox->addItem(temp->getProperty("name"), temp->getProperty("data")); } - qDebug()<<"finish add ComboBox Item"; } QVariant vOrigin = conf->getPropertyOriginValue("value_origin"); int *ptr = qvariant_cast(vOrigin); if(ptr!=nullptr) { - qDebug()<<"------------------------------------------------ptr is "<<*ptr; comboBox->setCurrentIndex(*ptr); } } diff --git a/CFDStruct/CUIProperty/CUIConfig.cpp b/CFDStruct/CUIProperty/CUIConfig.cpp index 7b1867a..294e4af 100644 --- a/CFDStruct/CUIProperty/CUIConfig.cpp +++ b/CFDStruct/CUIProperty/CUIConfig.cpp @@ -87,24 +87,22 @@ CUIConfig::CUIConfig(QMap property, QVector sub) */ void CUIConfig::printConfig() { - qDebug() << "{"; - for(auto it = property.begin(); it != property.end(); it++) { - qDebug() << it.key() << ' ' << it.value(); - } - for(auto it : sub) { - it->printConfig(); - } - qDebug() << "}"; +// qDebug() << "{"; +// for(auto it = property.begin(); it != property.end(); it++) { +// qDebug() << it.key() << ' ' << it.value(); +// } +// for(auto it : sub) { +// it->printConfig(); +// } +// qDebug() << "}"; } void CUIConfig::setValue(QVariant value) { -// qDebug()<<"setValue "<(pValue); - qDebug()<<"value_type is int"< &subCUI) m_groupBox->setTitle(conf->getPropertyValue("name")); m_layout = this->getLayout(conf); m_groupBox->setLayout(m_layout); - qDebug() << this->conf->getSub().size(); for(auto conf : this->conf->getSub()) { CUI* tmp = new CUI(nullptr, conf); subCUI.push_back(tmp); diff --git a/CFDStruct/CUIProperty/CUIRadioComponent.cpp b/CFDStruct/CUIProperty/CUIRadioComponent.cpp index b40df30..4616513 100644 --- a/CFDStruct/CUIProperty/CUIRadioComponent.cpp +++ b/CFDStruct/CUIProperty/CUIRadioComponent.cpp @@ -6,11 +6,16 @@ #include #include #include +#include CUIRadioComponent::CUIRadioComponent(CUIConfig *conf, QVector &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent) { this->conf = conf; iniUI(subCUI); + + connect(m_ButtonGroup,QOverload::of(&QButtonGroup::buttonClicked),[=](int idx){ + this->conf->setValue((int)idx); + }); } @@ -21,6 +26,8 @@ void CUIRadioComponent::iniUI(QVector &subCUI) QHBoxLayout* mainLayout = new QHBoxLayout; m_layout = this->getLayout(conf); + m_ButtonGroup = new QButtonGroup; + if(widget_type == "GroupBox"){ iniUI_GroupBox(); mainLayout->addWidget(m_GroupBox); @@ -38,9 +45,12 @@ void CUIRadioComponent::iniUI_GroupBox() m_GroupBox = new QGroupBox; m_GroupBox->setTitle(conf->getPropertyValue("name")); m_GroupBox->setLayout(m_layout); + int idx = 0; for(auto conf:this->conf->getSub()){ QRadioButton* radio = new QRadioButton(conf->getPropertyValue("name")); m_layout->addWidget(radio); + m_ButtonGroup->addButton(radio,idx); + idx++; } } @@ -49,8 +59,11 @@ void CUIRadioComponent::iniUI_Component() m_label = new QLabel(conf->getPropertyValue("name")); m_Component = new QWidget; m_Component->setLayout(m_layout); + int idx = 0; for(auto conf:this->conf->getSub()){ QRadioButton* radio = new QRadioButton(conf->getPropertyValue("name")); m_layout->addWidget(radio); + m_ButtonGroup->addButton(radio,idx); + idx++; } } diff --git a/CFDStruct/CUIProperty/CUIRadioComponent.h b/CFDStruct/CUIProperty/CUIRadioComponent.h index ed15ca4..d3df763 100644 --- a/CFDStruct/CUIProperty/CUIRadioComponent.h +++ b/CFDStruct/CUIProperty/CUIRadioComponent.h @@ -14,6 +14,7 @@ class QLabel; class QHBoxLayout; class QGroupBox; class QWidget; +class QButtonGroup; class CUIRadioComponent : public CUIComponentBaseContainerWidget { @@ -49,7 +50,7 @@ private: QLayout* m_layout; QGroupBox* m_GroupBox; QWidget* m_Component; - + QButtonGroup* m_ButtonGroup; signals: diff --git a/GUIWidget/TreeWidget.cpp b/GUIWidget/TreeWidget.cpp index 280559d..cf2139b 100644 --- a/GUIWidget/TreeWidget.cpp +++ b/GUIWidget/TreeWidget.cpp @@ -122,8 +122,6 @@ namespace GUI{ case GUI::MainTreeEnum::MainTree_Post:name = "actionPost"; break; } - qDebug()<