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.
This commit is contained in:
Jacob Støren
2015-05-20 09:40:00 +02:00
parent 85f3c86814
commit b280c2287e

View File

@@ -35,6 +35,9 @@
#include "RigCaseCellResultsData.h" #include "RigCaseCellResultsData.h"
#include "cafProgressInfo.h" #include "cafProgressInfo.h"
#include "RiuMainWindow.h"
#include <QMessageBox>
#include <QDir>
CAF_PDM_SOURCE_INIT(RimIdenticalGridCaseGroup, "RimIdenticalGridCaseGroup"); 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 // When reading active cell info, only the total cell count is tested for consistency
RimEclipseCase* mainCase = caseCollection()->reservoirs[0]; RimEclipseCase* mainCase = caseCollection()->reservoirs[0];
mainCase->openEclipseGridFile(); if (!mainCase->openReserviorCase())
RigCaseData* rigCaseData = mainCase->reservoirData();
if (rigCaseData)
{ {
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; QMessageBox::warning(RiuMainWindow::instance(),
RimReservoirCellResultsStorage* cellResultsStorage = mainCase->results(poroModel); "Error when opening project file",
"Could not open the Eclipse Grid file: \n"+ mainCase->gridFileName() + "\n"+
cellResultsStorage->cellResults()->createPlaceholderResultEntries(); "Current working directory is: \n" +
} QDir::currentPath());
else
{
// Error message
return; return;
} }
RigCaseData* rigCaseData = mainCase->reservoirData();
CVF_ASSERT(rigCaseData);
// Action A : Read active cell info // 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 // Read active cell info from all source cases. The file access is optimized for this purpose, and result meta data