|
|
|
|
@ -2885,6 +2885,12 @@ bool nmDataAnalyzeManager::ReadProjectData(const QString & filePath)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 读取已保存的成果井名称,待井数据加载完成后恢复。
|
|
|
|
|
QString sSavedCurWellName;
|
|
|
|
|
if(doc.HasMember("CurrentResultWellName") && doc["CurrentResultWellName"].IsString()) {
|
|
|
|
|
sSavedCurWellName = QString::fromUtf8(doc["CurrentResultWellName"].GetString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 清空现有数据,确保从头加载新数据
|
|
|
|
|
foreach(nmDataFracture* pFractureData, m_vFractureData) {
|
|
|
|
|
delete pFractureData; // 释放堆上分配的 nmDataFracture 对象
|
|
|
|
|
@ -3138,7 +3144,11 @@ bool nmDataAnalyzeManager::ReadProjectData(const QString & filePath)
|
|
|
|
|
ZxDataWell* pWellData = zxCurWell;
|
|
|
|
|
// 查找是否有当前井的数据
|
|
|
|
|
nmDataWellBase* pCurWell = nullptr;
|
|
|
|
|
if(pWellData != nullptr) {
|
|
|
|
|
if(!sSavedCurWellName.isEmpty()) {
|
|
|
|
|
pCurWell = this->findWellByName(sSavedCurWellName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(pCurWell == nullptr && pWellData != nullptr) {
|
|
|
|
|
pCurWell = this->findWellByName(pWellData->getName());
|
|
|
|
|
}
|
|
|
|
|
if (pCurWell != nullptr)
|
|
|
|
|
@ -3318,6 +3328,14 @@ bool nmDataAnalyzeManager::WriteProjectData(const QString & filePath)
|
|
|
|
|
|
|
|
|
|
doc.AddMember("Wells", wellsJsonArray, allocator);
|
|
|
|
|
|
|
|
|
|
// 保存当前成果井名称,供下次加载成果时恢复。
|
|
|
|
|
if(m_pCurDataWell != nullptr) {
|
|
|
|
|
QString sCurrentResultWellName = m_pCurDataWell->getWellName();
|
|
|
|
|
doc.AddMember("CurrentResultWellName",
|
|
|
|
|
rapidjson::Value(sCurrentResultWellName.toStdString().c_str(), allocator).Move(),
|
|
|
|
|
allocator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 序列化 时间步数据
|
|
|
|
|
if(m_pTimeStep) {
|
|
|
|
|
rapidjson::Value timeStepJson(rapidjson::kObjectType);
|
|
|
|
|
|