mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
2108 summary plot. Display short name in plot for calculated curves
This commit is contained in:
parent
eb6b0997c8
commit
83a272296c
@ -353,6 +353,18 @@ void RicSummaryCurveCreator::updatePreviewCurvesFromCurveDefinitions(const std::
|
||||
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||
m_previewPlot->addCurveNoUpdate(curve);
|
||||
curveLookCalc.setupCurveLook(curve);
|
||||
|
||||
if (curveDef.summaryAddress().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
|
||||
{
|
||||
// Use short version of calculated curves name
|
||||
std::string fullName = curveDef.summaryAddress().quantityName();
|
||||
size_t firstSpace = fullName.find_first_of(' ');
|
||||
QString shortName = firstSpace != std::string::npos ?
|
||||
QString::fromStdString(fullName.substr(0, firstSpace)) :
|
||||
QString::fromStdString(fullName);
|
||||
|
||||
curve->setCustomCurveName(shortName);
|
||||
}
|
||||
}
|
||||
|
||||
m_previewPlot->loadDataAndUpdate();
|
||||
|
@ -552,6 +552,15 @@ void RimPlotCurve::setZOrder(double z)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setCustomCurveName(const QString& customName)
|
||||
{
|
||||
m_isUsingAutoName = false;
|
||||
m_customCurveName = customName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -99,6 +99,7 @@ public:
|
||||
void showLegend(bool show);
|
||||
|
||||
void setZOrder(double z);
|
||||
void setCustomCurveName(const QString& customName);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -199,7 +199,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->summaryAddressX().quantityName());
|
||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->curveName().toStdString());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -208,7 +208,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->summaryAddressY().quantityName());
|
||||
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->curveName().toStdString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user