1、完成 无量纲化 将json中数据读入

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

@ -34,6 +34,31 @@ void CFDStructDataSolverReferenceQuantityManager::saveDataToDom(rapidjson::Docum
jsonAdd(dom, m_TorqueCenterOfMoment, {"region", 0, "refValue", "jx"});
}
void CFDStructDataSolverReferenceQuantityManager::readDataFromDom(rapidjson::Document &dom) {
QVariant temp;
jsonRead(dom, temp, {"region", 0, "refValue", "pressure"});
if (temp != QVariant()) {
m_Pressure = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "temperature"});
if (temp != QVariant()) {
m_Temperature = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "refLength"});
if (temp != QVariant()) {
m_Length = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "refArea"});
if (temp != QVariant()) {
m_Area = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "jx"});
if (temp != QVariant()) {
m_TorqueCenterOfMoment = temp.toString();
}
}
CUIConfig *CFDStructDataSolverReferenceQuantityManager::genUIConfig() {
return new CUIConfig({
{"type", "Widget"},

@ -18,6 +18,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverReferenceQuantityManager :
CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private:
// 生成界面配置
CUIConfig *genUIConfig();

Loading…
Cancel
Save