#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();

View File

@ -71,6 +71,8 @@ public:
caf::PdmField< bool > m_calculateEditCommand;
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath){}
void populateResultSelectionAfterLoadingGrid();
private:
void scheduleACTIVEGeometryRegenOnReservoirViews();
@ -79,7 +81,7 @@ private:
void getSourceCases(std::vector<RimEclipseCase*>& sourceCases);
void populateWithDefaultsIfNeeded();
void populateResultSelection();
void updateSelectionListVisibilities();
void updateSelectionSummaryLabel();
@ -121,4 +123,6 @@ private:
caf::PdmField<QString> m_wellDataSourceCase;
caf::PdmField< bool > m_useZeroAsInactiveCellValue;
bool m_populateSelectionAfterLoadingGrid;
};

View File

@ -378,7 +378,8 @@ RimEclipseStatisticsCase* RimIdenticalGridCaseGroup::createAndAppendStatisticsCa
newStatisticsCase->caseUserDescription = QString("Statistics ") + QString::number(statisticsCaseCollection()->reservoirs.size()+1);
statisticsCaseCollection()->reservoirs.push_back(newStatisticsCase);
newStatisticsCase->populateResultSelectionAfterLoadingGrid();
newStatisticsCase->openEclipseGridFile();
return newStatisticsCase;