From 92499a21e603a9f58913dfe84af6787289cb00d3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 17 Sep 2023 15:00:34 +0200 Subject: [PATCH 01/28] Rename to plotAxis() --- .../RicNewPlotAxisPropertiesFeature.cpp | 2 +- .../GridCrossPlots/RimGridCrossPlot.cpp | 6 +-- .../RimPlotAxisProperties.cpp | 4 +- .../ProjectDataModel/RimPlotAxisProperties.h | 2 +- .../RimPlotAxisPropertiesInterface.h | 2 +- .../Summary/RimEnsembleCurveSet.cpp | 2 +- .../Summary/RimSummaryCurve.cpp | 2 +- .../Summary/RimSummaryMultiPlot.cpp | 24 ++++----- .../Summary/RimSummaryPlot.cpp | 54 +++++++++---------- .../Summary/RimSummaryPlotAxisFormatter.cpp | 10 ++-- .../Summary/RimSummaryTimeAxisProperties.cpp | 2 +- .../Summary/RimSummaryTimeAxisProperties.h | 2 +- .../UserInterface/RiuSummaryQwtPlot.cpp | 2 +- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp index 1e00a9f2b2..6ec4e5e413 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp @@ -49,7 +49,7 @@ void RicNewPlotAxisPropertiesFeature::onActionTriggered( bool isChecked ) if ( !summaryPlot ) return; RimPlotAxisProperties* newPlotAxisProperties = summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis" ); - summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxisType() ); + summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxis() ); newPlotAxisProperties->setNameForUnusedAxis(); summaryPlot->updateConnectedEditors(); diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index 2ae1f7e921..a127e8c328 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -641,8 +641,8 @@ void RimGridCrossPlot::swapAxes() QString tmpName = xAxisProperties->objectName(); QString tmpTitle = xAxisProperties->axisTitleText(); - RiuPlotAxis tmpAxis = xAxisProperties->plotAxisType(); - xAxisProperties->setNameAndAxis( yAxisProperties->objectName(), yAxisProperties->axisTitleText(), yAxisProperties->plotAxisType().axis() ); + RiuPlotAxis tmpAxis = xAxisProperties->plotAxis(); + xAxisProperties->setNameAndAxis( yAxisProperties->objectName(), yAxisProperties->axisTitleText(), yAxisProperties->plotAxis().axis() ); yAxisProperties->setNameAndAxis( tmpName, tmpTitle, tmpAxis.axis() ); m_xAxisProperties.removeChild( xAxisProperties ); @@ -855,7 +855,7 @@ void RimGridCrossPlot::updateAxisInQwt( RiaDefines::PlotAxis axisType ) axisParameterString = yAxisParameterString(); } - RiuPlotAxis axis = axisProperties->plotAxisType(); + RiuPlotAxis axis = axisProperties->plotAxis(); if ( axisProperties->isActive() ) { m_plotWidget->enableAxis( axis, true ); diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp index b4ec8e965b..6aeb196346 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -327,7 +327,7 @@ const QString RimPlotAxisProperties::axisTitleText() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuPlotAxis RimPlotAxisProperties::plotAxisType() const +RiuPlotAxis RimPlotAxisProperties::plotAxis() const { return RiuPlotAxis( m_plotAxis.value(), m_plotAxisIndex ); } @@ -712,7 +712,7 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed else if ( changedField == &m_plotAxis ) { RiuPlotAxis oldPlotAxis = RiuPlotAxis( (RiaDefines::PlotAxis)oldValue.toInt(), m_plotAxisIndex ); - axisPositionChanged.send( this, oldPlotAxis, plotAxisType() ); + axisPositionChanged.send( this, oldPlotAxis, plotAxis() ); } else { diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h index fb96a8a04d..dc9acacd7a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h @@ -73,7 +73,7 @@ class RimPlotAxisProperties : public RimPlotAxisPropertiesInterface const QString objectName() const override; const QString axisTitleText() const override; - RiuPlotAxis plotAxisType() const override; + RiuPlotAxis plotAxis() const override; bool useAutoTitle() const; void setShowDescription( bool enable ); diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h index 2abbd3e1f1..51c818ee47 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h @@ -56,7 +56,7 @@ class RimPlotAxisPropertiesInterface : public caf::PdmObject virtual std::vector annotations() const = 0; virtual void appendAnnotation( RimPlotAxisAnnotation* annotation ) = 0; virtual void removeAllAnnotations() = 0; - virtual RiuPlotAxis plotAxisType() const = 0; + virtual RiuPlotAxis plotAxis() const = 0; virtual double visibleRangeMin() const = 0; virtual double visibleRangeMax() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index e5a8a1ff92..7e7bf9b58a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -2211,7 +2211,7 @@ int statisticsCurveSymbolSize( RiuPlotCurveSymbol::PointSymbolEnum symbol ) RiuPlotAxis RimEnsembleCurveSet::axisY() const { if ( m_plotAxisProperties ) - return m_plotAxisProperties->plotAxisType(); + return m_plotAxisProperties->plotAxis(); else return RiuPlotAxis::defaultLeft(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index ee58b359cc..0643130dd3 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -441,7 +441,7 @@ void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) RiuPlotAxis RimSummaryCurve::axisY() const { if ( m_plotAxisProperties ) - return m_plotAxisProperties->plotAxisType(); + return m_plotAxisProperties->plotAxis(); else return RiuPlotAxis::defaultLeft(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index aad1d86a3d..6168eed3ee 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -1084,7 +1084,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() { for ( auto curve : plot->summaryCurves() ) { - if ( curve->axisY() == axis->plotAxisType() ) + if ( curve->axisY() == axis->plotAxis() ) { std::vector summaryCases = summaryCasesForCurve( curve, m_axisRangeAggregation() ); std::vector addresses = addressesForCurve( curve, m_axisRangeAggregation() ); @@ -1093,14 +1093,14 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() auto [minimum, maximum] = findMinMaxForAddressesInSummaryCases( addresses, summaryCases, onlyPositiveValues ); - if ( axisRanges.count( axis->plotAxisType() ) == 0 ) + if ( axisRanges.count( axis->plotAxis() ) == 0 ) { - axisRanges[axis->plotAxisType()] = std::make_pair( minimum, maximum ); + axisRanges[axis->plotAxis()] = std::make_pair( minimum, maximum ); } else { - auto& [currentMin, currentMax] = axisRanges[axis->plotAxisType()]; - axisRanges[axis->plotAxisType()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } @@ -1109,7 +1109,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() { if ( !curveSet->summaryCaseCollection() ) continue; - if ( curveSet->axisY() == axis->plotAxisType() ) + if ( curveSet->axisY() == axis->plotAxis() ) { double minimum( std::numeric_limits::infinity() ); double maximum( -std::numeric_limits::infinity() ); @@ -1132,14 +1132,14 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() } } - if ( axisRanges.count( axis->plotAxisType() ) == 0 ) + if ( axisRanges.count( axis->plotAxis() ) == 0 ) { - axisRanges[axis->plotAxisType()] = std::make_pair( minimum, maximum ); + axisRanges[axis->plotAxis()] = std::make_pair( minimum, maximum ); } else { - auto& [currentMin, currentMax] = axisRanges[axis->plotAxisType()]; - axisRanges[axis->plotAxisType()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } @@ -1148,8 +1148,8 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() // set all plots to use the global min/max values for each category for ( auto axis : plot->plotYAxes() ) { - auto [minVal, maxVal] = axisRanges[axis->plotAxisType()]; - if ( RiaDefines::isVertical( axis->plotAxisType().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) ) + auto [minVal, maxVal] = axisRanges[axis->plotAxis()]; + if ( RiaDefines::isVertical( axis->plotAxis().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) ) { axis->setAutoZoom( false ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index a05c865b53..7e8dc7081b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -643,7 +643,7 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSu { QString data = ap->writeObjectToXmlString(); - auto axisProperty = axisPropertiesForPlotAxis( ap->plotAxisType() ); + auto axisProperty = axisPropertiesForPlotAxis( ap->plotAxis() ); if ( axisProperty ) { axisProperty->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); @@ -658,11 +658,11 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisT { for ( auto ap : sourceSummaryPlot.plotAxes() ) { - if ( ap->plotAxisType().axis() != plotAxisType ) continue; + if ( ap->plotAxis().axis() != plotAxisType ) continue; QString data = ap->writeObjectToXmlString(); - axisPropertiesForPlotAxis( ap->plotAxisType() )->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); + axisPropertiesForPlotAxis( ap->plotAxis() )->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); } } @@ -908,7 +908,7 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - RiuPlotAxis riuPlotAxis = axisProperties->plotAxisType(); + RiuPlotAxis riuPlotAxis = axisProperties->plotAxis(); if ( riuPlotAxis.axis() == plotAxis ) { auto* axisProps = dynamic_cast( axisProperties ); @@ -1054,7 +1054,7 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp { if ( !axisProperties ) return; - const auto plotAxis = axisProperties->plotAxisType(); + const auto plotAxis = axisProperties->plotAxis(); if ( axisProperties->isAutoZoom() ) { if ( axisProperties->isLogarithmicScaleEnabled() ) @@ -1086,16 +1086,16 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp std::swap( min, max ); } - plotWidget()->setAxisScale( axisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), min, max ); } else if ( ( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) && isOnlyWaterCutCurvesVisible( plotAxis ) ) { - plotWidget()->setAxisScale( axisProperties->plotAxisType(), 0.0, 1.0 ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), 0.0, 1.0 ); } else { - plotWidget()->setAxisAutoScale( axisProperties->plotAxisType(), true ); + plotWidget()->setAxisAutoScale( axisProperties->plotAxis(), true ); } } else @@ -1103,10 +1103,10 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp double min = axisProperties->visibleRangeMin(); double max = axisProperties->visibleRangeMax(); if ( axisProperties->isAxisInverted() ) std::swap( min, max ); - plotWidget()->setAxisScale( axisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), min, max ); } - plotWidget()->setAxisInverted( axisProperties->plotAxisType(), axisProperties->isAxisInverted() ); + plotWidget()->setAxisInverted( axisProperties->plotAxis(), axisProperties->isAxisInverted() ); } //-------------------------------------------------------------------------------------------------- @@ -1118,13 +1118,13 @@ void RimSummaryPlot::updateZoomForTimeAxis( RimSummaryTimeAxisProperties* timeAx if ( timeAxisProperties->isAutoZoom() ) { - plotWidget()->setAxisAutoScale( timeAxisProperties->plotAxisType(), true ); + plotWidget()->setAxisAutoScale( timeAxisProperties->plotAxis(), true ); } else { double min = timeAxisProperties->visibleRangeMin(); double max = timeAxisProperties->visibleRangeMax(); - plotWidget()->setAxisScale( timeAxisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( timeAxisProperties->plotAxis(), min, max ); } } @@ -1284,7 +1284,7 @@ RimPlotAxisPropertiesInterface* RimSummaryPlot::axisPropertiesForPlotAxis( RiuPl { for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType() == plotAxis ) return axisProperties; + if ( axisProperties->plotAxis() == plotAxis ) return axisProperties; } return nullptr; @@ -1708,10 +1708,10 @@ bool RimSummaryPlot::updateStackedCurveDataForRelevantAxes() bool anyStackedCurvesPresent = false; for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { - anyStackedCurvesPresent |= updateStackedCurveDataForAxis( axisProperties->plotAxisType() ); + anyStackedCurvesPresent |= updateStackedCurveDataForAxis( axisProperties->plotAxis() ); } } @@ -1913,7 +1913,7 @@ void RimSummaryPlot::updateZoomFromParentPlot() { if ( !axisProperties ) continue; - auto [axisMin, axisMax] = plotWidget()->axisRange( axisProperties->plotAxisType() ); + auto [axisMin, axisMax] = plotWidget()->axisRange( axisProperties->plotAxis() ); if ( axisProperties->isAxisInverted() ) std::swap( axisMin, axisMax ); if ( auto propertyAxis = dynamic_cast( axisProperties ) ) @@ -2672,7 +2672,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent for ( const auto& axisProperties : m_axisPropertiesArray ) { - plotWidget()->ensureAxisIsCreated( axisProperties->plotAxisType() ); + plotWidget()->ensureAxisIsCreated( axisProperties->plotAxis() ); } for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves ) @@ -2980,8 +2980,8 @@ void RimSummaryPlot::setAutoScaleXEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || - ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || + ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { ap->setAutoZoom( enabled ); } @@ -2995,8 +2995,8 @@ void RimSummaryPlot::setAutoScaleYEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { ap->setAutoZoom( enabled ); } @@ -3115,8 +3115,8 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) { for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { destinationCurve->setLeftOrRightAxisY( c->axisY() ); @@ -3149,9 +3149,9 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) size_t axisCountRight = 0; for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) axisCountLeft++; - else if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + else if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) axisCountRight++; } @@ -3206,7 +3206,7 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::set usedPlotAxis; for ( const auto& axisProperties : m_axisPropertiesArray ) { - usedPlotAxis.insert( axisProperties->plotAxisType() ); + usedPlotAxis.insert( axisProperties->plotAxis() ); } plotWidget()->pruneAxes( usedPlotAxis ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp index 6f0ec0f1a1..1dc6c042e7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp @@ -119,7 +119,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot { if ( !plotWidget ) return; - RiuPlotAxis axis = m_axisProperties->plotAxisType(); + RiuPlotAxis axis = m_axisProperties->plotAxis(); { QString axisTitle = m_axisProperties->customTitle(); if ( m_axisProperties->useAutoTitle() ) axisTitle = autoAxisTitle(); @@ -254,12 +254,12 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const RifEclipseSummaryAddress sumAddress; std::string unitText; - if ( m_axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( m_axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { sumAddress = rimCurve->summaryAddressX(); unitText = rimCurve->unitNameX(); } - else if ( rimCurve->axisY() == m_axisProperties->plotAxisType() ) + else if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { sumAddress = rimCurve->summaryAddressY(); unitText = rimCurve->unitNameY(); @@ -370,11 +370,11 @@ QString RimSummaryPlotAxisFormatter::createAxisObjectName() const { RifEclipseSummaryAddress sumAddress; - if ( m_axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( m_axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { sumAddress = rimCurve->summaryAddressX(); } - else if ( rimCurve->axisY() == m_axisProperties->plotAxisType() ) + else if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { sumAddress = rimCurve->summaryAddressY(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index f95b5b97aa..0ea047dce7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -164,7 +164,7 @@ RimPlotAxisPropertiesInterface::AxisTitlePositionType RimSummaryTimeAxisProperti //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuPlotAxis RimSummaryTimeAxisProperties::plotAxisType() const +RiuPlotAxis RimSummaryTimeAxisProperties::plotAxis() const { return RiuPlotAxis::defaultBottom(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h index d6976c031e..c8268f5026 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h @@ -85,7 +85,7 @@ class RimSummaryTimeAxisProperties : public RimPlotAxisPropertiesInterface caf::PdmField title; caf::PdmField showTitle; - RiuPlotAxis plotAxisType() const override; + RiuPlotAxis plotAxis() const override; AxisTitlePositionType titlePosition() const override; int titleFontSize() const override; int valuesFontSize() const override; diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp index 282c3ec29b..dfea11f16c 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -143,7 +143,7 @@ void RiuSummaryQwtPlot::useTimeBasedTimeAxis() void RiuSummaryQwtPlot::updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) { RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL; - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { orientation = RiaDefines::Orientation::VERTICAL; } From c5d049a13a59270ccf123c363064bc39bc649cc3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 17 Sep 2023 15:03:41 +0200 Subject: [PATCH 02/28] Add isHorizontal and isVertical --- ApplicationLibCode/UserInterface/RiuPlotAxis.cpp | 16 ++++++++++++++++ ApplicationLibCode/UserInterface/RiuPlotAxis.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp index 47d7569c73..a95f54c55a 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp @@ -92,6 +92,22 @@ RiaDefines::PlotAxis RiuPlotAxis::axis() const return m_axis; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuPlotAxis::isHorizontal() const +{ + return m_axis == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM || m_axis == RiaDefines::PlotAxis::PLOT_AXIS_TOP; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuPlotAxis::isVertical() const +{ + return m_axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || m_axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.h b/ApplicationLibCode/UserInterface/RiuPlotAxis.h index d3a1460350..bb2bc54c22 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.h +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.h @@ -35,6 +35,9 @@ class RiuPlotAxis RiaDefines::PlotAxis axis() const; + bool isHorizontal() const; + bool isVertical() const; + int index() const; bool operator<( const RiuPlotAxis& rhs ) const; From 882775b5b7e8cad5dfac2c2f2a54a025b292947e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 09:25:00 +0200 Subject: [PATCH 03/28] Add summary category time To be able to represent the time in a RifEclipseSummaryAddress object we add time as a category --- .../FileInterface/RifEclipseSummaryAddress.cpp | 18 ++++++++++++++++++ .../FileInterface/RifEclipseSummaryAddress.h | 4 ++++ .../RifEclipseSummaryAddressDefines.h | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 3a5ee2b187..bb4e51cf85 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -445,6 +445,16 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress( co return addr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RifEclipseSummaryAddress::timeAddress() +{ + RifEclipseSummaryAddress addr; + addr.m_variableCategory = SummaryVarCategory::SUMMARY_TIME; + return addr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1241,6 +1251,14 @@ bool RifEclipseSummaryAddress::isCalculated() const return m_id != -1; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifEclipseSummaryAddress::isTime() const +{ + return m_variableCategory == SummaryVarCategory::SUMMARY_TIME; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h index af064c79bd..e8a3bcb545 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h @@ -89,6 +89,9 @@ class RifEclipseSummaryAddress static RifEclipseSummaryAddress importedAddress( const std::string& vectorName, int calculationId = -1 ); static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& vectorName, const std::string& datavectorName ); + // Special address when time is used as x-axis + static RifEclipseSummaryAddress timeAddress(); + static std::string generateStringFromAddresses( const std::vector& addressVector, const std::string jointString = "; " ); @@ -147,6 +150,7 @@ class RifEclipseSummaryAddress auto operator<=>( const RifEclipseSummaryAddress& rhs ) const = default; bool isCalculated() const; + bool isTime() const; std::string formatUiTextRegionToRegion() const; static std::pair regionToRegionPairFromUiText( const std::string& s ); diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h index acea27c528..ff0ff26a38 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h @@ -47,7 +47,8 @@ enum class SummaryVarCategory SUMMARY_BLOCK, SUMMARY_BLOCK_LGR, SUMMARY_IMPORTED, - SUMMARY_ENSEMBLE_STATISTICS + SUMMARY_ENSEMBLE_STATISTICS, + SUMMARY_TIME // Used to represent time as along the x-axis }; enum class SummaryIdentifierType From 5ae47c69b3fa1bfc27526b900be4bb0cf866352a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 09:28:29 +0200 Subject: [PATCH 04/28] Rename to SummaryCategory --- .../Tools/RiaOptionItemFactory.cpp | 38 +-- .../Application/Tools/RiaOptionItemFactory.h | 2 +- .../Tools/RiaSummaryAddressAnalyzer.cpp | 42 +-- .../Tools/RiaSummaryAddressAnalyzer.h | 14 +- .../RicSaveMultiPlotTemplateFeature.cpp | 6 +- .../RicNewSummaryTableFeature.h | 8 +- .../RicPasteAsciiDataToSummaryPlotFeatureUi.h | 4 +- .../FileInterface/RifCsvUserDataParser.cpp | 4 +- .../FileInterface/RifEclEclipseSummary.cpp | 30 +- .../RifEclipseSummaryAddress.cpp | 230 +++++++------- .../FileInterface/RifEclipseSummaryAddress.h | 30 +- .../RifEclipseSummaryAddressDefines.h | 2 +- .../RifEclipseUserDataKeywordTools.cpp | 32 +- .../RifEnsembleStatisticsReader.cpp | 2 +- .../FileInterface/RifReaderObservedData.cpp | 10 +- .../FileInterface/RifReaderObservedData.h | 4 +- .../RifRevealCsvSectionSummaryReader.cpp | 4 +- .../RifRevealCsvSectionSummaryReader.h | 2 +- .../RifRevealCsvSummaryReader.cpp | 4 +- .../RimAnalysisPlotCollection.cpp | 2 +- .../RimDataSourceSteppingTools.cpp | 20 +- .../RimDataSourceSteppingTools.h | 2 +- .../RimSimWellInViewCollection.cpp | 2 +- .../RimSummaryCalculation.cpp | 60 ++-- .../ProjectDataModel/RimSummaryCalculation.h | 2 +- .../Summary/RimEnsembleCurveSet.cpp | 12 +- .../Summary/RimObservedSummaryData.cpp | 18 +- .../Summary/RimObservedSummaryData.h | 4 +- .../Summary/RimSummaryAddress.cpp | 16 +- .../Summary/RimSummaryAddress.h | 4 +- .../Summary/RimSummaryAddressCollection.cpp | 30 +- .../Summary/RimSummaryCurve.cpp | 2 +- .../RimSummaryCurveAppearanceCalculator.cpp | 2 +- .../Summary/RimSummaryCurveAutoName.cpp | 26 +- .../Summary/RimSummaryPlot.cpp | 12 +- .../Summary/RimSummaryPlotSourceStepping.cpp | 62 ++-- .../Summary/RimSummaryTable.cpp | 40 +-- .../Summary/RimSummaryTable.h | 8 +- .../Summary/RimSummaryTableCollection.cpp | 2 +- .../Summary/RimSummaryTableCollection.h | 2 +- .../UnitTests/ObservedDataParser-Test.cpp | 2 +- .../RiaSummaryAddressAnalyzer-Test.cpp | 2 +- .../RifEclipseSummaryAddress-Test.cpp | 46 +-- .../RifRevealCsvSectionSummaryReader-Test.cpp | 4 +- .../RiuSummaryVectorDescriptionMap-Test.cpp | 10 +- .../RiuSummaryQuantityNameInfoProvider.cpp | 40 +-- .../RiuSummaryQuantityNameInfoProvider.h | 10 +- .../RiuSummaryVectorSelectionUi.cpp | 280 +++++++++--------- .../RiuSummaryVectorSelectionUi.h | 8 +- 49 files changed, 599 insertions(+), 599 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp index 331a8837a5..33aeb9086b 100644 --- a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp +++ b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp @@ -55,9 +55,9 @@ void RiaOptionItemFactory::appendOptionItemsForEnsembleCurveSets( QList::uiText( summaryType ); + auto uiText = caf::AppEnum::uiText( summaryType ); // Use icons from https://github.com/equinor/webviz-subsurface-components @@ -65,55 +65,55 @@ caf::PdmOptionItemInfo RiaOptionItemFactory::optionItemFromSummaryType( RifEclip switch ( summaryType ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID: iconText = ":/summary/components/images/invalid.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD: iconText = ":/summary/components/images/field.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: iconText = ":/summary/components/images/aquifer.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: iconText = ":/summary/components/images/network.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC: iconText = ":/summary/components/images/misc.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: iconText = ":/summary/components/images/region.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: iconText = ":/summary/components/images/region-region.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: iconText = ":/summary/components/images/group.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: iconText = ":/summary/components/images/well.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: iconText = ":/summary/components/images/well-completion.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: iconText = ":/summary/components/images/well.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: iconText = ":/summary/components/images/well-completion.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: iconText = ":/summary/components/images/segment.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: iconText = ":/summary/components/images/block.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: iconText = ":/summary/components/images/block.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED: iconText = ":/summary/components/images/others.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS: break; } diff --git a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h index 77a788aa80..4fdf552330 100644 --- a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h +++ b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h @@ -31,5 +31,5 @@ class RiaOptionItemFactory public: static void appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList* optionItems ); static void appendOptionItemsForEnsembleCurveSets( QList* options ); - static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryVarCategory summaryType ); + static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryCategory summaryType ); }; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index d614b56956..7b9cdc369c 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -205,7 +205,7 @@ std::set RiaSummaryAddressAnalyzer::aquifers() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RiaSummaryAddressAnalyzer::categories() const +std::set RiaSummaryAddressAnalyzer::categories() const { return keysInMap( m_categories ); } @@ -238,12 +238,12 @@ std::vector> RiaSummaryAddressAnalyzer::ad //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddressDefines::SummaryVarCategory category, +std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& secondaryIdentifier ) const { std::vector identifierStrings; - if ( category == SummaryVarCategory::SUMMARY_REGION ) + if ( category == SummaryCategory::SUMMARY_REGION ) { auto keys = keysInMap( m_regionNumbers ); for ( const auto& key : keys ) @@ -251,7 +251,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::number( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL ) + else if ( category == SummaryCategory::SUMMARY_WELL ) { auto keys = keysInMap( m_wellNames ); for ( const auto& key : keys ) @@ -259,7 +259,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == SummaryCategory::SUMMARY_GROUP ) { auto keys = keysInMap( m_groupNames ); for ( const auto& key : keys ) @@ -267,7 +267,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == SummaryCategory::SUMMARY_NETWORK ) { auto keys = keysInMap( m_networkNames ); for ( const auto& key : keys ) @@ -275,7 +275,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( category == SummaryCategory::SUMMARY_BLOCK ) { auto keys = keysInMap( m_blocks ); for ( const auto& key : keys ) @@ -283,7 +283,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( category == SummaryCategory::SUMMARY_WELL_SEGMENT ) { auto segmentNumbers = wellSegmentNumbers( secondaryIdentifier ); for ( const auto& segment : segmentNumbers ) @@ -291,7 +291,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::number( segment ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( category == SummaryCategory::SUMMARY_WELL_COMPLETION ) { auto connections = wellCompletions( secondaryIdentifier ); for ( const auto& conn : connections ) @@ -299,7 +299,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( conn ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == SummaryCategory::SUMMARY_AQUIFER ) { auto keys = keysInMap( m_aquifers ); for ( const auto& key : keys ) @@ -316,7 +316,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma //-------------------------------------------------------------------------------------------------- std::vector RiaSummaryAddressAnalyzer::addressesForCategory( const std::set& addresses, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) + RifEclipseSummaryAddressDefines::SummaryCategory category ) { std::vector filteredAddresses; @@ -350,7 +350,7 @@ std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( con //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) +std::set RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) { auto it = m_categories.find( category ); if ( it != m_categories.end() ) return it->second; @@ -457,32 +457,32 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd m_regionNumbers.insert( { address.regionNumber(), address } ); } - if ( address.category() == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + if ( address.category() == SummaryCategory::SUMMARY_WELL_COMPLETION ) { auto wellNameAndCompletion = std::make_pair( wellName, address.blockAsString() ); m_wellCompletions.insert( wellNameAndCompletion ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( address.category() == SummaryCategory::SUMMARY_WELL_SEGMENT ) { auto wellNameAndSegment = std::make_pair( wellName, address.wellSegmentNumber() ); m_wellSegmentNumbers.insert( wellNameAndSegment ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( address.category() == SummaryCategory::SUMMARY_BLOCK ) { auto text = address.blockAsString(); m_blocks.insert( { text, address } ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( address.category() == SummaryCategory::SUMMARY_AQUIFER ) { m_aquifers.insert( { address.aquiferNumber(), address } ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_FIELD || address.category() == SummaryVarCategory::SUMMARY_MISC ) + else if ( address.category() == SummaryCategory::SUMMARY_FIELD || address.category() == SummaryCategory::SUMMARY_MISC ) { m_otherCategory.push_back( address ); } - if ( address.category() != SummaryVarCategory::SUMMARY_INVALID ) + if ( address.category() != SummaryCategory::SUMMARY_INVALID ) { if ( m_categories.count( address.category() ) == 0 ) { @@ -522,10 +522,10 @@ std::set RiaSummaryAddressAnalyzer::keysInMap( const std::multimap - RiaSummaryAddressAnalyzer::keysInMap( const std::map>& map ) +std::set + RiaSummaryAddressAnalyzer::keysInMap( const std::map>& map ) { - std::set keys; + std::set keys; for ( const auto& [key, value] : map ) { keys.insert( key ); diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index dc6727cec2..4426545c65 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -60,18 +60,18 @@ class RiaSummaryAddressAnalyzer std::set blocks() const; std::set aquifers() const; - std::set categories() const; + std::set categories() const; std::vector> addressesGroupedByObject() const; - std::vector identifierTexts( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + std::vector identifierTexts( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& secondaryIdentifier ) const; static std::vector addressesForCategory( const std::set& addresses, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + RifEclipseSummaryAddressDefines::SummaryCategory category ); static std::string correspondingHistorySummaryCurveName( const std::string& curveName ); - std::set vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + std::set vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ); private: void assignCategoryToQuantities() const; @@ -81,8 +81,8 @@ class RiaSummaryAddressAnalyzer static std::set keysInMap( const std::multimap& map ); static std::set keysInMap( const std::multimap& map ); - static std::set - keysInMap( const std::map>& map ); + static std::set + keysInMap( const std::map>& map ); static std::vector> valuesInMap( const std::multimap& map ); @@ -103,5 +103,5 @@ class RiaSummaryAddressAnalyzer std::multimap m_blocks; std::multimap m_aquifers; - std::map> m_categories; + std::map> m_categories; }; diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp index ab05853947..b2d6d50805 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp @@ -219,7 +219,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl } replaceStrings( sourceStrings, - dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), + dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), RicSummaryPlotTemplateTools::placeholderTextForWell(), objectAsText ); } @@ -233,7 +233,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl } replaceStrings( sourceStrings, - dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), + dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), RicSummaryPlotTemplateTools::placeholderTextForGroup(), objectAsText ); } @@ -251,7 +251,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl // Encode placeholder index. Use negative values below -1 to represent a placeholder index int index = -( i + 2 ); - QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ); + QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ); QString sourceString = QString( "<%1>%2" ).arg( fieldKeyword ).arg( regionNumbers[i] ); QString replacementTextWithIndex = QString( "<%1>%2" ).arg( fieldKeyword ).arg( index ); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h index 8e4d13f873..1b681da39a 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h @@ -37,8 +37,8 @@ class RicNewSummaryTableFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; private: - const std::set m_enabledCategories = - { RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION, - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP }; + const std::set m_enabledCategories = + { RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP }; }; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h index 4afc7de5c7..2f6543135e 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h @@ -42,7 +42,7 @@ class AsciiDataParseOptions : useCustomDateTimeFormat( false ) , assumeNumericDataColumns( false ) , curveSymbolSkipDistance( 0.0f ) - , defaultCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + , defaultCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { } @@ -62,7 +62,7 @@ class AsciiDataParseOptions QDateTime startDateTime; bool assumeNumericDataColumns; - RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory; + RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory; RiuQwtPlotCurveDefines::LineStyleEnum curveLineStyle; RiuPlotCurveSymbol::PointSymbolEnum curveSymbol; diff --git a/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp b/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp index 2f88adbf68..000e1d3e45 100644 --- a/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp +++ b/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp @@ -419,9 +419,9 @@ bool RifCsvUserDataParser::parseColumnInfo( QTextStream* RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( colName.toStdString() ); // Create address of a give category if provided - if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) addr = RifEclipseSummaryAddress::wellAddress( colName.toStdString(), nameFromData.toStdString() ); - else if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + else if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) addr = RifEclipseSummaryAddress::fieldAddress( colName.toStdString() ); double scaleFactor = 1.0; diff --git a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp index e346c71255..5920063f2b 100644 --- a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp @@ -107,7 +107,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu return RifEclipseSummaryAddress(); } - RifEclipseSummaryAddressDefines::SummaryVarCategory sumCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ); + RifEclipseSummaryAddressDefines::SummaryCategory sumCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ); std::string quantityName; int regionNumber( -1 ); int regionNumber2( -1 ); @@ -129,36 +129,36 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu { case ECL_SMSPEC_AQUIFER_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER; aquiferNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_WELL_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); } break; case ECL_SMSPEC_REGION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION; regionNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_FIELD_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD; } break; case ECL_SMSPEC_GROUP_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP; groupName = stringFromPointer( ertSumVarNode.get_wgname() ); } break; case ECL_SMSPEC_BLOCK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK; auto ijk = ertSumVarNode.get_ijk(); cellI = ijk[0]; @@ -168,7 +168,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_COMPLETION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); auto ijk = ertSumVarNode.get_ijk(); @@ -179,7 +179,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_BLOCK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR; lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); auto ijk = ertSumVarNode.get_lgr_ijk(); @@ -190,7 +190,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_COMPLETION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); @@ -202,33 +202,33 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_WELL_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); } break; case ECL_SMSPEC_NETWORK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK; } break; case ECL_SMSPEC_REGION_2_REGION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; regionNumber = ertSumVarNode.get_R1(); regionNumber2 = ertSumVarNode.get_R2(); } break; case ECL_SMSPEC_SEGMENT_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); wellSegmentNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_MISC_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC; } break; default: diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index bb4e51cf85..40e8d4768a 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -31,8 +31,8 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, std::map& identifiers ) - : m_variableCategory( category ) +RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, std::map& identifiers ) + : m_category( category ) , m_number0( -1 ) , m_number1( -1 ) , m_number2( -1 ) @@ -42,48 +42,48 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, std::pair reg2regPair; switch ( category ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: m_number0 = RiaStdStringTools::toInt16( identifiers[SummaryIdentifierType::INPUT_REGION_NUMBER] ); break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: reg2regPair = regionToRegionPairFromUiText( identifiers[SummaryIdentifierType::INPUT_REGION_2_REGION] ); m_number0 = reg2regPair.first; m_number1 = reg2regPair.second; break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: m_name = identifiers[SummaryIdentifierType::INPUT_GROUP_NAME]; break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: m_name = identifiers[SummaryIdentifierType::INPUT_NETWORK_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; m_number0 = RiaStdStringTools::toInt( identifiers[SummaryIdentifierType::INPUT_SEGMENT_NUMBER] ); break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: m_number0 = RiaStdStringTools::toInt( identifiers[SummaryIdentifierType::INPUT_AQUIFER_NUMBER] ); break; } @@ -95,7 +95,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, +RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, const std::string& vectorName, int regionNumber, int regionNumber2, @@ -110,7 +110,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, int aquiferNumber, bool isErrorResult, int id ) - : m_variableCategory( category ) + : m_category( category ) , m_vectorName( vectorName ) , m_lgrName( lgrName ) , m_number0( -1 ) @@ -121,44 +121,44 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, { switch ( category ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: m_number0 = regionNumber; break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: m_number0 = regionNumber; m_number1 = regionNumber2; break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: m_name = groupName; break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: m_name = networkName; break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: m_name = wellName; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: m_name = wellName; setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: m_name = wellName; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: m_name = wellName; setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: m_name = wellName; m_number0 = wellSegmentNumber; break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: m_number0 = aquiferNumber; break; } @@ -168,7 +168,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, /// //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress::RifEclipseSummaryAddress() - : m_variableCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + : m_category( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) , m_number0( -1 ) , m_number1( -1 ) , m_number2( -1 ) @@ -200,7 +200,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddressParseEr auto address = fromTokens( tokens ); - if ( address.category() == SummaryVarCategory::SUMMARY_INVALID || address.category() == SummaryVarCategory::SUMMARY_IMPORTED ) + if ( address.category() == SummaryCategory::SUMMARY_INVALID || address.category() == SummaryCategory::SUMMARY_IMPORTED ) { // Address category not recognized, use incoming text string without error prefix as vector name auto text = RiaStdStringTools::joinStrings( tokens, ':' ); @@ -227,7 +227,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_FIELD; + addr.m_category = SummaryCategory::SUMMARY_FIELD; addr.m_vectorName = vectorName; addr.m_id = calculationId; return addr; @@ -239,7 +239,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::aquiferAddress( const std::string& vectorName, int aquiferNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_AQUIFER; + addr.m_category = SummaryCategory::SUMMARY_AQUIFER; addr.m_vectorName = vectorName; addr.m_number0 = aquiferNumber; addr.m_id = calculationId; @@ -253,7 +253,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_NETWORK; + addr.m_category = SummaryCategory::SUMMARY_NETWORK; addr.m_vectorName = vectorName; addr.m_name = networkName; addr.m_id = calculationId; @@ -266,7 +266,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_MISC; + addr.m_category = SummaryCategory::SUMMARY_MISC; addr.m_vectorName = vectorName; addr.m_id = calculationId; return addr; @@ -278,7 +278,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::strin RifEclipseSummaryAddress RifEclipseSummaryAddress::regionAddress( const std::string& vectorName, int regionNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_REGION; + addr.m_category = SummaryCategory::SUMMARY_REGION; addr.m_vectorName = vectorName; addr.m_number0 = regionNumber; addr.m_id = calculationId; @@ -292,7 +292,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_REGION_2_REGION; + addr.m_category = SummaryCategory::SUMMARY_REGION_2_REGION; addr.m_vectorName = vectorName; addr.m_number0 = regionNumber; addr.m_number1 = region2Number; @@ -306,7 +306,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::string& vectorName, const std::string& groupName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_GROUP; + addr.m_category = SummaryCategory::SUMMARY_GROUP; addr.m_vectorName = vectorName; addr.m_name = groupName; addr.m_id = calculationId; @@ -319,7 +319,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::wellAddress( const std::string& vectorName, const std::string& wellName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL; + addr.m_category = SummaryCategory::SUMMARY_WELL; addr.m_vectorName = vectorName; addr.m_name = wellName; addr.m_id = calculationId; @@ -333,7 +333,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_COMPLETION; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION; addr.m_vectorName = vectorName; addr.m_name = wellName; addr.setCellIjk( i, j, k ); @@ -350,7 +350,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellLgrAddress( const std::st int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_LGR; + addr.m_category = SummaryCategory::SUMMARY_WELL_LGR; addr.m_vectorName = vectorName; addr.m_lgrName = lgrName; addr.m_name = wellName; @@ -370,7 +370,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionLgrAddress( con int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; addr.m_vectorName = vectorName; addr.m_lgrName = lgrName; addr.m_name = wellName; @@ -386,7 +386,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_SEGMENT; + addr.m_category = SummaryCategory::SUMMARY_WELL_SEGMENT; addr.m_vectorName = vectorName; addr.m_name = wellName; addr.m_number0 = segmentNumber; @@ -400,7 +400,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::blockAddress( const std::string& vectorName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_BLOCK; + addr.m_category = SummaryCategory::SUMMARY_BLOCK; addr.m_vectorName = vectorName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; @@ -414,7 +414,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_BLOCK_LGR; + addr.m_category = SummaryCategory::SUMMARY_BLOCK_LGR; addr.m_vectorName = vectorName; addr.m_lgrName = lgrName; addr.setCellIjk( i, j, k ); @@ -428,7 +428,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_IMPORTED; + addr.m_category = SummaryCategory::SUMMARY_IMPORTED; addr.m_vectorName = vectorName; addr.m_id = calculationId; return addr; @@ -440,7 +440,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::s RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress( const std::string& vectorName, const std::string& dataQuantityName ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS; + addr.m_category = SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS; addr.m_vectorName = vectorName + ":" + dataQuantityName; return addr; } @@ -451,7 +451,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress( co RifEclipseSummaryAddress RifEclipseSummaryAddress::timeAddress() { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_TIME; + addr.m_category = SummaryCategory::SUMMARY_TIME; return addr; } @@ -481,19 +481,19 @@ std::string RifEclipseSummaryAddress::generateStringFromAddresses( const std::ve //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryVarCategory category ) +bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryCategory category ) { - return ( category == SummaryVarCategory::SUMMARY_WELL || category == SummaryVarCategory::SUMMARY_WELL_COMPLETION || - category == SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR || category == SummaryVarCategory::SUMMARY_WELL_LGR || - category == SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + return ( category == SummaryCategory::SUMMARY_WELL || category == SummaryCategory::SUMMARY_WELL_COMPLETION || + category == SummaryCategory::SUMMARY_WELL_COMPLETION_LGR || category == SummaryCategory::SUMMARY_WELL_LGR || + category == SummaryCategory::SUMMARY_WELL_SEGMENT ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RifEclipseSummaryAddress::category() const +RifEclipseSummaryAddressDefines::SummaryCategory RifEclipseSummaryAddress::category() const { - return m_variableCategory; + return m_category; } //-------------------------------------------------------------------------------------------------- @@ -535,7 +535,7 @@ int RifEclipseSummaryAddress::regionNumber2() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::groupName() const { - return ( m_variableCategory == SummaryVarCategory::SUMMARY_GROUP ) ? m_name : std::string(); + return ( m_category == SummaryCategory::SUMMARY_GROUP ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -543,7 +543,7 @@ std::string RifEclipseSummaryAddress::groupName() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::networkName() const { - return ( m_variableCategory == SummaryVarCategory::SUMMARY_NETWORK ) ? m_name : std::string(); + return ( m_category == SummaryCategory::SUMMARY_NETWORK ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -551,7 +551,7 @@ std::string RifEclipseSummaryAddress::networkName() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::wellName() const { - return isDependentOnWellName( m_variableCategory ) ? m_name : std::string(); + return isDependentOnWellName( m_category ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -651,45 +651,45 @@ std::string RifEclipseSummaryAddress::itemUiText() const switch ( category() ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: { text += std::to_string( regionNumber() ); } break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: { text += formatUiTextRegionToRegion(); } break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: { text += groupName(); } break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: { text += networkName(); } break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: { text += wellName(); } break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: { text += wellName(); text += ":" + blockAsString(); } break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: { text += lgrName(); text += ":"; text += wellName(); } break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: { text += lgrName(); text += ":"; @@ -698,31 +698,31 @@ std::string RifEclipseSummaryAddress::itemUiText() const text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: { text += wellName(); text += ":"; text += std::to_string( wellSegmentNumber() ); } break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: { text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: { text += lgrName(); text += ":"; text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: { text += std::to_string( aquiferNumber() ); } break; - case SummaryVarCategory::SUMMARY_IMPORTED: + case SummaryCategory::SUMMARY_IMPORTED: { text += vectorName(); } @@ -788,39 +788,39 @@ bool RifEclipseSummaryAddress::isValid() const switch ( category() ) { - case SummaryVarCategory::SUMMARY_INVALID: + case SummaryCategory::SUMMARY_INVALID: return false; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: if ( m_number0 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: if ( m_lgrName.empty() ) return false; if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( m_lgrName.empty() ) return false; if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; @@ -828,25 +828,25 @@ bool RifEclipseSummaryAddress::isValid() const if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: if ( m_lgrName.empty() ) return false; if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: if ( m_number0 == -1 ) return false; return true; } @@ -979,7 +979,7 @@ bool RifEclipseSummaryAddress::hasAccumulatedData() const if ( !isValidEclipseCategory() ) return false; QString quantityForInspection = QString::fromStdString( vectorName() ); - if ( category() == SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( category() == SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { // Remove statistics text prefix quantityForInspection = quantityForInspection.mid( quantityForInspection.indexOf( ":" ) + 1 ); @@ -1016,14 +1016,14 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector if ( tokens.size() > 1 ) token1 = tokens[1]; if ( tokens.size() > 2 ) token2 = tokens[2]; - SummaryVarCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( vectorName ); + SummaryCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( vectorName ); switch ( category ) { - case SummaryVarCategory::SUMMARY_FIELD: + case SummaryCategory::SUMMARY_FIELD: return fieldAddress( vectorName ); - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: if ( !token1.empty() ) { RiaStdStringTools::toInt( token1, intValue0 ); @@ -1031,15 +1031,15 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: return networkAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_MISC: return miscAddress( vectorName ); break; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: if ( !token1.empty() ) { RiaStdStringTools::toInt( token1, intValue0 ); @@ -1047,7 +1047,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: if ( !token1.empty() ) { auto regions = RiaStdStringTools::splitString( token1, '-' ); @@ -1061,15 +1061,15 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: if ( !token1.empty() ) return groupAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: if ( !token1.empty() ) return wellAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: if ( !token2.empty() ) { auto ijk = RiaStdStringTools::splitString( token2, ',' ); @@ -1084,11 +1084,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: if ( !token1.empty() && !token2.empty() ) return wellLgrAddress( vectorName, token1, token2 ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( tokens.size() > 2 ) { const auto& token3 = tokens[3]; @@ -1104,7 +1104,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: if ( !token2.empty() ) { @@ -1114,7 +1114,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: if ( !token1.empty() ) { auto ijk = RiaStdStringTools::splitString( token1, ',' ); @@ -1129,7 +1129,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: if ( !token2.empty() ) { auto ijk = RiaStdStringTools::splitString( token2, ',' ); @@ -1144,8 +1144,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_IMPORTED: - case SummaryVarCategory::SUMMARY_INVALID: + case SummaryCategory::SUMMARY_IMPORTED: + case SummaryCategory::SUMMARY_INVALID: default: break; } @@ -1160,21 +1160,21 @@ bool RifEclipseSummaryAddress::isValidEclipseCategory() const { switch ( category() ) { - case SummaryVarCategory::SUMMARY_FIELD: - case SummaryVarCategory::SUMMARY_AQUIFER: - case SummaryVarCategory::SUMMARY_NETWORK: - case SummaryVarCategory::SUMMARY_MISC: - case SummaryVarCategory::SUMMARY_REGION: - case SummaryVarCategory::SUMMARY_REGION_2_REGION: - case SummaryVarCategory::SUMMARY_GROUP: - case SummaryVarCategory::SUMMARY_WELL: - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: - case SummaryVarCategory::SUMMARY_WELL_LGR: - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: - case SummaryVarCategory::SUMMARY_BLOCK: - case SummaryVarCategory::SUMMARY_BLOCK_LGR: - case SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS: + case SummaryCategory::SUMMARY_FIELD: + case SummaryCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS: return true; } return false; @@ -1256,7 +1256,7 @@ bool RifEclipseSummaryAddress::isCalculated() const //-------------------------------------------------------------------------------------------------- bool RifEclipseSummaryAddress::isTime() const { - return m_variableCategory == SummaryVarCategory::SUMMARY_TIME; + return m_category == SummaryCategory::SUMMARY_TIME; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h index e8a3bcb545..8dddb06d52 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h @@ -37,7 +37,7 @@ class RifEclipseSummaryAddress public: RifEclipseSummaryAddress(); - RifEclipseSummaryAddress( SummaryVarCategory category, + RifEclipseSummaryAddress( SummaryCategory category, const std::string& vectorName, int regionNumber, int regionNumber2, @@ -53,7 +53,7 @@ class RifEclipseSummaryAddress bool isErrorResult, int id ); - RifEclipseSummaryAddress( SummaryVarCategory category, std::map& identifiers ); + RifEclipseSummaryAddress( SummaryCategory category, std::map& identifiers ); // Static specialized creation methods @@ -95,13 +95,13 @@ class RifEclipseSummaryAddress static std::string generateStringFromAddresses( const std::vector& addressVector, const std::string jointString = "; " ); - static bool isDependentOnWellName( RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + static bool isDependentOnWellName( RifEclipseSummaryAddressDefines::SummaryCategory category ); // Access methods - SummaryVarCategory category() const; - std::string vectorName() const; - bool isHistoryVector() const; + SummaryCategory category() const; + std::string vectorName() const; + bool isHistoryVector() const; int regionNumber() const; int regionNumber2() const; @@ -167,15 +167,15 @@ class RifEclipseSummaryAddress // The ordering the variables are defined in defines how the objects get sorted. Members defined first will be // evaluated first. This concept is used by <=> operator. - SummaryVarCategory m_variableCategory; - std::string m_vectorName; - std::string m_name; - std::string m_lgrName; - int m_number0; - int m_number1; - int m_number2; - bool m_isErrorResult; - int m_id; + SummaryCategory m_category; + std::string m_vectorName; + std::string m_name; + std::string m_lgrName; + int m_number0; + int m_number1; + int m_number2; + bool m_isErrorResult; + int m_id; }; QTextStream& operator<<( QTextStream& str, const RifEclipseSummaryAddress& sobj ); diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h index ff0ff26a38..9a4772903a 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h @@ -29,7 +29,7 @@ namespace RifEclipseSummaryAddressDefines { // Based on list in ecl_smspec.c and list of types taken from Eclipse Reference Manual ecl_rm_2011.1.pdf -enum class SummaryVarCategory +enum class SummaryCategory { SUMMARY_INVALID, SUMMARY_FIELD, diff --git a/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp b/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp index d1c00e78fc..c9f43e425d 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp @@ -166,10 +166,10 @@ bool RifEclipseUserDataKeywordTools::isYearX( const std::string& identifier ) RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( const std::string quantityName, const std::vector& columnHeaderText ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory category = + RifEclipseSummaryAddressDefines::SummaryCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( quantityName ); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { return RifEclipseSummaryAddress::importedAddress( quantityName ); } @@ -190,9 +190,9 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con switch ( category ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: { if ( columnHeaderText.size() > 0 ) { @@ -200,11 +200,11 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: { if ( columnHeaderText.size() > 0 ) { @@ -212,9 +212,9 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: { if ( columnHeaderText.size() > 0 ) { @@ -222,7 +222,7 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: { if ( columnHeaderText.size() > 0 ) { @@ -230,7 +230,7 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: { if ( columnHeaderText.size() > 1 ) { @@ -241,14 +241,14 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con break; } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: if ( columnHeaderText.size() > 1 ) { wellName = columnHeaderText[0]; lgrName = columnHeaderText[1]; } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( columnHeaderText.size() > 2 ) { wellName = columnHeaderText[0]; @@ -257,20 +257,20 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con RifEclipseUserDataKeywordTools::extractThreeInts( &cellI, &cellJ, &cellK, columnHeaderText[2] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: if ( columnHeaderText.size() > 1 ) { wellName = columnHeaderText[0]; wellSegmentNumber = RiaStdStringTools::toInt( columnHeaderText[1] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: if ( columnHeaderText.size() > 0 ) { RifEclipseUserDataKeywordTools::extractThreeInts( &cellI, &cellJ, &cellK, columnHeaderText[0] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: if ( columnHeaderText.size() > 1 ) { lgrName = columnHeaderText[0]; diff --git a/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp b/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp index 60bb0009e1..28dcf3ddbc 100644 --- a/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp +++ b/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp @@ -111,6 +111,6 @@ RiaDefines::EclipseUnitSystem RifEnsembleStatisticsReader::unitSystem() const //-------------------------------------------------------------------------------------------------- bool RifEnsembleStatisticsReader::validateAddress( const RifEclipseSummaryAddress& address ) const { - return address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS && + return address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS && !address.vectorName().empty(); } diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp index c2e1e16046..6e49bcb270 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp @@ -47,7 +47,7 @@ RifReaderObservedData::~RifReaderObservedData() //-------------------------------------------------------------------------------------------------- bool RifReaderObservedData::open( const QString& headerFileName, const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ) + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { AsciiDataParseOptions parseOptions; parseOptions.dateFormat = "yyyy-MM-dd"; @@ -156,7 +156,7 @@ std::vector RifReaderObservedData::timeSteps( const RifEclipseSummaryAdd //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress RifReaderObservedData::address( const QString& vectorName, const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ) + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { std::string stdVectorName = vectorName.toStdString(); int regionNumber( -1 ); @@ -175,13 +175,13 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString& switch ( summaryCategory ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: groupName = identifierName.toStdString(); break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: wellName = identifierName.toStdString(); break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: lgrName = identifierName.toStdString(); break; default: diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.h b/ApplicationLibCode/FileInterface/RifReaderObservedData.h index 7606478ce1..677b7be7aa 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.h +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.h @@ -41,7 +41,7 @@ class RifReaderObservedData : public RifSummaryReaderInterface RifReaderObservedData(); ~RifReaderObservedData() override; - bool open( const QString& headerFileName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ); + bool open( const QString& headerFileName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); std::vector timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override; @@ -54,7 +54,7 @@ class RifReaderObservedData : public RifSummaryReaderInterface private: RifEclipseSummaryAddress address( const QString& vectorName, const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ); + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); private: std::unique_ptr m_asciiParser; diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp index 78e8d531ab..de5609faa3 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp @@ -53,7 +53,7 @@ RifRevealCsvSectionSummaryReader::~RifRevealCsvSectionSummaryReader() /// //-------------------------------------------------------------------------------------------------- bool RifRevealCsvSectionSummaryReader::parse( const QString& text, - RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory, + RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory, QString* errorText ) { m_allResultAddresses.clear(); @@ -82,7 +82,7 @@ bool RifRevealCsvSectionSummaryReader::parse( const QString& { "1000Sm3/d", { "SM3/DAY", 1000.0 } }, { "MSm3", { "SM3", 1000000.0 } } }; - QString prefix = defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ? "F" : "W"; + QString prefix = defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ? "F" : "W"; std::map nameMapping = { { "WaterCut", prefix + "WCT" }, { "GOR", prefix + "GOR" }, { "BottomHolePressure", prefix + "BHP" }, { "CumLiquidInjected", prefix + "LIT" }, diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h index 9c02db4902..c5be4fbf88 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h @@ -35,5 +35,5 @@ class RifRevealCsvSectionSummaryReader : public RifCsvSummaryReader RifRevealCsvSectionSummaryReader(); ~RifRevealCsvSectionSummaryReader() override; - bool parse( const QString& fileName, RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory, QString* errorText = nullptr ); + bool parse( const QString& fileName, RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory, QString* errorText = nullptr ); }; diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp index 25f11b1c4c..596ef222a0 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp @@ -66,8 +66,8 @@ std::pair RifRevealCsvSummaryReader::parse( const QString& fileNa cvf::ref sectionReader = new RifRevealCsvSectionSummaryReader; // The first part is field data, and the rest is well data - auto defaultCategory = isFirst ? RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD - : RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + auto defaultCategory = isFirst ? RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD + : RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; QString errorMessage; if ( !sectionReader->parse( p, defaultCategory, &errorMessage ) ) diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp index 912a497c23..b396b58870 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp @@ -201,7 +201,7 @@ void RimAnalysisPlotCollection::applySummaryCaseCollectionAndFieldAddressToPlot( { for ( auto address : allAddresses ) { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { if ( quantityName.empty() || quantityName == address.vectorName() ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp index 8f7fe30ed5..a09f6e6f5a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp @@ -76,12 +76,12 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField* //-------------------------------------------------------------------------------------------------- bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue, const QVariant& newValue, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, RifEclipseSummaryAddress* adr ) { if ( !adr ) return false; - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); @@ -93,7 +93,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); @@ -105,7 +105,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -117,7 +117,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -129,7 +129,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -141,8 +141,8 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK || - category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK || + category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -153,7 +153,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -166,7 +166,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h index f3e25459ec..7a751babe0 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h @@ -38,7 +38,7 @@ class RimDataSourceSteppingTools static bool updateAddressIfMatching( const QVariant& oldValue, const QVariant& newValue, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, RifEclipseSummaryAddress* adr ); static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr ); diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp index 24614fd606..35d100cc2b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -516,7 +516,7 @@ QList RimSimWellInViewCollection::calculateValueOptions( auto addresses = summaryCase->summaryReader()->allResultAddresses(); for ( auto addr : addresses ) { - if ( addr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( addr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { summaries.insert( addr.vectorName() ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp index ef95f556f1..829f8d3be0 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp @@ -239,45 +239,45 @@ void RimSummaryCalculation::substituteVariables( std::vector RimSummaryCalculation::allAddressesFor /// //-------------------------------------------------------------------------------------------------- std::vector - RimSummaryCalculation::allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RimSummaryCalculation::allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::set& allResultAddresses ) const { std::vector addresses; std::string name = shortName().toStdString(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::fieldAddress( name, m_id ) ) ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { std::set uniqueNumbers; std::for_each( allResultAddresses.begin(), @@ -515,11 +515,11 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::aquiferAddress( name, num, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::miscAddress( name, m_id ) ) ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { std::set uniqueNames; std::for_each( allResultAddresses.begin(), @@ -531,7 +531,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::networkAddress( name, networkName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { std::set uniqueWellNames; std::for_each( allResultAddresses.begin(), @@ -543,7 +543,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::wellAddress( name, wellName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { std::set uniqueGroupNames; std::for_each( allResultAddresses.begin(), @@ -555,7 +555,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::groupAddress( name, groupName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { std::set uniqueRegionNumbers; std::for_each( allResultAddresses.begin(), @@ -567,7 +567,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::regionAddress( name, regionNumber, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { std::set> uniqueRegionNumbers; std::for_each( allResultAddresses.begin(), @@ -580,7 +580,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::regionToRegionAddress( name, r1, r2, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::importedAddress( name, m_id ) ) ); } @@ -595,40 +595,40 @@ RimSummaryCalculationAddress RimSummaryCalculation::singleAddressesForCategory( { std::string name = shortName().toStdString(); - RifEclipseSummaryAddressDefines::SummaryVarCategory category = address.category(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + RifEclipseSummaryAddressDefines::SummaryCategory category = address.category(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { return RifEclipseSummaryAddress::fieldAddress( name, m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { return RifEclipseSummaryAddress::aquiferAddress( name, address.aquiferNumber(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC ) { return RifEclipseSummaryAddress::miscAddress( name, m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { return RifEclipseSummaryAddress::networkAddress( name, address.networkName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return RifEclipseSummaryAddress::wellAddress( name, address.wellName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { return RifEclipseSummaryAddress::groupAddress( name, address.groupName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return RifEclipseSummaryAddress::regionAddress( name, address.regionNumber(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { return RifEclipseSummaryAddress::regionToRegionAddress( name, address.regionNumber(), address.regionNumber2(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED ) { return RifEclipseSummaryAddress::importedAddress( name, m_id ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h index aef1f33ebb..d4d55a7fff 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h +++ b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h @@ -77,7 +77,7 @@ class RimSummaryCalculation : public RimUserDefinedCalculation static void substituteVariables( std::vector& vars, const RifEclipseSummaryAddress& address ); - std::vector allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + std::vector allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::set& allResultAddresses ) const; RimSummaryCalculationAddress singleAddressesForCategory( const RifEclipseSummaryAddress& address ) const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 7e7bf9b58a..57ce8b3b25 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -449,7 +449,7 @@ void RimEnsembleCurveSet::deleteEnsembleCurves() for ( size_t c = 0; c < m_curves.size(); c++ ) { RimSummaryCurve* curve = m_curves[c]; - if ( curve->summaryAddressY().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) curvesIndexesToDelete.push_back( c ); } @@ -471,7 +471,7 @@ void RimEnsembleCurveSet::deleteStatisticsCurves() for ( size_t c = 0; c < m_curves.size(); c++ ) { RimSummaryCurve* curve = m_curves[c]; - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) curvesIndexesToDelete.push_back( c ); } @@ -583,7 +583,7 @@ void RimEnsembleCurveSet::updateAllCurves() RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); RimSummaryAddress* addr = m_yValuesSummaryAddress(); - if ( group && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( group && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { std::vector allCases = group->allSummaryCases(); std::vector filteredCases = filterEnsembleCases( allCases ); @@ -1669,7 +1669,7 @@ void RimEnsembleCurveSet::updateCurveColors() std::vector summaryCases; for ( auto& curve : m_curves ) { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; curvesToColor.push_back( curve ); @@ -1785,7 +1785,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vectoraddress().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( plot && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { if ( isCurvesVisible() ) { @@ -1856,7 +1856,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves( const std::vectoraddress().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + addr->address().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return; // Calculate diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp index cbef91fef0..f744982437 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp @@ -43,8 +43,8 @@ RimObservedSummaryData::RimObservedSummaryData() m_useCustomIdentifier.uiCapability()->setUiHidden( true ); CAF_PDM_InitField( &m_summaryCategory, "SummaryType", - caf::AppEnum( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), + caf::AppEnum( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), "Summary Type" ); m_summaryCategory.uiCapability()->setUiHidden( true ); CAF_PDM_InitFieldNoDefault( &m_identifierName, "IdentifierName", "Identifier Name" ); @@ -72,7 +72,7 @@ QString RimObservedSummaryData::identifierName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RimObservedSummaryData::summaryCategory() const +RifEclipseSummaryAddressDefines::SummaryCategory RimObservedSummaryData::summaryCategory() const { return m_summaryCategory(); } @@ -102,7 +102,7 @@ void RimObservedSummaryData::updateMetaData() //-------------------------------------------------------------------------------------------------- QString RimObservedSummaryData::customWellName() const { - if ( m_useCustomIdentifier() && m_summaryCategory() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( m_useCustomIdentifier() && m_summaryCategory() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return m_identifierName(); } @@ -119,11 +119,11 @@ QList RimObservedSummaryData::calculateValueOptions( con { QList options; - using AddressAppEnum = caf::AppEnum; - options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) ); - options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) ); + using AddressAppEnum = caf::AppEnum; + options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) ); + options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) ); return options; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h index e1d729b84b..17c3be219f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h @@ -39,7 +39,7 @@ class RimObservedSummaryData : public RimSummaryCase QString caseName() const override; QString identifierName() const; - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory() const; + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory() const; void updateMetaData(); @@ -51,7 +51,7 @@ class RimObservedSummaryData : public RimSummaryCase void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; private: - caf::PdmField> m_summaryCategory; + caf::PdmField> m_summaryCategory; caf::PdmField m_identifierName; caf::PdmField m_useCustomIdentifier; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp index 504eed6723..cefc8e4678 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp @@ -29,9 +29,9 @@ namespace caf { template <> -void caf::AppEnum::setUp() +void caf::AppEnum::setUp() { - using RifAdr = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using RifAdr = RifEclipseSummaryAddressDefines::SummaryCategory; addItem( RifAdr::SUMMARY_FIELD, "SUMMARY_FIELD", RiaDefines::summaryField() ); addItem( RifAdr::SUMMARY_AQUIFER, "SUMMARY_AQUIFER", RiaDefines::summaryAquifer() ); @@ -82,7 +82,7 @@ RimSummaryAddress::RimSummaryAddress() CAF_PDM_InitField( &m_caseId, "CaseId", -1, "CaseId" ); CAF_PDM_InitField( &m_ensembleId, "EnsembleId", -1, "EnsembleId" ); - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; m_regionNumber = -1; m_regionNumber2 = -1; m_wellSegmentNumber = -1; @@ -186,14 +186,14 @@ RiaDefines::PhaseType RimSummaryAddress::addressPhaseType() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const +QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) const { // Return the keyword text for supported field replacement in plot templates - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) return m_wellName.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) return m_groupName.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) return m_regionNumber.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) return m_networkName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) return m_wellName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) return m_groupName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) return m_regionNumber.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) return m_networkName.keyword(); return {}; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h index 7e506a13ce..20088ee191 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h @@ -60,7 +60,7 @@ class RimSummaryAddress : public caf::PdmObject RiaDefines::PhaseType addressPhaseType() const; - QString keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const; + QString keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) const; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; @@ -68,7 +68,7 @@ class RimSummaryAddress : public caf::PdmObject QString iconResourceText() const; private: - caf::PdmField> m_category; + caf::PdmField> m_category; caf::PdmField m_vectorName; caf::PdmField m_regionNumber; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp index 1764d2ac6b..94db19360e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp @@ -212,27 +212,27 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddAddress( address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: aquifer->addToSubfolder( QString::number( address.aquiferNumber() ), CollectionContentType::AQUIFER, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: networks->addToSubfolder( QString::fromStdString( address.networkName() ), CollectionContentType::NETWORK, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_MISC: misc->addAddress( address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: regions->addToSubfolder( QString::number( address.regionNumber() ), CollectionContentType::REGION, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: region2region->addToSubfolder( QString::fromStdString( address.itemUiText() ), CollectionContentType::REGION_2_REGION, address, @@ -240,15 +240,15 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolder( QString::fromStdString( address.groupName() ), CollectionContentType::GROUP, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: wells->addToSubfolder( QString::fromStdString( address.wellName() ), CollectionContentType::WELL, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: completion->addToSubfolderTree( { QString::fromStdString( address.wellName() ), QString::fromStdString( address.blockAsString() ) }, CollectionContentType::WELL_COMPLETION, @@ -257,7 +257,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.wellName() ), QString::number( address.wellSegmentNumber() ) }, CollectionContentType::WELL_SEGMENT, address, @@ -265,11 +265,11 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolder( QString::fromStdString( address.blockAsString() ), CollectionContentType::BLOCK, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: lgrwell->addToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.wellName() ) }, CollectionContentType::WELL_LGR, address, @@ -277,7 +277,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.wellName() ), QString::fromStdString( address.blockAsString() ) }, @@ -287,7 +287,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.blockAsString() ) }, CollectionContentType::BLOCK_LGR, address, @@ -295,7 +295,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddAddress( address, caseId, ensembleId ); break; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 0643130dd3..c768351369 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -798,7 +798,7 @@ double RimSummaryCurve::computeCurveZValue() { zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_OBSERVED ); } - else if ( sumAddr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + else if ( sumAddr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_STAT_CURVE ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp index 4626889739..44a5fd975a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp @@ -696,7 +696,7 @@ std::set RimSummaryCurveAppearanceCalculator::getAllSummaryWellName for ( auto& address : allAddresses ) { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { summaryWellNames.insert( address.wellName() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp index 8ba2f79f51..efce53cf2d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp @@ -215,7 +215,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& } } - if ( summaryAddress.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( summaryAddress.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { text = summaryAddress.vectorName(); } @@ -265,7 +265,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& { switch ( summaryAddress.category() ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: { if ( m_aquiferNumber ) { @@ -274,7 +274,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: { if ( m_regionNumber ) { @@ -287,7 +287,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: { if ( m_regionNumber ) { @@ -297,7 +297,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: { if ( m_groupName ) { @@ -310,7 +310,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: { bool skipSubString = nameHelper && nameHelper->isNetworkInTitle(); if ( !skipSubString ) @@ -320,12 +320,12 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: { appendWellName( text, summaryAddress, nameHelper ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: { appendWellName( text, summaryAddress, nameHelper ); @@ -341,13 +341,13 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: { appendLgrName( text, summaryAddress ); appendWellName( text, summaryAddress, nameHelper ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: { appendLgrName( text, summaryAddress ); appendWellName( text, summaryAddress, nameHelper ); @@ -364,7 +364,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: { appendWellName( text, summaryAddress, nameHelper ); @@ -379,7 +379,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: { if ( m_completion ) { @@ -393,7 +393,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: { appendLgrName( text, summaryAddress ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 7e8dc7081b..20b4b6aaec 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2309,28 +2309,28 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar auto newCurveDef = curveDef; auto curveAdr = newCurveDef.summaryAddress(); std::string objectIdentifierString; - if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) && + if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL ) ) { objectIdentifierString = curveAdr.wellName(); curveAdr.setWellName( droppedName ); newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::GROUP ) ) { objectIdentifierString = curveAdr.groupName(); curveAdr.setGroupName( droppedName ); newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::NETWORK ) ) { objectIdentifierString = curveAdr.networkName(); curveAdr.setNetworkName( droppedName ); newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) ) { objectIdentifierString = std::to_string( curveAdr.regionNumber() ); @@ -2340,7 +2340,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar curveAdr.setRegion( droppedRegion ); newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT ) ) { objectIdentifierString = std::to_string( curveAdr.wellSegmentNumber() ); @@ -2802,7 +2802,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na { sumCases.push_back( curve->summaryCaseX() ); - if ( curve->summaryAddressX().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( curve->summaryAddressX().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { addresses.push_back( curve->summaryAddressX() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp index 860d61a151..a3a2b7abfd 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp @@ -255,47 +255,47 @@ QList RimSummaryPlotSourceStepping::calculateValueOption } else { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_INVALID; + SummaryCategory category = SummaryCategory::SUMMARY_INVALID; std::string secondaryIdentifier; if ( fieldNeedingOptions == &m_wellName ) { - category = SummaryVarCategory::SUMMARY_WELL; + category = SummaryCategory::SUMMARY_WELL; } else if ( fieldNeedingOptions == &m_region ) { - category = SummaryVarCategory::SUMMARY_REGION; + category = SummaryCategory::SUMMARY_REGION; } else if ( fieldNeedingOptions == &m_groupName ) { - category = SummaryVarCategory::SUMMARY_GROUP; + category = SummaryCategory::SUMMARY_GROUP; } else if ( fieldNeedingOptions == &m_networkName ) { - category = SummaryVarCategory::SUMMARY_NETWORK; + category = SummaryCategory::SUMMARY_NETWORK; } else if ( fieldNeedingOptions == &m_cellBlock ) { - category = SummaryVarCategory::SUMMARY_BLOCK; + category = SummaryCategory::SUMMARY_BLOCK; } else if ( fieldNeedingOptions == &m_wellSegment ) { secondaryIdentifier = m_wellName().toStdString(); - category = SummaryVarCategory::SUMMARY_WELL_SEGMENT; + category = SummaryCategory::SUMMARY_WELL_SEGMENT; } else if ( fieldNeedingOptions == &m_completion ) { secondaryIdentifier = m_wellName().toStdString(); - category = SummaryVarCategory::SUMMARY_WELL_COMPLETION; + category = SummaryCategory::SUMMARY_WELL_COMPLETION; } else if ( fieldNeedingOptions == &m_aquifer ) { - category = SummaryVarCategory::SUMMARY_AQUIFER; + category = SummaryCategory::SUMMARY_AQUIFER; } std::vector identifierTexts; - if ( category != SummaryVarCategory::SUMMARY_INVALID ) + if ( category != SummaryCategory::SUMMARY_INVALID ) { identifierTexts = analyzer->identifierTexts( category, secondaryIdentifier ); } @@ -445,41 +445,41 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle* if ( changedField != &m_vectorName ) { - SummaryVarCategory summaryCategoryToModify = SummaryVarCategory::SUMMARY_INVALID; + SummaryCategory summaryCategoryToModify = SummaryCategory::SUMMARY_INVALID; if ( changedField == &m_wellName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL; } else if ( changedField == &m_region ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_REGION; + summaryCategoryToModify = SummaryCategory::SUMMARY_REGION; } else if ( changedField == &m_groupName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_GROUP; + summaryCategoryToModify = SummaryCategory::SUMMARY_GROUP; } else if ( changedField == &m_networkName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_NETWORK; + summaryCategoryToModify = SummaryCategory::SUMMARY_NETWORK; } else if ( changedField == &m_cellBlock ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_BLOCK; + summaryCategoryToModify = SummaryCategory::SUMMARY_BLOCK; } else if ( changedField == &m_wellSegment ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL_SEGMENT; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL_SEGMENT; } else if ( changedField == &m_completion ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL_COMPLETION; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL_COMPLETION; } else if ( changedField == &m_aquifer ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_AQUIFER; + summaryCategoryToModify = SummaryCategory::SUMMARY_AQUIFER; } - if ( summaryCategoryToModify != SummaryVarCategory::SUMMARY_INVALID ) + if ( summaryCategoryToModify != SummaryCategory::SUMMARY_INVALID ) { for ( auto curve : curves ) { @@ -745,7 +745,7 @@ std::vector RimSummaryPlotSourceStepping::activeFieldsForD RiaSummaryAddressAnalyzer analyzer; analyzer.appendAddresses( addressesForCurvesInPlot() ); - SummaryVarCategory category = SummaryVarCategory::SUMMARY_INVALID; + SummaryCategory category = SummaryCategory::SUMMARY_INVALID; if ( !analyzer.categories().empty() ) { @@ -766,12 +766,12 @@ std::vector RimSummaryPlotSourceStepping::activeFieldsForD if ( allCategoriesAreDependingOnWellName ) { - category = SummaryVarCategory::SUMMARY_WELL; + category = SummaryCategory::SUMMARY_WELL; } } } - if ( category != SummaryVarCategory::SUMMARY_INVALID ) + if ( category != SummaryCategory::SUMMARY_INVALID ) { if ( analyzer.wellNames().size() == 1 ) { @@ -1020,7 +1020,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu { case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_WELL, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_WELL, "" ); auto searchString = QString::fromStdString( addr.wellName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setWellName( ( *found ).toStdString() ); @@ -1029,7 +1029,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_GROUP, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_GROUP, "" ); auto searchString = QString::fromStdString( addr.groupName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setGroupName( ( *found ).toStdString() ); @@ -1038,7 +1038,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_NETWORK, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_NETWORK, "" ); auto searchString = QString::fromStdString( addr.networkName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setNetworkName( ( *found ).toStdString() ); @@ -1047,7 +1047,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_REGION, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_REGION, "" ); auto searchString = QString::number( addr.regionNumber() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setRegion( ( *found ).toInt() ); @@ -1072,7 +1072,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_BLOCK, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_BLOCK, "" ); auto searchString = QString::fromStdString( addr.blockAsString() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setCellIjk( ( *found ).toStdString() ); @@ -1081,7 +1081,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_AQUIFER, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_AQUIFER, "" ); auto searchString = QString::number( addr.aquiferNumber() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setAquiferNumber( ( *found ).toInt() ); @@ -1190,7 +1190,7 @@ void RimSummaryPlotSourceStepping::setStep( QString stepIdentifier ) //-------------------------------------------------------------------------------------------------- std::map RimSummaryPlotSourceStepping::optionsForQuantity( std::set addresses ) { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_FIELD; + SummaryCategory category = SummaryCategory::SUMMARY_FIELD; auto visibleCurveAddresses = addressesForCurvesInPlot(); if ( !visibleCurveAddresses.empty() ) @@ -1223,7 +1223,7 @@ std::map RimSummaryPlotSourceStepping::optionsForQuantity( std //-------------------------------------------------------------------------------------------------- std::map RimSummaryPlotSourceStepping::optionsForQuantity( RiaSummaryAddressAnalyzer* analyzser ) { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_FIELD; + SummaryCategory category = SummaryCategory::SUMMARY_FIELD; auto visibleCurveAddresses = addressesForCurvesInPlot(); if ( !visibleCurveAddresses.empty() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp index 4bb8e1b751..94b0189e35 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp @@ -74,7 +74,7 @@ RimSummaryTable::RimSummaryTable() m_vector.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); CAF_PDM_InitFieldNoDefault( &m_category, "Categories", "Category" ); m_category.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; CAF_PDM_InitFieldNoDefault( &m_resamplingSelection, "ResamplingSelection", "Date Resampling" ); m_resamplingSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); @@ -128,7 +128,7 @@ void RimSummaryTable::setDefaultCaseAndCategoryAndVectorName() { const auto summaryCases = getToplevelSummaryCases(); m_case = nullptr; - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; m_vector = ""; m_tableName = createTableName(); @@ -151,7 +151,7 @@ void RimSummaryTable::setDefaultCaseAndCategoryAndVectorName() /// //-------------------------------------------------------------------------------------------------- void RimSummaryTable::setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vectorName ) { m_case = summaryCase; @@ -354,15 +354,15 @@ QList RimSummaryTable::calculateValueOptions( const caf: } else if ( fieldNeedingOptions == &m_category ) { - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) ); - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) ); - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) ); } else if ( fieldNeedingOptions == &m_vector && m_case ) { @@ -603,7 +603,7 @@ QString RimSummaryTable::dateFormatString() const /// //-------------------------------------------------------------------------------------------------- std::set RimSummaryTable::getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vector ) const { if ( !summaryReader ) return {}; @@ -623,12 +623,12 @@ std::set RimSummaryTable::getSummaryAddressesFromReade /// //-------------------------------------------------------------------------------------------------- std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const + RifEclipseSummaryAddressDefines::SummaryCategory category ) const { if ( !summaryReader ) return {}; - if ( category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL && - category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP && - category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + if ( category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL && + category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP && + category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return {}; } @@ -649,15 +649,15 @@ std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const Rif //-------------------------------------------------------------------------------------------------- QString RimSummaryTable::getCategoryNameFromAddress( const RifEclipseSummaryAddress& address ) const { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return QString::fromStdString( address.wellName() ); } - else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { return QString::fromStdString( address.groupName() ); } - else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return QString( "Region %1" ).arg( address.regionNumber() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h index e007b33de0..b3590c2e38 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h @@ -60,7 +60,7 @@ class RimSummaryTable : public RimPlotWindow void setDefaultCaseAndCategoryAndVectorName(); void setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vectorName ); void setDescription( const QString& description ); QString description() const override; @@ -99,10 +99,10 @@ class RimSummaryTable : public RimPlotWindow QString dateFormatString() const; std::set getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vector ) const; std::set getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const; + RifEclipseSummaryAddressDefines::SummaryCategory category ) const; QString getCategoryNameFromAddress( const RifEclipseSummaryAddress& address ) const; std::vector getToplevelSummaryCases() const; @@ -115,7 +115,7 @@ class RimSummaryTable : public RimPlotWindow caf::PdmField m_isAutomaticName; caf::PdmPtrField m_case; - caf::PdmField> m_category; + caf::PdmField> m_category; caf::PdmField m_vector; caf::PdmField> m_resamplingSelection; caf::PdmField m_thresholdValue; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp index 14301b6cc3..e229de9fff 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp @@ -130,7 +130,7 @@ RimSummaryTable* RimSummaryTableCollection::createDefaultSummaryTable() //-------------------------------------------------------------------------------------------------- RimSummaryTable* RimSummaryTableCollection::createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vectorName ) { RimSummaryTable* table = new RimSummaryTable(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h index ef108d235e..f83dc33d6e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h @@ -52,7 +52,7 @@ class RimSummaryTableCollection : public caf::PdmObject, public RimPlotCollectio RimSummaryTable* createDefaultSummaryTable(); RimSummaryTable* createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vectorName ); private: diff --git a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp index 3cea9ad2ad..d1f5f055ab 100644 --- a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp +++ b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp @@ -991,7 +991,7 @@ TEST( RifKeywordBasedRsmspecParserTest, TestAddressCreation ) RifEclipseSummaryAddress address = RifEclipseUserDataKeywordTools::makeAndFillAddress( quantityName, headerColumn ); EXPECT_TRUE( address.isValid() ); - EXPECT_EQ( address.category(), RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ); + EXPECT_EQ( address.category(), RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ); EXPECT_EQ( address.uiText(), "LCABC:lgrName:wellName:12,14,16" ); } diff --git a/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp b/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp index 8a7c601673..fd18dac23c 100644 --- a/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp +++ b/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp @@ -168,6 +168,6 @@ TEST( RiaSummaryAddressAnalyzer, QuantitiesPerCategory ) auto categories = analyzer.categories(); EXPECT_EQ( 2u, categories.size() ); - auto vectorNamesForWells = analyzer.vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ); + auto vectorNamesForWells = analyzer.vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); EXPECT_EQ( 3u, vectorNamesForWells.size() ); } diff --git a/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp b/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp index c2a7d79dda..3d493779ae 100644 --- a/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp +++ b/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp @@ -18,7 +18,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Field ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD, addr.category() ); EXPECT_EQ( "FOPT", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -30,7 +30,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Aquifer ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER, addr.category() ); EXPECT_EQ( "AAQR", addr.vectorName() ); EXPECT_EQ( 456, addr.aquiferNumber() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -43,7 +43,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK, addr.category() ); EXPECT_EQ( "NETW", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -55,7 +55,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network_name ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK, addr.category() ); EXPECT_EQ( "NETW", addr.vectorName() ); EXPECT_EQ( "MYNAME", addr.networkName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -68,7 +68,7 @@ TEST( RifEclipseSummaryAddressTest, DISABLED_TestEclipseAddressParsing_Misc ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC, addr.category() ); EXPECT_EQ( "CPU", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -80,7 +80,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Region ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION, addr.category() ); EXPECT_EQ( "RPR", addr.vectorName() ); EXPECT_EQ( 7081, addr.regionNumber() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -93,7 +93,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_RegionToRegion ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION, addr.category() ); EXPECT_EQ( "ROFR", addr.vectorName() ); EXPECT_EQ( 7081, addr.regionNumber() ); EXPECT_EQ( 8001, addr.regionNumber2() ); @@ -107,7 +107,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellGroup ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP, addr.category() ); EXPECT_EQ( "GOPR", addr.vectorName() ); EXPECT_EQ( "WELLS1", addr.groupName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -120,7 +120,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Well ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, addr.category() ); EXPECT_EQ( "WOPR", addr.vectorName() ); EXPECT_EQ( "B-2H", addr.wellName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -133,7 +133,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellCompletion ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION, addr.category() ); EXPECT_EQ( "COFRL", addr.vectorName() ); EXPECT_EQ( "B-1H", addr.wellName() ); EXPECT_EQ( 15, addr.cellI() ); @@ -149,7 +149,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellLgr ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR, addr.category() ); EXPECT_EQ( "LWABC", addr.vectorName() ); EXPECT_EQ( "LGRNA", addr.lgrName() ); EXPECT_EQ( "B-10H", addr.wellName() ); @@ -163,7 +163,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellCompletionLgr RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); EXPECT_EQ( "LCGAS", addr.vectorName() ); EXPECT_EQ( "LGR1", addr.lgrName() ); EXPECT_EQ( "B-1H", addr.wellName() ); @@ -180,7 +180,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellSegment ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT, addr.category() ); EXPECT_EQ( "SOFR", addr.vectorName() ); EXPECT_EQ( "B-5H", addr.wellName() ); EXPECT_EQ( 32, addr.wellSegmentNumber() ); @@ -194,7 +194,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Block ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK, addr.category() ); EXPECT_EQ( "BPR", addr.vectorName() ); EXPECT_EQ( 123, addr.cellI() ); EXPECT_EQ( 122, addr.cellJ() ); @@ -209,7 +209,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_BlockLgr ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR, addr.category() ); EXPECT_EQ( "LBABC", addr.vectorName() ); EXPECT_EQ( "LGRN", addr.lgrName() ); EXPECT_EQ( 45, addr.cellI() ); @@ -225,7 +225,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Imported ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED, addr.category() ); EXPECT_EQ( "FAULT (Imp)", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -237,7 +237,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult1 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER, addr.category() ); EXPECT_EQ( "AAQR", addr.vectorName() ); EXPECT_EQ( 456, addr.aquiferNumber() ); EXPECT_TRUE( addr.isErrorResult() ); @@ -250,7 +250,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult2 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); EXPECT_EQ( "LCGAS", addr.vectorName() ); EXPECT_EQ( "LGR1", addr.lgrName() ); EXPECT_EQ( "B-1H", addr.wellName() ); @@ -267,14 +267,14 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult3 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED, addr.category() ); EXPECT_EQ( "FAULT (Imp)", addr.vectorName() ); EXPECT_TRUE( addr.isErrorResult() ); } TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory cat = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION; + RifEclipseSummaryAddressDefines::SummaryCategory cat = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION; std::map identifiers( { { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_WELL_NAME, "1-BH" }, { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_CELL_IJK, "6, 7, 8" }, @@ -284,7 +284,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) RifEclipseSummaryAddress addr( cat, identifiers ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION, addr.category() ); EXPECT_EQ( "WOPR", addr.vectorName() ); EXPECT_EQ( "1-BH", addr.wellName() ); EXPECT_EQ( 6, addr.cellI() ); @@ -295,7 +295,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) TEST( RifEclipseSummaryAddressTest, TestEclipseAddressRegToRegParsing ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory cat = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + RifEclipseSummaryAddressDefines::SummaryCategory cat = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; std::map identifiers( { { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_REGION_2_REGION, "123 - 456" }, { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_VECTOR_NAME, "ROFR" }, @@ -304,7 +304,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressRegToRegParsing ) RifEclipseSummaryAddress addr( cat, identifiers ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION, addr.category() ); EXPECT_EQ( "ROFR", addr.vectorName() ); EXPECT_EQ( 123, addr.regionNumber() ); EXPECT_EQ( 456, addr.regionNumber2() ); diff --git a/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp b/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp index 5917f81e31..0675d6be73 100644 --- a/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp +++ b/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp @@ -27,7 +27,7 @@ TEST( RifRevealCsvSectionSummaryReaderTest, ExpectedText ) QString errorMessage; RifRevealCsvSectionSummaryReader reader; - bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, &errorMessage ); + bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, &errorMessage ); ASSERT_TRUE( isOk ); EXPECT_TRUE( errorMessage.isEmpty() ); @@ -46,6 +46,6 @@ TEST( RifRevealCsvSectionSummaryReaderTest, EmptyText ) QString fileContents = ""; QString errorMessage; - bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC, &errorMessage ); + bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC, &errorMessage ); ASSERT_FALSE( isOk ); } diff --git a/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp b/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp index 1900c40b08..4519c861f4 100644 --- a/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp +++ b/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp @@ -11,7 +11,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestInit ) { std::string s( "SRSFC" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); EXPECT_TRUE( longName == "Reach brine concentration" ); @@ -27,7 +27,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestInit ) { std::string s( "does not exist" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); @@ -57,7 +57,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestCustomNaming ) { std::string s( "SRSFCABC" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); EXPECT_TRUE( longName == "Reach brine concentration" ); @@ -79,13 +79,13 @@ TEST( RiuSummaryQuantityNameInfoProvider, Test6x ) { std::string s( "GLIT" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ); } { std::string s( "WSBVPROP" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); } } diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp index 61798c0194..4fe3744b10 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp @@ -64,36 +64,36 @@ RiuSummaryQuantityNameInfoProvider* RiuSummaryQuantityNameInfoProvider::instance //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RiuSummaryQuantityNameInfoProvider::identifyCategory( const std::string& vectorName ) +RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvider::identifyCategory( const std::string& vectorName ) { // Try to an exact match on the vector name first in the vector table. bool exactMatch = true; auto exactCategory = categoryFromVectorName( vectorName, exactMatch ); - if ( exactCategory != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) return exactCategory; + if ( exactCategory != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return exactCategory; - if ( vectorName.size() < 3 || vectorName.size() > 8 ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + if ( vectorName.size() < 3 || vectorName.size() > 8 ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; // Try to match the base vector name with more heuristics auto strippedQuantityName = RifEclipseSummaryAddress::baseVectorName( vectorName ); // First, try to lookup vector in vector table auto category = categoryFromVectorName( strippedQuantityName ); - if ( category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) return category; + if ( category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return category; switch ( strippedQuantityName[0] ) { case 'A': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER; case 'B': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK; case 'F': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD; case 'N': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK; case 'S': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT; case 'W': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; default: break; } @@ -101,25 +101,25 @@ RifEclipseSummaryAddressDefines::SummaryVarCategory RiuSummaryQuantityNameInfoPr if ( strippedQuantityName[0] == 'R' ) { if ( ParseHelpers::is_region_to_region( strippedQuantityName ) ) - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION; } // Then check LGR categories std::string firstTwoLetters = strippedQuantityName.substr( 0, 2 ); - if ( firstTwoLetters == "LB" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR; - if ( firstTwoLetters == "LC" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; - if ( firstTwoLetters == "LW" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR; + if ( firstTwoLetters == "LB" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR; + if ( firstTwoLetters == "LC" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; + if ( firstTwoLetters == "LW" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR; - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory +RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, bool exactMatch ) const { auto info = quantityInfo( vectorName, exactMatch ); @@ -185,7 +185,7 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo RiuSummaryQuantityNam std::string RiuSummaryQuantityNameInfoProvider::longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound ) const { auto info = quantityInfo( vectorName ); - return info.category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID || !returnVectorNameIfNotFound ? info.longName + return info.category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID || !returnVectorNameIfNotFound ? info.longName : vectorName; } @@ -212,7 +212,7 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityNameInfoProvider() std::unordered_map RiuSummaryQuantityNameInfoProvider::createInfoForEclipseKeywords() { - using A = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using A = RifEclipseSummaryAddressDefines::SummaryCategory; std::unordered_map info; @@ -2142,7 +2142,7 @@ std::unordered_map RiuSummaryQuantityNameInfoProvider::createInfoFor6xKeywords() { - using A = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using A = RifEclipseSummaryAddressDefines::SummaryCategory; std::unordered_map info; diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h index fd491d8c65..7558f15992 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h @@ -31,7 +31,7 @@ class RiuSummaryQuantityNameInfoProvider public: static RiuSummaryQuantityNameInfoProvider* instance(); - RifEclipseSummaryAddressDefines::SummaryVarCategory identifyCategory( const std::string& vectorName ); + RifEclipseSummaryAddressDefines::SummaryCategory identifyCategory( const std::string& vectorName ); std::string longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound = false ) const; @@ -40,16 +40,16 @@ class RiuSummaryQuantityNameInfoProvider { public: RiuSummaryQuantityInfo() - : category( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + : category( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { } - RiuSummaryQuantityInfo( RifEclipseSummaryAddressDefines::SummaryVarCategory category, const std::string& longName ) + RiuSummaryQuantityInfo( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& longName ) : category( category ) , longName( longName ) { } - RifEclipseSummaryAddressDefines::SummaryVarCategory category; + RifEclipseSummaryAddressDefines::SummaryCategory category; std::string longName; }; @@ -57,7 +57,7 @@ class RiuSummaryQuantityNameInfoProvider RiuSummaryQuantityNameInfoProvider(); RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const; - RifEclipseSummaryAddressDefines::SummaryVarCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const; + RifEclipseSummaryAddressDefines::SummaryCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const; static std::unordered_map createInfoForEclipseKeywords(); static std::unordered_map createInfoFor6xKeywords(); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp index 6f83dc11f8..5115ba6a2e 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp @@ -96,67 +96,67 @@ SummaryIdentifierAndField::~SummaryIdentifierAndField() //-------------------------------------------------------------------------------------------------- RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() : m_identifierFieldsMap( { - { SummaryVarCategory::SUMMARY_FIELD, + { SummaryCategory::SUMMARY_FIELD, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_AQUIFER, + { SummaryCategory::SUMMARY_AQUIFER, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_AQUIFER_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_NETWORK, + { SummaryCategory::SUMMARY_NETWORK, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_NETWORK_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_MISC, + { SummaryCategory::SUMMARY_MISC, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_REGION, + { SummaryCategory::SUMMARY_REGION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_REGION_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_REGION_2_REGION, + { SummaryCategory::SUMMARY_REGION_2_REGION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_REGION_2_REGION ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_GROUP, + { SummaryCategory::SUMMARY_GROUP, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_GROUP_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL, + { SummaryCategory::SUMMARY_WELL, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_COMPLETION, + { SummaryCategory::SUMMARY_WELL_COMPLETION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, + { SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_LGR, + { SummaryCategory::SUMMARY_WELL_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_SEGMENT, + { SummaryCategory::SUMMARY_WELL_SEGMENT, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_SEGMENT_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_BLOCK, + { SummaryCategory::SUMMARY_BLOCK, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_BLOCK_LGR, + { SummaryCategory::SUMMARY_BLOCK_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_IMPORTED, + { SummaryCategory::SUMMARY_IMPORTED, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, @@ -169,114 +169,114 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( &m_currentSummaryCategory, "CurrentSummaryCategory", "Current Summary Category" ); CAF_PDM_InitFieldNoDefault( &m_selectedSummaryCategories, "SelectedSummaryCategories", "Summary Categories" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][1]->pdmField(), "FieldCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][2]->pdmField(), "AquifierCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][0]->pdmField(), "NetworkNames", "Networks" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][1]->pdmField(), "NetworkVectors", "Network Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][0]->pdmField(), "NetworkNames", "Networks" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][1]->pdmField(), "NetworkVectors", "Network Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][2]->pdmField(), "NetworkCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][0]->pdmField(), "MiscVectors", "Misc Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][1]->pdmField(), "MiscCalculationIds", "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][0]->pdmField(), "MiscVectors", "Misc Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][1]->pdmField(), "MiscCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][0]->pdmField(), "Regions", "Regions" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][0]->pdmField(), "Regions", "Regions" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][2]->pdmField(), "RegionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][0]->pdmField(), "Region2RegionRegions", "Regions" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][1]->pdmField(), "Region2RegionVectors", "Region2s Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][2]->pdmField(), "Region2RegionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Groups" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Groups" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(), "WellGroupVectors", "Well Group Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][2]->pdmField(), "WellGroupCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][0]->pdmField(), "WellWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][1]->pdmField(), "WellVectors", "Well Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][2]->pdmField(), "WellCalculationIds", "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][0]->pdmField(), "WellWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][1]->pdmField(), "WellVectors", "Well Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][2]->pdmField(), "WellCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][0]->pdmField(), "WellCompletionWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), "WellCompletionIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(), "WellCompletionVectors", "Well Completion Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][3]->pdmField(), "WellCompletionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField(), "WellCompletionLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField(), "WellCompletionLgrWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField(), "WellCompletionLgrIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(), "WellCompletionLgrVectors", "Well Completion Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][4]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][4]->pdmField(), "WellCompletionLgrCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][0]->pdmField(), "WellLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][1]->pdmField(), "WellLgrWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][2]->pdmField(), "WellLgrVectors", "Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][0]->pdmField(), "WellLgrLgrName", "LGR Names" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][1]->pdmField(), "WellLgrWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][2]->pdmField(), "WellLgrVectors", "Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][3]->pdmField(), "WellLgrCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][0]->pdmField(), "WellSegmentWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][1]->pdmField(), "WellSegmentNumber", "Segments" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(), "WellSegmentVectors", "Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][0]->pdmField(), "WellSegmentWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][1]->pdmField(), "WellSegmentNumber", "Segments" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(), "WellSegmentVectors", "Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][3]->pdmField(), "WellSegmentCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][0]->pdmField(), "BlockIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][1]->pdmField(), "BlockVectors", "Block Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][0]->pdmField(), "BlockIjk", "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][1]->pdmField(), "BlockVectors", "Block Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][2]->pdmField(), "BlockCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][0]->pdmField(), "BlockLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][1]->pdmField(), "BlockLgrIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][2]->pdmField(), "BlockLgrVectors", "Block Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][0]->pdmField(), "BlockLgrLgrName", "LGR Names" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][1]->pdmField(), "BlockLgrIjk", "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][2]->pdmField(), "BlockLgrVectors", "Block Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][3]->pdmField(), "BlockLgrCalculationIds", "CalculationIds" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(), "ImportedVectors", "Imported vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][1]->pdmField(), "ImportedCalculationIds", "Calculation Ids" ); @@ -648,7 +648,7 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector { resetAllFields(); - std::set categories; + std::set categories; for ( const auto& curveDef : curveDefinitions ) { if ( !( curveDef.summaryCase() || curveDef.isEnsembleCurve() ) ) continue; @@ -658,14 +658,14 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector RifEclipseSummaryAddress summaryAddress = curveDef.summaryAddress(); // Ignore ensemble statistics curves - if ( summaryAddress.category() == SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; + if ( summaryAddress.category() == SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; // Select summary category if not already selected auto& selectedCategories = m_selectedSummaryCategories(); if ( std::find( selectedCategories.begin(), selectedCategories.end(), summaryAddress.category() ) == selectedCategories.end() ) { - if ( summaryAddress.category() != SummaryVarCategory::SUMMARY_INVALID ) + if ( summaryAddress.category() != SummaryCategory::SUMMARY_INVALID ) { m_selectedSummaryCategories.v().push_back( summaryAddress.category() ); } @@ -730,7 +730,7 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector if ( !categories.empty() ) { - SummaryVarCategory cat = *( categories.begin() ); + SummaryCategory cat = *( categories.begin() ); m_currentSummaryCategory.setValue( cat ); } @@ -745,8 +745,8 @@ void RiuSummaryVectorSelectionUi::fieldChangedByUi( const caf::PdmFieldHandle* c { if ( changedField != &m_selectedSources && changedField != &m_selectedSummaryCategories && changedField != &m_currentSummaryCategory ) { - SummaryVarCategory currentCategory = m_currentSummaryCategory(); - if ( currentCategory != SummaryVarCategory::SUMMARY_INVALID ) + SummaryCategory currentCategory = m_currentSummaryCategory(); + if ( currentCategory != SummaryCategory::SUMMARY_INVALID ) { // When a summary vector is selected, make sure the summary category for the summary vector is in the // selection Note that we use the size of the variant to avoid this operation when an item in unchecked @@ -846,137 +846,137 @@ void RiuSummaryVectorSelectionUi::defineUiOrdering( QString uiConfigName, caf::P caf::PdmField>* summaryiesField = nullptr; - SummaryVarCategory sumCategory = m_currentSummaryCategory(); - if ( sumCategory == SummaryVarCategory::SUMMARY_INVALID ) + SummaryCategory sumCategory = m_currentSummaryCategory(); + if ( sumCategory == SummaryCategory::SUMMARY_INVALID ) { - sumCategory = SummaryVarCategory::SUMMARY_FIELD; + sumCategory = SummaryCategory::SUMMARY_FIELD; } - if ( sumCategory == SummaryVarCategory::SUMMARY_FIELD ) + if ( sumCategory == SummaryCategory::SUMMARY_FIELD ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][0]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( sumCategory == SummaryCategory::SUMMARY_AQUIFER ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryAquifer() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_NETWORK ) + else if ( sumCategory == SummaryCategory::SUMMARY_NETWORK ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryNetwork() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_MISC ) + else if ( sumCategory == SummaryCategory::SUMMARY_MISC ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][0]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_REGION ) + else if ( sumCategory == SummaryCategory::SUMMARY_REGION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryRegion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( sumCategory == SummaryCategory::SUMMARY_REGION_2_REGION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( "Regions" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_GROUP ) + else if ( sumCategory == SummaryCategory::SUMMARY_GROUP ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWellGroup() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWell() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_COMPLETION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryCompletion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrCompletion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrWell() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_SEGMENT ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWellSegment() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( sumCategory == SummaryCategory::SUMMARY_BLOCK ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryBlock() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_BLOCK_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_BLOCK_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrBlock() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( sumCategory == SummaryCategory::SUMMARY_IMPORTED ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(); } caf::PdmUiGroup* summariesGroup = uiOrdering.addNewGroupWithKeyword( "Summaries", RiuSummaryCurveDefinitionKeywords::summaries() ); @@ -1220,7 +1220,7 @@ std::set RiuSummaryVectorSelectionUi::buildAddressList std::set addressSet; for ( const auto& category : m_selectedSummaryCategories() ) { - if ( m_identifierFieldsMap.at( category ).size() == 0 || category == SummaryVarCategory::SUMMARY_INVALID ) continue; + if ( m_identifierFieldsMap.at( category ).size() == 0 || category == SummaryCategory::SUMMARY_INVALID ) continue; const auto& identifierAndFieldList = m_identifierFieldsMap.at( category ); std::vector> selectionStack; @@ -1233,7 +1233,7 @@ std::set RiuSummaryVectorSelectionUi::buildAddressList /// //-------------------------------------------------------------------------------------------------- void RiuSummaryVectorSelectionUi::buildAddressListForCategoryRecursively( - SummaryVarCategory category, + SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const @@ -1314,7 +1314,7 @@ void RiuSummaryVectorSelectionUi::defineEditorAttribute( const caf::PdmFieldHand void RiuSummaryVectorSelectionUi::resetAllFields() { m_selectedSources.clearWithoutDelete(); - m_selectedSummaryCategories = std::vector>(); + m_selectedSummaryCategories = std::vector>(); // clear all state in fields for ( auto& identifierAndFieldList : m_identifierFieldsMap ) @@ -1370,28 +1370,28 @@ void RiuSummaryVectorSelectionUi::appendOptionItemsForSources( QList& options ) const { - std::vector sortedCategoriesForUi; - - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_FIELD ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_AQUIFER ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_NETWORK ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_MISC ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_REGION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_REGION_2_REGION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_GROUP ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_COMPLETION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_BLOCK ); + std::vector sortedCategoriesForUi; + + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_FIELD ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_AQUIFER ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_NETWORK ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_MISC ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_REGION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_REGION_2_REGION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_GROUP ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_COMPLETION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_BLOCK ); if ( !m_hideCalculationIncompatibleCategories ) { - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_SEGMENT ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_LGR ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_BLOCK_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_SEGMENT ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_BLOCK_LGR ); } - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_IMPORTED ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_IMPORTED ); // NB SUMMARY_ENSEMBLE_STATISTICS is intentionally excluded // categoriesForUiDisplay.push_back(SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h index f6c6932cbf..b960e9b005 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h @@ -95,7 +95,7 @@ class RiuSummaryVectorSelectionUi : public caf::PdmObject const std::vector& identifierAndFieldList ) const; std::set buildAddressListFromSelections() const; - void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const; @@ -113,10 +113,10 @@ class RiuSummaryVectorSelectionUi : public caf::PdmObject private: caf::PdmPtrArrayField m_selectedSources; - caf::PdmField>> m_selectedSummaryCategories; - caf::PdmField> m_currentSummaryCategory; + caf::PdmField>> m_selectedSummaryCategories; + caf::PdmField> m_currentSummaryCategory; - std::map> m_identifierFieldsMap; + std::map> m_identifierFieldsMap; bool m_multiSelectionMode; From 2adb5a22527ca829bc89b03ae7f6986761d5492d Mon Sep 17 00:00:00 2001 From: magnesj Date: Mon, 18 Sep 2023 07:29:37 +0000 Subject: [PATCH 05/28] Fixes by clang-format --- .../Tools/RiaSummaryAddressAnalyzer.cpp | 5 +- .../Tools/RiaSummaryAddressAnalyzer.h | 6 +- .../RicSaveMultiPlotTemplateFeature.cpp | 4 +- .../FileInterface/RifEclEclipseSummary.cpp | 28 ++--- .../RifEclipseSummaryAddress.cpp | 118 +++++++++--------- .../FileInterface/RifReaderObservedData.cpp | 8 +- .../FileInterface/RifReaderObservedData.h | 5 +- .../RifRevealCsvSectionSummaryReader.cpp | 4 +- .../RimDataSourceSteppingTools.cpp | 6 +- .../RimDataSourceSteppingTools.h | 6 +- .../RimPlotAxisPropertiesInterface.h | 2 +- .../RimSummaryCalculation.cpp | 2 +- .../Summary/RimObservedSummaryData.h | 6 +- .../Summary/RimSummaryMultiPlot.cpp | 4 +- .../Summary/RimSummaryPlot.cpp | 6 +- .../Summary/RimSummaryPlotSourceStepping.cpp | 2 +- .../Summary/RimSummaryTable.cpp | 6 +- .../Summary/RimSummaryTable.h | 16 +-- .../Summary/RimSummaryTableCollection.cpp | 7 +- .../Summary/RimSummaryTableCollection.h | 4 +- .../RiuSummaryQuantityNameInfoProvider.cpp | 6 +- .../RiuSummaryQuantityNameInfoProvider.h | 4 +- .../RiuSummaryVectorSelectionUi.cpp | 26 ++-- .../RiuSummaryVectorSelectionUi.h | 2 +- 24 files changed, 133 insertions(+), 150 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index 7b9cdc369c..86f5b2725c 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -314,9 +314,8 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector - RiaSummaryAddressAnalyzer::addressesForCategory( const std::set& addresses, - RifEclipseSummaryAddressDefines::SummaryCategory category ) +std::vector RiaSummaryAddressAnalyzer::addressesForCategory( const std::set& addresses, + RifEclipseSummaryAddressDefines::SummaryCategory category ) { std::vector filteredAddresses; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index 4426545c65..b9d116cd39 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -61,12 +61,12 @@ class RiaSummaryAddressAnalyzer std::set aquifers() const; std::set categories() const; - std::vector> addressesGroupedByObject() const; + std::vector> addressesGroupedByObject() const; std::vector identifierTexts( RifEclipseSummaryAddressDefines::SummaryCategory category, - const std::string& secondaryIdentifier ) const; + const std::string& secondaryIdentifier ) const; - static std::vector addressesForCategory( const std::set& addresses, + static std::vector addressesForCategory( const std::set& addresses, RifEclipseSummaryAddressDefines::SummaryCategory category ); static std::string correspondingHistorySummaryCurveName( const std::string& curveName ); diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp index b2d6d50805..34fb9ffc08 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp @@ -251,8 +251,8 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl // Encode placeholder index. Use negative values below -1 to represent a placeholder index int index = -( i + 2 ); - QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ); - QString sourceString = QString( "<%1>%2" ).arg( fieldKeyword ).arg( regionNumbers[i] ); + QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ); + QString sourceString = QString( "<%1>%2" ).arg( fieldKeyword ).arg( regionNumbers[i] ); QString replacementTextWithIndex = QString( "<%1>%2" ).arg( fieldKeyword ).arg( index ); objectAsText.replace( sourceString, replacementTextWithIndex ); diff --git a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp index 5920063f2b..c6b5729aac 100644 --- a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp @@ -108,20 +108,20 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu } RifEclipseSummaryAddressDefines::SummaryCategory sumCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ); - std::string quantityName; - int regionNumber( -1 ); - int regionNumber2( -1 ); - std::string groupName; - std::string networkName; - std::string wellName; - int wellSegmentNumber( -1 ); - std::string lgrName; - int cellI( -1 ); - int cellJ( -1 ); - int cellK( -1 ); - int aquiferNumber( -1 ); - bool isErrorResult( false ); - int id( -1 ); + std::string quantityName; + int regionNumber( -1 ); + int regionNumber2( -1 ); + std::string groupName; + std::string networkName; + std::string wellName; + int wellSegmentNumber( -1 ); + std::string lgrName; + int cellI( -1 ); + int cellJ( -1 ); + int cellK( -1 ); + int aquiferNumber( -1 ); + bool isErrorResult( false ); + int id( -1 ); quantityName = stringFromPointer( ertSumVarNode.get_keyword() ); diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 40e8d4768a..1921aeefce 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -95,7 +95,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, st //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, +RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, const std::string& vectorName, int regionNumber, int regionNumber2, @@ -227,9 +227,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_FIELD; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_FIELD; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -239,10 +239,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::aquiferAddress( const std::string& vectorName, int aquiferNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_AQUIFER; - addr.m_vectorName = vectorName; - addr.m_number0 = aquiferNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_AQUIFER; + addr.m_vectorName = vectorName; + addr.m_number0 = aquiferNumber; + addr.m_id = calculationId; return addr; } @@ -253,10 +253,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_NETWORK; - addr.m_vectorName = vectorName; - addr.m_name = networkName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_NETWORK; + addr.m_vectorName = vectorName; + addr.m_name = networkName; + addr.m_id = calculationId; return addr; } @@ -266,9 +266,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_MISC; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_MISC; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -278,10 +278,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::strin RifEclipseSummaryAddress RifEclipseSummaryAddress::regionAddress( const std::string& vectorName, int regionNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_REGION; - addr.m_vectorName = vectorName; - addr.m_number0 = regionNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_REGION; + addr.m_vectorName = vectorName; + addr.m_number0 = regionNumber; + addr.m_id = calculationId; return addr; } @@ -292,11 +292,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_REGION_2_REGION; - addr.m_vectorName = vectorName; - addr.m_number0 = regionNumber; - addr.m_number1 = region2Number; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_REGION_2_REGION; + addr.m_vectorName = vectorName; + addr.m_number0 = regionNumber; + addr.m_number1 = region2Number; + addr.m_id = calculationId; return addr; } @@ -306,10 +306,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::string& vectorName, const std::string& groupName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_GROUP; - addr.m_vectorName = vectorName; - addr.m_name = groupName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_GROUP; + addr.m_vectorName = vectorName; + addr.m_name = groupName; + addr.m_id = calculationId; return addr; } @@ -319,10 +319,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::wellAddress( const std::string& vectorName, const std::string& wellName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_WELL; - addr.m_vectorName = vectorName; - addr.m_name = wellName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL; + addr.m_vectorName = vectorName; + addr.m_name = wellName; + addr.m_id = calculationId; return addr; } @@ -333,9 +333,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION; - addr.m_vectorName = vectorName; - addr.m_name = wellName; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION; + addr.m_vectorName = vectorName; + addr.m_name = wellName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -350,11 +350,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellLgrAddress( const std::st int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_WELL_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; - addr.m_name = wellName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; + addr.m_name = wellName; + addr.m_id = calculationId; return addr; } @@ -370,10 +370,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionLgrAddress( con int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; - addr.m_name = wellName; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; + addr.m_name = wellName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -386,11 +386,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_WELL_SEGMENT; - addr.m_vectorName = vectorName; - addr.m_name = wellName; - addr.m_number0 = segmentNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL_SEGMENT; + addr.m_vectorName = vectorName; + addr.m_name = wellName; + addr.m_number0 = segmentNumber; + addr.m_id = calculationId; return addr; } @@ -400,8 +400,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::blockAddress( const std::string& vectorName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_BLOCK; - addr.m_vectorName = vectorName; + addr.m_category = SummaryCategory::SUMMARY_BLOCK; + addr.m_vectorName = vectorName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -414,9 +414,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_BLOCK_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; + addr.m_category = SummaryCategory::SUMMARY_BLOCK_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -428,9 +428,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_IMPORTED; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_IMPORTED; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -440,8 +440,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::s RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress( const std::string& vectorName, const std::string& dataQuantityName ) { RifEclipseSummaryAddress addr; - addr.m_category = SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS; - addr.m_vectorName = vectorName + ":" + dataQuantityName; + addr.m_category = SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS; + addr.m_vectorName = vectorName + ":" + dataQuantityName; return addr; } diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp index 6e49bcb270..3d1d2eccf3 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp @@ -45,8 +45,8 @@ RifReaderObservedData::~RifReaderObservedData() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderObservedData::open( const QString& headerFileName, - const QString& identifierName, +bool RifReaderObservedData::open( const QString& headerFileName, + const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { AsciiDataParseOptions parseOptions; @@ -154,8 +154,8 @@ std::vector RifReaderObservedData::timeSteps( const RifEclipseSummaryAdd //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress RifReaderObservedData::address( const QString& vectorName, - const QString& identifierName, +RifEclipseSummaryAddress RifReaderObservedData::address( const QString& vectorName, + const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { std::string stdVectorName = vectorName.toStdString(); diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.h b/ApplicationLibCode/FileInterface/RifReaderObservedData.h index 677b7be7aa..e91f59c58a 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.h +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.h @@ -52,9 +52,8 @@ class RifReaderObservedData : public RifSummaryReaderInterface RiaDefines::EclipseUnitSystem unitSystem() const override; private: - RifEclipseSummaryAddress address( const QString& vectorName, - const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); + RifEclipseSummaryAddress + address( const QString& vectorName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); private: std::unique_ptr m_asciiParser; diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp index de5609faa3..6c3393d59f 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp @@ -52,9 +52,9 @@ RifRevealCsvSectionSummaryReader::~RifRevealCsvSectionSummaryReader() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifRevealCsvSectionSummaryReader::parse( const QString& text, +bool RifRevealCsvSectionSummaryReader::parse( const QString& text, RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory, - QString* errorText ) + QString* errorText ) { m_allResultAddresses.clear(); m_mapFromAddressToResultIndex.clear(); diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp index a09f6e6f5a..d95122ad4c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp @@ -74,10 +74,10 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue, - const QVariant& newValue, +bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue, + const QVariant& newValue, RifEclipseSummaryAddressDefines::SummaryCategory category, - RifEclipseSummaryAddress* adr ) + RifEclipseSummaryAddress* adr ) { if ( !adr ) return false; diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h index 7a751babe0..79ee1ce209 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h @@ -36,10 +36,10 @@ class RimDataSourceSteppingTools int indexOffset, bool notifyChange = true ); - static bool updateAddressIfMatching( const QVariant& oldValue, - const QVariant& newValue, + static bool updateAddressIfMatching( const QVariant& oldValue, + const QVariant& newValue, RifEclipseSummaryAddressDefines::SummaryCategory category, - RifEclipseSummaryAddress* adr ); + RifEclipseSummaryAddress* adr ); static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr ); diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h index 51c818ee47..e752348826 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h @@ -56,7 +56,7 @@ class RimPlotAxisPropertiesInterface : public caf::PdmObject virtual std::vector annotations() const = 0; virtual void appendAnnotation( RimPlotAxisAnnotation* annotation ) = 0; virtual void removeAllAnnotations() = 0; - virtual RiuPlotAxis plotAxis() const = 0; + virtual RiuPlotAxis plotAxis() const = 0; virtual double visibleRangeMin() const = 0; virtual double visibleRangeMax() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp index 829f8d3be0..2d89a6bf2b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp @@ -494,7 +494,7 @@ std::vector RimSummaryCalculation::allAddressesFor //-------------------------------------------------------------------------------------------------- std::vector RimSummaryCalculation::allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category, - const std::set& allResultAddresses ) const + const std::set& allResultAddresses ) const { std::vector addresses; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h index 17c3be219f..fc6b28603f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h @@ -38,7 +38,7 @@ class RimObservedSummaryData : public RimSummaryCase QString caseName() const override; - QString identifierName() const; + QString identifierName() const; RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory() const; void updateMetaData(); @@ -52,8 +52,8 @@ class RimObservedSummaryData : public RimSummaryCase private: caf::PdmField> m_summaryCategory; - caf::PdmField m_identifierName; - caf::PdmField m_useCustomIdentifier; + caf::PdmField m_identifierName; + caf::PdmField m_useCustomIdentifier; caf::PdmField m_importedSummaryData; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 6168eed3ee..9eb5c2ef5b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -1100,7 +1100,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() else { auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; - axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } @@ -1139,7 +1139,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() else { auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; - axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 20b4b6aaec..aefafe3143 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2980,8 +2980,7 @@ void RimSummaryPlot::setAutoScaleXEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || - ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { ap->setAutoZoom( enabled ); } @@ -2995,8 +2994,7 @@ void RimSummaryPlot::setAutoScaleYEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { ap->setAutoZoom( enabled ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp index a3a2b7abfd..47a20b25f4 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp @@ -256,7 +256,7 @@ QList RimSummaryPlotSourceStepping::calculateValueOption else { SummaryCategory category = SummaryCategory::SUMMARY_INVALID; - std::string secondaryIdentifier; + std::string secondaryIdentifier; if ( fieldNeedingOptions == &m_wellName ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp index 94b0189e35..ab71646ba1 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp @@ -150,9 +150,9 @@ void RimSummaryTable::setDefaultCaseAndCategoryAndVectorName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryTable::setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, +void RimSummaryTable::setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, RifEclipseSummaryAddressDefines::SummaryCategory category, - const QString& vectorName ) + const QString& vectorName ) { m_case = summaryCase; m_category = category; @@ -622,7 +622,7 @@ std::set RimSummaryTable::getSummaryAddressesFromReade //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, +std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, RifEclipseSummaryAddressDefines::SummaryCategory category ) const { if ( !summaryReader ) return {}; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h index b3590c2e38..9b7db25081 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h @@ -59,9 +59,9 @@ class RimSummaryTable : public RimPlotWindow ~RimSummaryTable() override; void setDefaultCaseAndCategoryAndVectorName(); - void setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, + void setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, RifEclipseSummaryAddressDefines::SummaryCategory category, - const QString& vectorName ); + const QString& vectorName ); void setDescription( const QString& description ); QString description() const override; @@ -98,10 +98,10 @@ class RimSummaryTable : public RimPlotWindow std::pair createLegendMinMaxValues( const double maxTableValue ) const; QString dateFormatString() const; - std::set getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, + std::set getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, RifEclipseSummaryAddressDefines::SummaryCategory category, - const QString& vector ) const; - std::set getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, + const QString& vector ) const; + std::set getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, RifEclipseSummaryAddressDefines::SummaryCategory category ) const; QString getCategoryNameFromAddress( const RifEclipseSummaryAddress& address ) const; @@ -116,9 +116,9 @@ class RimSummaryTable : public RimPlotWindow caf::PdmPtrField m_case; caf::PdmField> m_category; - caf::PdmField m_vector; - caf::PdmField> m_resamplingSelection; - caf::PdmField m_thresholdValue; + caf::PdmField m_vector; + caf::PdmField> m_resamplingSelection; + caf::PdmField m_thresholdValue; caf::PdmField> m_excludedRowsUiField; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp index e229de9fff..88b3e16926 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp @@ -128,10 +128,9 @@ RimSummaryTable* RimSummaryTableCollection::createDefaultSummaryTable() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryTable* - RimSummaryTableCollection::createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryCategory category, - const QString& vectorName ) +RimSummaryTable* RimSummaryTableCollection::createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vectorName ) { RimSummaryTable* table = new RimSummaryTable(); table->setFromCaseAndCategoryAndVectorName( summaryCase, category, vectorName ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h index f83dc33d6e..eaaca4f85d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h @@ -51,9 +51,9 @@ class RimSummaryTableCollection : public caf::PdmObject, public RimPlotCollectio void removeTable( RimSummaryTable* table ); RimSummaryTable* createDefaultSummaryTable(); - RimSummaryTable* createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, + RimSummaryTable* createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, RifEclipseSummaryAddressDefines::SummaryCategory category, - const QString& vectorName ); + const QString& vectorName ); private: caf::PdmChildArrayField m_summaryTables; diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp index 4fe3744b10..5badea1ea1 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp @@ -119,8 +119,8 @@ RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvi //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryCategory - RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, bool exactMatch ) const +RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, + bool exactMatch ) const { auto info = quantityInfo( vectorName, exactMatch ); @@ -186,7 +186,7 @@ std::string RiuSummaryQuantityNameInfoProvider::longNameFromVectorName( const st { auto info = quantityInfo( vectorName ); return info.category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID || !returnVectorNameIfNotFound ? info.longName - : vectorName; + : vectorName; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h index 7558f15992..843caaba13 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h @@ -50,13 +50,13 @@ class RiuSummaryQuantityNameInfoProvider } RifEclipseSummaryAddressDefines::SummaryCategory category; - std::string longName; + std::string longName; }; private: RiuSummaryQuantityNameInfoProvider(); - RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const; + RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const; RifEclipseSummaryAddressDefines::SummaryCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const; static std::unordered_map createInfoForEclipseKeywords(); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp index 5115ba6a2e..0365eaefff 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp @@ -170,9 +170,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( &m_selectedSummaryCategories, "SelectedSummaryCategories", "Summary Categories" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][1]->pdmField(), - "FieldCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][1]->pdmField(), "FieldCalculationIds", "Calculation Ids" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors" ); @@ -191,9 +189,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][0]->pdmField(), "Regions", "Regions" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][2]->pdmField(), - "RegionCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][2]->pdmField(), "RegionCalculationIds", "Calculation Ids" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][0]->pdmField(), "Region2RegionRegions", @@ -206,9 +202,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() "Calculation Ids" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Groups" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(), - "WellGroupVectors", - "Well Group Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(), "WellGroupVectors", "Well Group Vectors" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][2]->pdmField(), "WellGroupCalculationIds", "Calculation Ids" ); @@ -220,9 +214,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][0]->pdmField(), "WellCompletionWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), - "WellCompletionIjk", - "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), "WellCompletionIjk", "Cell IJK" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(), "WellCompletionVectors", "Well Completion Vectors" ); @@ -262,9 +254,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][0]->pdmField(), "BlockIjk", "Cell IJK" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][1]->pdmField(), "BlockVectors", "Block Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][2]->pdmField(), - "BlockCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][2]->pdmField(), "BlockCalculationIds", "Calculation Ids" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][0]->pdmField(), "BlockLgrLgrName", "LGR Names" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][1]->pdmField(), "BlockLgrIjk", "Cell IJK" ); @@ -273,9 +263,7 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() "BlockLgrCalculationIds", "CalculationIds" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(), - "ImportedVectors", - "Imported vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(), "ImportedVectors", "Imported vectors" ); CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][1]->pdmField(), "ImportedCalculationIds", "Calculation Ids" ); @@ -1233,7 +1221,7 @@ std::set RiuSummaryVectorSelectionUi::buildAddressList /// //-------------------------------------------------------------------------------------------------- void RiuSummaryVectorSelectionUi::buildAddressListForCategoryRecursively( - SummaryCategory category, + SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h index b960e9b005..744228101e 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h @@ -95,7 +95,7 @@ class RiuSummaryVectorSelectionUi : public caf::PdmObject const std::vector& identifierAndFieldList ) const; std::set buildAddressListFromSelections() const; - void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryCategory category, + void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const; From b89d403934d32a6017fae826ffd49486d2d19002 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 09:55:14 +0200 Subject: [PATCH 06/28] Add data source for x-values Default data source for x-values is RifEclipseSummaryAddress::timeAddress() --- .../Application/RiaSummaryCurveDefinition.cpp | 73 +++++++++++++++++++ .../Application/RiaSummaryCurveDefinition.h | 12 +++ 2 files changed, 85 insertions(+) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp index 4c15df4673..807335c7aa 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp @@ -17,8 +17,10 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiaSummaryCurveDefinition.h" +#include "RiaStdStringTools.h" #include "RifSummaryReaderInterface.h" + #include "RimSummaryCase.h" #include "RimSummaryCaseCollection.h" @@ -29,6 +31,8 @@ //-------------------------------------------------------------------------------------------------- RiaSummaryCurveDefinition::RiaSummaryCurveDefinition() : m_summaryCase( nullptr ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( nullptr ) , m_isEnsembleCurve( false ) { @@ -42,6 +46,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* bool isEnsembleCurve ) : m_summaryCase( summaryCase ) , m_summaryAddress( summaryAddress ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( nullptr ) , m_isEnsembleCurve( isEnsembleCurve ) { @@ -53,6 +59,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ) : m_summaryCase( nullptr ) , m_summaryAddress( summaryAddress ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( ensemble ) , m_isEnsembleCurve( true ) { @@ -98,6 +106,71 @@ void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddres m_summaryAddress = address; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setSummaryCaseX( RimSummaryCase* summaryCase ) +{ + m_summaryCaseX = summaryCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress ) +{ + m_summaryAddressX = summaryAddress; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSummaryCase* RiaSummaryCurveDefinition::summaryCaseX() const +{ + return m_summaryCaseX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveDefinition::summaryAddressX() const +{ + return m_summaryAddressX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, const std::string& name ) +{ + if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) ) + { + m_summaryAddress.setWellName( name ); + m_summaryAddressX.setWellName( name ); + } + + int id = RiaStdStringTools::toInt( name ); + + switch ( category ) + { + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: + m_summaryAddress.setAquiferNumber( id ); + m_summaryAddressX.setAquiferNumber( id ); + break; + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: + m_summaryAddress.setRegion( id ); + m_summaryAddressX.setRegion( id ); + break; + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: + m_summaryAddress.setGroupName( name ); + m_summaryAddressX.setGroupName( name ); + break; + default: + break; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h index 598b54803f..ccdfb82a12 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h @@ -19,6 +19,7 @@ #pragma once #include "RifEclipseSummaryAddress.h" +#include "RifEclipseSummaryAddressDefines.h" #include @@ -40,12 +41,21 @@ class RiaSummaryCurveDefinition explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve ); explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ); + // Y Axis RimSummaryCase* summaryCase() const; const RifEclipseSummaryAddress& summaryAddress() const; RimSummaryCaseCollection* ensemble() const; bool isEnsembleCurve() const; void setSummaryAddress( const RifEclipseSummaryAddress& address ); + // X Axis + void setSummaryCaseX( RimSummaryCase* summaryCase ); + void setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress ); + RimSummaryCase* summaryCaseX() const; + RifEclipseSummaryAddress summaryAddressX() const; + + void setIdentifierText( SummaryCategory category, const std::string& name ); + bool operator<( const RiaSummaryCurveDefinition& other ) const; // TODO: Consider moving to a separate tools class @@ -59,6 +69,8 @@ class RiaSummaryCurveDefinition private: RimSummaryCase* m_summaryCase; RifEclipseSummaryAddress m_summaryAddress; + RimSummaryCase* m_summaryCaseX; + RifEclipseSummaryAddress m_summaryAddressX; RimSummaryCaseCollection* m_ensemble; bool m_isEnsembleCurve; }; From 381ff37dfb1e9dc1334bcdc8e9c83831199e525c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 12:54:32 +0200 Subject: [PATCH 07/28] Support cross plot curves in plot templates --- .../RicSaveMultiPlotTemplateFeature.cpp | 22 +++++++++ .../RicSummaryPlotTemplateTools.cpp | 47 +++++++++++++++++-- .../RicSummaryPlotTemplateTools.h | 2 + 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp index 34fb9ffc08..80f0264f9f 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp @@ -182,6 +182,28 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl replaceStrings( sourceStrings, summaryFieldKeyword, RicSummaryPlotTemplateTools::placeholderTextForSummaryCase(), objectAsText ); } + { + std::set sourceStrings; + + const QString summaryFieldKeyword = RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword(); + for ( const auto& curve : summaryPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) ) + { + if ( curve->axisTypeX() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) continue; + + auto fieldHandle = curve->findField( summaryFieldKeyword ); + if ( fieldHandle ) + { + auto reference = caf::PdmReferenceHelper::referenceFromFieldToObject( fieldHandle, curve->summaryCaseX() ); + + sourceStrings.insert( reference ); + } + + addresses.push_back( curve->summaryAddressX() ); + } + + replaceStrings( sourceStrings, summaryFieldKeyword, RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX(), objectAsText ); + } + { std::set ensembleReferenceStrings; diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp index a712c185bc..d1e042442a 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp @@ -250,13 +250,13 @@ void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot* auto summaryCurves = summaryPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ); for ( const auto& curve : summaryCurves ) { - auto fieldHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() ); - if ( fieldHandle ) + auto summaryCaseHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() ); + if ( summaryCaseHandle ) { bool conversionOk = false; const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCase(); - auto referenceString = fieldHandle->xmlCapability()->referenceString(); + auto referenceString = summaryCaseHandle->xmlCapability()->referenceString(); int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk ); if ( conversionOk && indexValue >= 0 && indexValue < static_cast( selectedSummaryCases.size() ) ) @@ -266,12 +266,37 @@ void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot* } } + auto summaryCaseXHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword() ); + if ( summaryCaseXHandle ) + { + bool conversionOk = false; + const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX(); + + auto referenceString = summaryCaseXHandle->xmlCapability()->referenceString(); + int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk ); + + if ( conversionOk && indexValue >= 0 && indexValue < static_cast( selectedSummaryCases.size() ) ) + { + auto summaryCase = selectedSummaryCases[static_cast( indexValue )]; + curve->setSummaryCaseX( summaryCase ); + } + } + // Replace placeholders with object names from selection auto curveAdr = curve->summaryAddressY(); setPlaceholderWellName( &curveAdr, wellNames ); setPlaceholderGroupName( &curveAdr, groupNames ); setPlaceholderRegion( &curveAdr, regions ); curve->setSummaryAddressY( curveAdr ); + + if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + auto curveAdr = curve->summaryAddressX(); + setPlaceholderWellName( &curveAdr, wellNames ); + setPlaceholderGroupName( &curveAdr, groupNames ); + setPlaceholderRegion( &curveAdr, regions ); + curve->setSummaryAddressX( curveAdr ); + } } for ( const auto& curveSet : summaryPlot->curveSets() ) @@ -493,6 +518,14 @@ QString RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() return "SummaryCase"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword() +{ + return "SummaryCaseX"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -509,6 +542,14 @@ QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCase() return "__CASE_NAME__"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX() +{ + return "__CASE_NAME_X__"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h index 57df90477b..1476d3859d 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h @@ -51,9 +51,11 @@ class RicSummaryPlotTemplateTools static std::vector selectDefaultPlotTemplates( std::vector currentSelection ); static QString summaryCaseFieldKeyword(); + static QString summaryCaseXFieldKeyword(); static QString summaryGroupFieldKeyword(); static QString placeholderTextForSummaryCase(); + static QString placeholderTextForSummaryCaseX(); static QString placeholderTextForSummaryGroup(); static QString placeholderTextForWell(); static QString placeholderTextForGroup(); From df6ef5f809ec394856bee8eb5972fe4a2e4a62ca Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 17 Sep 2023 15:14:17 +0200 Subject: [PATCH 08/28] Working version of summary cross plot curves - add RiaDefines::HorizontalAxisType - remove boolean defining a summary cross plot - allow multiple horizontal axes - evaluate axis visibility on connection to both x and y axis - improve default cross plot curve --- .../Application/RiaSummaryDefines.cpp | 12 + .../Application/RiaSummaryDefines.h | 6 + .../RicNewSummaryCrossPlotCurveFeature.cpp | 26 +- .../RicNewSummaryCrossPlotCurveFeature.h | 4 +- .../RimGridTimeHistoryCurve.cpp | 2 +- .../RimPlotAxisProperties.cpp | 25 +- .../ProjectDataModel/RimPlotCurve.cpp | 18 +- .../ProjectDataModel/RimPlotCurve.h | 4 +- .../Summary/RimAsciiDataCurve.cpp | 2 +- .../Summary/RimSummaryCrossPlot.cpp | 10 +- .../Summary/RimSummaryCrossPlot.h | 2 +- .../Summary/RimSummaryCurve.cpp | 166 +++++++-- .../Summary/RimSummaryCurve.h | 39 ++- .../Summary/RimSummaryCurveCollection.cpp | 15 + .../Summary/RimSummaryCurveCollection.h | 6 +- .../Summary/RimSummaryMultiPlot.cpp | 11 +- .../Summary/RimSummaryPlot.cpp | 318 ++++++++++++------ .../ProjectDataModel/Summary/RimSummaryPlot.h | 15 +- .../Summary/RimSummaryPlotAxisFormatter.cpp | 10 +- .../UserInterface/RiuQwtPlotWidget.cpp | 9 +- 20 files changed, 470 insertions(+), 230 deletions(-) diff --git a/ApplicationLibCode/Application/RiaSummaryDefines.cpp b/ApplicationLibCode/Application/RiaSummaryDefines.cpp index 7efa9c8293..ca10038193 100644 --- a/ApplicationLibCode/Application/RiaSummaryDefines.cpp +++ b/ApplicationLibCode/Application/RiaSummaryDefines.cpp @@ -17,6 +17,18 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiaSummaryDefines.h" +#include "cafAppEnum.h" + +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RiaDefines::HorizontalAxisType::TIME, "TIME", "Time" ); + addItem( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR, "SUMMARY_VECTOR", "Summary Vector" ); + setDefault( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); +} +} // namespace caf //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationLibCode/Application/RiaSummaryDefines.h b/ApplicationLibCode/Application/RiaSummaryDefines.h index 1559fee019..3429c423a3 100644 --- a/ApplicationLibCode/Application/RiaSummaryDefines.h +++ b/ApplicationLibCode/Application/RiaSummaryDefines.h @@ -29,6 +29,12 @@ enum class FileType STIMPLAN_SUMMARY }; +enum class HorizontalAxisType +{ + TIME, + SUMMARY_VECTOR +}; + QString summaryField(); QString summaryAquifer(); QString summaryNetwork(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp index 4f27eee0c3..dd16106175 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp @@ -45,7 +45,7 @@ CAF_CMD_SOURCE_INIT( RicNewSummaryCrossPlotCurveFeature, "RicNewSummaryCrossPlot //-------------------------------------------------------------------------------------------------- bool RicNewSummaryCrossPlotCurveFeature::isCommandEnabled() const { - return ( selectedCrossPlot() ); + return ( selectedSummaryPlot() ); } //-------------------------------------------------------------------------------------------------- @@ -55,24 +55,29 @@ void RicNewSummaryCrossPlotCurveFeature::onActionTriggered( bool isChecked ) { RimProject* project = RimProject::current(); - RimSummaryCrossPlot* plot = selectedCrossPlot(); + auto plot = selectedSummaryPlot(); if ( plot ) { RimSummaryCurve* newCurve = new RimSummaryCurve(); cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable( plot->curveCount() ); newCurve->setColor( curveColor ); - plot->addCurveAndUpdate( newCurve ); - RimSummaryCase* defaultCase = nullptr; if ( project->activeOilField()->summaryCaseMainCollection()->summaryCaseCount() > 0 ) { defaultCase = project->activeOilField()->summaryCaseMainCollection()->summaryCase( 0 ); newCurve->setSummaryCaseY( defaultCase ); + newCurve->setSummaryAddressY( RifEclipseSummaryAddress::fieldAddress( "FOPT" ) ); - newCurve->loadDataAndUpdate( true ); + newCurve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + newCurve->setSummaryCaseX( defaultCase ); + newCurve->setSummaryAddressX( RifEclipseSummaryAddress::fieldAddress( "FGOR" ) ); } + plot->addCurveAndUpdate( newCurve ); + + newCurve->loadDataAndUpdate( true ); + plot->updateConnectedEditors(); RiuPlotMainWindowTools::onObjectAppended( newCurve ); @@ -91,15 +96,8 @@ void RicNewSummaryCrossPlotCurveFeature::setupActionLook( QAction* actionToSetup //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryCrossPlot* RicNewSummaryCrossPlotCurveFeature::selectedCrossPlot() const +RimSummaryPlot* RicNewSummaryCrossPlotCurveFeature::selectedSummaryPlot() const { - RimSummaryCrossPlot* crossPlot = nullptr; - caf::PdmObject* selObj = dynamic_cast( caf::SelectionManager::instance()->selectedItem() ); - if ( selObj ) - { - crossPlot = RiaSummaryTools::parentCrossPlot( selObj ); - } - - return crossPlot; + return RiaSummaryTools::parentSummaryPlot( selObj ); } diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h index c789c6286b..248b610c41 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h @@ -22,7 +22,7 @@ #include -class RimSummaryCrossPlot; +class RimSummaryPlot; //================================================================================================== /// @@ -37,5 +37,5 @@ class RicNewSummaryCrossPlotCurveFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; private: - RimSummaryCrossPlot* selectedCrossPlot() const; + RimSummaryPlot* selectedSummaryPlot() const; }; diff --git a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index 92aa241fc4..4d1435b8e5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -697,7 +697,7 @@ QString RimGridTimeHistoryCurve::geometrySelectionText() const //-------------------------------------------------------------------------------------------------- void RimGridTimeHistoryCurve::updateQwtPlotAxis() { - if ( m_plotCurve ) updateAxisInPlot( yAxis() ); + if ( m_plotCurve ) updateYAxisInPlot( yAxis() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp index 6aeb196346..3d4af51931 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -147,11 +147,14 @@ void RimPlotAxisProperties::setNameForUnusedAxis() { QString name = "Unused "; - if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) - name += "Left"; - else if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) - name += "Right"; - + /* + if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) + name += "Left"; + else if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + name += "Right"; + */ + + name += m_plotAxis().text(); m_objectName = name; } @@ -184,18 +187,6 @@ QList RimPlotAxisProperties::calculateValueOptions( cons { options = caf::FontTools::relativeSizeValueOptions( RiaPreferences::current()->defaultPlotFontSize() ); } - else if ( fieldNeedingOptions == &m_plotAxis ) - { - std::vector plotAxes = { RiaDefines::PlotAxis::PLOT_AXIS_LEFT, RiaDefines::PlotAxis::PLOT_AXIS_RIGHT }; - - for ( auto plotAxis : plotAxes ) - { - auto plotAxisEnum = caf::AppEnum( plotAxis ); - - QString uiText = plotAxisEnum.uiText(); - options.push_back( caf::PdmOptionItemInfo( uiText, plotAxisEnum.value() ) ); - } - } return options; } diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index 74d25a588a..c2123a22ea 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -575,14 +575,6 @@ void RimPlotCurve::checkAndApplyDefaultFillColor() // } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimPlotCurve::isCrossPlotCurve() const -{ - return firstAncestorOrThisOfType() != nullptr; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -875,11 +867,19 @@ void RimPlotCurve::setSamplesFromXYErrorValues( const std::vector& xVa //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPlotCurve::updateAxisInPlot( RiuPlotAxis plotAxis ) +void RimPlotCurve::updateYAxisInPlot( RiuPlotAxis plotAxis ) { if ( m_plotCurve ) m_plotCurve->setYAxis( plotAxis ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotCurve::updateXAxisInPlot( RiuPlotAxis plotAxis ) +{ + if ( m_plotCurve ) m_plotCurve->setXAxis( plotAxis ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h index 1e43dc311c..1b2ecf1a40 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h @@ -115,7 +115,6 @@ class RimPlotCurve : public caf::PdmObject void setErrorBarsVisible( bool isVisible ); virtual void updateCurveAppearance(); - bool isCrossPlotCurve() const; virtual void updateUiIconFromPlotSymbol(); virtual bool hasParentPlot() const; @@ -186,7 +185,8 @@ class RimPlotCurve : public caf::PdmObject virtual void clearErrorBars(); void checkAndApplyDefaultFillColor(); - virtual void updateAxisInPlot( RiuPlotAxis plotAxis ); + void updateYAxisInPlot( RiuPlotAxis plotAxis ); + void updateXAxisInPlot( RiuPlotAxis plotAxis ); void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp index 650c74236a..80b811fdc7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp @@ -197,7 +197,7 @@ void RimAsciiDataCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi //-------------------------------------------------------------------------------------------------- void RimAsciiDataCurve::updateQwtPlotAxis() { - if ( m_plotCurve ) updateAxisInPlot( yAxis() ); + if ( m_plotCurve ) updateYAxisInPlot( yAxis() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp index 6abeb75401..7e83ee25cf 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp @@ -27,7 +27,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryCrossPlot, "SummaryCrossPlot" ); /// //-------------------------------------------------------------------------------------------------- RimSummaryCrossPlot::RimSummaryCrossPlot() - : RimSummaryPlot( true ) + : RimSummaryPlot() { CAF_PDM_InitObject( "Summary Cross Plot", ":/SummaryXPlotLight16x16.png" ); } @@ -35,7 +35,7 @@ RimSummaryCrossPlot::RimSummaryCrossPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryPlotSourceStepping* RimSummaryCrossPlot::sourceSteppingObjectForKeyEventHandling() const -{ - return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); -} +// RimSummaryPlotSourceStepping* RimSummaryCrossPlot::sourceSteppingObjectForKeyEventHandling() const +// { +// return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); +// } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h index 480aaf0f39..02bddf6a15 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h @@ -31,5 +31,5 @@ class RimSummaryCrossPlot : public RimSummaryPlot public: RimSummaryCrossPlot(); - RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const override; + // RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const override; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index c768351369..d3d2ba73e3 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -52,11 +52,14 @@ #include "RiuQwtPlotCurve.h" #include "RiuSummaryVectorSelectionDialog.h" +#include "cafAssert.h" #include "cafPdmUiComboBoxEditor.h" #include "cafPdmUiLineEditor.h" #include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiTreeOrdering.h" +#pragma optimize( "", off ) + CAF_PDM_SOURCE_INIT( RimSummaryCurve, "SummaryCurve" ); //-------------------------------------------------------------------------------------------------- @@ -86,9 +89,15 @@ RimSummaryCurve::RimSummaryCurve() m_yValuesSummaryAddress = new RimSummaryAddress; - CAF_PDM_InitFieldNoDefault( &m_resampling, "Resampling", "Resampling" ); + CAF_PDM_InitFieldNoDefault( &m_yValuesResampling, "Resampling", "Resampling" ); // X Values + + CAF_PDM_InitField( &m_axisType, + "HorizontalAxisType", + caf::AppEnum( RiaDefines::HorizontalAxisType::TIME ), + "Axis Type" ); + CAF_PDM_InitFieldNoDefault( &m_xValuesSummaryCase, "SummaryCaseX", "Case" ); m_xValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden( true ); m_xValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue( false ); @@ -116,7 +125,8 @@ RimSummaryCurve::RimSummaryCurve() CAF_PDM_InitFieldNoDefault( &m_plotAxis_OBSOLETE, "PlotAxis", "Axis" ); m_plotAxis_OBSOLETE.xmlCapability()->setIOWritable( false ); - CAF_PDM_InitFieldNoDefault( &m_plotAxisProperties, "Axis", "Axis" ); + CAF_PDM_InitFieldNoDefault( &m_yPlotAxisProperties, "Axis", "Axis" ); + CAF_PDM_InitFieldNoDefault( &m_xPlotAxisProperties, "XAxis", "Axis" ); CAF_PDM_InitFieldNoDefault( &m_curveNameConfig, "SummaryCurveNameConfig", "SummaryCurveNameConfig" ); m_curveNameConfig.uiCapability()->setUiTreeHidden( true ); @@ -192,6 +202,28 @@ void RimSummaryCurve::setSummaryAddressX( const RifEclipseSummaryAddress& addres // TODO: Should interpolation be computed similar to RimSummaryCurve::setSummaryAddressY } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCurve::setTopOrBottomAxisX( RiuPlotAxis plotAxis ) +{ + CAF_ASSERT( plotAxis.isHorizontal() ); + + RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); + m_xPlotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuPlotAxis RimSummaryCurve::axisX() const +{ + if ( m_xPlotAxisProperties ) + return m_xPlotAxisProperties->plotAxis(); + else + return RiuPlotAxis::defaultBottom(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -395,6 +427,22 @@ void RimSummaryCurve::setOverrideCurveDataY( const std::vector& dateTime setSamplesFromTimeTAndYValues( dateTimes, yValues, true ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCurve::setAxisTypeX( RiaDefines::HorizontalAxisType axisType ) +{ + m_axisType = axisType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaDefines::HorizontalAxisType RimSummaryCurve::axisTypeX() const +{ + return m_axisType(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -429,10 +477,12 @@ RimSummaryCase* RimSummaryCurve::summaryCaseX() const //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) { + CAF_ASSERT( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ); + m_plotAxis_OBSOLETE = plotAxis.axis(); - RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); - m_plotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); + RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); + m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); } //-------------------------------------------------------------------------------------------------- @@ -440,8 +490,8 @@ void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- RiuPlotAxis RimSummaryCurve::axisY() const { - if ( m_plotAxisProperties ) - return m_plotAxisProperties->plotAxis(); + if ( m_yPlotAxisProperties ) + return m_yPlotAxisProperties->plotAxis(); else return RiuPlotAxis::defaultLeft(); } @@ -499,18 +549,28 @@ QList RimSummaryCurve::calculateValueOptions( const caf: { appendOptionItemsForSummaryAddresses( &options, m_xValuesSummaryCase() ); } - else if ( fieldNeedingOptions == &m_plotAxisProperties ) + else if ( fieldNeedingOptions == &m_yPlotAxisProperties ) { auto plot = firstAncestorOrThisOfTypeAsserted(); for ( auto axis : plot->plotAxes() ) { + // TODO: Should we allow time axis to be used as Y axis? if ( dynamic_cast( axis ) ) { options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) ); } } } + else if ( fieldNeedingOptions == &m_xPlotAxisProperties ) + { + auto plot = firstAncestorOrThisOfTypeAsserted(); + + for ( auto axis : plot->plotAxes() ) + { + options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) ); + } + } return options; } @@ -546,7 +606,6 @@ QString RimSummaryCurve::createCurveAutoName() curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), nullptr, nullptr ); } - if ( isCrossPlotCurve() ) { QString curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), currentPlotNameHelper, &multiNameHelper ); if ( curveNameX.isEmpty() ) @@ -554,7 +613,7 @@ QString RimSummaryCurve::createCurveAutoName() curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), nullptr, nullptr ); } - if ( !curveName.isEmpty() || !curveNameX.isEmpty() ) + if ( !curveName.isEmpty() && !curveNameX.isEmpty() ) { curveName += " | " + curveNameX; } @@ -634,7 +693,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) else { std::vector curveTimeStepsY = timeStepsY(); - if ( curveTimeStepsY.size() > 0 && curveTimeStepsY.size() == curveValuesY.size() ) + if ( plot->timeAxisProperties() && curveTimeStepsY.size() > 0 && curveTimeStepsY.size() == curveValuesY.size() ) { if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE ) { @@ -660,13 +719,13 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) } else { - if ( m_resampling() != RiaDefines::DateTimePeriod::NONE ) + if ( m_yValuesResampling() != RiaDefines::DateTimePeriod::NONE ) { auto [resampledTimeSteps, resampledValues] = RiaSummaryTools::resampledValuesForPeriod( m_yValuesSummaryAddress->address(), curveTimeStepsY, curveValuesY, - m_resampling() ); + m_yValuesResampling() ); if ( !resampledValues.empty() && !resampledTimeSteps.empty() ) { @@ -728,7 +787,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) updateTimeAnnotations(); } - if ( updateParentPlot ) updateAxisInPlot( axisY() ); + if ( updateParentPlot ) updatePlotAxis(); } //-------------------------------------------------------------------------------------------------- @@ -770,10 +829,10 @@ void RimSummaryCurve::initAfterRead() { RimStackablePlotCurve::initAfterRead(); - if ( m_plotAxisProperties.value() == nullptr ) + if ( m_yPlotAxisProperties.value() == nullptr ) { auto plot = firstAncestorOrThisOfType(); - if ( plot ) m_plotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) ); + if ( plot ) m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) ); } if ( m_isEnsembleCurve().isPartiallyTrue() ) @@ -842,28 +901,32 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { RimPlotCurve::updateFieldUiState(); + bool isSummaryXHidden = ( m_axisType() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + + m_xValuesSummaryCase.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xValuesSummaryAddress.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xValuesSummaryAddressUiField.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xPushButtonSelectSummaryAddress.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xPlotAxisProperties.uiCapability()->setUiHidden( isSummaryXHidden ); + { - QString curveDataGroupName = "Summary Vector"; - if ( isCrossPlotCurve() ) curveDataGroupName += " Y"; - caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "Summary Vector Y" ); + QString curveDataGroupName = "Summary Vector"; + caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "curveDataGroupName" ); curveDataGroup->add( &m_yValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_yValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } ); - curveDataGroup->add( &m_resampling, { true, 3, 1 } ); - curveDataGroup->add( &m_plotAxisProperties, { true, 3, 1 } ); - - if ( isCrossPlotCurve() ) - m_showErrorBars = false; - else - curveDataGroup->add( &m_showErrorBars ); + curveDataGroup->add( &m_yValuesResampling, { true, 3, 1 } ); + curveDataGroup->add( &m_yPlotAxisProperties, { true, 3, 1 } ); + curveDataGroup->add( &m_showErrorBars ); } - if ( isCrossPlotCurve() ) { - caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X" ); + caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X Axis" ); + curveDataGroup->add( &m_axisType, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } ); + curveDataGroup->add( &m_xPlotAxisProperties, { true, 3, 1 } ); } caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" ); @@ -882,7 +945,7 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering m_curveNameConfig->uiOrdering( uiConfigName, *nameGroup ); } - uiOrdering.skipRemainingFields(); // For now. + uiOrdering.skipRemainingFields(); } //-------------------------------------------------------------------------------------------------- @@ -912,12 +975,23 @@ void RimSummaryCurve::appendOptionItemsForSummaryAddresses( QList( xPlotAxisProperties ) ) return false; + + return true; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setResampling( RiaDefines::DateTimePeriodEnum resampling ) { - m_resampling = resampling; + m_yValuesResampling = resampling; } //-------------------------------------------------------------------------------------------------- @@ -943,7 +1017,8 @@ RiaDefines::PhaseType RimSummaryCurve::phaseType() const //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::updatePlotAxis() { - updateAxisInPlot( axisY() ); + updateYAxisInPlot( axisY() ); + updateXAxisInPlot( axisX() ); } //-------------------------------------------------------------------------------------------------- @@ -1067,10 +1142,28 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, loadAndUpdate = true; } - else if ( changedField == &m_resampling ) + else if ( changedField == &m_yValuesResampling ) { loadAndUpdate = true; } + else if ( &m_axisType == changedField ) + { + if ( m_axisType() == RiaDefines::HorizontalAxisType::TIME ) + { + m_xPlotAxisProperties = plot->timeAxisProperties(); + } + else if ( m_axisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + if ( !m_xValuesSummaryCase() ) + { + m_xValuesSummaryCase = m_yValuesSummaryCase(); + m_xValuesSummaryAddress->setAddress( m_yValuesSummaryAddress()->address() ); + } + + plot->findOrAssignPlotAxisX( this ); + } + loadAndUpdate = true; + } else if ( &m_showCurve == changedField ) { plot->updateAxes(); @@ -1079,9 +1172,16 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow(); mainPlotWindow->updateMultiPlotToolBar(); } - else if ( changedField == &m_plotAxisProperties ) + else if ( changedField == &m_yPlotAxisProperties ) + { + updateYAxisInPlot( axisY() ); + plot->updateAxes(); + dataChanged.send(); + } + else if ( changedField == &m_xPlotAxisProperties ) { - updateAxisInPlot( axisY() ); + // TODO: Must find a concept to handle x axis properties + updateXAxisInPlot( axisX() ); plot->updateAxes(); dataChanged.send(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index aa307204ca..c1a35a9a24 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -26,6 +26,7 @@ #include "RiaDateTimeDefines.h" #include "RiaDefines.h" +#include "RiaSummaryDefines.h" #include "RifEclipseSummaryAddressQMetaType.h" #include "RimStackablePlotCurve.h" @@ -74,14 +75,18 @@ class RimSummaryCurve : public RimStackablePlotCurve void setOverrideCurveDataY( const std::vector& xValues, const std::vector& yValues ); // X Axis functions - RiaSummaryCurveDefinition curveDefinitionX() const; - RimSummaryCase* summaryCaseX() const; - RifEclipseSummaryAddress summaryAddressX() const; - std::string unitNameX() const; - virtual std::vector valuesX() const; - - void setSummaryCaseX( RimSummaryCase* sumCase ); - void setSummaryAddressX( const RifEclipseSummaryAddress& address ); + void setAxisTypeX( RiaDefines::HorizontalAxisType axisType ); + RiaDefines::HorizontalAxisType axisTypeX() const; + RiaSummaryCurveDefinition curveDefinitionX() const; + RimSummaryCase* summaryCaseX() const; + RifEclipseSummaryAddress summaryAddressX() const; + std::string unitNameX() const; + virtual std::vector valuesX() const; + + void setSummaryCaseX( RimSummaryCase* sumCase ); + void setSummaryAddressX( const RifEclipseSummaryAddress& address ); + void setTopOrBottomAxisX( RiuPlotAxis plotAxis ); + RiuPlotAxis axisX() const; // Other bool isEnsembleCurve() const; @@ -131,6 +136,8 @@ class RimSummaryCurve : public RimStackablePlotCurve static void appendOptionItemsForSummaryAddresses( QList* options, RimSummaryCase* summaryCase ); + bool isCrossPlotCurve() const; + private: // Y values caf::PdmPtrField m_yValuesSummaryCase; @@ -138,18 +145,22 @@ class RimSummaryCurve : public RimStackablePlotCurve caf::PdmField m_yValuesSummaryAddressUiField; caf::PdmField m_yPushButtonSelectSummaryAddress; - caf::PdmField m_resampling; + caf::PdmPtrField m_yPlotAxisProperties; + caf::PdmField m_yValuesResampling; // X values - caf::PdmPtrField m_xValuesSummaryCase; - caf::PdmChildField m_xValuesSummaryAddress; - caf::PdmField m_xValuesSummaryAddressUiField; - caf::PdmField m_xPushButtonSelectSummaryAddress; + caf::PdmField> m_axisType; + caf::PdmPtrField m_xValuesSummaryCase; + caf::PdmChildField m_xValuesSummaryAddress; + caf::PdmField m_xValuesSummaryAddressUiField; + caf::PdmField m_xPushButtonSelectSummaryAddress; + + caf::PdmPtrField m_xPlotAxisProperties; + // Other fields caf::PdmField m_isEnsembleCurve; caf::PdmChildField m_curveNameConfig; caf::PdmField> m_plotAxis_OBSOLETE; - caf::PdmPtrField m_plotAxisProperties; caf::PdmField m_isTopZWithinCategory; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index 987066a04b..28e11db03d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -447,6 +447,21 @@ RimSummaryPlotSourceStepping* RimSummaryCurveCollection::sourceSteppingObject( R return nullptr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::set RimSummaryCurveCollection::horizontalAxisTypes() const +{ + std::set axisTypes; + + for ( const auto& curve : m_curves ) + { + axisTypes.insert( curve->axisTypeX() ); + } + + return axisTypes; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h index a8956dcd5d..7203a7d7df 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h @@ -18,6 +18,7 @@ #pragma once +#include "RiaSummaryDefines.h" #include "RimSummaryPlotSourceStepping.h" #include "cafPdmChildArrayField.h" @@ -54,8 +55,9 @@ class RimSummaryCurveCollection : public caf::PdmObject RimSummaryPlotSourceStepping* sourceSteppingObject( RimSummaryDataSourceStepping::Axis sourceSteppingType ) const; - std::vector curves() const; - std::vector curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const; + std::set horizontalAxisTypes() const; + std::vector curves() const; + std::vector curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const; void setCurveAsTopZWithinCategory( RimSummaryCurve* curve ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 9eb5c2ef5b..669ba72077 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -1273,12 +1273,13 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings() for ( auto p : summaryPlots() ) { - auto timeAxisProp = p->timeAxisProperties(); - - auto tickMarkCount = ( columnCount() < 3 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT - : RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW; + if ( auto timeAxisProp = p->timeAxisProperties() ) + { + auto tickMarkCount = ( columnCount() < 3 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT + : RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW; - timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged ); + timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged ); + } for ( auto* axisProp : p->plotYAxes() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index aefafe3143..46e9373a3d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -30,6 +30,7 @@ #include "RiaStdStringTools.h" #include "RiaSummaryAddressAnalyzer.h" #include "RiaSummaryCurveDefinition.h" +#include "RiaSummaryDefines.h" #include "RiaSummaryTools.h" #include "RiaTimeHistoryCurveResampler.h" @@ -99,6 +100,8 @@ #include #include +#pragma optimize( "", off ) + CAF_PDM_SOURCE_INIT( RimSummaryPlot, "SummaryPlot" ); struct RimSummaryPlot::CurveInfo @@ -118,9 +121,8 @@ struct RimSummaryPlot::CurveInfo //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) +RimSummaryPlot::RimSummaryPlot() : RimPlot() - , m_isCrossPlot( isCrossPlot ) , curvesChanged( this ) , axisChanged( this ) , plotZoomedByUser( this ) @@ -156,19 +158,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) CAF_PDM_InitFieldNoDefault( &m_axisPropertiesArray, "AxisProperties", "Axes", ":/Axes16x16.png" ); - if ( m_isCrossPlot ) - { - addNewAxisProperties( RiuPlotAxis::defaultBottom(), "Bottom" ); - } - else - { - auto* timeAxisProperties = new RimSummaryTimeAxisProperties; - timeAxisProperties->settingsChanged.connect( this, &RimSummaryPlot::timeAxisSettingsChanged ); - timeAxisProperties->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::timeAxisSettingsChangedReloadRequired ); - - m_axisPropertiesArray.push_back( timeAxisProperties ); - } - auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" ); leftAxis->setAlwaysRequired( true ); @@ -179,14 +168,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" ); m_sourceStepping = new RimSummaryPlotSourceStepping; - if ( m_isCrossPlot ) - { - m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); - } - else - { - m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); - } m_sourceStepping->setSourceSteppingObject( this ); m_sourceStepping.uiCapability()->setUiTreeHidden( true ); @@ -220,6 +201,8 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) m_timeAxisProperties_OBSOLETE.uiCapability()->setUiTreeHidden( true ); m_timeAxisProperties_OBSOLETE.xmlCapability()->setIOWritable( false ); m_timeAxisProperties_OBSOLETE = new RimSummaryTimeAxisProperties; + + ensureRequiredAxisObjectsForCurves(); } //-------------------------------------------------------------------------------------------------- @@ -258,14 +241,9 @@ void RimSummaryPlot::updateAxes() m_summaryPlot->updateAnnotationObjects( leftYAxisProperties ); } - if ( m_isCrossPlot ) - { - updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); - } - else - { - updateTimeAxis( timeAxisProperties() ); - } + updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_TOP ); + updateTimeAxis( timeAxisProperties() ); updateZoomInParentPlot(); } @@ -501,7 +479,12 @@ std::vector RimSummaryPlot::allCurves( RimSummaryDataSourceSte //-------------------------------------------------------------------------------------------------- std::vector RimSummaryPlot::availableAxes() const { - if ( m_isCrossPlot ) return { RimSummaryDataSourceStepping::Axis::X_AXIS, RimSummaryDataSourceStepping::Axis::Y_AXIS }; + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + return { RimSummaryDataSourceStepping::Axis::X_AXIS, RimSummaryDataSourceStepping::Axis::Y_AXIS }; + } return { RimSummaryDataSourceStepping::Axis::X_AXIS }; } @@ -911,51 +894,58 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) RiuPlotAxis riuPlotAxis = axisProperties->plotAxis(); if ( riuPlotAxis.axis() == plotAxis ) { + bool isBottom = plotAxis == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + bool isTop = plotAxis == RiaDefines::PlotAxis::PLOT_AXIS_TOP; + auto* axisProps = dynamic_cast( axisProperties ); - if ( axisProps ) + if ( !axisProps ) continue; + + if ( axisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) ) { - if ( axisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) ) - { - plotWidget()->enableAxis( riuPlotAxis, true ); - } - else - { - plotWidget()->enableAxis( riuPlotAxis, false ); - } + plotWidget()->enableAxis( riuPlotAxis, true ); + } + else + { + plotWidget()->enableAxis( riuPlotAxis, false ); + } + + if ( !hasVisibleCurvesForAxis( riuPlotAxis ) ) + { + axisProps->setNameForUnusedAxis(); + } + else + { + std::set timeHistoryQuantities; - if ( !hasVisibleCurvesForAxis( riuPlotAxis ) ) + for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) ) { - axisProps->setNameForUnusedAxis(); + timeHistoryQuantities.insert( c->quantityName() ); } - else - { - std::set timeHistoryQuantities; - for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) ) - { - timeHistoryQuantities.insert( c->quantityName() ); - } - - std::vector curveDefs; - for ( auto summaryCurve : summaryCurves() ) + std::vector curveDefs; + for ( auto summaryCurve : summaryCurves() ) + { + if ( summaryCurve->axisY() == riuPlotAxis ) { - if ( summaryCurve->axisY() != riuPlotAxis ) continue; - curveDefs.push_back( summaryCurve->curveDefinitionY() ); } - - for ( auto curveSet : ensembleCurveSetCollection()->curveSets() ) + else if ( summaryCurve->axisX() == riuPlotAxis ) { - if ( curveSet->axisY() != riuPlotAxis ) continue; - - RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ); - curveDefs.push_back( def ); + curveDefs.push_back( summaryCurve->curveDefinitionX() ); } + } - RimSummaryPlotAxisFormatter calc( axisProps, {}, curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities ); + for ( auto curveSet : ensembleCurveSetCollection()->curveSets() ) + { + if ( curveSet->axisY() != riuPlotAxis ) continue; - calc.applyAxisPropertiesToPlot( plotWidget() ); + RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ); + curveDefs.push_back( def ); } + + RimSummaryPlotAxisFormatter calc( axisProps, {}, curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities ); + + calc.applyAxisPropertiesToPlot( plotWidget() ); } plotWidget()->enableAxisNumberLabels( riuPlotAxis, axisProps->showNumbers() ); @@ -972,11 +962,18 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisProperties ) { - if ( !plotWidget() ) return; + if ( !plotWidget() || !timeAxisProperties ) return; + + bool anyTimeHistoryCurvePresent = false; + { + if ( !visibleTimeHistoryCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + if ( !visibleAsciiDataCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + if ( !visibleSummaryCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + } - if ( !timeAxisProperties->isActive() ) + if ( !anyTimeHistoryCurvePresent || !timeAxisProperties->isActive() ) { - plotWidget()->enableAxis( RiuPlotAxis::defaultBottom(), false ); + plotWidget()->enableAxis( RimSummaryPlot::plotAxisForTime(), false ); return; } @@ -996,7 +993,7 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope m_summaryPlot->useTimeBasedTimeAxis(); } - plotWidget()->enableAxis( RiuPlotAxis::defaultBottom(), true ); + plotWidget()->enableAxis( RimSummaryPlot::plotAxisForTime(), true ); { Qt::AlignmentFlag alignment = Qt::AlignCenter; @@ -1005,20 +1002,20 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope alignment = Qt::AlignRight; } - plotWidget()->setAxisFontsAndAlignment( RiuPlotAxis::defaultBottom(), + plotWidget()->setAxisFontsAndAlignment( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->titleFontSize(), timeAxisProperties->valuesFontSize(), true, alignment ); - plotWidget()->setAxisTitleText( RiuPlotAxis::defaultBottom(), timeAxisProperties->title() ); - plotWidget()->setAxisTitleEnabled( RiuPlotAxis::defaultBottom(), timeAxisProperties->showTitle ); + plotWidget()->setAxisTitleText( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->title() ); + plotWidget()->setAxisTitleEnabled( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->showTitle ); if ( timeAxisProperties->tickmarkType() == RimSummaryTimeAxisProperties::TickmarkType::TICKMARK_COUNT ) { RimSummaryTimeAxisProperties::LegendTickmarkCount tickmarkCountEnum = timeAxisProperties->majorTickmarkCount(); int maxTickmarkCount = RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( tickmarkCountEnum ); - plotWidget()->setAxisMaxMajor( RiuPlotAxis::defaultBottom(), maxTickmarkCount ); + plotWidget()->setAxisMaxMajor( RimSummaryPlot::plotAxisForTime(), maxTickmarkCount ); } else if ( timeAxisProperties->tickmarkType() == RimSummaryTimeAxisProperties::TickmarkType::TICKMARK_CUSTOM ) { @@ -1135,10 +1132,10 @@ void RimSummaryPlot::createAndSetCustomTimeAxisTickmarks( RimSummaryTimeAxisProp { if ( !timeAxisProperties || !plotWidget() ) return; - const auto [minValue, maxValue] = plotWidget()->axisRange( RiuPlotAxis::defaultBottom() ); + const auto [minValue, maxValue] = plotWidget()->axisRange( RimSummaryPlot::plotAxisForTime() ); const auto tickmarkList = timeAxisProperties->createTickmarkList( QwtDate::toDateTime( minValue ), QwtDate::toDateTime( maxValue ) ); - plotWidget()->setMajorTicksList( RiuPlotAxis::defaultBottom(), tickmarkList, minValue, maxValue ); + plotWidget()->setMajorTicksList( RimSummaryPlot::plotAxisForTime(), tickmarkList, minValue, maxValue ); } //-------------------------------------------------------------------------------------------------- @@ -1155,7 +1152,7 @@ void RimSummaryPlot::overrideTimeAxisSettingsIfTooManyCustomTickmarks( RimSummar // Prevent too large number of ticks by overriding time axis interval and step to // prevent large number of tickmarks by accident. - const auto [minValue, maxValue] = plotWidget()->axisRange( RiuPlotAxis::defaultBottom() ); + const auto [minValue, maxValue] = plotWidget()->axisRange( RimSummaryPlot::plotAxisForTime() ); const double ticksInterval = timeAxisProperties->getTickmarkIntervalDouble(); const uint numTicks = static_cast( std::ceil( ( maxValue - minValue ) / ticksInterval ) ); if ( numTicks > MAX_NUM_TICKS ) @@ -1198,54 +1195,108 @@ bool RimSummaryPlot::isOnlyWaterCutCurvesVisible( RiuPlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::scheduleReplotIfVisible() +RiuPlotAxis RimSummaryPlot::plotAxisForTime() { - if ( showWindow() && plotWidget() ) plotWidget()->scheduleReplot(); + return RiuPlotAxis::defaultBottom(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const +void RimSummaryPlot::ensureRequiredAxisObjectsForCurves() { - std::vector curves; + // Always make sure time axis properties are present + if ( !timeAxisProperties() ) + { + auto* axisProperties = new RimSummaryTimeAxisProperties; + axisProperties->settingsChanged.connect( this, &RimSummaryPlot::timeAxisSettingsChanged ); + axisProperties->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::timeAxisSettingsChangedReloadRequired ); + + m_axisPropertiesArray.push_back( axisProperties ); + } - if ( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); + } + else { - if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::findOrAssignPlotAxisX( RimSummaryCurve* curve ) +{ + for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) + { + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { - for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + auto propertyAxis = dynamic_cast( axisProperties ); + if ( propertyAxis ) { - if ( curve->isChecked() ) - { - curves.push_back( curve ); - } + curve->setTopOrBottomAxisX( propertyAxis->plotAxis() ); + + return; } } } - else + + if ( curve->summaryCaseX() != nullptr && plotWidget() && plotWidget()->isMultiAxisSupported() ) { - if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + QString axisObjectName = "New Axis"; + if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + + RiuPlotAxis newPlotAxis = plotWidget()->createNextPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + addNewAxisProperties( newPlotAxis, axisObjectName ); + if ( plotWidget() ) { - for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + plotWidget()->ensureAxisIsCreated( newPlotAxis ); + } + + updateAxes(); + curve->setTopOrBottomAxisX( newPlotAxis ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::scheduleReplotIfVisible() +{ + if ( showWindow() && plotWidget() ) plotWidget()->scheduleReplot(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const +{ + std::vector curves; + + if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + { + for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + { + if ( curve->isChecked() && ( curve->axisY() == plotAxis || curve->axisX() == plotAxis ) ) { - if ( curve->isChecked() && curve->axisY() == plotAxis ) - { - curves.push_back( curve ); - } + curves.push_back( curve ); } } + } - if ( m_ensembleCurveSetCollection && m_ensembleCurveSetCollection->isCurveSetsVisible() ) + if ( m_ensembleCurveSetCollection && m_ensembleCurveSetCollection->isCurveSetsVisible() ) + { + for ( RimEnsembleCurveSet* curveSet : m_ensembleCurveSetCollection->curveSets() ) { - for ( RimEnsembleCurveSet* curveSet : m_ensembleCurveSetCollection->curveSets() ) + for ( RimSummaryCurve* curve : curveSet->curves() ) { - for ( RimSummaryCurve* curve : curveSet->curves() ) + if ( curve->isChecked() && ( curve->axisY() == plotAxis || curve->axisX() == plotAxis ) ) { - if ( curve->isChecked() && curve->axisY() == plotAxis ) - { - curves.push_back( curve ); - } + curves.push_back( curve ); } } } @@ -1349,6 +1400,7 @@ void RimSummaryPlot::updateCaseNameHasChanged() RimTimeAxisAnnotation* RimSummaryPlot::addTimeAnnotation( time_t time ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); auto* annotation = new RimTimeAxisAnnotation; annotation->setTime( time ); @@ -1364,6 +1416,7 @@ RimTimeAxisAnnotation* RimSummaryPlot::addTimeAnnotation( time_t time ) RimTimeAxisAnnotation* RimSummaryPlot::addTimeRangeAnnotation( time_t startTime, time_t endTime ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); auto* annotation = new RimTimeAxisAnnotation; annotation->setTimeRange( startTime, endTime ); @@ -1379,7 +1432,7 @@ RimTimeAxisAnnotation* RimSummaryPlot::addTimeRangeAnnotation( time_t startTime, void RimSummaryPlot::removeAllTimeAnnotations() { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); - axisProps->removeAllAnnotations(); + if ( axisProps ) axisProps->removeAllAnnotations(); } //-------------------------------------------------------------------------------------------------- @@ -1388,6 +1441,8 @@ void RimSummaryPlot::removeAllTimeAnnotations() void RimSummaryPlot::removeTimeAnnotation( RimTimeAxisAnnotation* annotation ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); + axisProps->removeAnnotation( annotation ); } @@ -1816,12 +1871,9 @@ void RimSummaryPlot::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin uiTreeOrdering.add( curve ); } - if ( !m_isCrossPlot ) + for ( auto& curveSet : m_ensembleCurveSetCollection->curveSets() ) { - for ( auto& curveSet : m_ensembleCurveSetCollection->curveSets() ) - { - uiTreeOrdering.add( curveSet ); - } + uiTreeOrdering.add( curveSet ); } if ( !isPlotEditor ) @@ -2049,7 +2101,7 @@ void RimSummaryPlot::timeAxisSettingsChanged( const caf::SignalEmitter* emitter if ( !timeAxisProps->isAutoZoom() && plotWidget() ) { // If not auto zoom - the new date and time ranges must be set and axes updated - plotWidget()->setAxisScale( RiuPlotAxis::defaultBottom(), timeAxisProps->visibleRangeMin(), timeAxisProps->visibleRangeMax() ); + plotWidget()->setAxisScale( RimSummaryPlot::plotAxisForTime(), timeAxisProps->visibleRangeMin(), timeAxisProps->visibleRangeMax() ); plotWidget()->updateAxes(); } @@ -2743,11 +2795,8 @@ void RimSummaryPlot::initAfterRead() copyAxis( RiuPlotAxis::defaultLeft(), m_leftYAxisProperties_OBSOLETE.v() ); copyAxis( RiuPlotAxis::defaultRight(), m_rightYAxisProperties_OBSOLETE.v() ); - - if ( m_isCrossPlot ) - copyAxis( RiuPlotAxis::defaultBottom(), m_bottomAxisProperties_OBSOLETE.v() ); - else - copyAxis( RiuPlotAxis::defaultBottom(), m_timeAxisProperties_OBSOLETE.v() ); + copyAxis( RiuPlotAxis::defaultBottom(), m_bottomAxisProperties_OBSOLETE.v() ); + copyAxis( RiuPlotAxis::defaultBottom(), m_timeAxisProperties_OBSOLETE.v() ); } for ( const auto& axisProperties : m_axisPropertiesArray ) @@ -2970,6 +3019,13 @@ void RimSummaryPlot::onPlotItemSelected( std::shared_ptr plotItem, //-------------------------------------------------------------------------------------------------- RimSummaryPlotSourceStepping* RimSummaryPlot::sourceSteppingObjectForKeyEventHandling() const { + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); + } + return m_sourceStepping; } @@ -3041,7 +3097,11 @@ std::vector RimSummaryPlot::plotYAxes() const for ( const auto& ap : m_axisPropertiesArray ) { auto plotAxisProp = dynamic_cast( ap.p() ); - if ( plotAxisProp ) axisProps.push_back( plotAxisProp ); + if ( plotAxisProp && ( plotAxisProp->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + plotAxisProp->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) ) + { + axisProps.push_back( plotAxisProp ); + } } return axisProps; @@ -3051,6 +3111,15 @@ std::vector RimSummaryPlot::plotYAxes() const /// //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) +{ + assignXPlotAxis( destinationCurve ); + assignYPlotAxis( destinationCurve ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) { enum class AxisAssignmentStrategy { @@ -3178,6 +3247,31 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) destinationCurve->setLeftOrRightAxisY( newPlotAxis ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::assignXPlotAxis( RimSummaryCurve* curve ) +{ + RiuPlotAxis newPlotAxis = RimSummaryPlot::plotAxisForTime(); + + if ( curve->summaryCaseX() != nullptr && plotWidget() && plotWidget()->isMultiAxisSupported() ) + { + QString axisObjectName = "New Axis"; + if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + + newPlotAxis = plotWidget()->createNextPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + addNewAxisProperties( newPlotAxis, axisObjectName ); + if ( plotWidget() ) + { + plotWidget()->ensureAxisIsCreated( newPlotAxis ); + } + + updateAxes(); + } + + curve->setTopOrBottomAxisX( newPlotAxis ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index e20f8a184f..099a4cf340 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -86,7 +86,7 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping caf::Signal autoTitleChanged; public: - RimSummaryPlot( bool isCrossPlot = false ); + RimSummaryPlot(); ~RimSummaryPlot() override; void setDescription( const QString& description ); @@ -175,7 +175,7 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping void setNormalizationEnabled( bool enable ); bool isNormalizationEnabled(); - virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const; + RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const; void setAutoScaleXEnabled( bool enabled ) override; void setAutoScaleYEnabled( bool enabled ) override; @@ -205,8 +205,9 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping std::vector plotYAxes() const; RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const; - - RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name ); + RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name ); + void ensureRequiredAxisObjectsForCurves(); + void findOrAssignPlotAxisX( RimSummaryCurve* curve ); std::vector visibleCurvesForLegend() override; @@ -297,6 +298,8 @@ private slots: void timeAxisSettingsChangedReloadRequired( const caf::SignalEmitter* emitter ); void assignPlotAxis( RimSummaryCurve* curve ); + void assignYPlotAxis( RimSummaryCurve* curve ); + void assignXPlotAxis( RimSummaryCurve* curve ); RimSummaryCurve* addNewCurveY( const RifEclipseSummaryAddress& address, RimSummaryCase* summaryCase ); RimEnsembleCurveSet* addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble ); @@ -314,6 +317,8 @@ private slots: bool isOnlyWaterCutCurvesVisible( RiuPlotAxis plotAxis ); + static RiuPlotAxis plotAxisForTime(); + private: #ifdef USE_QTCHARTS caf::PdmField m_useQtChartsPlot; @@ -341,8 +346,6 @@ private slots: std::unique_ptr m_summaryPlot; std::unique_ptr m_plotInfoLabel; - bool m_isCrossPlot; - std::unique_ptr m_nameHelperAllCurves; caf::PdmChildField m_sourceStepping; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp index 1dc6c042e7..8746cb2be7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp @@ -131,7 +131,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot } QString objectName = createAxisObjectName(); - m_axisProperties->setNameAndAxis( objectName, axisTitle, axis.axis(), axis.index() ); + m_axisProperties->setNameAndAxis( objectName + axisTitle, axisTitle, axis.axis(), axis.index() ); plotWidget->setAxisTitleText( axis, axisTitle ); bool titleBold = false; @@ -370,13 +370,13 @@ QString RimSummaryPlotAxisFormatter::createAxisObjectName() const { RifEclipseSummaryAddress sumAddress; - if ( m_axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { - sumAddress = rimCurve->summaryAddressX(); + sumAddress = rimCurve->summaryAddressY(); } - else if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) + else if ( rimCurve->axisX() == m_axisProperties->plotAxis() ) { - sumAddress = rimCurve->summaryAddressY(); + sumAddress = rimCurve->summaryAddressX(); } else { diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index c0d90f0c91..ac760f37d4 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -73,6 +73,8 @@ #include #include +#pragma optimize( "", off ) + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -349,7 +351,8 @@ void RiuQwtPlotWidget::setAxisRange( RiuPlotAxis axis, double min, double max ) //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::setAxisInverted( RiuPlotAxis axis, bool isInverted ) { - m_plot->axisScaleEngine( toQwtPlotAxis( axis ) )->setAttribute( QwtScaleEngine::Inverted, isInverted ); + auto scaleEngine = m_plot->axisScaleEngine( toQwtPlotAxis( axis ) ); + if ( scaleEngine ) scaleEngine->setAttribute( QwtScaleEngine::Inverted, isInverted ); } //-------------------------------------------------------------------------------------------------- @@ -1279,6 +1282,10 @@ void RiuQwtPlotWidget::ensureAxisIsCreated( RiuPlotAxis axis ) //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::enableAxis( RiuPlotAxis axis, bool isEnabled ) { + auto axisLocation = axis.axis(); + + bool isBottom = ( axisLocation == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + ensureAxisIsCreated( axis ); m_plot->setAxisVisible( toQwtPlotAxis( axis ), isEnabled ); From aa3a24abda58f57e3b327f93189d58bce86034f3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 08:11:49 +0200 Subject: [PATCH 09/28] Add support for drag/drop of object names --- .../RifEclipseSummaryAddress.cpp | 2 +- .../Summary/RimSummaryPlot.cpp | 52 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 1921aeefce..6c512ce13e 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -479,7 +479,7 @@ std::string RifEclipseSummaryAddress::generateStringFromAddresses( const std::ve } //-------------------------------------------------------------------------------------------------- -/// +/// TODO: Move to RifEclipseSummaryAddressDefines //-------------------------------------------------------------------------------------------------- bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryCategory category ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 46e9373a3d..a084d23c4c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2343,68 +2343,60 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { for ( auto& curve : summaryCurves() ) { - sourceCurveDefs.push_back( curve->curveDefinitionY() ); + RiaSummaryCurveDefinition curveDef = curve->curveDefinitionY(); + if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + curveDef.setSummaryDataXAxis( curve->summaryCaseX(), curve->summaryAddressX() ); + } + sourceCurveDefs.push_back( curveDef ); } - } - if ( ensembleCase ) - { - auto curveSets = m_ensembleCurveSetCollection->curveSets(); - for ( auto curveSet : curveSets ) + if ( ensembleCase ) { - sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->summaryAddress() ) ); + auto curveSets = m_ensembleCurveSetCollection->curveSets(); + for ( auto curveSet : curveSets ) + { + sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->summaryAddress() ) ); + } } } for ( auto& curveDef : sourceCurveDefs ) { - auto newCurveDef = curveDef; - auto curveAdr = newCurveDef.summaryAddress(); + auto newCurveDef = curveDef; + const auto curveAdr = newCurveDef.summaryAddress(); + std::string objectIdentifierString; if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL ) ) { objectIdentifierString = curveAdr.wellName(); - curveAdr.setWellName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::GROUP ) ) { objectIdentifierString = curveAdr.groupName(); - curveAdr.setGroupName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::NETWORK ) ) { objectIdentifierString = curveAdr.networkName(); - curveAdr.setNetworkName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) ) { objectIdentifierString = std::to_string( curveAdr.regionNumber() ); - - int droppedRegion = std::stoi( droppedName ); - - curveAdr.setRegion( droppedRegion ); - newCurveDef.setSummaryAddress( curveAdr ); } else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT ) ) { objectIdentifierString = std::to_string( curveAdr.wellSegmentNumber() ); - - int droppedWellSegmentNumber = std::stoi( droppedName ); - - curveAdr.setWellSegmentNumber( droppedWellSegmentNumber ); - newCurveDef.setSummaryAddress( curveAdr ); } if ( !objectIdentifierString.empty() ) { + newCurveDef.setIdentifierText( curveAdr.category(), droppedName ); + newCurveDefsWithObjectNames[newCurveDef].insert( objectIdentifierString ); const auto& addr = curveDef.summaryAddress(); if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() ) @@ -2437,7 +2429,15 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { if ( curveDef.summaryCase()->summaryReader() && curveDef.summaryCase()->summaryReader()->hasAddress( curveDef.summaryAddress() ) ) { - curves.push_back( addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase() ) ); + auto curve = addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase() ); + curves.push_back( curve ); + if ( curveDef.summaryCaseX() ) + { + curve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + curve->setSummaryCaseX( curveDef.summaryCaseX() ); + curve->setSummaryAddressX( curveDef.summaryAddressX() ); + findOrAssignPlotAxisX( curve ); + } newCurves++; } } From 5cad2250fd44e6d581082f950135212b24ebdd1f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 09:46:25 +0200 Subject: [PATCH 10/28] Include both axes data source info in curveDefinition --- .../RicSummaryPlotEditorUi.cpp | 6 ++-- .../Summary/RimEnsembleCurveSet.cpp | 2 +- .../Summary/RimSummaryCurve.cpp | 28 ++++++------------- .../Summary/RimSummaryCurve.h | 5 ++-- .../Summary/RimSummaryCurvesData.cpp | 4 +-- .../Summary/RimSummaryPlot.cpp | 14 ++-------- 6 files changed, 19 insertions(+), 40 deletions(-) diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp index 9c36b8a795..79993fc9f7 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp @@ -371,7 +371,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection() for ( const auto& curve : currentCurvesInPreviewPlot ) { - currentCurveDefs.insert( curve->curveDefinitionY() ); + currentCurveDefs.insert( curve->curveDefinition() ); } { @@ -385,7 +385,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection() for ( const auto& curve : currentCurvesInPreviewPlot ) { - RiaSummaryCurveDefinition curveDef = curve->curveDefinitionY(); + RiaSummaryCurveDefinition curveDef = curve->curveDefinition(); if ( deleteCurveDefs.count( curveDef ) > 0 ) curvesToDelete.insert( curve ); } } @@ -630,7 +630,7 @@ void RicSummaryPlotEditorUi::populateCurveCreator( const RimSummaryPlot& sourceS for ( const auto& curve : sourceSummaryPlot.summaryCurves() ) { - curveDefs.push_back( curve->curveDefinitionY() ); + curveDefs.push_back( curve->curveDefinition() ); // Copy curve object to the preview plot copyCurveAndAddToPlot( curve, m_previewPlot.get(), true ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 57ce8b3b25..2a08d5639d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -1403,7 +1403,7 @@ std::vector RimEnsembleCurveSet::curveDefinitions() c std::vector curveDefs; for ( auto dataEntry : m_curves() ) { - curveDefs.push_back( dataEntry->curveDefinitionY() ); + curveDefs.push_back( dataEntry->curveDefinition() ); } return curveDefs; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index d3d2ba73e3..7f3be71ac1 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -153,9 +153,15 @@ RimSummaryCurve::~RimSummaryCurve() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiaSummaryCurveDefinition RimSummaryCurve::curveDefinitionY() const +RiaSummaryCurveDefinition RimSummaryCurve::curveDefinition() const { - return RiaSummaryCurveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); + RiaSummaryCurveDefinition curveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); + if ( m_axisType() == RiaDefines::HorizontalAxisType::TIME ) + { + curveDefinition.setSummaryDataXAxis( summaryCaseX(), summaryAddressX() ); + } + + return curveDefinition; } //-------------------------------------------------------------------------------------------------- @@ -311,16 +317,6 @@ std::vector RimSummaryCurve::valuesY() const return values; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSummaryCurve::applyCurveDefinitionY( const RiaSummaryCurveDefinition& curveDefinition ) -{ - setSummaryCaseY( curveDefinition.summaryCase() ); - setSummaryAddressY( curveDefinition.summaryAddress() ); - setIsEnsembleCurve( curveDefinition.isEnsembleCurve() ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -443,14 +439,6 @@ RiaDefines::HorizontalAxisType RimSummaryCurve::axisTypeX() const return m_axisType(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiaSummaryCurveDefinition RimSummaryCurve::curveDefinitionX() const -{ - return RiaSummaryCurveDefinition( summaryCaseX(), summaryAddressX(), isEnsembleCurve() ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index c1a35a9a24..e73125ced6 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -53,14 +53,14 @@ class RimSummaryCurve : public RimStackablePlotCurve RimSummaryCurve(); ~RimSummaryCurve() override; + RiaSummaryCurveDefinition curveDefinition() const; + // Y Axis functions - RiaSummaryCurveDefinition curveDefinitionY() const; RimSummaryCase* summaryCaseY() const; RifEclipseSummaryAddress summaryAddressY() const; std::string unitNameY() const; virtual std::vector valuesY() const; - void applyCurveDefinitionY( const RiaSummaryCurveDefinition& curveDefinition ); void setSummaryCaseY( RimSummaryCase* sumCase ); void setSummaryAddressYAndApplyInterpolation( const RifEclipseSummaryAddress& address ); void setSummaryAddressY( const RifEclipseSummaryAddress& address ); @@ -77,7 +77,6 @@ class RimSummaryCurve : public RimStackablePlotCurve // X Axis functions void setAxisTypeX( RiaDefines::HorizontalAxisType axisType ); RiaDefines::HorizontalAxisType axisTypeX() const; - RiaSummaryCurveDefinition curveDefinitionX() const; RimSummaryCase* summaryCaseX() const; RifEclipseSummaryAddress summaryAddressX() const; std::string unitNameX() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp index 7726cfee0b..76b2ff488e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp @@ -198,9 +198,9 @@ void RimSummaryCurvesData::populateSummaryCurvesData( std::vectorsummaryCaseY()->displayCaseName(); QString ensembleName; - if ( curve->curveDefinitionY().ensemble() ) + if ( curve->curveDefinition().ensemble() ) { - ensembleName = curve->curveDefinitionY().ensemble()->name(); + ensembleName = curve->curveDefinition().ensemble()->name(); } CurveData curveData = { curve->curveExportDescription( {} ), curve->summaryAddressY(), curve->valuesY() }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index a084d23c4c..c4b482bce8 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -925,13 +925,9 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) std::vector curveDefs; for ( auto summaryCurve : summaryCurves() ) { - if ( summaryCurve->axisY() == riuPlotAxis ) + if ( summaryCurve->axisY() == riuPlotAxis || summaryCurve->axisX() == riuPlotAxis ) { - curveDefs.push_back( summaryCurve->curveDefinitionY() ); - } - else if ( summaryCurve->axisX() == riuPlotAxis ) - { - curveDefs.push_back( summaryCurve->curveDefinitionX() ); + curveDefs.push_back( summaryCurve->curveDefinition() ); } } @@ -2343,11 +2339,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { for ( auto& curve : summaryCurves() ) { - RiaSummaryCurveDefinition curveDef = curve->curveDefinitionY(); - if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) - { - curveDef.setSummaryDataXAxis( curve->summaryCaseX(), curve->summaryAddressX() ); - } + RiaSummaryCurveDefinition curveDef = curve->curveDefinition(); sourceCurveDefs.push_back( curveDef ); } From 7b6bdaf8af1713d26475473c61888b2f548e0d04 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 09:49:17 +0200 Subject: [PATCH 11/28] wip --- .../ProjectDataModel/Summary/RimSummaryCurve.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 7f3be71ac1..5e587d93db 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -156,9 +156,10 @@ RimSummaryCurve::~RimSummaryCurve() RiaSummaryCurveDefinition RimSummaryCurve::curveDefinition() const { RiaSummaryCurveDefinition curveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); - if ( m_axisType() == RiaDefines::HorizontalAxisType::TIME ) + if ( m_axisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { - curveDefinition.setSummaryDataXAxis( summaryCaseX(), summaryAddressX() ); + curveDefinition.setSummaryCaseX( summaryCaseX() ); + curveDefinition.setSummaryAddressX( summaryAddressX() ); } return curveDefinition; From 8b07e38d0537fabeb3b104b1f5dbaab8cdc8673f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 10:54:53 +0200 Subject: [PATCH 12/28] Support drag/drop of summary case --- .../Summary/RimSummaryCurve.cpp | 3 ++ .../Summary/RimSummaryPlot.cpp | 40 +++++++++----- .../ProjectDataModel/Summary/RimSummaryPlot.h | 5 +- .../Summary/RimSummaryPlotAxisFormatter.cpp | 53 ++++++++++--------- 4 files changed, 62 insertions(+), 39 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 5e587d93db..5f85e47b72 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -27,6 +27,7 @@ #include "RiaQDateTimeTools.h" #include "RiaResultNames.h" #include "RiaSummaryCurveDefinition.h" +#include "RiaSummaryDefines.h" #include "RiaSummaryTools.h" #include "RimEclipseResultCase.h" @@ -196,6 +197,8 @@ RimSummaryCase* RimSummaryCurve::summaryCaseY() const //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const { + if ( m_axisType == RiaDefines::HorizontalAxisType::TIME ) return RifEclipseSummaryAddress::timeAddress(); + return m_xValuesSummaryAddress->address(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index c4b482bce8..34230b3ecc 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2268,26 +2268,30 @@ bool RimSummaryPlot::autoPlotTitle() const //-------------------------------------------------------------------------------------------------- RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryCaseDrop( RimSummaryCase* summaryCase ) { - int newCurves = 0; - std::vector curves; - - std::map> dataVectorMap; + std::map, std::set> dataVectorMap; for ( auto& curve : summaryCurves() ) { - const auto addr = curve->summaryAddressY(); - dataVectorMap[addr].insert( curve->summaryCaseY() ); + const auto addr = curve->summaryAddressY(); + const auto addrX = curve->summaryAddressX(); + + // NB! This concept is used to make it possible to avoid adding curves for a case that is already present + // To be complete, the summaryCaseX() should also be checked, but this is not done for now + dataVectorMap[std::make_pair( addr, addrX )].insert( curve->summaryCaseY() ); } - for ( const auto& [addr, cases] : dataVectorMap ) + std::vector curves; + + for ( const auto& [addressPair, cases] : dataVectorMap ) { if ( cases.count( summaryCase ) > 0 ) continue; - curves.push_back( addNewCurveY( addr, summaryCase ) ); - newCurves++; + const auto& [addrY, addrX] = addressPair; + + curves.push_back( addNewCurveY( addrY, summaryCase, addrX, summaryCase ) ); } - return { newCurves, curves, {} }; + return { .curveCount = static_cast( curves.size() ), .curves = curves, .curveSets = {} }; } //-------------------------------------------------------------------------------------------------- @@ -2421,7 +2425,8 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { if ( curveDef.summaryCase()->summaryReader() && curveDef.summaryCase()->summaryReader()->hasAddress( curveDef.summaryAddress() ) ) { - auto curve = addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase() ); + auto curve = + addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase(), curveDef.summaryAddressX(), curveDef.summaryCaseX() ); curves.push_back( curve ); if ( curveDef.summaryCaseX() ) { @@ -2514,7 +2519,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd if ( !skipAddress ) { - curves.push_back( addNewCurveY( droppedAddress, summaryCase ) ); + curves.push_back( addNewCurveY( droppedAddress, summaryCase, RifEclipseSummaryAddress::timeAddress(), nullptr ) ); newCurves++; } } @@ -2577,11 +2582,20 @@ void RimSummaryPlot::handleDroppedObjects( const std::vectorsetSummaryCaseY( summaryCase ); newCurve->setSummaryAddressYAndApplyInterpolation( 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 + newCurve->setSummaryAddressX( addressX ); + newCurve->setSummaryCaseX( summaryCaseX ); + addCurveNoUpdate( newCurve ); return newCurve; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index 099a4cf340..b84ed86f04 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -301,7 +301,10 @@ private slots: void assignYPlotAxis( RimSummaryCurve* curve ); void assignXPlotAxis( RimSummaryCurve* curve ); - RimSummaryCurve* addNewCurveY( const RifEclipseSummaryAddress& address, RimSummaryCase* summaryCase ); + RimSummaryCurve* addNewCurveY( const RifEclipseSummaryAddress& address, + RimSummaryCase* summaryCase, + const RifEclipseSummaryAddress& addressX, + RimSummaryCase* summaryCaseX ); RimEnsembleCurveSet* addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble ); void updateStackedCurveData(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp index 8746cb2be7..3ed729108b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp @@ -254,7 +254,7 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const RifEclipseSummaryAddress sumAddress; std::string unitText; - if ( m_axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( m_axisProperties->plotAxis().isHorizontal() ) { sumAddress = rimCurve->summaryAddressX(); unitText = rimCurve->unitNameX(); @@ -264,23 +264,15 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const sumAddress = rimCurve->summaryAddressY(); unitText = rimCurve->unitNameY(); } - else - { - continue; - } addToUnitToQuantityMap( unitText, sumAddress ); } for ( const RiaSummaryCurveDefinition& curveDef : m_curveDefinitions ) { - const RifEclipseSummaryAddress& sumAddress = curveDef.summaryAddress(); - std::string unitText; - if ( curveDef.summaryCase() && curveDef.summaryCase()->summaryReader() ) - { - unitText = curveDef.summaryCase()->summaryReader()->unitName( sumAddress ); - } - else if ( curveDef.ensemble() ) + std::string unitText; + RifEclipseSummaryAddress sumAddress = curveDef.summaryAddress(); + if ( curveDef.ensemble() ) { std::vector sumCases = curveDef.ensemble()->allSummaryCases(); if ( !sumCases.empty() && sumCases[0] && sumCases[0]->summaryReader() ) @@ -288,6 +280,20 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const unitText = sumCases[0]->summaryReader()->unitName( sumAddress ); } } + else + { + RimSummaryCase* sumCase = curveDef.summaryCase(); + if ( m_axisProperties->plotAxis().isHorizontal() ) + { + sumCase = curveDef.summaryCaseX(); + sumAddress = curveDef.summaryAddressX(); + } + + if ( sumCase && sumCase->summaryReader() ) + { + unitText = sumCase->summaryReader()->unitName( sumAddress ); + } + } addToUnitToQuantityMap( unitText, sumAddress ); } @@ -368,29 +374,26 @@ QString RimSummaryPlotAxisFormatter::createAxisObjectName() const for ( RimSummaryCurve* rimCurve : m_summaryCurves ) { - RifEclipseSummaryAddress sumAddress; - if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { - sumAddress = rimCurve->summaryAddressY(); + addVectorNames( rimCurve->summaryAddressY() ); } else if ( rimCurve->axisX() == m_axisProperties->plotAxis() ) { - sumAddress = rimCurve->summaryAddressX(); - } - else - { - continue; + addVectorNames( rimCurve->summaryAddressX() ); } - - addVectorNames( sumAddress ); } for ( const RiaSummaryCurveDefinition& curveDef : m_curveDefinitions ) { - const RifEclipseSummaryAddress& sumAddress = curveDef.summaryAddress(); - - addVectorNames( sumAddress ); + if ( m_axisProperties->plotAxis().isVertical() ) + { + addVectorNames( curveDef.summaryAddress() ); + } + else + { + addVectorNames( curveDef.summaryAddressX() ); + } } QString assembledAxisObjectName; From a593f010a91427e4af6701f3f725c9ac7488e3e3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 12:53:37 +0200 Subject: [PATCH 13/28] Reuse x-axis object if possible --- .../Summary/RimSummaryCurve.cpp | 2 +- .../Summary/RimSummaryPlot.cpp | 153 +++++++++++++++--- .../UserInterface/RiuPlotAxis.cpp | 9 ++ .../UserInterface/RiuPlotAxis.h | 1 + 4 files changed, 142 insertions(+), 23 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 5f85e47b72..7c980f201c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -469,7 +469,7 @@ RimSummaryCase* RimSummaryCurve::summaryCaseX() const //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) { - CAF_ASSERT( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ); + CAF_ASSERT( plotAxis.isVertical() ); m_plotAxis_OBSOLETE = plotAxis.axis(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 34230b3ecc..a336e52888 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -3125,7 +3125,7 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) +void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* curve ) { enum class AxisAssignmentStrategy { @@ -3138,14 +3138,14 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT; - auto destinationUnit = RiaStdStringTools::toUpper( destinationCurve->unitNameY() ); + auto destinationUnit = RiaStdStringTools::toUpper( curve->unitNameY() ); if ( destinationUnit.empty() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; - auto anyCurveWithUnitText = [this, destinationCurve] + auto anyCurveWithUnitText = [this, curve] { for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; if ( !c->unitNameY().empty() ) return true; } @@ -3161,11 +3161,11 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; - if ( c->summaryAddressY().vectorName() == destinationCurve->summaryAddressY().vectorName() ) + if ( c->summaryAddressY().vectorName() == curve->summaryAddressY().vectorName() ) { - destinationCurve->setLeftOrRightAxisY( c->axisY() ); + curve->setLeftOrRightAxisY( c->axisY() ); return; } } @@ -3177,7 +3177,7 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; if ( c->axisY() == RiuPlotAxis::defaultLeft() ) isLeftUsed = true; if ( c->axisY() == RiuPlotAxis::defaultRight() ) isRightUsed = true; @@ -3191,7 +3191,7 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { - destinationCurve->setLeftOrRightAxisY( c->axisY() ); + curve->setLeftOrRightAxisY( c->axisY() ); return; } @@ -3201,13 +3201,13 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) if ( !isLeftUsed ) { - destinationCurve->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() ); + curve->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() ); return; } if ( !isRightUsed ) { - destinationCurve->setLeftOrRightAxisY( RiuPlotAxis::defaultRight() ); + curve->setLeftOrRightAxisY( RiuPlotAxis::defaultRight() ); return; } @@ -3243,14 +3243,13 @@ void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* destinationCurve ) if ( plotWidget() && plotWidget()->isMultiAxisSupported() ) { QString axisObjectName = "New Axis"; - if ( !destinationCurve->summaryAddressY().uiText().empty() ) - axisObjectName = QString::fromStdString( destinationCurve->summaryAddressY().uiText() ); + if ( !curve->summaryAddressY().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressY().uiText() ); newPlotAxis = plotWidget()->createNextPlotAxis( plotAxisType ); addNewAxisProperties( newPlotAxis, axisObjectName ); } - destinationCurve->setLeftOrRightAxisY( newPlotAxis ); + curve->setLeftOrRightAxisY( newPlotAxis ); } //-------------------------------------------------------------------------------------------------- @@ -3260,19 +3259,129 @@ void RimSummaryPlot::assignXPlotAxis( RimSummaryCurve* curve ) { RiuPlotAxis newPlotAxis = RimSummaryPlot::plotAxisForTime(); - if ( curve->summaryCaseX() != nullptr && plotWidget() && plotWidget()->isMultiAxisSupported() ) + if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { - QString axisObjectName = "New Axis"; - if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + enum class AxisAssignmentStrategy + { + ALL_TOP, + ALL_BOTTOM, + ALTERNATING, + USE_MATCHING_UNIT, + USE_MATCHING_VECTOR + }; - newPlotAxis = plotWidget()->createNextPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); - addNewAxisProperties( newPlotAxis, axisObjectName ); - if ( plotWidget() ) + auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT; + + auto destinationUnit = RiaStdStringTools::toUpper( curve->unitNameX() ); + if ( destinationUnit.empty() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; + + auto anyCurveWithUnitText = [this, curve] { - plotWidget()->ensureAxisIsCreated( newPlotAxis ); + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( !c->unitNameX().empty() ) return true; + } + + return false; + }; + + if ( !anyCurveWithUnitText() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; + + if ( strategy == AxisAssignmentStrategy::USE_MATCHING_VECTOR ) + { + // Special handling if curve unit is matching. Try to match on summary vector name to avoid creation of new axis + + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( c->summaryAddressX().vectorName() == curve->summaryAddressX().vectorName() ) + { + curve->setTopOrBottomAxisX( c->axisX() ); + return; + } + } } + else if ( strategy == AxisAssignmentStrategy::USE_MATCHING_UNIT ) + { + bool isTopUsed = false; + bool isBottomUsed = false; - updateAxes(); + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( c->axisX() == RiuPlotAxis::defaultTop() ) isTopUsed = true; + if ( c->axisX() == RiuPlotAxis::defaultBottomForSummaryVectors() ) isBottomUsed = true; + + auto currentUnit = RiaStdStringTools::toUpper( c->unitNameX() ); + + if ( currentUnit == destinationUnit ) + { + for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) + { + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + { + curve->setTopOrBottomAxisX( c->axisX() ); + + return; + } + } + } + } + + if ( !isTopUsed ) + { + curve->setTopOrBottomAxisX( RiuPlotAxis::defaultTop() ); + return; + } + + if ( !isBottomUsed ) + { + curve->setTopOrBottomAxisX( RiuPlotAxis::defaultBottomForSummaryVectors() ); + return; + } + + strategy = AxisAssignmentStrategy::ALTERNATING; + } + + RiaDefines::PlotAxis plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_TOP; + + if ( strategy == AxisAssignmentStrategy::ALTERNATING ) + { + size_t axisCountTop = 0; + size_t axisCountBot = 0; + for ( const auto& ap : m_axisPropertiesArray ) + { + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP ) + axisCountTop++; + else if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + axisCountBot++; + } + + if ( axisCountTop > axisCountBot ) plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + } + else if ( strategy == AxisAssignmentStrategy::ALL_TOP ) + { + plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_TOP; + } + else if ( strategy == AxisAssignmentStrategy::ALL_BOTTOM ) + { + plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + } + + RiuPlotAxis newPlotAxis = RiuPlotAxis::defaultBottomForSummaryVectors(); + if ( plotWidget() && plotWidget()->isMultiAxisSupported() ) + { + QString axisObjectName = "New Axis"; + if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + + newPlotAxis = plotWidget()->createNextPlotAxis( plotAxisType ); + addNewAxisProperties( newPlotAxis, axisObjectName ); + } } curve->setTopOrBottomAxisX( newPlotAxis ); diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp index a95f54c55a..23531e3f2a 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp @@ -84,6 +84,15 @@ RiuPlotAxis RiuPlotAxis::defaultBottom() return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuPlotAxis RiuPlotAxis::defaultBottomForSummaryVectors() +{ + // Time axis is using index 0, so we need to use index 1 for the bottom axis + return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM, 1 ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.h b/ApplicationLibCode/UserInterface/RiuPlotAxis.h index bb2bc54c22..5588847d54 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.h +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.h @@ -32,6 +32,7 @@ class RiuPlotAxis static RiuPlotAxis defaultRight(); static RiuPlotAxis defaultTop(); static RiuPlotAxis defaultBottom(); + static RiuPlotAxis defaultBottomForSummaryVectors(); RiaDefines::PlotAxis axis() const; From 964c5faee54026ca89783d1e08e2dd13145e7903 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 14:44:10 +0200 Subject: [PATCH 14/28] Fix bug for cross plot curves --- .../ProjectDataModel/Summary/RimSummaryPlot.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index a336e52888..357dcb0258 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -34,6 +34,7 @@ #include "RiaSummaryTools.h" #include "RiaTimeHistoryCurveResampler.h" +#include "RifEclipseSummaryAddressDefines.h" #include "RifReaderEclipseSummary.h" #include "RicfCommandObject.h" @@ -2593,8 +2594,12 @@ RimSummaryCurve* RimSummaryPlot::addNewCurveY( const RifEclipseSummaryAddress& a // 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 - newCurve->setSummaryAddressX( addressX ); - newCurve->setSummaryCaseX( summaryCaseX ); + if ( addressX.category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_TIME ) + { + newCurve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + newCurve->setSummaryAddressX( addressX ); + newCurve->setSummaryCaseX( summaryCaseX ); + } addCurveNoUpdate( newCurve ); From 43296664d8bcfb7cf6985e5347580f3df518f1fd Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 14:44:28 +0200 Subject: [PATCH 15/28] Add summarycurveaddress --- .../Application/CMakeLists_files.cmake | 2 + .../Application/RiaSummaryCurveAddress.cpp | 44 +++++++++++++++++++ .../Application/RiaSummaryCurveAddress.h | 39 ++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp create mode 100644 ApplicationLibCode/Application/RiaSummaryCurveAddress.h diff --git a/ApplicationLibCode/Application/CMakeLists_files.cmake b/ApplicationLibCode/Application/CMakeLists_files.cmake index d32c5e561f..ed89dbc257 100644 --- a/ApplicationLibCode/Application/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/CMakeLists_files.cmake @@ -34,6 +34,7 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -72,6 +73,7 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp ) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp new file mode 100644 index 0000000000..7dc5d91582 --- /dev/null +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2023 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaSummaryCurveAddress.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY ) + : m_summaryAddressX( summaryAddressX ) + , m_summaryAddressY( summaryAddressY ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressX() const +{ + return m_summaryAddressX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressY() const +{ + return m_summaryAddressY; +} diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.h b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h new file mode 100644 index 0000000000..73715a225d --- /dev/null +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2023 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RifEclipseSummaryAddress.h" + +//================================================================================================== +/// +//================================================================================================== +class RiaSummaryCurveAddress +{ +public: + explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY ); + + RifEclipseSummaryAddress summaryAddressX() const; + RifEclipseSummaryAddress summaryAddressY() const; + + auto operator<=>( const RiaSummaryCurveAddress& rhs ) const = default; + +private: + RifEclipseSummaryAddress m_summaryAddressX; + RifEclipseSummaryAddress m_summaryAddressY; +}; From 62691103acec37f25b327ae408b9d7a9b2703beb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 15:30:17 +0200 Subject: [PATCH 16/28] Summary titles WIP --- .../Application/RiaSummaryCurveAddress.cpp | 8 +++ .../Application/RiaSummaryCurveAddress.h | 1 + .../Tools/RiaSummaryAddressAnalyzer.cpp | 57 +++++++++++++++++++ .../Tools/RiaSummaryAddressAnalyzer.h | 16 ++++++ .../Summary/RimEnsembleCurveSet.cpp | 8 +++ .../Summary/RimEnsembleCurveSet.h | 2 + .../Summary/RimSummaryCurve.cpp | 8 +++ .../Summary/RimSummaryCurve.h | 2 + .../Summary/RimSummaryMultiPlot.cpp | 6 +- .../Summary/RimSummaryPlot.cpp | 18 +++--- .../Summary/RimSummaryPlotNameHelper.cpp | 4 +- .../Summary/RimSummaryPlotNameHelper.h | 2 +- 12 files changed, 117 insertions(+), 15 deletions(-) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp index 7dc5d91582..2b0bbb0aea 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp @@ -27,6 +27,14 @@ RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& { } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY ) + : m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) +{ +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.h b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h index 73715a225d..fd13a97e78 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveAddress.h +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h @@ -26,6 +26,7 @@ class RiaSummaryCurveAddress { public: + explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY ); explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY ); RifEclipseSummaryAddress summaryAddressX() const; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index 86f5b2725c..7cc02a9bbc 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -32,6 +32,7 @@ using namespace RifEclipseSummaryAddressDefines; /// //-------------------------------------------------------------------------------------------------- RiaSummaryAddressAnalyzer::RiaSummaryAddressAnalyzer() + : m_onlyCrossPlotCurves( false ) { } @@ -57,6 +58,34 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set auto&& addresses ) +{ + for ( const auto& adr : addresses ) + { + analyzeSingleAddress( adr.summaryAddressX() ); + analyzeSingleAddress( adr.summaryAddressY() ); + } +} +*/ + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryAddressAnalyzer::appendAddresses_concept( const std::vector& addresses ) +{ + m_onlyCrossPlotCurves = true; + + for ( const auto& adr : addresses ) + { + analyzeSingleAddress( adr.summaryAddressX() ); + analyzeSingleAddress( adr.summaryAddressY() ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -100,6 +129,14 @@ bool RiaSummaryAddressAnalyzer::isSingleQuantityIgnoreHistory() const return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaSummaryAddressAnalyzer::onlyCrossPlotCurves() const +{ + return m_onlyCrossPlotCurves; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -110,6 +147,20 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const return *quantities().begin(); } + if ( quantities().size() == 2 && m_onlyCrossPlotCurves ) + { + // We have a cross plot with only one curve + + std::string title; + for ( const auto& q : quantities() ) + { + if ( !title.empty() ) title += " | "; + title += q; + } + + return title; + } + if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 ) { return *quantityNamesWithHistory().begin(); @@ -429,6 +480,12 @@ void RiaSummaryAddressAnalyzer::computeQuantityNamesWithHistory() const //-------------------------------------------------------------------------------------------------- void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddress& address ) { + if ( address.category() == SummaryCategory::SUMMARY_TIME ) + { + m_onlyCrossPlotCurves = false; + return; + } + const std::string& wellName = address.wellName(); if ( !wellName.empty() ) diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index b9d116cd39..083e202d37 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -18,8 +18,10 @@ #pragma once +#include "RiaSummaryCurveAddress.h" #include "RifEclipseSummaryAddress.h" +#include #include #include #include @@ -29,6 +31,13 @@ class RimSummaryCurveCollection; class QString; +// Define a concept for an input range of a specific type. This allows any container type to be used as input argument, like std::vector, +// std::set, ... +// Inspired by https://www.reedbeta.com/blog/ranges-compatible-containers/ +// +template +concept input_range_of = std::ranges::input_range && std::convertible_to, T>; + //================================================================================================== // //================================================================================================== @@ -40,6 +49,9 @@ class RiaSummaryAddressAnalyzer void appendAddresses( const std::set& allAddresses ); void appendAddresses( const std::vector& allAddresses ); + // void appendAddresses_concept( input_range_of auto&& addresses ); + void appendAddresses_concept( const std::vector& addresses ); + void clear(); std::set quantities() const; @@ -48,6 +60,8 @@ class RiaSummaryAddressAnalyzer bool isSingleQuantityIgnoreHistory() const; + bool onlyCrossPlotCurves() const; + std::string quantityNameForTitle() const; std::set wellNames() const; @@ -104,4 +118,6 @@ class RiaSummaryAddressAnalyzer std::multimap m_aquifers; std::map> m_categories; + + bool m_onlyCrossPlotCurves; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 2a08d5639d..4c81a581ba 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -424,6 +424,14 @@ RifEclipseSummaryAddress RimEnsembleCurveSet::summaryAddress() const return m_yValuesSummaryAddress->address(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress RimEnsembleCurveSet::curveAddress() const +{ + return RiaSummaryCurveAddress( summaryAddress(), RifEclipseSummaryAddress::timeAddress() ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index c5a9072d35..75113758d5 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -24,6 +24,7 @@ #include "RiaDateTimeDefines.h" #include "RiaPlotDefines.h" +#include "RiaSummaryCurveAddress.h" #include "RimEnsembleCurveSetColorManager.h" #include "RimEnsembleCurveSetInterface.h" @@ -112,6 +113,7 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt void setSummaryAddress( RifEclipseSummaryAddress address ); void setSummaryAddressAndStatisticsFlag( RifEclipseSummaryAddress address ); RifEclipseSummaryAddress summaryAddress() const; + RiaSummaryCurveAddress curveAddress() const; std::vector curves() const; int ensembleId() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 7c980f201c..b8ba4879db 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -166,6 +166,14 @@ RiaSummaryCurveDefinition RimSummaryCurve::curveDefinition() const return curveDefinition; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress RimSummaryCurve::curveAddress() const +{ + return RiaSummaryCurveAddress( summaryAddressX(), summaryAddressY() ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index e73125ced6..967c81bede 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -26,6 +26,7 @@ #include "RiaDateTimeDefines.h" #include "RiaDefines.h" +#include "RiaSummaryCurveAddress.h" #include "RiaSummaryDefines.h" #include "RifEclipseSummaryAddressQMetaType.h" @@ -54,6 +55,7 @@ class RimSummaryCurve : public RimStackablePlotCurve ~RimSummaryCurve() override; RiaSummaryCurveDefinition curveDefinition() const; + RiaSummaryCurveAddress curveAddress() const; // Y Axis functions RimSummaryCase* summaryCaseY() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 669ba72077..d3c5ceab67 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -374,19 +374,19 @@ void RimSummaryMultiPlot::populateNameHelper( RimSummaryPlotNameHelper* nameHelp { nameHelper->clear(); - std::vector addresses; + std::vector addresses; std::vector sumCases; std::vector ensembleCases; for ( RimSummaryCurve* curve : allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) ) { - addresses.push_back( curve->summaryAddressY() ); + addresses.push_back( curve->curveAddress() ); sumCases.push_back( curve->summaryCaseY() ); } for ( auto curveSet : curveSets() ) { - addresses.push_back( curveSet->summaryAddress() ); + addresses.push_back( curveSet->curveAddress() ); ensembleCases.push_back( curveSet->summaryCaseCollection() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 357dcb0258..c840817f94 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2841,7 +2841,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na if ( !nameHelper ) return; nameHelper->clear(); - std::vector addresses; + std::vector addresses; std::vector sumCases; std::vector ensembleCases; @@ -2851,21 +2851,21 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na { if ( curve->summaryAddressY().isCalculated() ) { - RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( curve->summaryAddressY().id(), sumCases, addresses ); + std::vector calcAddresses; + RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( curve->summaryAddressY().id(), sumCases, calcAddresses ); + for ( const auto& adr : calcAddresses ) + { + addresses.push_back( RiaSummaryCurveAddress( adr ) ); + } } else { - addresses.push_back( curve->summaryAddressY() ); + addresses.push_back( curve->curveAddress() ); sumCases.push_back( curve->summaryCaseY() ); if ( curve->summaryCaseX() ) { sumCases.push_back( curve->summaryCaseX() ); - - if ( curve->summaryAddressX().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) - { - addresses.push_back( curve->summaryAddressX() ); - } } } } @@ -2873,7 +2873,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na for ( auto curveSet : m_ensembleCurveSetCollection->curveSets() ) { - addresses.push_back( curveSet->summaryAddress() ); + addresses.push_back( curveSet->curveAddress() ); ensembleCases.push_back( curveSet->summaryCaseCollection() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp index bd32597303..aaaab75891 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp @@ -48,9 +48,9 @@ void RimSummaryPlotNameHelper::clear() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlotNameHelper::appendAddresses( const std::vector& addresses ) +void RimSummaryPlotNameHelper::appendAddresses( const std::vector& addresses ) { - m_analyzer->appendAddresses( addresses ); + m_analyzer->appendAddresses_concept( addresses ); extractPlotTitleSubStrings(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h index a872dc046c..6f64f810c9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h @@ -44,7 +44,7 @@ class RimSummaryPlotNameHelper : public RimSummaryNameHelper void clear(); - void appendAddresses( const std::vector& addresses ); + void appendAddresses( const std::vector& addresses ); void setSummaryCases( const std::vector& summaryCases ); void setEnsembleCases( const std::vector& ensembleCases ); From 2e71a9cf39ff9f26c275a9af51cde4d92ad0e928 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 18 Sep 2023 15:59:35 +0200 Subject: [PATCH 17/28] Improvements for cross plot curves from multiple realizations WIP: Must fix single cross plot curve --- .../Summary/RimEnsembleCurveSet.cpp | 9 +++------ .../RimMultipleSummaryPlotNameHelper.cpp | 6 +++--- .../RimMultipleSummaryPlotNameHelper.h | 2 +- .../Summary/RimSummaryCurve.cpp | 19 +----------------- .../Summary/RimSummaryCurveAutoName.cpp | 20 ++++++++++++++++++- .../Summary/RimSummaryCurveAutoName.h | 14 ++++++++----- .../Summary/RimSummaryNameHelper.h | 2 +- .../Summary/RimSummaryPlotNameHelper.cpp | 9 ++++++++- .../Summary/RimSummaryPlotNameHelper.h | 2 +- 9 files changed, 46 insertions(+), 37 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 4c81a581ba..50f7d2f5d8 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -2155,12 +2155,9 @@ QString RimEnsembleCurveSet::createAutoName() const { auto plot = firstAncestorOrThisOfTypeAsserted(); - QString curveSetName = - m_summaryAddressNameTools->curveNameY( m_yValuesSummaryAddress->address(), plot->plotTitleHelper(), plot->plotTitleHelper() ); - if ( curveSetName.isEmpty() ) - { - curveSetName = m_summaryAddressNameTools->curveNameY( m_yValuesSummaryAddress->address(), nullptr, nullptr ); - } + QString curveSetName = m_summaryAddressNameTools->curveName( RiaSummaryCurveAddress( m_yValuesSummaryAddress->address() ), + plot->plotTitleHelper(), + plot->plotTitleHelper() ); if ( curveSetName.isEmpty() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp index 7286fb86f6..0196809103 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp @@ -49,12 +49,12 @@ QString RimMultiSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const +bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleCurveType() const { int plotCountWithSingleQuantity = 0; for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleVectorName() ) plotCountWithSingleQuantity++; + if ( nameHelper->isPlotDisplayingSingleCurveType() ) plotCountWithSingleQuantity++; } return plotCountWithSingleQuantity == 1; @@ -160,7 +160,7 @@ std::string RimMultiSummaryPlotNameHelper::titleVectorName() const { for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleVectorName() ) return nameHelper->titleVectorName(); + if ( nameHelper->isPlotDisplayingSingleCurveType() ) return nameHelper->titleVectorName(); } return ""; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h index 56d6ed9581..71d5c9cbb2 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h @@ -30,7 +30,7 @@ class RimMultiSummaryPlotNameHelper : public RimSummaryNameHelper QString plotTitle() const override; - bool isPlotDisplayingSingleVectorName() const override; + bool isPlotDisplayingSingleCurveType() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index b8ba4879db..92a104191b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -600,25 +600,8 @@ QString RimSummaryCurve::createCurveAutoName() } RimMultiSummaryPlotNameHelper multiNameHelper( plotNameHelpers ); - QString curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), currentPlotNameHelper, &multiNameHelper ); - if ( curveName.isEmpty() ) - { - curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), nullptr, nullptr ); - } - - { - QString curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), currentPlotNameHelper, &multiNameHelper ); - if ( curveNameX.isEmpty() ) - { - curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), nullptr, nullptr ); - } - - if ( !curveName.isEmpty() && !curveNameX.isEmpty() ) - { - curveName += " | " + curveNameX; - } - } + QString curveName = m_curveNameConfig->curveName( curveAddress(), currentPlotNameHelper, &multiNameHelper ); if ( curveName.isEmpty() ) { curveName = "Curve Name Placeholder"; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp index efce53cf2d..a11585bddf 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp @@ -65,6 +65,24 @@ RimSummaryCurveAutoName::RimSummaryCurveAutoName() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimSummaryCurveAutoName::curveName( const RiaSummaryCurveAddress& summaryCurveAddress, + const RimSummaryNameHelper* currentNameHelper, + const RimSummaryNameHelper* plotNameHelper ) const +{ + QString name; + + name = curveNameY( summaryCurveAddress.summaryAddressY(), currentNameHelper, plotNameHelper ); + if ( name.isEmpty() ) + { + name = curveNameY( summaryCurveAddress.summaryAddressY(), nullptr, nullptr ); + } + + return name; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -193,7 +211,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& if ( m_vectorName || m_longVectorName ) { - bool skipSubString = currentNameHelper && currentNameHelper->vectorNames().size() == 1; + bool skipSubString = currentNameHelper && currentNameHelper->isPlotDisplayingSingleCurveType(); if ( !skipSubString ) { if ( m_longVectorName() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h index baaacc7c31..ca86409300 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h @@ -31,6 +31,15 @@ class RimSummaryCurveAutoName : public caf::PdmObject public: RimSummaryCurveAutoName(); + QString curveName( const RiaSummaryCurveAddress& summaryCurveAddress, + const RimSummaryNameHelper* currentNameHelper, + const RimSummaryNameHelper* plotNameHelper ) const; + + void applySettings( const RimSummaryCurveAutoName& other ); + +private: + // friend class RimSummaryCurve; + QString curveNameY( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; @@ -38,11 +47,6 @@ class RimSummaryCurveAutoName : public caf::PdmObject const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; - void applySettings( const RimSummaryCurveAutoName& other ); - -private: - friend class RimSummaryCurve; - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h index b21d58416f..c6549fc3be 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h @@ -38,7 +38,7 @@ class RimSummaryNameHelper QString aggregatedPlotTitle( const RimSummaryNameHelper& summaryMultiPlotNameHelper ) const; - virtual bool isPlotDisplayingSingleVectorName() const = 0; + virtual bool isPlotDisplayingSingleCurveType() const = 0; virtual bool isWellNameInTitle() const = 0; virtual bool isGroupNameInTitle() const = 0; virtual bool isNetworkInTitle() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp index aaaab75891..25a8076924 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp @@ -102,8 +102,14 @@ QString RimSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const +bool RimSummaryPlotNameHelper::isPlotDisplayingSingleCurveType() const { + if ( m_analyzer->quantities().size() == 2 && m_analyzer->onlyCrossPlotCurves() ) + { + // We have cross plot curves, and two quantities. This means that we have one curve. + return true; + } + if ( m_analyzer->quantities().size() == 2 ) { std::vector strings; @@ -113,6 +119,7 @@ bool RimSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const auto first = RimObjectiveFunctionTools::nativeQuantityName( strings[0] ); auto second = RimObjectiveFunctionTools::nativeQuantityName( strings[1] ); + // We have two quantities, one history and one not. if ( first == second ) return true; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h index 6f64f810c9..65de09e958 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h @@ -50,7 +50,7 @@ class RimSummaryPlotNameHelper : public RimSummaryNameHelper QString plotTitle() const override; - bool isPlotDisplayingSingleVectorName() const override; + bool isPlotDisplayingSingleCurveType() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; From 46f084562388d4c57445dcad7440207bb8610fee Mon Sep 17 00:00:00 2001 From: magnesj Date: Mon, 18 Sep 2023 14:00:31 +0000 Subject: [PATCH 18/28] Fixes by clang-format --- .../Summary/RimSummaryNameHelper.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h index c6549fc3be..a3dafd9779 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h @@ -39,14 +39,14 @@ class RimSummaryNameHelper QString aggregatedPlotTitle( const RimSummaryNameHelper& summaryMultiPlotNameHelper ) const; virtual bool isPlotDisplayingSingleCurveType() const = 0; - virtual bool isWellNameInTitle() const = 0; - virtual bool isGroupNameInTitle() const = 0; - virtual bool isNetworkInTitle() const = 0; - virtual bool isRegionInTitle() const = 0; - virtual bool isCaseInTitle() const = 0; - virtual bool isBlockInTitle() const = 0; - virtual bool isSegmentInTitle() const = 0; - virtual bool isCompletionInTitle() const = 0; + virtual bool isWellNameInTitle() const = 0; + virtual bool isGroupNameInTitle() const = 0; + virtual bool isNetworkInTitle() const = 0; + virtual bool isRegionInTitle() const = 0; + virtual bool isCaseInTitle() const = 0; + virtual bool isBlockInTitle() const = 0; + virtual bool isSegmentInTitle() const = 0; + virtual bool isCompletionInTitle() const = 0; virtual std::set vectorNames() const = 0; virtual QString caseName() const = 0; From 7b92f26ad00d79a456581e042b911980025db3f6 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 19 Sep 2023 11:26:47 +0200 Subject: [PATCH 19/28] Fix display of ensemble curves --- .../ProjectDataModel/Summary/RimSummaryCurve.cpp | 13 +------------ .../ProjectDataModel/Summary/RimSummaryCurve.h | 2 -- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 92a104191b..b0b7ac299b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -643,7 +643,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) bool shouldPopulateViewWithEmptyData = false; - if ( isCrossPlotCurve() ) + if ( m_axisType == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { auto curveValuesX = valuesX(); auto curveTimeStepsX = timeStepsX(); @@ -958,17 +958,6 @@ void RimSummaryCurve::appendOptionItemsForSummaryAddresses( QList( xPlotAxisProperties ) ) return false; - - return true; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index 967c81bede..16fee2d275 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -137,8 +137,6 @@ class RimSummaryCurve : public RimStackablePlotCurve static void appendOptionItemsForSummaryAddresses( QList* options, RimSummaryCase* summaryCase ); - bool isCrossPlotCurve() const; - private: // Y values caf::PdmPtrField m_yValuesSummaryCase; From 3421801220492ca7ac4b99565b41112b0eebc6c8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 19 Sep 2023 16:33:30 +0200 Subject: [PATCH 20/28] Add helper functions for assignment of data source and axis --- .../Application/Tools/RiaSummaryTools.cpp | 23 +++++++++++++++++++ .../Application/Tools/RiaSummaryTools.h | 4 ++++ .../RicCreateDeclineCurvesFeature.cpp | 8 +++---- ...icCreateRegressionAnalysisCurveFeature.cpp | 8 +++---- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp index dddd1fb349..61efb76450 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp @@ -354,3 +354,26 @@ QList RiaSummaryTools::optionsForSummaryCases( const std return options; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setSummaryAddressX( otherCurve.summaryAddressX() ); + curve.setSummaryCaseX( otherCurve.summaryCaseX() ); + + curve.setSummaryAddressY( otherCurve.summaryAddressY() ); + curve.setSummaryCaseY( otherCurve.summaryCaseY() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setAxisTypeX( otherCurve.axisTypeX() ); + curve.setTopOrBottomAxisX( otherCurve.axisX() ); + + curve.setLeftOrRightAxisY( otherCurve.axisY() ); +} diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h index ebb46308a9..02571787cd 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h @@ -36,6 +36,7 @@ class RimSummaryCaseCollection; class RimSummaryTable; class RimSummaryTableCollection; class RimObservedDataCollection; +class RimSummaryCurve; class RifEclipseSummaryAddress; @@ -88,4 +89,7 @@ class RiaSummaryTools static QList optionsForAllSummaryCases(); static QList optionsForSummaryCases( const std::vector& cases ); + + static void copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); + static void copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); }; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp index 10de3fc79d..3946d2d9fe 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp @@ -92,11 +92,7 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT RimSummaryDeclineCurve* newCurve = new RimSummaryDeclineCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setDeclineCurveType( declineCurveType ); @@ -105,6 +101,8 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp index 9ad8b0a9d5..f2387228c1 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp @@ -78,11 +78,7 @@ RimSummaryRegressionAnalysisCurve* RimSummaryRegressionAnalysisCurve* newCurve = new RimSummaryRegressionAnalysisCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setColor( sourceCurve->color() ); newCurve->setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_RECT ); @@ -90,6 +86,8 @@ RimSummaryRegressionAnalysisCurve* summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors(); From 69e2a61c93ba4f2ac690aa73aee0d6253f1d39df Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 19 Sep 2023 16:52:53 +0200 Subject: [PATCH 21/28] Add missing initializer --- ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp index 2b0bbb0aea..aedcbf31b8 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp @@ -32,6 +32,7 @@ RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& //-------------------------------------------------------------------------------------------------- RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY ) : m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) + , m_summaryAddressY( summaryAddressY ) { } From 890beeecc18471c11f613c5c01b22c02ea3c4ce5 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 19 Sep 2023 17:08:28 +0200 Subject: [PATCH 22/28] Fix for bottom summary axis --- ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index c840817f94..b87f0d3b49 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2806,7 +2806,7 @@ void RimSummaryPlot::initAfterRead() copyAxis( RiuPlotAxis::defaultLeft(), m_leftYAxisProperties_OBSOLETE.v() ); copyAxis( RiuPlotAxis::defaultRight(), m_rightYAxisProperties_OBSOLETE.v() ); - copyAxis( RiuPlotAxis::defaultBottom(), m_bottomAxisProperties_OBSOLETE.v() ); + copyAxis( RiuPlotAxis::defaultBottomForSummaryVectors(), m_bottomAxisProperties_OBSOLETE.v() ); copyAxis( RiuPlotAxis::defaultBottom(), m_timeAxisProperties_OBSOLETE.v() ); } From cf51a4bfd19e0a9c41802cbf8e10da82b4c997e3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 08:05:23 +0200 Subject: [PATCH 23/28] Cleanup --- .../Tools/RiaSummaryAddressAnalyzer.cpp | 17 ++--------------- .../Tools/RiaSummaryAddressAnalyzer.h | 11 +---------- .../Summary/RimSummaryPlotNameHelper.cpp | 4 ++-- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index 7cc02a9bbc..50d47e4eca 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -38,6 +38,7 @@ RiaSummaryAddressAnalyzer::RiaSummaryAddressAnalyzer() //-------------------------------------------------------------------------------------------------- /// +// //-------------------------------------------------------------------------------------------------- void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector& allAddresses ) { @@ -58,24 +59,10 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set auto&& addresses ) -{ - for ( const auto& adr : addresses ) - { - analyzeSingleAddress( adr.summaryAddressX() ); - analyzeSingleAddress( adr.summaryAddressY() ); - } -} -*/ - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiaSummaryAddressAnalyzer::appendAddresses_concept( const std::vector& addresses ) +void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector& addresses ) { m_onlyCrossPlotCurves = true; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index 083e202d37..8c72cf08cb 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -31,13 +31,6 @@ class RimSummaryCurveCollection; class QString; -// Define a concept for an input range of a specific type. This allows any container type to be used as input argument, like std::vector, -// std::set, ... -// Inspired by https://www.reedbeta.com/blog/ranges-compatible-containers/ -// -template -concept input_range_of = std::ranges::input_range && std::convertible_to, T>; - //================================================================================================== // //================================================================================================== @@ -48,9 +41,7 @@ class RiaSummaryAddressAnalyzer void appendAddresses( const std::set& allAddresses ); void appendAddresses( const std::vector& allAddresses ); - - // void appendAddresses_concept( input_range_of auto&& addresses ); - void appendAddresses_concept( const std::vector& addresses ); + void appendAddresses( const std::vector& addresses ); void clear(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp index 25a8076924..bff10ff29a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp @@ -50,7 +50,7 @@ void RimSummaryPlotNameHelper::clear() //-------------------------------------------------------------------------------------------------- void RimSummaryPlotNameHelper::appendAddresses( const std::vector& addresses ) { - m_analyzer->appendAddresses_concept( addresses ); + m_analyzer->appendAddresses( addresses ); extractPlotTitleSubStrings(); } @@ -119,7 +119,7 @@ bool RimSummaryPlotNameHelper::isPlotDisplayingSingleCurveType() const auto first = RimObjectiveFunctionTools::nativeQuantityName( strings[0] ); auto second = RimObjectiveFunctionTools::nativeQuantityName( strings[1] ); - // We have two quantities, one history and one not. + // We have two quantities, one summary vector and one corresponding history vector. if ( first == second ) return true; } From 0ab2261f586d359b03187d25547de00d17389273 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 08:22:48 +0200 Subject: [PATCH 24/28] Cleanup --- .../Tools/RiaSummaryAddressAnalyzer.cpp | 9 +++++++-- .../Tools/RiaSummaryAddressAnalyzer.h | 1 - .../FileInterface/RifEclipseSummaryAddress.cpp | 2 +- .../ProjectDataModel/RimPlotAxisProperties.cpp | 10 +--------- .../RimMultipleSummaryPlotNameHelper.cpp | 6 +++--- .../Summary/RimMultipleSummaryPlotNameHelper.h | 2 +- .../Summary/RimSummaryCurve.cpp | 1 - .../Summary/RimSummaryCurveAutoName.cpp | 2 +- .../Summary/RimSummaryNameHelper.h | 18 +++++++++--------- .../Summary/RimSummaryPlotNameHelper.cpp | 2 +- .../Summary/RimSummaryPlotNameHelper.h | 2 +- 11 files changed, 25 insertions(+), 30 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index 50d47e4eca..664fea76df 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -64,6 +64,9 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set& addresses ) { + // RiaSummaryCurveAddress can be used to represent cross plot curves. Set the flag m_onlyCrossPlotCurves to true, and this will be set + // to false in analyzeSingleAddress if we detect a time curve + m_onlyCrossPlotCurves = true; for ( const auto& adr : addresses ) @@ -139,10 +142,10 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const // We have a cross plot with only one curve std::string title; - for ( const auto& q : quantities() ) + for ( const auto& quantity : quantities() ) { if ( !title.empty() ) title += " | "; - title += q; + title += quantity; } return title; @@ -470,6 +473,8 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd if ( address.category() == SummaryCategory::SUMMARY_TIME ) { m_onlyCrossPlotCurves = false; + + // A time address has no other information than SummaryCategory::SUMMARY_TIME return; } diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index 8c72cf08cb..3b8d088389 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -21,7 +21,6 @@ #include "RiaSummaryCurveAddress.h" #include "RifEclipseSummaryAddress.h" -#include #include #include #include diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 6c512ce13e..1921aeefce 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -479,7 +479,7 @@ std::string RifEclipseSummaryAddress::generateStringFromAddresses( const std::ve } //-------------------------------------------------------------------------------------------------- -/// TODO: Move to RifEclipseSummaryAddressDefines +/// //-------------------------------------------------------------------------------------------------- bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryCategory category ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp index 3d4af51931..f58c2ae03f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -145,16 +145,8 @@ void RimPlotAxisProperties::enableRangeSettings( bool enable ) //-------------------------------------------------------------------------------------------------- void RimPlotAxisProperties::setNameForUnusedAxis() { - QString name = "Unused "; + QString name = "Unused " + m_plotAxis().text(); - /* - if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) - name += "Left"; - else if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) - name += "Right"; - */ - - name += m_plotAxis().text(); m_objectName = name; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp index 0196809103..81c11540f6 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp @@ -49,12 +49,12 @@ QString RimMultiSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleCurveType() const +bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleCurve() const { int plotCountWithSingleQuantity = 0; for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleCurveType() ) plotCountWithSingleQuantity++; + if ( nameHelper->isPlotDisplayingSingleCurve() ) plotCountWithSingleQuantity++; } return plotCountWithSingleQuantity == 1; @@ -160,7 +160,7 @@ std::string RimMultiSummaryPlotNameHelper::titleVectorName() const { for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleCurveType() ) return nameHelper->titleVectorName(); + if ( nameHelper->isPlotDisplayingSingleCurve() ) return nameHelper->titleVectorName(); } return ""; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h index 71d5c9cbb2..62039afd7c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h @@ -30,7 +30,7 @@ class RimMultiSummaryPlotNameHelper : public RimSummaryNameHelper QString plotTitle() const override; - bool isPlotDisplayingSingleCurveType() const override; + bool isPlotDisplayingSingleCurve() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index b0b7ac299b..a824d9310e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -1152,7 +1152,6 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, } else if ( changedField == &m_xPlotAxisProperties ) { - // TODO: Must find a concept to handle x axis properties updateXAxisInPlot( axisX() ); plot->updateAxes(); dataChanged.send(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp index a11585bddf..692809ff1d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp @@ -211,7 +211,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& if ( m_vectorName || m_longVectorName ) { - bool skipSubString = currentNameHelper && currentNameHelper->isPlotDisplayingSingleCurveType(); + bool skipSubString = currentNameHelper && currentNameHelper->isPlotDisplayingSingleCurve(); if ( !skipSubString ) { if ( m_longVectorName() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h index a3dafd9779..5759db3e6f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h @@ -38,15 +38,15 @@ class RimSummaryNameHelper QString aggregatedPlotTitle( const RimSummaryNameHelper& summaryMultiPlotNameHelper ) const; - virtual bool isPlotDisplayingSingleCurveType() const = 0; - virtual bool isWellNameInTitle() const = 0; - virtual bool isGroupNameInTitle() const = 0; - virtual bool isNetworkInTitle() const = 0; - virtual bool isRegionInTitle() const = 0; - virtual bool isCaseInTitle() const = 0; - virtual bool isBlockInTitle() const = 0; - virtual bool isSegmentInTitle() const = 0; - virtual bool isCompletionInTitle() const = 0; + virtual bool isPlotDisplayingSingleCurve() const = 0; + virtual bool isWellNameInTitle() const = 0; + virtual bool isGroupNameInTitle() const = 0; + virtual bool isNetworkInTitle() const = 0; + virtual bool isRegionInTitle() const = 0; + virtual bool isCaseInTitle() const = 0; + virtual bool isBlockInTitle() const = 0; + virtual bool isSegmentInTitle() const = 0; + virtual bool isCompletionInTitle() const = 0; virtual std::set vectorNames() const = 0; virtual QString caseName() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp index bff10ff29a..48e4aab140 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp @@ -102,7 +102,7 @@ QString RimSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimSummaryPlotNameHelper::isPlotDisplayingSingleCurveType() const +bool RimSummaryPlotNameHelper::isPlotDisplayingSingleCurve() const { if ( m_analyzer->quantities().size() == 2 && m_analyzer->onlyCrossPlotCurves() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h index 65de09e958..953614120a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h @@ -50,7 +50,7 @@ class RimSummaryPlotNameHelper : public RimSummaryNameHelper QString plotTitle() const override; - bool isPlotDisplayingSingleCurveType() const override; + bool isPlotDisplayingSingleCurve() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; From 2b28c4bb739602bf34938e9f1e408953ae87b0b8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 08:32:21 +0200 Subject: [PATCH 25/28] Mark obsolete --- .../RimMainPlotCollection.cpp | 34 +++++++++---------- .../ProjectDataModel/RimMainPlotCollection.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp index e3999857f8..f66ceac04a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp @@ -98,8 +98,8 @@ RimMainPlotCollection::RimMainPlotCollection() CAF_PDM_InitFieldNoDefault( &m_correlationPlotCollection, "CorrelationPlotCollection", "Correlation Plots" ); m_correlationPlotCollection.uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_summaryCrossPlotCollection, "SummaryCrossPlotCollection", "Summary Cross Plots" ); - m_summaryCrossPlotCollection.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_summaryCrossPlotCollection_OBSOLETE, "SummaryCrossPlotCollection", "Summary Cross Plots" ); + m_summaryCrossPlotCollection_OBSOLETE.uiCapability()->setUiTreeHidden( true ); CAF_PDM_InitFieldNoDefault( &m_summaryTableCollection, "SummaryTableCollection", "Summary Tables" ); m_summaryTableCollection.uiCapability()->setUiTreeHidden( true ); @@ -129,20 +129,20 @@ RimMainPlotCollection::RimMainPlotCollection() m_ensembleFractureStatisticsPlotCollection.uiCapability()->setUiTreeHidden( true ); #endif - m_wellLogPlotCollection = new RimWellLogPlotCollection(); - m_rftPlotCollection = new RimRftPlotCollection(); - m_pltPlotCollection = new RimPltPlotCollection(); - m_summaryMultiPlotCollection = new RimSummaryMultiPlotCollection(); - m_summaryCrossPlotCollection = new RimSummaryCrossPlotCollection(); - m_summaryTableCollection = new RimSummaryTableCollection(); - m_flowPlotCollection = new RimFlowPlotCollection(); - m_gridCrossPlotCollection = new RimGridCrossPlotCollection; - m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection; - m_multiPlotCollection = new RimMultiPlotCollection; - m_analysisPlotCollection = new RimAnalysisPlotCollection; - m_correlationPlotCollection = new RimCorrelationPlotCollection; - m_stimPlanModelPlotCollection = new RimStimPlanModelPlotCollection; - m_vfpPlotCollection = new RimVfpPlotCollection(); + m_wellLogPlotCollection = new RimWellLogPlotCollection(); + m_rftPlotCollection = new RimRftPlotCollection(); + m_pltPlotCollection = new RimPltPlotCollection(); + m_summaryMultiPlotCollection = new RimSummaryMultiPlotCollection(); + m_summaryCrossPlotCollection_OBSOLETE = new RimSummaryCrossPlotCollection(); + m_summaryTableCollection = new RimSummaryTableCollection(); + m_flowPlotCollection = new RimFlowPlotCollection(); + m_gridCrossPlotCollection = new RimGridCrossPlotCollection; + m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection; + m_multiPlotCollection = new RimMultiPlotCollection; + m_analysisPlotCollection = new RimAnalysisPlotCollection; + m_correlationPlotCollection = new RimCorrelationPlotCollection; + m_stimPlanModelPlotCollection = new RimStimPlanModelPlotCollection; + m_vfpPlotCollection = new RimVfpPlotCollection(); #ifdef USE_QTCHARTS m_gridStatisticsPlotCollection = new RimGridStatisticsPlotCollection; m_ensembleFractureStatisticsPlotCollection = new RimEnsembleFractureStatisticsPlotCollection; @@ -242,7 +242,7 @@ RimSummaryMultiPlotCollection* RimMainPlotCollection::summaryMultiPlotCollection //-------------------------------------------------------------------------------------------------- RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection() const { - return m_summaryCrossPlotCollection(); + return m_summaryCrossPlotCollection_OBSOLETE(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h index 3dc02afb02..1ec6bccecd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h @@ -112,7 +112,7 @@ class RimMainPlotCollection : public caf::PdmObject caf::PdmChildField m_rftPlotCollection; caf::PdmChildField m_pltPlotCollection; caf::PdmChildField m_summaryMultiPlotCollection; - caf::PdmChildField m_summaryCrossPlotCollection; + caf::PdmChildField m_summaryCrossPlotCollection_OBSOLETE; caf::PdmChildField m_summaryTableCollection; caf::PdmChildField m_analysisPlotCollection; caf::PdmChildField m_correlationPlotCollection; From 67c5cc26b6a07df8b728822e5a5d537ec31f068a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 08:56:39 +0200 Subject: [PATCH 26/28] Cleanup --- .../Summary/RimSummaryCurve.cpp | 24 +++++++++---------- .../Summary/RimSummaryCurve.h | 14 +++++------ .../Summary/RimSummaryCurveAutoName.h | 3 +-- .../Summary/RimSummaryPlot.cpp | 22 +++++++---------- .../ProjectDataModel/Summary/RimSummaryPlot.h | 4 ++-- .../UserInterface/RiuQwtPlotWidget.cpp | 6 ----- 6 files changed, 29 insertions(+), 44 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index a824d9310e..26e506258a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -59,8 +59,6 @@ #include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiTreeOrdering.h" -#pragma optimize( "", off ) - CAF_PDM_SOURCE_INIT( RimSummaryCurve, "SummaryCurve" ); //-------------------------------------------------------------------------------------------------- @@ -94,7 +92,7 @@ RimSummaryCurve::RimSummaryCurve() // X Values - CAF_PDM_InitField( &m_axisType, + CAF_PDM_InitField( &m_xAxisType, "HorizontalAxisType", caf::AppEnum( RiaDefines::HorizontalAxisType::TIME ), "Axis Type" ); @@ -157,7 +155,7 @@ RimSummaryCurve::~RimSummaryCurve() RiaSummaryCurveDefinition RimSummaryCurve::curveDefinition() const { RiaSummaryCurveDefinition curveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); - if ( m_axisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + if ( m_xAxisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { curveDefinition.setSummaryCaseX( summaryCaseX() ); curveDefinition.setSummaryAddressX( summaryAddressX() ); @@ -205,7 +203,7 @@ RimSummaryCase* RimSummaryCurve::summaryCaseY() const //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const { - if ( m_axisType == RiaDefines::HorizontalAxisType::TIME ) return RifEclipseSummaryAddress::timeAddress(); + if ( m_xAxisType == RiaDefines::HorizontalAxisType::TIME ) return RifEclipseSummaryAddress::timeAddress(); return m_xValuesSummaryAddress->address(); } @@ -440,7 +438,7 @@ void RimSummaryCurve::setOverrideCurveDataY( const std::vector& dateTime //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setAxisTypeX( RiaDefines::HorizontalAxisType axisType ) { - m_axisType = axisType; + m_xAxisType = axisType; } //-------------------------------------------------------------------------------------------------- @@ -448,7 +446,7 @@ void RimSummaryCurve::setAxisTypeX( RiaDefines::HorizontalAxisType axisType ) //-------------------------------------------------------------------------------------------------- RiaDefines::HorizontalAxisType RimSummaryCurve::axisTypeX() const { - return m_axisType(); + return m_xAxisType(); } //-------------------------------------------------------------------------------------------------- @@ -643,7 +641,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) bool shouldPopulateViewWithEmptyData = false; - if ( m_axisType == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + if ( m_xAxisType == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { auto curveValuesX = valuesX(); auto curveTimeStepsX = timeStepsX(); @@ -884,7 +882,7 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { RimPlotCurve::updateFieldUiState(); - bool isSummaryXHidden = ( m_axisType() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + bool isSummaryXHidden = ( m_xAxisType() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); m_xValuesSummaryCase.uiCapability()->setUiHidden( isSummaryXHidden ); m_xValuesSummaryAddress.uiCapability()->setUiHidden( isSummaryXHidden ); @@ -905,7 +903,7 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X Axis" ); - curveDataGroup->add( &m_axisType, { true, 3, 1 } ); + curveDataGroup->add( &m_xAxisType, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } ); @@ -1118,13 +1116,13 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, { loadAndUpdate = true; } - else if ( &m_axisType == changedField ) + else if ( &m_xAxisType == changedField ) { - if ( m_axisType() == RiaDefines::HorizontalAxisType::TIME ) + if ( m_xAxisType() == RiaDefines::HorizontalAxisType::TIME ) { m_xPlotAxisProperties = plot->timeAxisProperties(); } - else if ( m_axisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + else if ( m_xAxisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { if ( !m_xValuesSummaryCase() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index 16fee2d275..aaa9ed95b9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -139,22 +139,20 @@ class RimSummaryCurve : public RimStackablePlotCurve private: // Y values - caf::PdmPtrField m_yValuesSummaryCase; - caf::PdmChildField m_yValuesSummaryAddress; - caf::PdmField m_yValuesSummaryAddressUiField; - caf::PdmField m_yPushButtonSelectSummaryAddress; - + caf::PdmPtrField m_yValuesSummaryCase; + caf::PdmChildField m_yValuesSummaryAddress; + caf::PdmField m_yValuesSummaryAddressUiField; + caf::PdmField m_yPushButtonSelectSummaryAddress; caf::PdmPtrField m_yPlotAxisProperties; caf::PdmField m_yValuesResampling; // X values - caf::PdmField> m_axisType; + caf::PdmField> m_xAxisType; caf::PdmPtrField m_xValuesSummaryCase; caf::PdmChildField m_xValuesSummaryAddress; caf::PdmField m_xValuesSummaryAddressUiField; caf::PdmField m_xPushButtonSelectSummaryAddress; - - caf::PdmPtrField m_xPlotAxisProperties; + caf::PdmPtrField m_xPlotAxisProperties; // Other fields caf::PdmField m_isEnsembleCurve; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h index ca86409300..65bb77609e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h @@ -38,11 +38,10 @@ class RimSummaryCurveAutoName : public caf::PdmObject void applySettings( const RimSummaryCurveAutoName& other ); private: - // friend class RimSummaryCurve; - QString curveNameY( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; + QString curveNameX( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index b87f0d3b49..2dc12e62aa 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -101,8 +101,6 @@ #include #include -#pragma optimize( "", off ) - CAF_PDM_SOURCE_INIT( RimSummaryPlot, "SummaryPlot" ); struct RimSummaryPlot::CurveInfo @@ -2289,7 +2287,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryCaseDrop( RimSummaryCase* const auto& [addrY, addrX] = addressPair; - curves.push_back( addNewCurveY( addrY, summaryCase, addrX, summaryCase ) ); + curves.push_back( addNewCurve( addrY, summaryCase, addrX, summaryCase ) ); } return { .curveCount = static_cast( curves.size() ), .curves = curves, .curveSets = {} }; @@ -2344,8 +2342,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { for ( auto& curve : summaryCurves() ) { - RiaSummaryCurveDefinition curveDef = curve->curveDefinition(); - sourceCurveDefs.push_back( curveDef ); + sourceCurveDefs.push_back( curve->curveDefinition() ); } if ( ensembleCase ) @@ -2427,7 +2424,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar if ( curveDef.summaryCase()->summaryReader() && curveDef.summaryCase()->summaryReader()->hasAddress( curveDef.summaryAddress() ) ) { auto curve = - addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase(), curveDef.summaryAddressX(), curveDef.summaryCaseX() ); + addNewCurve( curveDef.summaryAddress(), curveDef.summaryCase(), curveDef.summaryAddressX(), curveDef.summaryCaseX() ); curves.push_back( curve ); if ( curveDef.summaryCaseX() ) { @@ -2520,7 +2517,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd if ( !skipAddress ) { - curves.push_back( addNewCurveY( droppedAddress, summaryCase, RifEclipseSummaryAddress::timeAddress(), nullptr ) ); + curves.push_back( addNewCurve( droppedAddress, summaryCase, RifEclipseSummaryAddress::timeAddress(), nullptr ) ); newCurves++; } } @@ -2583,10 +2580,10 @@ void RimSummaryPlot::handleDroppedObjects( const std::vectorsetSummaryCaseY( summaryCase ); @@ -3108,8 +3105,7 @@ std::vector RimSummaryPlot::plotYAxes() const for ( const auto& ap : m_axisPropertiesArray ) { auto plotAxisProp = dynamic_cast( ap.p() ); - if ( plotAxisProp && ( plotAxisProp->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - plotAxisProp->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) ) + if ( plotAxisProp && plotAxisProp->plotAxis().isVertical() ) { axisProps.push_back( plotAxisProp ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index b84ed86f04..5806670fb7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -206,7 +206,6 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const; RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name ); - void ensureRequiredAxisObjectsForCurves(); void findOrAssignPlotAxisX( RimSummaryCurve* curve ); std::vector visibleCurvesForLegend() override; @@ -297,11 +296,12 @@ private slots: void timeAxisSettingsChanged( const caf::SignalEmitter* emitter ); void timeAxisSettingsChangedReloadRequired( const caf::SignalEmitter* emitter ); + void ensureRequiredAxisObjectsForCurves(); void assignPlotAxis( RimSummaryCurve* curve ); void assignYPlotAxis( RimSummaryCurve* curve ); void assignXPlotAxis( RimSummaryCurve* curve ); - RimSummaryCurve* addNewCurveY( const RifEclipseSummaryAddress& address, + RimSummaryCurve* addNewCurve( const RifEclipseSummaryAddress& address, RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& addressX, RimSummaryCase* summaryCaseX ); diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index ac760f37d4..d80a1e58f9 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -73,8 +73,6 @@ #include #include -#pragma optimize( "", off ) - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1282,10 +1280,6 @@ void RiuQwtPlotWidget::ensureAxisIsCreated( RiuPlotAxis axis ) //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::enableAxis( RiuPlotAxis axis, bool isEnabled ) { - auto axisLocation = axis.axis(); - - bool isBottom = ( axisLocation == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); - ensureAxisIsCreated( axis ); m_plot->setAxisVisible( toQwtPlotAxis( axis ), isEnabled ); From 0a8ab620368b223956c1dee35e425f8a14d0099d Mon Sep 17 00:00:00 2001 From: magnesj Date: Wed, 20 Sep 2023 06:57:34 +0000 Subject: [PATCH 27/28] Fixes by clang-format --- .../ProjectDataModel/Summary/RimSummaryPlot.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index 5806670fb7..007e127362 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -302,9 +302,9 @@ private slots: void assignXPlotAxis( RimSummaryCurve* curve ); RimSummaryCurve* addNewCurve( const RifEclipseSummaryAddress& address, - RimSummaryCase* summaryCase, - const RifEclipseSummaryAddress& addressX, - RimSummaryCase* summaryCaseX ); + RimSummaryCase* summaryCase, + const RifEclipseSummaryAddress& addressX, + RimSummaryCase* summaryCaseX ); RimEnsembleCurveSet* addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble ); void updateStackedCurveData(); From 055eaa9e844dae3406e707760bf23aae88f23b85 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 09:14:36 +0200 Subject: [PATCH 28/28] Improve curve name for cross plot curves --- .../Summary/RimSummaryCrossPlot.cpp | 8 ------- .../Summary/RimSummaryCrossPlot.h | 2 -- .../Summary/RimSummaryCurve.cpp | 2 ++ .../Summary/RimSummaryCurveAutoName.cpp | 21 ++++++++++++++++--- .../Summary/RimSummaryPlot.cpp | 1 + 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp index 7e83ee25cf..64af8dfc8d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp @@ -31,11 +31,3 @@ RimSummaryCrossPlot::RimSummaryCrossPlot() { CAF_PDM_InitObject( "Summary Cross Plot", ":/SummaryXPlotLight16x16.png" ); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// RimSummaryPlotSourceStepping* RimSummaryCrossPlot::sourceSteppingObjectForKeyEventHandling() const -// { -// return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); -// } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h index 02bddf6a15..3f1f456538 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h @@ -30,6 +30,4 @@ class RimSummaryCrossPlot : public RimSummaryPlot public: RimSummaryCrossPlot(); - - // RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const override; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 26e506258a..127a082df7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -1132,6 +1132,8 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, plot->findOrAssignPlotAxisX( this ); } + plot->updateAxes(); + plot->updatePlotTitle(); loadAndUpdate = true; } else if ( &m_showCurve == changedField ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp index 692809ff1d..efd0dd1d30 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp @@ -74,10 +74,25 @@ QString RimSummaryCurveAutoName::curveName( const RiaSummaryCurveAddress& summar { QString name; - name = curveNameY( summaryCurveAddress.summaryAddressY(), currentNameHelper, plotNameHelper ); - if ( name.isEmpty() ) { - name = curveNameY( summaryCurveAddress.summaryAddressY(), nullptr, nullptr ); + auto nameForY = curveNameY( summaryCurveAddress.summaryAddressY(), currentNameHelper, plotNameHelper ); + if ( nameForY.isEmpty() ) + { + nameForY = curveNameY( summaryCurveAddress.summaryAddressY(), nullptr, nullptr ); + } + + name += nameForY; + } + + if ( summaryCurveAddress.summaryAddressX().category() != SummaryCategory::SUMMARY_TIME ) + { + auto nameForX = curveNameX( summaryCurveAddress.summaryAddressX(), currentNameHelper, plotNameHelper ); + if ( nameForX.isEmpty() ) + { + nameForX = curveNameX( summaryCurveAddress.summaryAddressX(), nullptr, nullptr ); + } + + if ( nameForX != name ) name += " | " + nameForX; } return name; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 2dc12e62aa..8ebb95e088 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2570,6 +2570,7 @@ void RimSummaryPlot::handleDroppedObjects( const std::vector