diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp index 5eb80a4..cf9939c 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -29,7 +29,11 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do jsonAdd(dom, m_MotionName, {"region", 0, "motion", this->getId(), "meshMotion", "name"}); jsonAdd(dom, m_MotionType, {"region", 0, "motion", this->getId(), "meshMotion", "MotionType"}); jsonAdd(dom, m_MotionMode, {"region", 0, "motion", this->getId(), "meshMotion", "attrtype"}); - jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"}); + // jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"}); + jsonAdd(dom, m_originX, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 0}); + 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_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"}); } @@ -48,9 +52,17 @@ void CFDStructDataSolverSportsAttributesItemManager::readDataFromDom(rapidjson:: if (temp != QVariant()) { m_MotionType = temp.toInt(); } - jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"}); + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 0}); + if (temp != QVariant()) { + m_originX = temp.toDouble(); + } + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 1}); if (temp != QVariant()) { - m_RotationAxisOrigin = temp.toString(); + m_originY = temp.toDouble(); + } + jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin", 2}); + if (temp != QVariant()) { + m_originZ = temp.toDouble(); } jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"}); if (temp != QVariant()) { @@ -102,12 +114,37 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, {"value_origin", QVA_GLOBAL(&m_MotionMode)}, }), + // new CUIConfig({ + // {"type", "LineEdit"}, // 转轴原点 + // {"name", tr("Axis origin")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + // {"value_origin", QVA_GLOBAL(&m_RotationAxisOrigin)}, + // }), new CUIConfig({ - {"type", "LineEdit"}, // 转轴原点 - {"name", tr("Axis origin")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, - {"value_origin", QVA_GLOBAL(&m_RotationAxisOrigin)}, - }), + {"type", "GroupBox"}, // 转轴原点 + {"name", "Axis origin"}, + {"layout", "QHBoxLayout"}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "X:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_originX}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "X:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_originX}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "Z:"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", m_originZ}, + }), + }), new CUIConfig({ {"type", "LineEdit"}, // 转轴方向 {"name", tr("Axis direction")}, diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h index a12eae0..be2c4bf 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -46,7 +46,10 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager QString m_MotionMode; // Motion Mode // 转轴原点 - QString m_RotationAxisOrigin; // Rotation Axis Origin + // QString m_RotationAxisOrigin; // Rotation Axis Origin + double m_originX = 0; + double m_originY = 0; + double m_originZ = 0; // 转轴方向 QString m_RotationAxisDirection; // Rotation Axis Direction