Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ApplicationLibCode/Application/RiaExperimentalFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const std::vector<RiaExperimentalFeatures::Feature>& 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;
Expand Down
2 changes: 2 additions & 0 deletions ApplicationLibCode/Application/RiaExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Feature>& availableFeatures();
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "Formations/RimWellFormationsCollection.h"
#include "Formations/RimWellFormationsFile.h"
#include "RifEclipseSummaryAddressDefines.h"
#include "RimCorrelationMatrixPlot.h"
#include "RimCorrelationPlot.h"
#include "RimCorrelationReportPlot.h"
Expand Down Expand Up @@ -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<QString> nativeMatrixQuantityNames;
for ( const auto& name : matrixQuantityNames )
nativeMatrixQuantityNames.push_back( nativeQuantityName( name ) );
const QString nativeMainQuantityName = nativeQuantityName( tornadoAndCrossPlotQuantityName );

std::set<RifEclipseSummaryAddress> allAddresses = ensemble->ensembleSummaryAddresses();
std::vector<RiaSummaryCurveDefinition> curveDefsMatrix;
std::vector<RiaSummaryCurveDefinition> 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;
Comment thread
magnesj marked this conversation as resolved.

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 ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#include "RimCurveStyleRules.h"

#include "RiaExperimentalFeatures.h"
#include "RiaGuiApplication.h"
#include "RiaPreferencesSystem.h"

#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
Expand Down Expand Up @@ -440,6 +442,8 @@ const caf::PdmField<std::vector<QString>>* 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& )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -126,15 +128,24 @@ RimSummaryMultiPlot::GlobalAppearance RimSummaryMultiPlot::globalAppearance() co
//--------------------------------------------------------------------------------------------------
bool RimSummaryMultiPlot::useGlobalColor() const
{
return m_globalAppearance() == GlobalAppearance::GLOBAL;
return isGlobalAppearanceActive();
}

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

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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 ) )
Comment thread
magnesj marked this conversation as resolved.
{
auto appearanceGroup = uiOrdering.addNewGroup( "Curve Appearance" );
appearanceGroup->add( &m_globalAppearance );
}

auto legendsGroup = uiOrdering.addNewGroup( "Legends" );
legendsGroup->setCollapsedByDefault();
Expand Down Expand Up @@ -749,7 +763,10 @@ std::vector<caf::PdmFieldHandle*> RimSummaryMultiPlot::fieldsToShowInToolbar()
toolBarFields.push_back( &m_appendNextCurve );

toolBarFields.push_back( &m_createPlotDuplicate );
toolBarFields.push_back( &m_showCurveAppearance );
if ( RiaPreferencesSystem::current()->isFeatureEnabled( RiaExperimentalFeatures::curveAppearanceKeyword ) )
Comment thread
magnesj marked this conversation as resolved.
{
toolBarFields.push_back( &m_showCurveAppearance );
}

auto multiFields = RimMultiPlot::fieldsToShowInToolbar();
toolBarFields.insert( std::end( toolBarFields ), std::begin( multiFields ), std::end( multiFields ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class RimSummaryMultiPlot : public RimMultiPlot, public RimSummaryDataSourceStep
RimSummaryPlotReadOut* activeReadoutSettings() const;

private:
bool isGlobalAppearanceActive() const;

caf::PdmField<bool> m_autoPlotTitle;
caf::PdmField<bool> m_autoSubPlotTitle;
caf::PdmField<bool> m_disableWheelZoom;
Expand Down
8 changes: 5 additions & 3 deletions ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "RiaApplication.h"
#include "RiaBaseDefs.h"
#include "RiaExperimentalFeatures.h"
#include "RiaGuiApplication.h"
#include "RiaPreferences.h"
#include "RiaPreferencesSystem.h"
Expand Down Expand Up @@ -127,7 +128,7 @@ RiuPlotMainWindow::~RiuPlotMainWindow()
setBeingDestroyed();

m_summaryPlotManagerView->showProperties( nullptr );
m_curveStyleRulesView->showProperties( nullptr );
if ( m_curveStyleRulesView ) m_curveStyleRulesView->showProperties( nullptr );
setPdmRoot( nullptr );
}

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -247,7 +248,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
{
pdmUiPropertyView->showProperties( nullptr );
}
m_curveStyleRulesView->showProperties( nullptr );
if ( m_curveStyleRulesView ) m_curveStyleRulesView->showProperties( nullptr );

cleanUpTemporaryWidgets();

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