diff --git a/ApplicationCode/Application/Tools/RiaSummaryTools.cpp b/ApplicationCode/Application/Tools/RiaSummaryTools.cpp index 892df17d38..ca383cfd23 100644 --- a/ApplicationCode/Application/Tools/RiaSummaryTools.cpp +++ b/ApplicationCode/Application/Tools/RiaSummaryTools.cpp @@ -72,7 +72,7 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged(const QString& previou if (adr.quantityName() == previousCurveName.toStdString()) { RifEclipseSummaryAddress updatedAdr = RifEclipseSummaryAddress::calculatedAddress(currentCurveName.toStdString()); - curve->setSummaryAddressY(updatedAdr); + curve->setSummaryAddressYAndApplyInterpolation(updatedAdr); } } } diff --git a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp index 2312bd3b27..480327bc0c 100644 --- a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp @@ -292,7 +292,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot* plot->addCurveAndUpdate(newCurve); newCurve->setSummaryCaseY(gridSummaryCase); - newCurve->setSummaryAddressY(addr); + newCurve->setSummaryAddressYAndApplyInterpolation(addr); newCurve->setColor(color); newCurve->setLeftOrRightAxisY(plotAxis); newCurve->loadDataAndUpdate(true); diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp index 2836e28918..5f418670d1 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryCurveFeature.cpp @@ -61,7 +61,7 @@ RimSummaryCurve* RicNewSummaryCurveFeature::addCurveToPlot(RimSummaryPlot* plot, newCurve->setSummaryCaseY(summaryCase); } - newCurve->setSummaryAddressY(RifEclipseSummaryAddress::fieldAddress("FOPT")); + newCurve->setSummaryAddressYAndApplyInterpolation(RifEclipseSummaryAddress::fieldAddress("FOPT")); newCurve->loadDataAndUpdate(true); diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index 29c674d2fe..c587144e89 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -463,7 +463,7 @@ void RicSummaryCurveCreator::updatePreviewCurvesFromCurveDefinitions( RimSummaryCase* currentCase = curveDef.summaryCase(); RimSummaryCurve* curve = new RimSummaryCurve(); curve->setSummaryCaseY(currentCase); - curve->setSummaryAddressY(curveDef.summaryAddress()); + curve->setSummaryAddressYAndApplyInterpolation(curveDef.summaryAddress()); curve->applyCurveAutoNameSettings(*m_curveNameConfig()); if (currentCase->isObservedData()) curve->setSymbolSkipDistance(0); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index f962b3bdd1..23cf28d469 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -977,7 +977,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves(const std::vectorsetSummaryCaseY(sumCase); - curve->setSummaryAddressY(addr->address()); + curve->setSummaryAddressYAndApplyInterpolation(addr->address()); curve->setLeftOrRightAxisY(m_plotAxis()); addCurve(curve); @@ -1069,7 +1069,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves(const std::vectorsetLineStyle(RiuQwtPlotCurve::STYLE_SOLID); curve->setSummaryCaseY(m_ensembleStatCase.get()); - curve->setSummaryAddressY(address); + curve->setSummaryAddressYAndApplyInterpolation(address); curve->setLeftOrRightAxisY(m_plotAxis()); curve->updateCurveVisibility(false); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index d513634176..766c3dbd19 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -203,6 +203,16 @@ RifEclipseSummaryAddress RimSummaryCurve::summaryAddressY() const return m_yValuesCurveVariable->address(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCurve::setSummaryAddressYAndApplyInterpolation(const RifEclipseSummaryAddress& address) +{ + setSummaryAddressY(address); + + calculateCurveInterpolationFromAddress(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -216,8 +226,6 @@ void RimSummaryCurve::setSummaryAddressY(const RifEclipseSummaryAddress& address m_yValuesCurveVariable->setAddress(address); m_yValuesSummaryFilter->updateFromAddress(address); - - calculateCurveInterpolationFromAddress(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.h index f5553f5fc3..b919d22b3e 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -54,7 +54,9 @@ public: // Y Axis functions void setSummaryCaseY(RimSummaryCase* sumCase); RimSummaryCase* summaryCaseY() const; + void setSummaryAddressYAndApplyInterpolation(const RifEclipseSummaryAddress& address); void setSummaryAddressY(const RifEclipseSummaryAddress& address); + RifEclipseSummaryAddress summaryAddressY() const; std::string unitNameY() const; std::vector valuesY() const; @@ -76,7 +78,7 @@ public: void updateQwtPlotAxis(); void applyCurveAutoNameSettings(const RimSummaryCurveAutoName& autoNameSettings); - QString curveExportDescription(const RifEclipseSummaryAddress& address = RifEclipseSummaryAddress()) const override; + QString curveExportDescription(const RifEclipseSummaryAddress& address = RifEclipseSummaryAddress()) const override; void forceUpdateCurveAppearanceFromCaseType(); void markCachedDataForPurge(); @@ -97,11 +99,11 @@ protected: void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; private: - RifSummaryReaderInterface* valuesSummaryReaderX() const; - RifSummaryReaderInterface* valuesSummaryReaderY() const; - const std::vector& timeStepsX() const; + RifSummaryReaderInterface* valuesSummaryReaderX() const; + RifSummaryReaderInterface* valuesSummaryReaderY() const; + const std::vector& timeStepsX() const; - void calculateCurveInterpolationFromAddress(); + void calculateCurveInterpolationFromAddress(); // Overridden PDM methods void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; @@ -109,9 +111,9 @@ private: void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; - static void appendOptionItemsForSummaryAddresses(QList* options, - RimSummaryCase* summaryCase, - RimSummaryFilter* summaryFilter); + static void appendOptionItemsForSummaryAddresses(QList* options, + RimSummaryCase* summaryCase, + RimSummaryFilter* summaryFilter); private: // Y values