Skip to content

Commit

Permalink
Append vector name if multiple cases are present
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Nov 9, 2023
1 parent eea56e4 commit 9af9aa7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,17 @@ std::string RimMultiSummaryPlotNameHelper::titleCompletion() const

return "";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimMultiSummaryPlotNameHelper::numberOfCases() const
{
size_t caseCount = 0;
for ( auto nameHelper : m_nameHelpers )
{
caseCount += nameHelper->numberOfCases();
}

return caseCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class RimMultiSummaryPlotNameHelper : public RimSummaryNameHelper
std::string titleSegment() const override;
std::string titleCompletion() const override;

size_t numberOfCases() const override;

private:
std::vector<const RimSummaryNameHelper*> m_nameHelpers;
};
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,18 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress&

if ( m_caseName && !skipSubString )
{
const bool isTextEmptyBeforeCaseName = text.empty();

if ( !text.empty() ) text += ", ";
text += caseName;

if ( isTextEmptyBeforeCaseName && currentNameHelper && currentNameHelper->numberOfCases() > 1 &&
currentNameHelper->vectorNames().size() > 1 )
{
// Add vector name to the case name if there are multiple cases and multiple vectors

text += ":" + summaryAddress.vectorName();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ class RimSummaryNameHelper
virtual std::string titleBlock() const = 0;
virtual std::string titleSegment() const = 0;
virtual std::string titleCompletion() const = 0;

virtual size_t numberOfCases() const = 0;
};
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ std::string RimSummaryPlotNameHelper::titleCompletion() const
return m_titleCompletion;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimSummaryPlotNameHelper::numberOfCases() const
{
return m_summaryCases.size() + m_ensembleCases.size();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class RimSummaryPlotNameHelper : public RimSummaryNameHelper
std::string titleSegment() const override;
std::string titleCompletion() const override;

size_t numberOfCases() const override;

private:
void clearTitleSubStrings();
void extractPlotTitleSubStrings();
Expand Down

0 comments on commit 9af9aa7

Please sign in to comment.