1、修改基本模型中数据从json读入的逻辑,添加了判断读出数据是否为空

feature/struct-menu-20241023
mzh 1 week ago
parent 8a040a2adf
commit b080d0ee33

@ -38,17 +38,29 @@ void CFDStructDataSolverBasicModelManager::saveDataToDom(rapidjson::Document &do
void CFDStructDataSolverBasicModelManager::readDataFromDom(rapidjson::Document &dom) {
QVariant temp;
jsonRead(dom, temp, {"region", 0, "flowType"});
m_FlowModel = temp.toInt();
if (temp != QVariant()) {
m_FlowModel = temp.toInt();
}
jsonRead(dom, temp, {"region", 0, "chimeraMesh"});
m_OverlayNetwork = temp.toInt();
if (temp != QVariant()) {
m_OverlayNetwork = temp.toInt();
}
jsonRead(dom, temp, {"region", 0, "refValue", "rgas_mean"});
m_Rgasmean = temp.toDouble();
if (temp != QVariant()) {
m_Rgasmean = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "gamma"});
m_Gmean = temp.toDouble();
if (temp != QVariant()) {
m_Gmean = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "solver", "turbModel", "RANS", "params", "Prl"});
m_Prlmean = temp.toDouble();
if (temp != QVariant()) {
m_Prlmean = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "solver", "turbModel", "RANS", "params", "Prt"});
m_Prtmean = temp.toDouble();
if (temp != QVariant()) {
m_Prtmean = temp.toDouble();
}
}
/**

Loading…
Cancel
Save