2017-10-12 07:30:37 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-10-12 07:30:37 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-10-12 07:30:37 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-10-12 07:30:37 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-10-23 14:42:38 +02:00
|
|
|
#include "RimSummaryCalculationCollection.h"
|
2017-10-12 07:30:37 +02:00
|
|
|
|
2024-10-21 14:40:25 +02:00
|
|
|
#include "Summary/RiaSummaryTools.h"
|
2024-02-26 13:55:41 +01:00
|
|
|
|
|
|
|
|
#include "RifSummaryReaderInterface.h"
|
|
|
|
|
|
|
|
|
|
#include "RimObservedSummaryData.h"
|
2017-10-23 14:42:38 +02:00
|
|
|
#include "RimSummaryCalculation.h"
|
2024-02-26 13:55:41 +01:00
|
|
|
#include "RimSummaryCase.h"
|
|
|
|
|
#include "RimSummaryCaseMainCollection.h"
|
2024-07-29 15:38:17 +02:00
|
|
|
#include "RimSummaryEnsemble.h"
|
2017-10-12 07:30:37 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_SOURCE_INIT( RimSummaryCalculationCollection, "RimSummaryCalculationCollection" );
|
2017-10-12 07:30:37 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-12 07:30:37 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-23 14:42:38 +02:00
|
|
|
RimSummaryCalculationCollection::RimSummaryCalculationCollection()
|
2017-10-12 07:30:37 +02:00
|
|
|
{
|
2022-01-07 08:31:52 +01:00
|
|
|
CAF_PDM_InitObject( "Calculation Collection", ":/chain.png" );
|
2017-10-12 07:30:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-12 07:30:37 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-04-22 12:18:34 +02:00
|
|
|
RimSummaryCalculation* RimSummaryCalculationCollection::createCalculation() const
|
2019-12-10 13:18:14 +01:00
|
|
|
{
|
2022-04-22 12:18:34 +02:00
|
|
|
return new RimSummaryCalculation;
|
2019-12-10 13:18:14 +01:00
|
|
|
}
|
|
|
|
|
|
2024-02-26 13:55:41 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimSummaryCalculationCollection::updateDataDependingOnCalculations()
|
|
|
|
|
{
|
|
|
|
|
// Refresh data sources tree
|
|
|
|
|
// Refresh meta data for all summary cases and rebuild AddressNodes in the summary tree
|
|
|
|
|
RimSummaryCaseMainCollection* summaryCaseCollection = RiaSummaryTools::summaryCaseMainCollection();
|
|
|
|
|
auto summaryCases = summaryCaseCollection->allSummaryCases();
|
|
|
|
|
for ( RimSummaryCase* summaryCase : summaryCases )
|
|
|
|
|
{
|
|
|
|
|
if ( !summaryCase ) continue;
|
|
|
|
|
|
|
|
|
|
if ( auto reader = summaryCase->summaryReader() )
|
|
|
|
|
{
|
|
|
|
|
reader->buildMetaData();
|
2024-03-19 13:12:12 +01:00
|
|
|
|
2024-07-05 09:06:16 +02:00
|
|
|
if ( summaryCase->showVectorItemsInProjectTree() )
|
2024-03-19 13:12:12 +01:00
|
|
|
{
|
|
|
|
|
summaryCase->onCalculationUpdated();
|
|
|
|
|
}
|
2024-02-26 13:55:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RimObservedDataCollection* observedDataCollection = RiaSummaryTools::observedDataCollection();
|
|
|
|
|
auto observedData = observedDataCollection->allObservedSummaryData();
|
|
|
|
|
for ( auto obs : observedData )
|
|
|
|
|
{
|
|
|
|
|
if ( !obs ) continue;
|
|
|
|
|
|
|
|
|
|
if ( auto reader = obs->summaryReader() )
|
|
|
|
|
{
|
|
|
|
|
reader->buildMetaData();
|
|
|
|
|
obs->onCalculationUpdated();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto summaryCaseCollections = summaryCaseCollection->summaryCaseCollections();
|
2024-07-29 15:38:17 +02:00
|
|
|
for ( RimSummaryEnsemble* summaryCaseCollection : summaryCaseCollections )
|
2024-02-26 13:55:41 +01:00
|
|
|
{
|
|
|
|
|
summaryCaseCollection->onCalculationUpdated();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-18 11:18:43 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-18 11:18:43 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-23 14:42:38 +02:00
|
|
|
void RimSummaryCalculationCollection::rebuildCaseMetaData()
|
2017-10-18 11:18:43 +02:00
|
|
|
{
|
2022-05-09 09:32:09 +02:00
|
|
|
ensureValidCalculationIds();
|
2024-02-26 13:55:41 +01:00
|
|
|
updateDataDependingOnCalculations();
|
2017-10-20 10:04:05 +02:00
|
|
|
}
|