From 7518a1880ae3b064e437a042756999d304caa15e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jan 2019 10:06:30 +0100 Subject: [PATCH] Revert "#4018 Result management : Use ensureReservoirCaseIsOpen instead of open..." This reverts commit fde60d1e34ab6c1d2844e6f65665b354e746ea8b. --- .../CommandFileInterface/RicfExportProperty.cpp | 9 ++++++--- ApplicationCode/ProjectDataModel/RimEclipseCase.h | 4 ++-- ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp | 2 +- .../ProjectDataModel/RimEclipseResultCase.cpp | 2 +- .../ProjectDataModel/RimEclipseStatisticsCase.cpp | 2 +- ApplicationCode/ProjectDataModel/RimEclipseView.cpp | 2 +- .../ProjectDataModel/RimIdenticalGridCaseGroup.cpp | 2 +- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp index 788951506b..63a0f54f1e 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp @@ -71,10 +71,13 @@ void RicfExportProperty::execute() return; } - if (!eclipseCase->ensureReservoirCaseIsOpen()) + if (!eclipseCase->eclipseCaseData()) { - RiaLogging::error(QString("exportProperty: Could not find eclipseCaseData with ID %1").arg(m_caseId())); - return; + if (!eclipseCase->openReserviorCase()) + { + RiaLogging::error(QString("exportProperty: Could not find eclipseCaseData with ID %1").arg(m_caseId())); + return; + } } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 446eaf4ae4..ad33df9f73 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -70,6 +70,7 @@ public: void setFilesContainingFaults(const std::vector& val); bool ensureReservoirCaseIsOpen(); + bool openReserviorCase(); virtual bool openEclipseGridFile() = 0; RigEclipseCaseData* eclipseCaseData(); @@ -130,8 +131,7 @@ protected: private: void createTimeStepFormatString(); - std::vector allSpecialViews() const override; - bool openReserviorCase(); + std::vector allSpecialViews() const override; protected: caf::PdmField m_flipXAxis; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index d4f75da3e1..bf0f01b77d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -233,7 +233,7 @@ bool RimEclipseInputCase::openEclipseGridFile() void RimEclipseInputCase::reloadEclipseGridFile() { setReservoirData(nullptr); - ensureReservoirCaseIsOpen(); + openReserviorCase(); } #define for_all(stdVector, indexName) for (size_t indexName = 0; indexName < stdVector.size(); ++indexName) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index cf773d7738..ef1a72c049 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -243,7 +243,7 @@ void RimEclipseResultCase::reloadEclipseGridFile() m_gridAndWellDataIsReadFromFile = false; m_activeCellInfoIsReadFromFile = false; setReservoirData(nullptr); - ensureReservoirCaseIsOpen(); + openReserviorCase(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index ccf0fce2af..26d320dd5e 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -176,7 +176,7 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() void RimEclipseStatisticsCase::reloadEclipseGridFile() { setReservoirData(nullptr); - ensureReservoirCaseIsOpen(); + openReserviorCase(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index c9acb071f3..ebd058d36d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -830,7 +830,7 @@ void RimEclipseView::onLoadDataAndUpdate() if (m_eclipseCase) { - if (!m_eclipseCase->ensureReservoirCaseIsOpen()) + if (!m_eclipseCase->openReserviorCase()) { QMessageBox::warning(RiuMainWindow::instance(), "Error when opening project file", diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index e5bdee47b4..2686fcca33 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -171,7 +171,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() // When reading active cell info, only the total cell count is tested for consistency RimEclipseCase* mainCase = caseCollection()->reservoirs[0]; - if (!mainCase->ensureReservoirCaseIsOpen()) + if (!mainCase->openReserviorCase()) { QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(), "Error when opening project file",