mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
Ensures addresses are created for single summary cases
Addresses are now explicitly created for summary cases upon loading or importing. Remove a potentially costly rebuild if when no calculations are present.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RifSummaryCaseRestartSelector.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RigGridManager.h"
|
||||
|
||||
@@ -126,6 +127,8 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
|
||||
for ( RimSummaryCase* newSumCase : candidateCases )
|
||||
{
|
||||
newSumCase->summaryReader()->createAddressesIfRequired();
|
||||
|
||||
RimSummaryEnsemble* existingCollection = nullptr;
|
||||
auto existingSummaryCase = sumCaseColl->findTopLevelSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );
|
||||
if ( existingSummaryCase )
|
||||
|
||||
@@ -50,6 +50,8 @@ RimSummaryCalculation* RimSummaryCalculationCollection::createCalculation() cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCalculationCollection::updateDataDependingOnCalculations()
|
||||
{
|
||||
if ( calculations().empty() ) return;
|
||||
|
||||
// Refresh data sources tree
|
||||
// Refresh meta data for all summary cases and rebuild AddressNodes in the summary tree
|
||||
RimSummaryCaseMainCollection* summaryCaseCollection = RiaSummaryTools::summaryCaseMainCollection();
|
||||
|
||||
@@ -365,6 +365,15 @@ void RimSummaryCaseMainCollection::loadAllSummaryCaseData()
|
||||
std::vector<RimSummaryCase*> sumCases = allSummaryCases();
|
||||
|
||||
RimSummaryCaseMainCollection::loadSummaryCaseData( sumCases );
|
||||
|
||||
// Create addresses for all single summary cases (not part of an ensemble)
|
||||
for ( auto sumCase : topLevelSummaryCases() )
|
||||
{
|
||||
if ( sumCase->summaryReader() )
|
||||
{
|
||||
sumCase->summaryReader()->createAddressesIfRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user