1、修改运动属性-转轴方向的设置

feature/struct-menu-20241023
mzh 1 week ago
parent 341481b9e4
commit 64adf2650c

@ -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_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_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"}); jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
} }
@ -64,9 +67,17 @@ void CFDStructDataSolverSportsAttributesItemManager::readDataFromDom(rapidjson::
if (temp != QVariant()) { if (temp != QVariant()) {
m_originZ = temp.toDouble(); 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()) { 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"}); jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
if (temp != QVariant()) { if (temp != QVariant()) {
@ -134,9 +145,9 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC
}), }),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, {"type", "LineEdit"},
{"name", "X:"}, {"name", "Y:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_originX}, {"value_origin", m_originY},
}), }),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, {"type", "LineEdit"},
@ -146,11 +157,33 @@ CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIC
}), }),
}), }),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, // 转轴方向 {"type", "GroupBox"}, // 转轴方向
{"name", tr("Axis direction")}, {"name", tr("Axis direction")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, {"layout", "QHBoxLayout"},
{"value_origin", QVA_GLOBAL(&m_RotationAxisDirection)}, // {"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({ new CUIConfig({
{"type", "LineEdit"}, // 转速 {"type", "LineEdit"}, // 转速
{"name", tr("speed")}, {"name", tr("speed")},

@ -52,10 +52,13 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager
double m_originZ = 0; 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 * TODO

Loading…
Cancel
Save