2108 summary plot. Display short name in plot for calculated curves

This commit is contained in:
Bjørn Erik Jensen 2017-12-01 15:14:47 +01:00
parent eb6b0997c8
commit 83a272296c
4 changed files with 24 additions and 2 deletions

View File

@ -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();

View File

@ -552,6 +552,15 @@ void RimPlotCurve::setZOrder(double z)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setCustomCurveName(const QString& customName)
{
m_isUsingAutoName = false;
m_customCurveName = customName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -99,6 +99,7 @@ public:
void showLegend(bool show);
void setZOrder(double z);
void setCustomCurveName(const QString& customName);
protected:

View File

@ -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());
}
}
}