mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5131 Update calculation cross plot curves when summary case is replaced.
This commit is contained in:
@@ -44,6 +44,16 @@ RimSummaryPlotCollection* RiaSummaryTools::summaryPlotCollection()
|
|||||||
return project->mainPlotCollection()->summaryPlotCollection();
|
return project->mainPlotCollection()->summaryPlotCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryCrossPlotCollection* RiaSummaryTools::summaryCrossPlotCollection()
|
||||||
|
{
|
||||||
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
|
||||||
|
return project->mainPlotCollection()->summaryCrossPlotCollection();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,8 +37,9 @@ class PdmObject;
|
|||||||
class RiaSummaryTools
|
class RiaSummaryTools
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||||
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
static RimSummaryCrossPlotCollection* summaryCrossPlotCollection();
|
||||||
|
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
||||||
|
|
||||||
static void notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName );
|
static void notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName );
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryCaseCollection.h"
|
#include "RimSummaryCaseCollection.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
|
#include "RimSummaryCrossPlot.h"
|
||||||
|
#include "RimSummaryCrossPlotCollection.h"
|
||||||
#include "RimSummaryCurve.h"
|
#include "RimSummaryCurve.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
#include "RimSummaryPlotCollection.h"
|
#include "RimSummaryPlotCollection.h"
|
||||||
@@ -113,6 +115,45 @@ void RicReplaceSummaryCaseFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
summaryPlot->loadDataAndUpdate();
|
summaryPlot->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimSummaryCrossPlotCollection* summaryCrossPlotColl = RiaSummaryTools::summaryCrossPlotCollection();
|
||||||
|
for ( RimSummaryPlot* summaryPlot : summaryCrossPlotColl->summaryPlots() )
|
||||||
|
{
|
||||||
|
// Update summary curves on calculated data
|
||||||
|
std::vector<RimSummaryCurve*> summaryCurves = summaryPlot->summaryCurves();
|
||||||
|
for ( RimSummaryCurve* summaryCurve : summaryCurves )
|
||||||
|
{
|
||||||
|
RifEclipseSummaryAddress summaryAddressX = summaryCurve->summaryAddressX();
|
||||||
|
if ( summaryAddressX.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED &&
|
||||||
|
ids.find( summaryAddressX.id() ) != ids.end() )
|
||||||
|
{
|
||||||
|
RifCalculatedSummaryCurveReader reader( calcColl );
|
||||||
|
RimSummaryCalculation* calculation = reader.findCalculationByName( summaryAddressX );
|
||||||
|
QString description = calculation->description();
|
||||||
|
|
||||||
|
RifEclipseSummaryAddress updatedAdr =
|
||||||
|
RifEclipseSummaryAddress::calculatedAddress( description.toStdString(), calculation->id() );
|
||||||
|
summaryCurve->setSummaryAddressX( updatedAdr );
|
||||||
|
summaryCurve->loadDataAndUpdate( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
RifEclipseSummaryAddress summaryAddressY = summaryCurve->summaryAddressY();
|
||||||
|
if ( summaryAddressY.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED &&
|
||||||
|
ids.find( summaryAddressY.id() ) != ids.end() )
|
||||||
|
{
|
||||||
|
RifCalculatedSummaryCurveReader reader( calcColl );
|
||||||
|
RimSummaryCalculation* calculation = reader.findCalculationByName( summaryAddressY );
|
||||||
|
QString description = calculation->description();
|
||||||
|
|
||||||
|
RifEclipseSummaryAddress updatedAdr =
|
||||||
|
RifEclipseSummaryAddress::calculatedAddress( description.toStdString(), calculation->id() );
|
||||||
|
summaryCurve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||||
|
summaryCurve->loadDataAndUpdate( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
summaryPlot->loadDataAndUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user