1、完成运动属性item,数据从json中读出

feature/struct-menu-20241023
mzh 1 week ago
parent 8adb47980e
commit de48fffe11

@ -33,6 +33,34 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do
jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
}
void CFDStructDataSolverSportsAttributesItemManager::readDataFromDom(rapidjson::Document &dom) {
QVariant temp;
// id应该是在读取之前就由manager创建
// jsonAdd(dom, m_id, {"region", 0, "motion", this->getId(), "id"});
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "name"});
if (temp != QVariant()) {
m_MotionName = temp.toString();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "MotionType"});
if (temp != QVariant()) {
m_MotionType = temp.toInt();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"});
if (temp != QVariant()) {
m_RotationAxisOrigin = temp.toString();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"});
if (temp != QVariant()) {
m_RotationAxisDirection = temp.toString();
}
jsonRead(dom, temp, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
if (temp != QVariant()) {
m_RotationSpeed = temp.toDouble();
}
}
CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIConfig() {
return new CUIConfig({
{"type", "Widget"},

@ -17,6 +17,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager
CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private:
// 生成运动坐标系的界面配置
CUIConfig *genMovingFrameModeUIConfig();

Loading…
Cancel
Save