From b280c2287e53dc13621223258b53d6152ef531b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Wed, 20 May 2015 09:40:00 +0200 Subject: [PATCH] Case Groups: Added error message on missing maincase When loading a project file, there were no error messages if the grid file could not be found. --- .../RimIdenticalGridCaseGroup.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index c13585cce8..77295d538f 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -35,6 +35,9 @@ #include "RigCaseCellResultsData.h" #include "cafProgressInfo.h" +#include "RiuMainWindow.h" +#include +#include CAF_PDM_SOURCE_INIT(RimIdenticalGridCaseGroup, "RimIdenticalGridCaseGroup"); @@ -156,21 +159,18 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() // When reading active cell info, only the total cell count is tested for consistency RimEclipseCase* mainCase = caseCollection()->reservoirs[0]; - mainCase->openEclipseGridFile(); - RigCaseData* rigCaseData = mainCase->reservoirData(); - if (rigCaseData) + if (!mainCase->openReserviorCase()) { - RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; - RimReservoirCellResultsStorage* cellResultsStorage = mainCase->results(poroModel); - - cellResultsStorage->cellResults()->createPlaceholderResultEntries(); - } - else - { - // Error message + QMessageBox::warning(RiuMainWindow::instance(), + "Error when opening project file", + "Could not open the Eclipse Grid file: \n"+ mainCase->gridFileName() + "\n"+ + "Current working directory is: \n" + + QDir::currentPath()); return; } + RigCaseData* rigCaseData = mainCase->reservoirData(); + CVF_ASSERT(rigCaseData); // Action A : Read active cell info // Read active cell info from all source cases. The file access is optimized for this purpose, and result meta data