From 3bef103a4071e0502f5047f14fd153295b368cdc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 28 Oct 2026 13:31:58 +0100 Subject: [PATCH 1/3] Use simulated vectors instead of history vectors in correlation report plots --- .../RimCorrelationPlotCollection.cpp | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlotCollection.cpp index 7a86eae03f..d7cdd5cdd7 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlotCollection.cpp @@ -22,6 +22,7 @@ #include "Formations/RimWellFormationsCollection.h" #include "Formations/RimWellFormationsFile.h" +#include "RifEclipseSummaryAddressDefines.h" #include "RimCorrelationMatrixPlot.h" #include "RimCorrelationPlot.h" #include "RimCorrelationReportPlot.h" @@ -454,18 +455,36 @@ void RimCorrelationPlotCollection::applyEnsembleFieldAndTimeStepToReport( RimCor { if ( ensemble ) { + // Quantity names given as history vectors (e.g. WOPRH:A1) are replaced by the simulated vector (e.g. WOPR:A1) + auto nativeQuantityName = []( const QString& quantityName ) + { + const auto separatorIndex = quantityName.indexOf( ':' ); + auto nativeName = quantityName.left( separatorIndex ); + const auto historySuffix = QString::fromStdString( RifEclipseSummaryAddressDefines::historyIdentifier() ); + if ( nativeName.endsWith( historySuffix ) ) nativeName.chop( historySuffix.size() ); + return separatorIndex < 0 ? nativeName : nativeName + quantityName.mid( separatorIndex ); + }; + + std::vector nativeMatrixQuantityNames; + for ( const auto& name : matrixQuantityNames ) + nativeMatrixQuantityNames.push_back( nativeQuantityName( name ) ); + const QString nativeMainQuantityName = nativeQuantityName( tornadoAndCrossPlotQuantityName ); + std::set allAddresses = ensemble->ensembleSummaryAddresses(); std::vector curveDefsMatrix; std::vector curveDefsTornadoAndCrossPlot; for ( auto address : allAddresses ) { - auto it = std::find( matrixQuantityNames.begin(), matrixQuantityNames.end(), QString::fromStdString( address.uiText() ) ); - if ( it != matrixQuantityNames.end() || matrixQuantityNames.empty() ) + if ( address.isHistoryVector() ) continue; + + auto it = + std::find( nativeMatrixQuantityNames.begin(), nativeMatrixQuantityNames.end(), QString::fromStdString( address.uiText() ) ); + if ( it != nativeMatrixQuantityNames.end() || nativeMatrixQuantityNames.empty() ) { curveDefsMatrix.push_back( RiaSummaryCurveDefinition( ensemble, address ) ); } - if ( tornadoAndCrossPlotQuantityName.isEmpty() || tornadoAndCrossPlotQuantityName == QString::fromStdString( address.uiText() ) ) + if ( nativeMainQuantityName.isEmpty() || nativeMainQuantityName == QString::fromStdString( address.uiText() ) ) { curveDefsTornadoAndCrossPlot.push_back( RiaSummaryCurveDefinition( ensemble, address ) ); } From 5de792ee983aeb4a2095f42872c3bf4c1613cd03 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 28 Oct 2026 13:40:16 +0100 Subject: [PATCH 2/3] Use depth type and unit from source plot when creating RFT correlation report --- .../CorrelationPlots/RimRftCorrelationReportPlot.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimRftCorrelationReportPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimRftCorrelationReportPlot.cpp index fbdccfea3d..cad91bc02e 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimRftCorrelationReportPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimRftCorrelationReportPlot.cpp @@ -212,8 +212,19 @@ RimParameterRftCrossPlot* RimRftCorrelationReportPlot::crossPlot() const //-------------------------------------------------------------------------------------------------- void RimRftCorrelationReportPlot::initializeFromSourcePlot( RimWellRftPlot* source ) { + if ( source ) + { + const auto sourceDepthType = source->depthType(); + if ( sourceDepthType == RiaDefines::DepthType::MEASURED_DEPTH || sourceDepthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ) + { + m_depthType = sourceDepthType; + } + } + applyDepthTypeToSubPlots(); + if ( source ) m_wellRftPlot->setDepthUnit( source->depthUnit() ); + m_wellRftPlot->setSimWellOrWellPathName( source ? source->simWellOrWellPathName() : RimWellPlotTools::firstWellNameWithEnsembleRftData() ); // A fresh RimWellRftPlot has no tracks; syncCurvesFromUiSelection exits early without one. From cc353522cdf89742ded62e974539d5b15d35db6a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 28 Oct 2026 13:53:33 +0100 Subject: [PATCH 3/3] Hide Curve Appearance UI behind experimental feature flag --- .../Application/RiaExperimentalFeatures.cpp | 4 +++ .../Application/RiaExperimentalFeatures.h | 2 ++ .../Summary/RimCurveStyleRules.cpp | 4 +++ .../Summary/RimSummaryMultiPlot.cpp | 27 +++++++++++++++---- .../Summary/RimSummaryMultiPlot.h | 2 ++ .../UserInterface/RiuPlotMainWindow.cpp | 8 +++--- 6 files changed, 39 insertions(+), 8 deletions(-) diff --git a/ApplicationLibCode/Application/RiaExperimentalFeatures.cpp b/ApplicationLibCode/Application/RiaExperimentalFeatures.cpp index c3b4afa16b..c3e63cba12 100644 --- a/ApplicationLibCode/Application/RiaExperimentalFeatures.cpp +++ b/ApplicationLibCode/Application/RiaExperimentalFeatures.cpp @@ -49,6 +49,10 @@ const std::vector& RiaExperimentalFeatures::av "lifecycle events; note that debug level also logs one message per rendering pass and per part, every " "frame, so the log can grow quickly." }, { "workflows", "Workflows", "Discover and run taskmaestro workflows from the project tree." }, + { curveAppearanceKeyword, + "Curve Appearance", + "Show the Curve Appearance panel, toolbar button and global appearance settings for summary plots. Restart " + "required." }, }; return features; diff --git a/ApplicationLibCode/Application/RiaExperimentalFeatures.h b/ApplicationLibCode/Application/RiaExperimentalFeatures.h index 572245fb35..724c1fb097 100644 --- a/ApplicationLibCode/Application/RiaExperimentalFeatures.h +++ b/ApplicationLibCode/Application/RiaExperimentalFeatures.h @@ -39,6 +39,8 @@ class RiaExperimentalFeatures QString description; ///< Short explanation, appended to the checkbox label. }; + static constexpr const char* curveAppearanceKeyword = "curve-appearance"; + /// The single, discoverable list of all experimental features. static const std::vector& availableFeatures(); }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimCurveStyleRules.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimCurveStyleRules.cpp index eaaeafa598..c9971b0f14 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimCurveStyleRules.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimCurveStyleRules.cpp @@ -18,7 +18,9 @@ #include "RimCurveStyleRules.h" +#include "RiaExperimentalFeatures.h" #include "RiaGuiApplication.h" +#include "RiaPreferencesSystem.h" #include "RimColorLegend.h" #include "RimColorLegendCollection.h" @@ -440,6 +442,8 @@ const caf::PdmField>* RimCurveStyleRules::itemOrder( RimCur //-------------------------------------------------------------------------------------------------- void RimCurveStyleRules::addGlobalAppearanceLink( caf::PdmUiOrdering& uiOrdering, const QString& text ) { + if ( !RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ) ) return; + auto label = uiOrdering.addNewLabel( text ); label->setLinkActivatedCallback( []( const QString& ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index befaf6a7c2..4b5eb56d05 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -19,10 +19,12 @@ #include "RimSummaryMultiPlot.h" #include "RiaApplication.h" +#include "RiaExperimentalFeatures.h" #include "RiaGuiApplication.h" #include "RiaNumericalTools.h" #include "RiaPlotDefines.h" #include "RiaPreferences.h" +#include "RiaPreferencesSystem.h" #include "RiaQDateTimeTools.h" #include "RiaTimeTTools.h" #include "Summary/RiaSummaryAddressAnalyzer.h" @@ -126,7 +128,7 @@ RimSummaryMultiPlot::GlobalAppearance RimSummaryMultiPlot::globalAppearance() co //-------------------------------------------------------------------------------------------------- bool RimSummaryMultiPlot::useGlobalColor() const { - return m_globalAppearance() == GlobalAppearance::GLOBAL; + return isGlobalAppearanceActive(); } //-------------------------------------------------------------------------------------------------- @@ -134,7 +136,16 @@ bool RimSummaryMultiPlot::useGlobalColor() const //-------------------------------------------------------------------------------------------------- bool RimSummaryMultiPlot::useGlobalSymbol() const { - return m_globalAppearance() == GlobalAppearance::GLOBAL; + return isGlobalAppearanceActive(); +} + +//-------------------------------------------------------------------------------------------------- +/// The global appearance is ignored when the curve appearance feature is disabled, as it can not be edited then +//-------------------------------------------------------------------------------------------------- +bool RimSummaryMultiPlot::isGlobalAppearanceActive() const +{ + return m_globalAppearance() == GlobalAppearance::GLOBAL && + RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ); } //-------------------------------------------------------------------------------------------------- @@ -491,8 +502,11 @@ void RimSummaryMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde subPlotSettingsGroup->add( &m_showIndividualPlotTitles ); subPlotSettingsGroup->add( &m_subTitleFontSize ); - auto appearanceGroup = uiOrdering.addNewGroup( "Curve Appearance" ); - appearanceGroup->add( &m_globalAppearance ); + if ( RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ) ) + { + auto appearanceGroup = uiOrdering.addNewGroup( "Curve Appearance" ); + appearanceGroup->add( &m_globalAppearance ); + } auto legendsGroup = uiOrdering.addNewGroup( "Legends" ); legendsGroup->setCollapsedByDefault(); @@ -749,7 +763,10 @@ std::vector RimSummaryMultiPlot::fieldsToShowInToolbar() toolBarFields.push_back( &m_appendNextCurve ); toolBarFields.push_back( &m_createPlotDuplicate ); - toolBarFields.push_back( &m_showCurveAppearance ); + if ( RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ) ) + { + toolBarFields.push_back( &m_showCurveAppearance ); + } auto multiFields = RimMultiPlot::fieldsToShowInToolbar(); toolBarFields.insert( std::end( toolBarFields ), std::begin( multiFields ), std::end( multiFields ) ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h index 00b7cc9ef4..edf68527da 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h @@ -171,6 +171,8 @@ class RimSummaryMultiPlot : public RimMultiPlot, public RimSummaryDataSourceStep RimSummaryPlotReadOut* activeReadoutSettings() const; private: + bool isGlobalAppearanceActive() const; + caf::PdmField m_autoPlotTitle; caf::PdmField m_autoSubPlotTitle; caf::PdmField m_disableWheelZoom; diff --git a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp index 655e80ada1..6d7b1f325e 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp @@ -20,6 +20,7 @@ #include "RiaApplication.h" #include "RiaBaseDefs.h" +#include "RiaExperimentalFeatures.h" #include "RiaGuiApplication.h" #include "RiaPreferences.h" #include "RiaPreferencesSystem.h" @@ -127,7 +128,7 @@ RiuPlotMainWindow::~RiuPlotMainWindow() setBeingDestroyed(); m_summaryPlotManagerView->showProperties( nullptr ); - m_curveStyleRulesView->showProperties( nullptr ); + if ( m_curveStyleRulesView ) m_curveStyleRulesView->showProperties( nullptr ); setPdmRoot( nullptr ); } @@ -172,7 +173,7 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded() setPdmRoot( RimProject::current() ); restoreTreeViewState(); - m_curveStyleRulesView->showProperties( RimProject::current()->curveStyleRules() ); + if ( m_curveStyleRulesView ) m_curveStyleRulesView->showProperties( RimProject::current()->curveStyleRules() ); RimMainPlotCollection* mainPlotColl = RimMainPlotCollection::current(); mainPlotColl->ensureDefaultFlowPlotsAreCreated(); @@ -247,7 +248,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose() { pdmUiPropertyView->showProperties( nullptr ); } - m_curveStyleRulesView->showProperties( nullptr ); + if ( m_curveStyleRulesView ) m_curveStyleRulesView->showProperties( nullptr ); cleanUpTemporaryWidgets(); @@ -598,6 +599,7 @@ void RiuPlotMainWindow::createDockPanels() } // the global curve appearance and per item rules, stored in the project + if ( RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ) ) { auto dockWidget = RiuDockWidgetTools::createDockWidget( "Curve Appearance", RiuDockWidgetTools::plotMainWindowCurveAppearanceName(), dockManager() );