mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Bugfix: show y axis text even if ensemble and summary curves are turned off.
This commit is contained in:
committed by
Magne Sjaastad
parent
451a049e0a
commit
7f3df954ad
@@ -18,7 +18,9 @@
|
||||
|
||||
#include "RifEnsembleStatisticsReader.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleStatisticsCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
static const std::vector<time_t> EMPTY_TIME_STEPS_VECTOR;
|
||||
|
||||
@@ -80,7 +82,23 @@ bool RifEnsembleStatisticsReader::values( const RifEclipseSummaryAddress& result
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEnsembleStatisticsReader::unitName( const RifEclipseSummaryAddress& resultAddress ) const
|
||||
{
|
||||
return "";
|
||||
std::string retval;
|
||||
|
||||
// The stat case does not have a unit set, so pick up the unit from one of the input cases, if possible
|
||||
auto cases = m_ensembleStatCase->curveSet()->summaryCaseCollection()->allSummaryCases();
|
||||
if ( cases.size() > 0 )
|
||||
{
|
||||
// get rid of the stats part of the quantity name
|
||||
QString qName = QString::fromStdString( resultAddress.quantityName() );
|
||||
std::string orgQName = qName.split( ":" )[1].toStdString();
|
||||
|
||||
RifEclipseSummaryAddress address = RifEclipseSummaryAddress( resultAddress );
|
||||
address.setQuantityName( orgQName );
|
||||
|
||||
retval = cases[0]->summaryReader()->unitName( address );
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -184,8 +184,12 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
auto addToUnitToQuantityMap =[&]( const std::string& unitText,
|
||||
const RifEclipseSummaryAddress& sumAddress )
|
||||
{
|
||||
// remove any stats prefix from the quantity name
|
||||
size_t cutPos = sumAddress.quantityName().find(':');
|
||||
if (cutPos == std::string::npos) cutPos = -1;
|
||||
|
||||
std::string quantityNameForDisplay;
|
||||
const std::string& quantityName = sumAddress.quantityName();
|
||||
const std::string& quantityName = sumAddress.quantityName().substr(cutPos+1);
|
||||
|
||||
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
@@ -225,11 +229,7 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
RifEclipseSummaryAddress sumAddress;
|
||||
std::string unitText;
|
||||
|
||||
if ( rimCurve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||
if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||
{
|
||||
sumAddress = rimCurve->summaryAddressX();
|
||||
unitText = rimCurve->unitNameX();
|
||||
|
||||
Reference in New Issue
Block a user