From 0ab2261f586d359b03187d25547de00d17389273 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Sep 2023 08:22:48 +0200 Subject: [PATCH] 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;