From 64adf2650cfdf6a2ef60869eabac5a0c4a21fa65 Mon Sep 17 00:00:00 2001 From: mzh Date: Fri, 8 Nov 2024 16:52:01 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E8=BF=90=E5=8A=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7-=E8=BD=AC=E8=BD=B4=E6=96=B9=E5=90=91?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tructDataSolverSportsAttributesManager.cpp | 53 +++++++++++++++---- ...DStructDataSolverSportsAttributesManager.h | 7 ++- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp index cf9939c..55d00a1 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -34,7 +34,10 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do jsonAdd(dom, m_originY, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 1}); jsonAdd(dom, m_originZ, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 2}); - jsonAdd(dom, m_RotationAxisDirection, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"}); + jsonAdd(dom, m_axisX, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 0}); + jsonAdd(dom, m_axisY, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 1}); + jsonAdd(dom, m_axisZ, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 2}); + jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"}); } @@ -64,9 +67,17 @@ void CFDStructDataSolverSportsAttributesItemManager::readDataFromDom(rapidjson:: if (temp != QVariant()) { m_originZ = temp.toDouble(); } - jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"}); + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 0}); + if (temp != QVariant()) { + m_axisX = temp.toDouble(); + } + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 1}); if (temp != QVariant()) { - m_RotationAxisDirection = temp.toString(); + m_axisY = temp.toDouble(); + } + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial", 2}); + if (temp != QVariant()) { + m_axisZ = temp.toDouble(); } jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"}); if (temp != QVariant()) { @@ -134,9 +145,9 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC }), new CUIConfig({ {"type", "LineEdit"}, - {"name", "X:"}, + {"name", "Y:"}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", m_originX}, + {"value_origin", m_originY}, }), new CUIConfig({ {"type", "LineEdit"}, @@ -146,11 +157,33 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC }), }), new CUIConfig({ - {"type", "LineEdit"}, // 转轴方向 - {"name", tr("Axis direction")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, - {"value_origin", QVA_GLOBAL(&m_RotationAxisDirection)}, - }), + {"type", "GroupBox"}, // 转轴方向 + {"name", tr("Axis direction")}, + {"layout", "QHBoxLayout"}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + // {"value_origin", QVA_GLOBAL(&m_RotationAxisDirection)}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "X:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_axisX}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "Y:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_axisY}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "Z:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_axisZ}, + }), + + }), new CUIConfig({ {"type", "LineEdit"}, // 转速 {"name", tr("speed")}, diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h index be2c4bf..b29d57c 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -52,10 +52,13 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager double m_originZ = 0; // 转轴方向 - QString m_RotationAxisDirection; // Rotation Axis Direction + // QString m_RotationAxisDirection; // Rotation Axis Direction + double m_axisX = 0; + double m_axisY = 0; + double m_axisZ = 0; // 转速 - double m_RotationSpeed; // Rotation Speed in rpm + double m_RotationSpeed = 0; // Rotation Speed in rpm /** * TODO运动区域,有关列表组件