mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3082 Statistics. Further fixes regarding P10 and P90 labels
This commit is contained in:
parent
155329b4fc
commit
b0355471b4
@ -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;
|
||||
}
|
||||
|
@ -32,5 +32,5 @@
|
||||
class RiaStatisticsTools
|
||||
{
|
||||
public:
|
||||
static const QString percentileToPValueText(const QString& percentile);
|
||||
static const QString replacePercentileByPValueText(const QString& percentile);
|
||||
};
|
||||
|
@ -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());
|
||||
|
@ -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() + "]";
|
||||
|
Loading…
Reference in New Issue
Block a user