Improve auto name for curves and plots

- use vector name as plot title if a vector and the associated history vector is present
- use short vector name as fallback for curve name
- use Plot N as fallback name for sub plot
This commit is contained in:
Magne Sjaastad 2022-06-01 14:00:35 +02:00
parent 36dab01cf5
commit 5e53f5687d
3 changed files with 18 additions and 4 deletions

View File

@ -93,6 +93,11 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
return *quantities().begin();
}
if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 )
{
return *quantityNamesWithHistory().begin();
}
return {};
}

View File

@ -243,6 +243,8 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress&
}
}
if ( text.empty() ) text = summaryAddress.vectorName();
return QString::fromStdString( text );
}

View File

@ -563,6 +563,17 @@ void RimSummaryPlot::updatePlotTitle()
m_description = m_nameHelperAllCurves->plotTitle();
}
if ( m_description().isEmpty() )
{
RimMultiPlot* plotWindow = nullptr;
firstAncestorOrThisOfType( plotWindow );
auto index = plotWindow->plotIndex( this );
QString title = QString( "Sub Plot %1" ).arg( index + 1 );
m_fallbackPlotName = title;
}
updateCurveNames();
updateMdiWindowTitle();
@ -2529,10 +2540,6 @@ void RimSummaryPlot::updateCurveNames()
{
curveSet->updateEnsembleLegendItem();
}
RimSummaryPlotNameHelper nameHelper;
updateNameHelperWithCurveData( &nameHelper );
m_fallbackPlotName = nameHelper.plotTitle();
}
//--------------------------------------------------------------------------------------------------