#991 Statistics: Do not modify selected results when loading project file

This commit is contained in:
Magne Sjaastad
2016-11-23 10:23:59 +01:00
parent 57aa47ecdd
commit 1b1831e5e1
3 changed files with 25 additions and 5 deletions

View File

@@ -111,6 +111,8 @@ RimEclipseStatisticsCase::RimEclipseStatisticsCase()
CAF_PDM_InitField(&m_wellDataSourceCase, "WellDataSourceCase", RimDefines::undefinedResultName(), "Well Data Source Case", "", "", "" );
CAF_PDM_InitField(&m_useZeroAsInactiveCellValue, "UseZeroAsInactiveCellValue", false, "Use Zero as Inactive Cell Value", "", "", "");
m_populateSelectionAfterLoadingGrid = false;
}
//--------------------------------------------------------------------------------------------------
@@ -156,7 +158,12 @@ bool RimEclipseStatisticsCase::openEclipseGridFile()
this->setReservoirData( eclipseCase.p() );
this->populateWithDefaultsIfNeeded();
if (m_populateSelectionAfterLoadingGrid)
{
this->populateResultSelection();
m_populateSelectionAfterLoadingGrid = false;
}
return true;
}
@@ -169,6 +176,14 @@ RimCaseCollection* RimEclipseStatisticsCase::parentStatisticsCaseCollection()
return dynamic_cast<RimCaseCollection*>(this->parentField()->ownerObject());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseStatisticsCase::populateResultSelectionAfterLoadingGrid()
{
m_populateSelectionAfterLoadingGrid = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -684,12 +699,12 @@ void RimEclipseStatisticsCase::computeStatisticsAndUpdateViews()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseStatisticsCase::populateWithDefaultsIfNeeded()
void RimEclipseStatisticsCase::populateResultSelection()
{
RimIdenticalGridCaseGroup* idgcg = caseGroup();
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->reservoirData()))
{
return ;
return;
}
RigCaseData* caseData = idgcg->mainCase()->reservoirData();