diff --git a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp index 63a0f54f1e..788951506b 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp @@ -71,13 +71,10 @@ void RicfExportProperty::execute() return; } - if (!eclipseCase->eclipseCaseData()) + if (!eclipseCase->ensureReservoirCaseIsOpen()) { - if (!eclipseCase->openReserviorCase()) - { - RiaLogging::error(QString("exportProperty: Could not find eclipseCaseData with ID %1").arg(m_caseId())); - return; - } + 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 ad33df9f73..446eaf4ae4 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -70,7 +70,6 @@ public: void setFilesContainingFaults(const std::vector& val); bool ensureReservoirCaseIsOpen(); - bool openReserviorCase(); virtual bool openEclipseGridFile() = 0; RigEclipseCaseData* eclipseCaseData(); @@ -131,7 +130,8 @@ protected: private: void createTimeStepFormatString(); - std::vector allSpecialViews() const override; + std::vector allSpecialViews() const override; + bool openReserviorCase(); protected: caf::PdmField m_flipXAxis; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index bf0f01b77d..d4f75da3e1 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -233,7 +233,7 @@ bool RimEclipseInputCase::openEclipseGridFile() void RimEclipseInputCase::reloadEclipseGridFile() { setReservoirData(nullptr); - openReserviorCase(); + ensureReservoirCaseIsOpen(); } #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 22c91a5c69..815c241c89 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); - openReserviorCase(); + ensureReservoirCaseIsOpen(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index 26d320dd5e..ccf0fce2af 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -176,7 +176,7 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() void RimEclipseStatisticsCase::reloadEclipseGridFile() { setReservoirData(nullptr); - openReserviorCase(); + ensureReservoirCaseIsOpen(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index ebd058d36d..c9acb071f3 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -830,7 +830,7 @@ void RimEclipseView::onLoadDataAndUpdate() if (m_eclipseCase) { - if (!m_eclipseCase->openReserviorCase()) + if (!m_eclipseCase->ensureReservoirCaseIsOpen()) { QMessageBox::warning(RiuMainWindow::instance(), "Error when opening project file", diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 2686fcca33..e5bdee47b4 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->openReserviorCase()) + if (!mainCase->ensureReservoirCaseIsOpen()) { QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(), "Error when opening project file",