Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Sep 20, 2023
1 parent cf51a4b commit 0ab2261
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set<RifEclipseSummar
//--------------------------------------------------------------------------------------------------
void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector<RiaSummaryCurveAddress>& 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 )
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "RiaSummaryCurveAddress.h"
#include "RifEclipseSummaryAddress.h"

#include <concepts>
#include <set>
#include <string>
#include <tuple>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ std::string RifEclipseSummaryAddress::generateStringFromAddresses( const std::ve
}

//--------------------------------------------------------------------------------------------------
/// TODO: Move to RifEclipseSummaryAddressDefines
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryCategory category )
{
Expand Down
10 changes: 1 addition & 9 deletions ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> vectorNames() const = 0;
virtual QString caseName() const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ab2261

Please sign in to comment.