mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3096 Implemented ensemble calulations
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
#include "RimDerivedEnsembleCaseCollection.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimProject.h"
|
||||
@@ -68,13 +69,34 @@ void RimSummaryCaseCollection::removeCase(RimSummaryCase* summaryCase)
|
||||
updateReferringCurveSets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::deleteAllCases()
|
||||
{
|
||||
m_cases.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::addCase(RimSummaryCase* summaryCase)
|
||||
void RimSummaryCaseCollection::addCase(RimSummaryCase* summaryCase, bool updateCurveSets)
|
||||
{
|
||||
m_cases.push_back(summaryCase);
|
||||
updateReferringCurveSets();
|
||||
|
||||
// Update derived ensemble cases (if any)
|
||||
std::vector<caf::PdmObjectHandle*> referringObjects;
|
||||
objectsWithReferringPtrFields(referringObjects);
|
||||
for (auto refObj : referringObjects)
|
||||
{
|
||||
auto derEnsemble = dynamic_cast<RimDerivedEnsembleCaseCollection*>(refObj);
|
||||
if (!derEnsemble) continue;
|
||||
|
||||
derEnsemble->updateDerivedEnsembleCases();
|
||||
if (updateCurveSets) derEnsemble->updateReferringCurveSets();
|
||||
}
|
||||
|
||||
if(updateCurveSets) updateReferringCurveSets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -133,11 +155,9 @@ std::set<RifEclipseSummaryAddress> RimSummaryCaseCollection::calculateUnionOfSum
|
||||
|
||||
if ( !reader ) continue;
|
||||
|
||||
const std::vector<RifEclipseSummaryAddress>& readerAddresses = reader->allResultAddresses();
|
||||
const std::set<RifEclipseSummaryAddress>& readerAddresses = reader->allResultAddresses();
|
||||
addressUnion.insert(readerAddresses.begin(), readerAddresses.end());
|
||||
|
||||
}
|
||||
|
||||
return addressUnion;
|
||||
}
|
||||
|
||||
@@ -234,6 +254,14 @@ EnsembleParameter RimSummaryCaseCollection::ensembleParameter(const QString& par
|
||||
return eParam;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::loadDataAndUpdate()
|
||||
{
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -242,10 +270,18 @@ caf::PdmFieldHandle* RimSummaryCaseCollection::userDescriptionField()
|
||||
return &m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::onLoadDataAndUpdate()
|
||||
{
|
||||
// NOP
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::updateReferringCurveSets() const
|
||||
void RimSummaryCaseCollection::updateReferringCurveSets()
|
||||
{
|
||||
// Update curve set referring to this group
|
||||
std::vector<PdmObjectHandle*> referringObjects;
|
||||
@@ -299,3 +335,20 @@ void RimSummaryCaseCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
updateIcon();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_name);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::setNameAsReadOnly()
|
||||
{
|
||||
m_name.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user