mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -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());
|
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||||
m_previewPlot->addCurveNoUpdate(curve);
|
m_previewPlot->addCurveNoUpdate(curve);
|
||||||
curveLookCalc.setupCurveLook(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();
|
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 showLegend(bool show);
|
||||||
|
|
||||||
void setZOrder(double z);
|
void setZOrder(double z);
|
||||||
|
void setCustomCurveName(const QString& customName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
|||||||
{
|
{
|
||||||
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
||||||
{
|
{
|
||||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->summaryAddressX().quantityName());
|
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->curveName().toStdString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -208,7 +208,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
|||||||
{
|
{
|
||||||
if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
|
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