From b5e34525c701b17e21ac8219bb7883d7af91bdf9 Mon Sep 17 00:00:00 2001 From: mzh Date: Fri, 1 Nov 2024 14:39:32 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=B8=BAcheckbox=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86connect=202=E3=80=81=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E4=BA=86=E5=9F=BA=E6=9C=AC=E6=A8=A1=E5=9E=8Bui?= =?UTF-8?q?=E7=9A=84=E7=95=8C=E9=9D=A2=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataSolverBasicModelManager.cpp | 36 +++++++++++++++--- .../CFDStructDataSolverBasicModelManager.h | 4 +- .../CFDStructMain/CFDStructMainWindow.cpp | 2 +- CFDStruct/CUIProperty/CUICheckBox.cpp | 12 ++++++ CFDStruct/CUIProperty/CUIConfig.cpp | 2 + Resources/Resources.qrc | 2 + Resources/img/test1.png | Bin 0 -> 3903 bytes 7 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 Resources/img/test1.png 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 0000000000000000000000000000000000000000..4268207aa67e27a336954e3397b6ad49dbf429c0 GIT binary patch literal 3903 zcmb7GdpHzY*WWV+LmXyuOJRtF1}RZSGvqd8MDDo^p$j3Y+%n^oM3nm^$>qpB_c|BDfJc>qY=q6Pm|is#l4Lvt|fnF;4Z}3yi5L5SkXiij=Y0@ zmXP&TXP3VUZa!e^_@il9a(0%IkbLQ(WgB%%RCJcrdA$sy(xg2}R~{V^O}D+rUkUki zcbYwEbb$G4i(8sj@IJ5L+5sku$7dPZ{tEfu8n{}Cyl`asfP-YL?~B%5bjFKUrzCA5 zkVu{Q{;h_UuCi8{5$c9d^-OSomRbIMxHIsfQ{?#VEXB_T#`w`#dsKoy+cN=;&7oc3 zh@j5Gdo>_YUL|Wn$Z$7sK*kg%u^W;EoAqAQ?*GlE_bVI}6~Yt{=3urSHh~dKS5pJw z_Y{#hK!&9QC>YSFx7m*Z;S{@vu=6s<4q;BeX*<;F`O2mX_Q(q1mje(8*%En=ssS0#)4u_e2JY$!WmaOTst_2k z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