2016-10-10 04:05:45 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
2019-04-09 02:50:51 -05:00
|
|
|
//
|
2016-10-10 04:05:45 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-04-09 02:50:51 -05:00
|
|
|
//
|
2016-10-10 04:05:45 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-04-09 02:50:51 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-10-10 04:05:45 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2019-11-29 07:00:22 -06:00
|
|
|
#include "RimSummaryPlotAxisFormatter.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2017-06-13 08:41:52 -05:00
|
|
|
#include "RiaDefines.h"
|
2022-01-17 06:14:21 -06:00
|
|
|
#include "RiaNumberFormat.h"
|
2021-02-17 03:18:21 -06:00
|
|
|
#include "RiaSummaryCurveDefinition.h"
|
2019-04-09 02:50:51 -05:00
|
|
|
|
2020-02-28 07:51:21 -06:00
|
|
|
#include "RifSummaryReaderInterface.h"
|
|
|
|
|
2017-08-17 07:24:49 -05:00
|
|
|
#include "RimAsciiDataCurve.h"
|
2019-04-09 02:50:51 -05:00
|
|
|
#include "RimPlotAxisProperties.h"
|
2020-02-28 07:51:21 -06:00
|
|
|
#include "RimSummaryCase.h"
|
|
|
|
#include "RimSummaryCaseCollection.h"
|
2019-04-09 02:50:51 -05:00
|
|
|
#include "RimSummaryCurve.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
#include "RiuQtChartsPlotWidget.h"
|
|
|
|
#include "RiuQwtPlotTools.h"
|
2019-10-18 07:28:02 -05:00
|
|
|
#include "RiuSummaryQuantityNameInfoProvider.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
#include "RiuSummaryQwtPlot.h"
|
|
|
|
|
2019-12-17 12:29:51 -06:00
|
|
|
#include "qwt_date_scale_engine.h"
|
2022-01-17 06:14:21 -06:00
|
|
|
#include "qwt_plot.h"
|
2016-10-10 04:05:45 -05:00
|
|
|
#include "qwt_plot_curve.h"
|
|
|
|
#include "qwt_scale_draw.h"
|
|
|
|
|
2019-04-09 02:50:51 -05:00
|
|
|
#include <cmath>
|
2016-10-10 04:05:45 -05:00
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-12 05:12:39 -05:00
|
|
|
// e format as [-]9.9e[+|-]999
|
|
|
|
// E format as[-]9.9E[+| -]999
|
|
|
|
// f format as[-]9.9
|
|
|
|
// g use e or f format, whichever is the most concise
|
|
|
|
// G use E or f format, whichever is the most concise
|
2016-10-10 04:05:45 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-26 04:37:58 -05:00
|
|
|
class SummaryScaleDraw : public QwtScaleDraw
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
SummaryScaleDraw( double scaleFactor,
|
|
|
|
int numberOfDecimals,
|
|
|
|
RimPlotAxisProperties::NumberFormatType numberFormat = RimPlotAxisProperties::NUMBER_FORMAT_AUTO )
|
2017-12-11 04:37:31 -06:00
|
|
|
{
|
2019-04-09 02:50:51 -05:00
|
|
|
m_scaleFactor = scaleFactor;
|
2017-12-11 04:37:31 -06:00
|
|
|
m_numberOfDecimals = numberOfDecimals;
|
2019-07-26 04:37:58 -05:00
|
|
|
m_numberFormat = numberFormat;
|
2017-12-11 04:37:31 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QwtText label( double value ) const override
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( qFuzzyCompare( scaledValue( value ) + 1.0, 1.0 ) ) value = 0.0;
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return QString::number( scaledValue( value ), numberFormat(), m_numberOfDecimals );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2019-07-26 04:37:58 -05:00
|
|
|
char numberFormat() const
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
switch ( m_numberFormat )
|
2019-07-26 04:37:58 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
case RimPlotAxisProperties::NUMBER_FORMAT_AUTO:
|
|
|
|
return 'g';
|
|
|
|
case RimPlotAxisProperties::NUMBER_FORMAT_DECIMAL:
|
|
|
|
return 'f';
|
|
|
|
case RimPlotAxisProperties::NUMBER_FORMAT_SCIENTIFIC:
|
|
|
|
return 'e';
|
|
|
|
default:
|
|
|
|
return 'g';
|
2019-07-26 04:37:58 -05:00
|
|
|
}
|
2017-12-11 04:37:31 -06:00
|
|
|
}
|
|
|
|
|
2020-02-12 04:13:38 -06:00
|
|
|
double scaledValue( double value ) const { return value / m_scaleFactor; }
|
2017-12-11 04:37:31 -06:00
|
|
|
|
2019-07-26 04:37:58 -05:00
|
|
|
private:
|
|
|
|
double m_scaleFactor;
|
|
|
|
int m_numberOfDecimals;
|
|
|
|
RimPlotAxisProperties::NumberFormatType m_numberFormat;
|
2016-10-10 04:05:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-04-09 02:50:51 -05:00
|
|
|
///
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-28 07:51:21 -06:00
|
|
|
RimSummaryPlotAxisFormatter::RimSummaryPlotAxisFormatter( RimPlotAxisProperties* axisProperties,
|
|
|
|
const std::vector<RimSummaryCurve*>& summaryCurves,
|
|
|
|
const std::vector<RiaSummaryCurveDefinition>& curveDefinitions,
|
|
|
|
const std::vector<RimAsciiDataCurve*>& asciiCurves,
|
2019-11-29 07:00:22 -06:00
|
|
|
const std::set<QString>& timeHistoryCurveQuantities )
|
2019-09-06 03:40:57 -05:00
|
|
|
: m_axisProperties( axisProperties )
|
|
|
|
, m_summaryCurves( summaryCurves )
|
2020-02-28 07:51:21 -06:00
|
|
|
, m_curveDefinitions( curveDefinitions )
|
2019-09-06 03:40:57 -05:00
|
|
|
, m_asciiDataCurves( asciiCurves )
|
|
|
|
, m_timeHistoryCurveQuantities( timeHistoryCurveQuantities )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-04-09 02:50:51 -05:00
|
|
|
///
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-01-17 06:14:21 -06:00
|
|
|
void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plotWidget )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
if ( !plotWidget ) return;
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
RiuPlotAxis axis = m_axisProperties->plotAxisType();
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
|
|
|
QString axisTitle = m_axisProperties->customTitle;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_axisProperties->useAutoTitle() ) axisTitle = autoAxisTitle();
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2019-10-31 09:37:30 -05:00
|
|
|
Qt::AlignmentFlag titleAlignment = Qt::AlignCenter;
|
|
|
|
if ( m_axisProperties->titlePosition() == RimPlotAxisPropertiesInterface::AXIS_TITLE_END )
|
2016-11-18 08:03:35 -06:00
|
|
|
{
|
2019-10-31 09:37:30 -05:00
|
|
|
titleAlignment = Qt::AlignRight;
|
2016-11-18 08:03:35 -06:00
|
|
|
}
|
2022-01-17 06:14:21 -06:00
|
|
|
plotWidget->setAxisTitleText( axis, axisTitle );
|
|
|
|
plotWidget->setAxisFontsAndAlignment( axis,
|
|
|
|
m_axisProperties->titleFontSize(),
|
|
|
|
m_axisProperties->valuesFontSize(),
|
|
|
|
true,
|
|
|
|
titleAlignment );
|
|
|
|
plotWidget->setAxisTitleEnabled( axis, true );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
auto qwtPlotWidget = dynamic_cast<RiuQwtPlotWidget*>( plotWidget );
|
|
|
|
if ( qwtPlotWidget )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-19 02:50:28 -06:00
|
|
|
QwtPlot::Axis qwtAxisId = RiuQwtPlotTools::toQwtPlotAxis( axis.axis() );
|
2022-01-17 06:14:21 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_axisProperties->numberFormat == RimPlotAxisProperties::NUMBER_FORMAT_AUTO &&
|
|
|
|
m_axisProperties->scaleFactor() == 1.0 )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2019-07-26 04:37:58 -05:00
|
|
|
// Default to Qwt's own scale draw to avoid changing too much for default values
|
2022-01-17 06:14:21 -06:00
|
|
|
qwtPlotWidget->qwtPlot()->setAxisScaleDraw( qwtAxisId, new QwtScaleDraw );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
2019-07-26 04:37:58 -05:00
|
|
|
else
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
qwtPlotWidget->qwtPlot()->setAxisScaleDraw( qwtAxisId,
|
|
|
|
new SummaryScaleDraw( m_axisProperties->scaleFactor(),
|
|
|
|
m_axisProperties->numberOfDecimals(),
|
|
|
|
m_axisProperties->numberFormat() ) );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
#ifdef USE_QTCHARTS
|
|
|
|
auto qtChartsPlotWidget = dynamic_cast<RiuQtChartsPlotWidget*>( plotWidget );
|
|
|
|
if ( qtChartsPlotWidget )
|
|
|
|
{
|
|
|
|
auto mapToRiaNumberFormatType = []( RimPlotAxisProperties::NumberFormatType formatType ) {
|
|
|
|
if ( formatType == RimPlotAxisProperties::NumberFormatType::NUMBER_FORMAT_DECIMAL )
|
|
|
|
return RiaNumberFormat::NumberFormatType::FIXED;
|
|
|
|
|
|
|
|
if ( formatType == RimPlotAxisProperties::NumberFormatType::NUMBER_FORMAT_SCIENTIFIC )
|
|
|
|
return RiaNumberFormat::NumberFormatType::SCIENTIFIC;
|
|
|
|
|
|
|
|
return RiaNumberFormat::NumberFormatType::AUTO;
|
|
|
|
};
|
|
|
|
|
|
|
|
auto formatType = mapToRiaNumberFormatType( m_axisProperties->numberFormat() );
|
|
|
|
QString format = RiaNumberFormat::sprintfFormat( formatType, m_axisProperties->numberOfDecimals() );
|
|
|
|
qtChartsPlotWidget->setAxisFormat( axis, format );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-19 02:50:28 -06:00
|
|
|
if ( m_axisProperties->isLogarithmicScaleEnabled() )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
bool isLogScale = plotWidget->axisScaleType( axis ) == RiuQwtPlotWidget::AxisScaleType::LOGARITHMIC;
|
|
|
|
if ( !isLogScale )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
plotWidget->setAxisScaleType( axis, RiuQwtPlotWidget::AxisScaleType::LOGARITHMIC );
|
|
|
|
plotWidget->setAxisMaxMinor( axis, 5 );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
bool isLinearScale = plotWidget->axisScaleType( axis ) == RiuQwtPlotWidget::AxisScaleType::LINEAR;
|
|
|
|
if ( !isLinearScale )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2022-01-17 06:14:21 -06:00
|
|
|
plotWidget->setAxisScaleType( axis, RiuQwtPlotWidget::AxisScaleType::LINEAR );
|
|
|
|
plotWidget->setAxisMaxMinor( axis, 3 );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-04-09 02:50:51 -05:00
|
|
|
///
|
2016-10-10 04:05:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-29 07:00:22 -06:00
|
|
|
QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2017-12-11 09:41:18 -06:00
|
|
|
std::map<std::string, std::set<std::string>> unitToQuantityNameMap;
|
2016-10-10 04:05:45 -05:00
|
|
|
|
2022-01-06 08:18:09 -06:00
|
|
|
auto addToUnitToQuantityMap = [&]( const std::string& unitText, const RifEclipseSummaryAddress& sumAddress ) {
|
2020-11-10 11:27:29 -06:00
|
|
|
// remove any stats prefix from the quantity name
|
2022-01-06 08:18:09 -06:00
|
|
|
size_t cutPos = sumAddress.quantityName().find( ':' );
|
|
|
|
if ( cutPos == std::string::npos ) cutPos = -1;
|
2020-11-10 11:27:29 -06:00
|
|
|
|
2020-02-28 07:51:21 -06:00
|
|
|
std::string quantityNameForDisplay;
|
2022-01-06 08:18:09 -06:00
|
|
|
const std::string& quantityName = sumAddress.quantityName().substr( cutPos + 1 );
|
2020-02-28 07:51:21 -06:00
|
|
|
|
|
|
|
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
|
|
|
{
|
|
|
|
quantityNameForDisplay = shortCalculationName( quantityName );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( m_axisProperties->showDescription() )
|
|
|
|
{
|
2022-01-06 08:18:09 -06:00
|
|
|
auto candidateName = quantityName;
|
|
|
|
|
|
|
|
if ( sumAddress.isHistoryQuantity() ) candidateName = quantityName.substr( 0, quantityName.size() - 1 );
|
|
|
|
|
2020-02-28 07:51:21 -06:00
|
|
|
quantityNameForDisplay =
|
2022-01-06 08:18:09 -06:00
|
|
|
RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( candidateName );
|
2020-02-28 07:51:21 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( m_axisProperties->showAcronym() )
|
|
|
|
{
|
|
|
|
if ( !quantityNameForDisplay.empty() )
|
|
|
|
{
|
|
|
|
quantityNameForDisplay += " (";
|
|
|
|
quantityNameForDisplay += quantityName;
|
|
|
|
quantityNameForDisplay += ")";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( quantityNameForDisplay.empty() )
|
|
|
|
{
|
|
|
|
quantityNameForDisplay = quantityName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unitToQuantityNameMap[unitText].insert( quantityNameForDisplay );
|
|
|
|
};
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSummaryCurve* rimCurve : m_summaryCurves )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2017-12-11 09:41:18 -06:00
|
|
|
RifEclipseSummaryAddress sumAddress;
|
|
|
|
std::string unitText;
|
2017-12-11 07:44:16 -06:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
if ( m_axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
2017-12-11 09:41:18 -06:00
|
|
|
{
|
|
|
|
sumAddress = rimCurve->summaryAddressX();
|
|
|
|
unitText = rimCurve->unitNameX();
|
2017-11-15 04:36:33 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
|
2017-12-11 09:41:18 -06:00
|
|
|
{
|
|
|
|
sumAddress = rimCurve->summaryAddressY();
|
|
|
|
unitText = rimCurve->unitNameY();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2020-02-28 07:51:21 -06:00
|
|
|
addToUnitToQuantityMap( unitText, sumAddress );
|
|
|
|
}
|
2017-12-11 09:41:18 -06:00
|
|
|
|
2020-02-28 07:51:21 -06:00
|
|
|
for ( const RiaSummaryCurveDefinition& curveDef : m_curveDefinitions )
|
|
|
|
{
|
|
|
|
RifEclipseSummaryAddress sumAddress = curveDef.summaryAddress();
|
|
|
|
std::string unitText;
|
|
|
|
if ( curveDef.summaryCase() && curveDef.summaryCase()->summaryReader() )
|
|
|
|
{
|
|
|
|
unitText = curveDef.summaryCase()->summaryReader()->unitName( sumAddress );
|
|
|
|
}
|
|
|
|
else if ( curveDef.ensemble() )
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCase*> sumCases = curveDef.ensemble()->allSummaryCases();
|
|
|
|
if ( sumCases.size() && sumCases[0] && sumCases[0]->summaryReader() )
|
2017-11-15 04:36:33 -06:00
|
|
|
{
|
2020-02-28 07:51:21 -06:00
|
|
|
unitText = sumCases[0]->summaryReader()->unitName( sumAddress );
|
2017-11-15 04:36:33 -06:00
|
|
|
}
|
2016-11-21 04:30:34 -06:00
|
|
|
}
|
2020-02-28 07:51:21 -06:00
|
|
|
|
|
|
|
addToUnitToQuantityMap( unitText, sumAddress );
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
QString assembledYAxisText;
|
2017-12-11 04:37:31 -06:00
|
|
|
QString scaleFactorText = "";
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_axisProperties->scaleFactor() != 1.0 )
|
2017-12-11 04:37:31 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
int exponent = std::log10( m_axisProperties->scaleFactor() );
|
|
|
|
scaleFactorText = QString( " x 10<sup>%1</sup> " ).arg( QString::number( exponent ) );
|
2017-12-11 04:37:31 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto unitIt : unitToQuantityNameMap )
|
2016-10-10 04:05:45 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& quantIt : unitIt.second )
|
2016-11-21 04:30:34 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
assembledYAxisText += QString::fromStdString( quantIt ) + " ";
|
2016-11-21 04:30:34 -06:00
|
|
|
}
|
2017-12-11 07:54:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_axisProperties->showUnitText() )
|
2017-12-11 07:54:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString unitAndScaleText = QString::fromStdString( unitIt.first ) + scaleFactorText;
|
2019-04-09 01:45:21 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !unitAndScaleText.isEmpty() )
|
2019-04-09 01:45:21 -05:00
|
|
|
{
|
|
|
|
assembledYAxisText += "[" + unitAndScaleText + "] ";
|
|
|
|
}
|
2017-12-11 07:54:54 -06:00
|
|
|
}
|
2016-10-10 04:05:45 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_timeHistoryCurveQuantities.empty() )
|
2017-03-19 02:45:29 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !assembledYAxisText.isEmpty() )
|
2017-03-19 02:45:29 -05:00
|
|
|
{
|
|
|
|
assembledYAxisText += " : ";
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& timeQuantity : m_timeHistoryCurveQuantities )
|
2017-03-19 02:45:29 -05:00
|
|
|
{
|
|
|
|
assembledYAxisText += timeQuantity + " ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-10 04:05:45 -05:00
|
|
|
return assembledYAxisText;
|
|
|
|
}
|
|
|
|
|
2017-12-11 07:44:16 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-04-09 02:50:51 -05:00
|
|
|
///
|
2017-12-11 07:44:16 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-29 07:00:22 -06:00
|
|
|
std::string RimSummaryPlotAxisFormatter::shortCalculationName( const std::string& calculationName )
|
2017-12-11 07:44:16 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString calculationShortName = QString::fromStdString( calculationName );
|
2016-11-18 08:03:35 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
int indexOfFirstSpace = calculationShortName.indexOf( ' ' );
|
|
|
|
if ( indexOfFirstSpace > -1 && indexOfFirstSpace < calculationShortName.size() )
|
2017-12-11 07:44:16 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
calculationShortName = calculationShortName.left( indexOfFirstSpace );
|
2017-12-11 07:44:16 -06:00
|
|
|
}
|
2016-11-18 08:03:35 -06:00
|
|
|
|
2017-12-11 07:44:16 -06:00
|
|
|
return calculationShortName.toStdString();
|
|
|
|
}
|