#3082 Statistics. Further fixes regarding P10 and P90 labels

This commit is contained in:
Bjørn Erik Jensen 2018-06-26 11:29:05 +02:00
parent 155329b4fc
commit b0355471b4
4 changed files with 29 additions and 6 deletions

View File

@ -25,9 +25,25 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QString RiaStatisticsTools::percentileToPValueText(const QString& percentile)
const QString RiaStatisticsTools::replacePercentileByPValueText(const QString& percentile)
{
if (percentile == ENSEMBLE_STAT_P10_QUANTITY_NAME) return "P90";
if (percentile == ENSEMBLE_STAT_P90_QUANTITY_NAME) return "P10";
return percentile;
QString result = percentile;
if (result == ENSEMBLE_STAT_P10_QUANTITY_NAME)
{
result = ENSEMBLE_STAT_P90_QUANTITY_NAME;
}
else if (result == ENSEMBLE_STAT_P90_QUANTITY_NAME)
{
result = ENSEMBLE_STAT_P10_QUANTITY_NAME;
}
else if (percentile.contains(QString("%1:").arg(ENSEMBLE_STAT_P10_QUANTITY_NAME)))
{
result.replace(ENSEMBLE_STAT_P10_QUANTITY_NAME, ENSEMBLE_STAT_P90_QUANTITY_NAME);
}
else if (percentile.contains(QString("%1:").arg(ENSEMBLE_STAT_P90_QUANTITY_NAME)))
{
result.replace(ENSEMBLE_STAT_P90_QUANTITY_NAME, ENSEMBLE_STAT_P10_QUANTITY_NAME);
}
return result;
}

View File

@ -32,5 +32,5 @@
class RiaStatisticsTools
{
public:
static const QString percentileToPValueText(const QString& percentile);
static const QString replacePercentileByPValueText(const QString& percentile);
};

View File

@ -992,7 +992,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves(bool calculate = true)
curve->setColor(m_statistics->color());
curve->setSymbol(RimPlotCurve::SYMBOL_ELLIPSE);
curve->setSymbolSkipDinstance(50);
curve->setSymbolLabel(RiaStatisticsTools::percentileToPValueText(
curve->setSymbolLabel(RiaStatisticsTools::replacePercentileByPValueText(
QString::fromStdString(address.ensembleStatisticsQuantityName())));
curve->setLineStyle(RimPlotCurve::STYLE_SOLID);
curve->setSummaryCaseY(m_ensembleStatCase.get());

View File

@ -18,6 +18,8 @@
#include "RimSummaryCurveAutoName.h"
#include "RiaStatisticsTools.h"
#include "RifEclipseSummaryAddress.h"
#include "RimEnsembleCurveSet.h"
@ -73,6 +75,11 @@ QString RimSummaryCurveAutoName::curveNameY(const RifEclipseSummaryAddress& summ
{
text += summaryAddress.quantityName();
if (summaryAddress.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS)
{
text = RiaStatisticsTools::replacePercentileByPValueText(QString::fromStdString(text)).toStdString();
}
if (m_unit && summaryCurve && !summaryCurve->unitNameY().empty())
{
text += "[" + summaryCurve->unitNameY() + "]";