#11857 Make sure the summary curve type is updated

Always compute curve type Rate or Accumulated based on address if Auto curve type is set.
This commit is contained in:
Magne Sjaastad 2024-11-05 15:00:34 +01:00
parent 1cbdbfa7df
commit 67e6df28b5
8 changed files with 11 additions and 18 deletions

View File

@ -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 );
}
}
}

View File

@ -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 );

View File

@ -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 );

View File

@ -689,7 +689,7 @@ RimSummaryCurve* RicSummaryPlotFeatureImpl::createCurve( RimSummaryCase* summary
{
auto curve = new RimSummaryCurve();
curve->setSummaryCaseY( summaryCase );
curve->setSummaryAddressYAndApplyInterpolation( address );
curve->setSummaryAddressY( address );
return curve;
}

View File

@ -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;
@ -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() )

View File

@ -244,16 +244,6 @@ RifEclipseSummaryAddress RimSummaryCurve::summaryAddressY() const
return m_yValuesSummaryAddress->address();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurve::setSummaryAddressYAndApplyInterpolation( const RifEclipseSummaryAddress& address )
{
setSummaryAddressY( address );
calculateCurveInterpolationFromAddress();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -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();
}
//--------------------------------------------------------------------------------------------------

View File

@ -65,7 +65,6 @@ public:
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 );

View File

@ -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