1、修改结构树点击逻辑

feature/struct-menu-20241023
mzh 2 weeks ago
parent b5e34525c7
commit 7a3e216e0f

@ -22,7 +22,6 @@ CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager()
CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig()
{
qDebug()<<"m_FluidProperties: "<<m_FluidProperties;
if(m_FluidProperties == 0)
return this->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)},
}),
})});
}

@ -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;
}

@ -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;

@ -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();
});
}

@ -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

@ -46,17 +46,25 @@ private:
signals:
private:
// // 鏃堕棿妯″紡
// int m_runtype = 0;
// // 杩唬姝ユ暟锛>=1锛屽畾甯告椂锛氳凯浠鏁帮紝闈炲畾甯革細鍐呰凯浠鏁 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;
};

@ -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(); });
}

@ -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()

@ -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<CFDStructDataSolverSportsAttributesItemManager*> 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

@ -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"},

@ -3,6 +3,8 @@
#include <QObject>
#include "CFDStructDataManager_global.h"
#include "CFDStructMain/CFDStructDefine.h"
#include <QVariant>
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;
};

@ -10,11 +10,6 @@ namespace GUI{
{
this->m_PropertyWidget = prowidget;
// this->setWidget(_treeWidget);
if(this->m_PropertyWidget == NULL)
qDebug()<<"?????";
init();
}

@ -47,5 +47,12 @@ enum class SolutionAnalysisTreeEnum {
};
Q_DECLARE_METATYPE(SolutionAnalysisTreeEnum)
// 属性变化信号
enum class SolutionAnalysisModuleProperty {
TIME_MODE,
KVISL,
UNKNOW,
};
#endif // CFDSTRUCTDEFINE_H

@ -24,24 +24,14 @@
#include <QTreeWidgetItem>
#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();

@ -30,6 +30,8 @@
#include <FITK_Kernel/FITKCore/FITKOperatorRepo.h>
#include <FITK_Kernel/FITKCore/FITKActionOperator.h>
#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<SolutionAnalysisTreeEnum>();
Interface::FITKGeoEnum::FITKGeometryComType geometryType = item->data(3, 0).value<Interface::FITKGeoEnum::FITKGeometryComType>();
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;

@ -6,6 +6,7 @@
#include "CFDStructDefine.h"
#include <CFDStructMainAPI.h>
#include <GUIWidget/TreeWidget.h>
#include "CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h"
class MainWindow;
class QTabWidget;

@ -1,7 +1,7 @@
HEADERS += \
$$PWD/CFDStructOperatorsModelAPI.h \
$$PWD/CFDStructOperatorsTimeModeManager.h
$$PWD/CFDStructOperatorsModelSolverProperty.h
SOURCES += \
$$PWD/CFDStructOperatorsTimeModeManager.cpp
$$PWD/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 <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(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;
}

@ -0,0 +1,22 @@
#ifndef CFDSTRUCTOPERATORSMODELSOLVERPROPERTY_H
#define CFDSTRUCTOPERATORSMODELSOLVERPROPERTY_H
#include <QObject>
#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

@ -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 <QLabel>
#include <QDebug>
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<GUI::MainWindow*>(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;
}
}

@ -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

@ -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";
}
}

@ -31,11 +31,7 @@ void CUIButtonBox::iniUI(QVector<CUI *> &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);
}

@ -21,7 +21,6 @@ void CUICheckBox::iniUI(QVector<CUI*> &subCUI)
}
connect(this, QOverload<bool>::of(&QCheckBox::clicked),[ = ](bool sign){
qDebug()<<"CheckBox is clicked"<<' '<<sign;
this->conf->setValue((int)sign);
});
}

@ -49,19 +49,11 @@ void CUIComboBox::iniUI(QVector<CUI*> &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<int>::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<int *>(vOrigin);
if(ptr!=nullptr)
{
qDebug()<<"------------------------------------------------ptr is "<<*ptr;
comboBox->setCurrentIndex(*ptr);
}
}

@ -87,24 +87,22 @@ CUIConfig::CUIConfig(QMap<QString, QVariant> property, QVector<CUIConfig *> 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 "<<value;
bool changed = false;
QVariant pValue = property["value_origin"];
if (property["value_type"] == CUI_DATA_TYPE_INT) {
int* ptr = qvariant_cast<int*>(pValue);
qDebug()<<"value_type is int"<<ptr;
if (*ptr != value.toInt()) {
*ptr = value.toInt();
changed = true;

@ -27,7 +27,6 @@ void CUIGroupBox::iniUI(QVector<CUI*> &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);

@ -6,11 +6,16 @@
#include <QWidget>
#include <QRadioButton>
#include <QLabel>
#include <QButtonGroup>
CUIRadioComponent::CUIRadioComponent(CUIConfig *conf, QVector<CUI *> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent)
{
this->conf = conf;
iniUI(subCUI);
connect(m_ButtonGroup,QOverload<int>::of(&QButtonGroup::buttonClicked),[=](int idx){
this->conf->setValue((int)idx);
});
}
@ -21,6 +26,8 @@ void CUIRadioComponent::iniUI(QVector<CUI *> &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++;
}
}

@ -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:

@ -122,8 +122,6 @@ namespace GUI{
case GUI::MainTreeEnum::MainTree_Post:name = "actionPost"; break;
}
qDebug()<<name;
if (!name.isEmpty()) {
QObject sender;
sender.setObjectName(name);

Loading…
Cancel
Save