Skip to content

Commit

Permalink
#11857 Make sure the summary curve type is updated
Browse files Browse the repository at this point in the history
Always compute curve type Rate or Accumulated based on address if Auto curve type is set.
  • Loading branch information
magnesj committed Nov 5, 2024
1 parent 7b2d9be commit 8c1e8f0
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( int calculationId, co
if ( adr.isCalculated() && adr.id() == calculationId )
{
adr.setVectorName( currentCurveName.toStdString() );
curve->setSummaryAddressYAndApplyInterpolation( adr );
curve->setSummaryAddressY( adr );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
plot->addCurveAndUpdate( newCurve );

newCurve->setSummaryCaseY( summaryCase );
newCurve->setSummaryAddressYAndApplyInterpolation( addr );
newCurve->setSummaryAddressY( addr );
newCurve->setColor( color );
newCurve->setLeftOrRightAxisY( RiuPlotAxis( plotAxis ) );
newCurve->loadDataAndUpdate( true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
curve->setShowInLegend( false );
}
curve->setSummaryCaseY( currentCase );
curve->setSummaryAddressYAndApplyInterpolation( curveDef.summaryAddressY() );
curve->setSummaryAddressY( curveDef.summaryAddressY() );
curve->applyCurveAutoNameSettings( *m_curveNameConfig() );
if ( currentCase && currentCase->isObservedData() ) curve->setSymbolSkipDistance( 0 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ RimSummaryCurve* RicSummaryPlotFeatureImpl::createCurve( RimSummaryCase* summary
{
auto curve = new RimSummaryCurve();
curve->setSummaryCaseY( summaryCase );
curve->setSummaryAddressYAndApplyInterpolation( address );
curve->setSummaryAddressY( address );

return curve;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector<RimSummaryCase
{
RimSummaryCurve* curve = new RimSummaryCurve();
curve->setSummaryCaseY( sumCase );
curve->setSummaryAddressYAndApplyInterpolation( addr->address() );
curve->setSummaryAddressY( addr->address() );
curve->setResampling( m_resampling() );

int lineThickness = 1;
Expand Down Expand Up @@ -2259,7 +2259,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves( const std::vector<RimSummaryCa
}

curve->setSummaryCaseY( summaryCase );
curve->setSummaryAddressYAndApplyInterpolation( address.summaryAddressY() );
curve->setSummaryAddressY( address.summaryAddressY() );
curve->setLeftOrRightAxisY( axisY() );

if ( isXAxisSummaryVector() )
Expand Down
14 changes: 4 additions & 10 deletions ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,6 @@ RifEclipseSummaryAddress RimSummaryCurve::summaryAddressY() const
return m_yValuesSummaryAddress->address();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurve::setSummaryAddressYAndApplyInterpolation( const RifEclipseSummaryAddress& address )
{
setSummaryAddressY( address );

calculateCurveInterpolationFromAddress();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand All @@ -265,6 +255,10 @@ void RimSummaryCurve::setSummaryAddressY( const RifEclipseSummaryAddress& addres
}

m_yValuesSummaryAddress->setAddress( address );

// Always calculate curve interpolation when address is changed
// This will ensure that the curve type (Rate or Accumulated) is correctly set based on the address
calculateCurveInterpolationFromAddress();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class RimSummaryCurve : public RimStackablePlotCurve
virtual std::vector<double> valuesY() const;

void setSummaryCaseY( RimSummaryCase* sumCase );
void setSummaryAddressYAndApplyInterpolation( const RifEclipseSummaryAddress& address );
void setSummaryAddressY( const RifEclipseSummaryAddress& address );
void setResampling( RiaDefines::DateTimePeriodEnum resampling );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,7 @@ RimSummaryCurve* RimSummaryPlot::addNewCurve( const RifEclipseSummaryAddress& ad
{
auto* newCurve = new RimSummaryCurve();
newCurve->setSummaryCaseY( summaryCase );
newCurve->setSummaryAddressYAndApplyInterpolation( address );
newCurve->setSummaryAddressY( address );

// This address is RifEclipseSummaryAddress::time() if the curve is a time plot. Otherwise it is the address of the summary vector used
// for the x-axis
Expand Down

0 comments on commit 8c1e8f0

Please sign in to comment.