mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-16 18:34:54 -06:00
#7018 VFP plots: Remove brackets for empty unit labels.
This commit is contained in:
parent
1724451c45
commit
4414b61efd
@ -396,16 +396,16 @@ void RimVfpPlot::populatePlotWidgetWithCurveData( RiuQwtPlotWidget* plotWidget,
|
|||||||
plotWidget->setAxisAutoScale( QwtPlot::xBottom, true );
|
plotWidget->setAxisAutoScale( QwtPlot::xBottom, true );
|
||||||
plotWidget->setAxisAutoScale( QwtPlot::yLeft, true );
|
plotWidget->setAxisAutoScale( QwtPlot::yLeft, true );
|
||||||
|
|
||||||
QString xAxisTitle = QString( "%1 [%2]" )
|
QString xAxisTitle =
|
||||||
.arg( caf::AppEnum<RimVfpPlot::ProductionVariableType>::uiText(
|
QString( "%1 %2" ).arg( caf::AppEnum<RimVfpPlot::ProductionVariableType>::uiText(
|
||||||
RimVfpPlot::ProductionVariableType::LIQUID_FLOW_RATE ),
|
RimVfpPlot::ProductionVariableType::LIQUID_FLOW_RATE ),
|
||||||
getDisplayUnit( RimVfpPlot::ProductionVariableType::LIQUID_FLOW_RATE ) );
|
getDisplayUnitWithBracket( RimVfpPlot::ProductionVariableType::LIQUID_FLOW_RATE ) );
|
||||||
|
|
||||||
plotWidget->setAxisTitleText( QwtPlot::xBottom, xAxisTitle );
|
plotWidget->setAxisTitleText( QwtPlot::xBottom, xAxisTitle );
|
||||||
|
|
||||||
QString yAxisTitle = QString( "%1 [%2]" )
|
QString yAxisTitle =
|
||||||
.arg( caf::AppEnum<RimVfpPlot::InterpolatedVariableType>::uiText( m_interpolatedVariable() ),
|
QString( "%1 %2" ).arg( caf::AppEnum<RimVfpPlot::InterpolatedVariableType>::uiText( m_interpolatedVariable() ),
|
||||||
getDisplayUnit( RimVfpPlot::ProductionVariableType::THP ) );
|
getDisplayUnitWithBracket( RimVfpPlot::ProductionVariableType::THP ) );
|
||||||
plotWidget->setAxisTitleText( QwtPlot::yLeft, yAxisTitle );
|
plotWidget->setAxisTitleText( QwtPlot::yLeft, yAxisTitle );
|
||||||
|
|
||||||
std::vector<double> thpValues = table.getTHPAxis();
|
std::vector<double> thpValues = table.getTHPAxis();
|
||||||
@ -458,13 +458,13 @@ void RimVfpPlot::populatePlotWidgetWithCurveData( RiuQwtPlotWidget*
|
|||||||
plotWidget->setAxisAutoScale( QwtPlot::xBottom, true );
|
plotWidget->setAxisAutoScale( QwtPlot::xBottom, true );
|
||||||
plotWidget->setAxisAutoScale( QwtPlot::yLeft, true );
|
plotWidget->setAxisAutoScale( QwtPlot::yLeft, true );
|
||||||
|
|
||||||
QString xAxisTitle = QString( "%1 [%2]" )
|
QString xAxisTitle =
|
||||||
.arg( caf::AppEnum<RimVfpPlot::ProductionVariableType>::uiText( primaryVariable ),
|
QString( "%1 %2" ).arg( caf::AppEnum<RimVfpPlot::ProductionVariableType>::uiText( primaryVariable ),
|
||||||
getDisplayUnit( primaryVariable ) );
|
getDisplayUnitWithBracket( primaryVariable ) );
|
||||||
plotWidget->setAxisTitleText( QwtPlot::xBottom, xAxisTitle );
|
plotWidget->setAxisTitleText( QwtPlot::xBottom, xAxisTitle );
|
||||||
QString yAxisTitle = QString( "%1 [%2]" )
|
QString yAxisTitle =
|
||||||
.arg( caf::AppEnum<RimVfpPlot::InterpolatedVariableType>::uiText( m_interpolatedVariable() ),
|
QString( "%1 %2" ).arg( caf::AppEnum<RimVfpPlot::InterpolatedVariableType>::uiText( m_interpolatedVariable() ),
|
||||||
getDisplayUnit( RimVfpPlot::ProductionVariableType::THP ) );
|
getDisplayUnitWithBracket( RimVfpPlot::ProductionVariableType::THP ) );
|
||||||
plotWidget->setAxisTitleText( QwtPlot::yLeft, yAxisTitle );
|
plotWidget->setAxisTitleText( QwtPlot::yLeft, yAxisTitle );
|
||||||
|
|
||||||
std::vector<double> primaryAxisValues = getProductionTableData( table, primaryVariable );
|
std::vector<double> primaryAxisValues = getProductionTableData( table, primaryVariable );
|
||||||
@ -574,6 +574,18 @@ void RimVfpPlot::convertToDisplayUnit( std::vector<double>& values, RimVfpPlot::
|
|||||||
values[i] = convertToDisplayUnit( values[i], variableType );
|
values[i] = convertToDisplayUnit( values[i], variableType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimVfpPlot::getDisplayUnitWithBracket( RimVfpPlot::ProductionVariableType variableType )
|
||||||
|
{
|
||||||
|
QString unit = getDisplayUnit( variableType );
|
||||||
|
if ( !unit.isEmpty() )
|
||||||
|
return QString( "[%1]" ).arg( unit );
|
||||||
|
else
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -126,6 +126,8 @@ private:
|
|||||||
|
|
||||||
static QString getDisplayUnit( RimVfpPlot::ProductionVariableType variableType );
|
static QString getDisplayUnit( RimVfpPlot::ProductionVariableType variableType );
|
||||||
|
|
||||||
|
static QString getDisplayUnitWithBracket( RimVfpPlot::ProductionVariableType variableType );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<caf::FilePath> m_filePath;
|
caf::PdmField<caf::FilePath> m_filePath;
|
||||||
caf::PdmField<int> m_tableNumber;
|
caf::PdmField<int> m_tableNumber;
|
||||||
|
Loading…
Reference in New Issue
Block a user