mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#991 Statistics: Do not modify selected results when loading project file
This commit is contained in:
parent
57aa47ecdd
commit
1b1831e5e1
@ -111,6 +111,8 @@ RimEclipseStatisticsCase::RimEclipseStatisticsCase()
|
|||||||
CAF_PDM_InitField(&m_wellDataSourceCase, "WellDataSourceCase", RimDefines::undefinedResultName(), "Well Data Source Case", "", "", "" );
|
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", "", "", "");
|
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->setReservoirData( eclipseCase.p() );
|
||||||
|
|
||||||
this->populateWithDefaultsIfNeeded();
|
if (m_populateSelectionAfterLoadingGrid)
|
||||||
|
{
|
||||||
|
this->populateResultSelection();
|
||||||
|
|
||||||
|
m_populateSelectionAfterLoadingGrid = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -169,6 +176,14 @@ RimCaseCollection* RimEclipseStatisticsCase::parentStatisticsCaseCollection()
|
|||||||
return dynamic_cast<RimCaseCollection*>(this->parentField()->ownerObject());
|
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();
|
RimIdenticalGridCaseGroup* idgcg = caseGroup();
|
||||||
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->reservoirData()))
|
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->reservoirData()))
|
||||||
{
|
{
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RigCaseData* caseData = idgcg->mainCase()->reservoirData();
|
RigCaseData* caseData = idgcg->mainCase()->reservoirData();
|
||||||
|
@ -72,6 +72,8 @@ public:
|
|||||||
caf::PdmField< bool > m_calculateEditCommand;
|
caf::PdmField< bool > m_calculateEditCommand;
|
||||||
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath){}
|
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath){}
|
||||||
|
|
||||||
|
void populateResultSelectionAfterLoadingGrid();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void scheduleACTIVEGeometryRegenOnReservoirViews();
|
void scheduleACTIVEGeometryRegenOnReservoirViews();
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ private:
|
|||||||
|
|
||||||
void getSourceCases(std::vector<RimEclipseCase*>& sourceCases);
|
void getSourceCases(std::vector<RimEclipseCase*>& sourceCases);
|
||||||
|
|
||||||
void populateWithDefaultsIfNeeded();
|
void populateResultSelection();
|
||||||
|
|
||||||
void updateSelectionListVisibilities();
|
void updateSelectionListVisibilities();
|
||||||
void updateSelectionSummaryLabel();
|
void updateSelectionSummaryLabel();
|
||||||
@ -121,4 +123,6 @@ private:
|
|||||||
caf::PdmField<QString> m_wellDataSourceCase;
|
caf::PdmField<QString> m_wellDataSourceCase;
|
||||||
|
|
||||||
caf::PdmField< bool > m_useZeroAsInactiveCellValue;
|
caf::PdmField< bool > m_useZeroAsInactiveCellValue;
|
||||||
|
|
||||||
|
bool m_populateSelectionAfterLoadingGrid;
|
||||||
};
|
};
|
||||||
|
@ -379,6 +379,7 @@ RimEclipseStatisticsCase* RimIdenticalGridCaseGroup::createAndAppendStatisticsCa
|
|||||||
newStatisticsCase->caseUserDescription = QString("Statistics ") + QString::number(statisticsCaseCollection()->reservoirs.size()+1);
|
newStatisticsCase->caseUserDescription = QString("Statistics ") + QString::number(statisticsCaseCollection()->reservoirs.size()+1);
|
||||||
statisticsCaseCollection()->reservoirs.push_back(newStatisticsCase);
|
statisticsCaseCollection()->reservoirs.push_back(newStatisticsCase);
|
||||||
|
|
||||||
|
newStatisticsCase->populateResultSelectionAfterLoadingGrid();
|
||||||
newStatisticsCase->openEclipseGridFile();
|
newStatisticsCase->openEclipseGridFile();
|
||||||
|
|
||||||
return newStatisticsCase;
|
return newStatisticsCase;
|
||||||
|
Loading…
Reference in New Issue
Block a user