#1665 Add error handling and logging to command file execution

This commit is contained in:
Bjørnar Grip Fjær
2017-07-27 14:26:59 +02:00
parent ab1322c5d7
commit d0564c4d2a
9 changed files with 113 additions and 22 deletions

View File

@@ -1,4 +1,3 @@
#include "RicfComputeCaseGroupStatistics.h"
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
@@ -29,6 +28,7 @@
#include "RimView.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
CAF_PDM_SOURCE_INIT(RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics");
@@ -47,6 +47,7 @@ void RicfComputeCaseGroupStatistics::execute()
{
for (int caseId : m_caseIds())
{
bool foundCase = false;
for (RimIdenticalGridCaseGroup* group : RiaApplication::instance()->project()->activeOilField()->analysisModels()->caseGroups)
{
for (RimEclipseCase* c : group->statisticsCaseCollection->reservoirs)
@@ -58,8 +59,21 @@ void RicfComputeCaseGroupStatistics::execute()
{
statsCase->computeStatisticsAndUpdateViews();
}
else
{
RiaLogging::warning(QString("computeCaseGroupStatistics: Found case with ID %1, but it is not a statistics case, cannot compute statistics.").arg(caseId));
}
foundCase = true;
break;
}
}
if (foundCase) break;
}
if (!foundCase)
{
RiaLogging::warning(QString("computeCaseGroupStatistics: Could not find statistics case with ID %1.").arg(caseId));
}
}
}