diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp index c3d7427..8e4c689 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp @@ -1,5 +1,7 @@ #include "CFDStructDataSolverBasicModelManager.h" #include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" CFDStructDataSolverBasicModelManager::CFDStructDataSolverBasicModelManager(QObject *parent) : CFDStructDataManagerBase(parent) { @@ -13,10 +15,19 @@ CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager() delete m_uiConfig; m_uiConfig = nullptr; } + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore){ + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); + }); } CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig() { + qDebug()<<"m_FluidProperties: "<genFluidPropertiesOffUIConfig(); + if(m_FluidProperties == 1) + return this->genFluidPropertiesOnUIConfig(); + return this->genFluidPropertiesOnUIConfig(); } @@ -40,7 +51,11 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig() })}), 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)}, + {"semaphore",1}, + }, {new CUIConfig({// 选项:外流 {"type", "Item"}, {"name", tr("Internal Flow")}}), @@ -54,8 +69,12 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig() {"type", "CheckBox"}, {"name", tr("Overlay Network")}}), new CUIConfig({// 方形选择按钮:流体属性 - {"type", "CheckButton"}, - {"name", tr("Fluid Properties")}})}); + {"type", "CheckBox"}, + {"name", tr("Fluid Properties")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin",QVA_GLOBAL(&m_FluidProperties)}, + {"semaphore",1}, + })}); } CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() @@ -85,10 +104,15 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() {"name", tr("Multistage Turbomachinery")}})}), new CUIConfig({// 方形勾选:重叠网络 {"type", "CheckBox"}, - {"name", tr("ichimr")}}), + {"name", tr("Overlay Network")}, + }), new CUIConfig({// 圆形选择按钮:流体属性 - {"type", "RadioButton"}, - {"name", tr("Fluid Properties")}}), + {"type", "CheckBox"}, + {"name", tr("Fluid Properties")}, + {"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin",QVA_GLOBAL(&m_FluidProperties)}, + {"semaphore",1}, + }), new CUIConfig({// 组,流体属性下的内容 {"type", "GroupBox"}, {"name", tr("Fluid Properties")}}, diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h index 2e6fadf..9fc8ca9 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h @@ -31,10 +31,10 @@ private: int m_FlowModel = 0; //重叠网格:不勾选0;勾选1 - bool m_OverlayNetwork = 0; + int m_OverlayNetwork = 0; //流体属性:关闭0;开启1 - bool m_FluidProperties = 0; + int m_FluidProperties = 0; //气体成分 QString m_GasComposition = ""; diff --git a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp index bc545bf..9dd10b8 100644 --- a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp +++ b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp @@ -197,7 +197,7 @@ void CFDStructMainWindow::addSARibbonCategoryCalculation() //"������"����"����͵���" pannelAddAction(pannel, action, SARibbonPannelItem::Large); //����ͼ��"����" - action = createAction(tr("Import"), "actionImport", ":/icons/createsphere.png", tr("Import")); + action = createAction(tr("Import"), "actionImport", ":/img/test1.png", tr("Import")); //"����"����"����͵���" pannelAddAction(pannel, action, SARibbonPannelItem::Large); //��������"���������" diff --git a/CFDStruct/CUIProperty/CUICheckBox.cpp b/CFDStruct/CUIProperty/CUICheckBox.cpp index 8eb4791..5be1df8 100644 --- a/CFDStruct/CUIProperty/CUICheckBox.cpp +++ b/CFDStruct/CUIProperty/CUICheckBox.cpp @@ -12,4 +12,16 @@ CUICheckBox::CUICheckBox(CUIConfig* conf, QVector &subCUI, QWidget *parent void CUICheckBox::iniUI(QVector &subCUI) { this->setText(conf->getPropertyValue("name")); + + QVariant vOrigin = conf->getPropertyOriginValue("value_origin"); + int *ptr = qvariant_cast(vOrigin); + if(ptr!=nullptr){ + if(*ptr == 1) + this->setCheckState(Qt::Checked); + } + + connect(this, QOverload::of(&QCheckBox::clicked),[ = ](bool sign){ + qDebug()<<"CheckBox is clicked"<<' '<conf->setValue((int)sign); + }); } diff --git a/CFDStruct/CUIProperty/CUIConfig.cpp b/CFDStruct/CUIProperty/CUIConfig.cpp index 66da7d1..7b1867a 100644 --- a/CFDStruct/CUIProperty/CUIConfig.cpp +++ b/CFDStruct/CUIProperty/CUIConfig.cpp @@ -99,10 +99,12 @@ void CUIConfig::printConfig() void CUIConfig::setValue(QVariant value) { +// qDebug()<<"setValue "<(pValue); + qDebug()<<"value_type is int"< ./icons/icoR_license.svg ./img/createbox.png + ./img/test1.png + diff --git a/Resources/img/test1.png b/Resources/img/test1.png new file mode 100644 index 0000000..4268207 Binary files /dev/null and b/Resources/img/test1.png differ