From b080d0ee33ec0a74297562a5efb71759f2eb48f5 Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 7 Nov 2024 15:44:10 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=AD=E6=95=B0=E6=8D=AE=E4=BB=8Ejson?= =?UTF-8?q?=E8=AF=BB=E5=85=A5=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=88=A4=E6=96=AD=E8=AF=BB=E5=87=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataSolverBasicModelManager.cpp | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp index 187c5da..2597f5a 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp @@ -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(); + } } /**