mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Moved UnitSystem from RiaEclipseUnitTools to RiaDefines. (#7225)
* Moved UnitSystem from RiaEclipseUnitTools to RiaDefines. - Renamed UnitSystem to EclipseUnitSystem - Replaced header includes and removed obsolete includes of RiaEclipseUnitTools.h * Moved result name functions into separate file. * Minor cleanup Co-authored-by: rubenthoms <rubenthoms@users.noreply.github.com> Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com> Co-authored-by: magnesj <magnesj@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
#include "RiuGuiTheme.h"
|
||||
#include "RiuPvtPlotUpdater.h"
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@@ -177,7 +179,7 @@ void RiuPvtPlotWidget::setPlotDefaults( QwtPlot* plot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotWidget::plotCurves( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void RiuPvtPlotWidget::plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
|
||||
double pressure,
|
||||
double pointMarkerYValue,
|
||||
@@ -511,7 +513,7 @@ void RiuPvtPlotWidget::slotPickerActivated( bool on )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPvtPlotPanel::RiuPvtPlotPanel( QDockWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_unitSystem( RiaEclipseUnitTools::UnitSystem::UNITS_UNKNOWN )
|
||||
, m_unitSystem( RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN )
|
||||
, m_plotUpdater( new RiuPvtPlotUpdater( this ) )
|
||||
{
|
||||
m_phaseComboBox = new QComboBox( this );
|
||||
@@ -563,7 +565,7 @@ RiuPvtPlotPanel::~RiuPvtPlotPanel()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotPanel::setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void RiuPvtPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
|
||||
const FvfDynProps& fvfDynProps,
|
||||
@@ -596,7 +598,7 @@ void RiuPvtPlotPanel::clearPlot()
|
||||
return;
|
||||
}
|
||||
|
||||
m_unitSystem = RiaEclipseUnitTools::UnitSystem::UNITS_UNKNOWN;
|
||||
m_unitSystem = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||
m_allFvfCurvesArr.clear();
|
||||
m_allViscosityCurvesArr.clear();
|
||||
m_fvfDynProps = FvfDynProps();
|
||||
@@ -754,18 +756,18 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Static helper to get unit labels
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent )
|
||||
{
|
||||
if ( curveIdent == RigFlowDiagSolverInterface::PvtCurve::Bo )
|
||||
{
|
||||
switch ( unitSystem )
|
||||
{
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_METRIC:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_METRIC:
|
||||
return "rm3/sm3";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_FIELD:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_FIELD:
|
||||
return "rb/stb";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_LAB:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_LAB:
|
||||
return "rcc/scc";
|
||||
default:
|
||||
return "";
|
||||
@@ -775,11 +777,11 @@ QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaEclipseUnitTools::UnitSyste
|
||||
{
|
||||
switch ( unitSystem )
|
||||
{
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_METRIC:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_METRIC:
|
||||
return "rm3/sm3";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_FIELD:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_FIELD:
|
||||
return "rb/Mscf";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_LAB:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_LAB:
|
||||
return "rcc/scc";
|
||||
default:
|
||||
return "";
|
||||
@@ -790,11 +792,11 @@ QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaEclipseUnitTools::UnitSyste
|
||||
{
|
||||
switch ( unitSystem )
|
||||
{
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_METRIC:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_METRIC:
|
||||
return "cP";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_FIELD:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_FIELD:
|
||||
return "cP";
|
||||
case RiaEclipseUnitTools::UnitSystem::UNITS_LAB:
|
||||
case RiaDefines::EclipseUnitSystem::UNITS_LAB:
|
||||
return "cP";
|
||||
default:
|
||||
return "";
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include <QPointer>
|
||||
@@ -59,7 +59,7 @@ class RiuPvtPlotWidget : public QWidget, public RiuPvtTrackerTextProvider
|
||||
public:
|
||||
RiuPvtPlotWidget( RiuPvtPlotPanel* parent );
|
||||
|
||||
void plotCurves( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
|
||||
double pressure,
|
||||
double pointMarkerYValue,
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
RiuPvtPlotPanel( QDockWidget* parent );
|
||||
~RiuPvtPlotPanel() override;
|
||||
|
||||
void setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
|
||||
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
|
||||
const FvfDynProps& fvfDynProps,
|
||||
@@ -137,14 +137,14 @@ public:
|
||||
|
||||
private:
|
||||
void plotUiSelectedCurves();
|
||||
static QString unitLabelFromCurveIdent( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
static QString unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent );
|
||||
|
||||
private slots:
|
||||
void slotPhaseComboCurrentIndexChanged( int );
|
||||
|
||||
private:
|
||||
RiaEclipseUnitTools::UnitSystem m_unitSystem;
|
||||
RiaDefines::EclipseUnitSystem m_unitSystem;
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allFvfCurvesArr;
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allViscosityCurvesArr;
|
||||
FvfDynProps m_fvfDynProps;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuRelativePermeabilityPlotPanel.h"
|
||||
|
||||
#include "RiuDockedQwtPlot.h"
|
||||
#include "RiuGuiTheme.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
@@ -25,6 +26,8 @@
|
||||
#include "RiuTextDialog.h"
|
||||
|
||||
#include "RiaCurveDataTools.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@@ -80,7 +83,7 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel( QDockWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_unitSystem( RiaEclipseUnitTools::UnitSystem::UNITS_UNKNOWN )
|
||||
, m_unitSystem( RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN )
|
||||
, m_swat( HUGE_VAL )
|
||||
, m_sgas( HUGE_VAL )
|
||||
, m_plotUpdater( new RiuRelativePermeabilityPlotUpdater( this ) )
|
||||
@@ -187,7 +190,7 @@ void RiuRelativePermeabilityPlotPanel::setPlotDefaults( QwtPlot* plot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRelativePermeabilityPlotPanel::setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void RiuRelativePermeabilityPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
|
||||
double swat,
|
||||
double sgas,
|
||||
@@ -218,7 +221,7 @@ void RiuRelativePermeabilityPlotPanel::clearPlot()
|
||||
return;
|
||||
}
|
||||
|
||||
m_unitSystem = RiaEclipseUnitTools::UnitSystem::UNITS_UNKNOWN;
|
||||
m_unitSystem = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||
m_allCurvesArr.clear();
|
||||
m_swat = HUGE_VAL;
|
||||
m_sgas = HUGE_VAL;
|
||||
@@ -316,7 +319,7 @@ void RiuRelativePermeabilityPlotPanel::addTransparentCurve( QwtPlot*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr,
|
||||
double swat,
|
||||
double sgas,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include <QPointer>
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
RiuRelativePermeabilityPlotPanel( QDockWidget* parent );
|
||||
~RiuRelativePermeabilityPlotPanel() override;
|
||||
|
||||
void setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
|
||||
double swat,
|
||||
double sgas,
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
|
||||
void plotUiSelectedCurves();
|
||||
static void setPlotDefaults( QwtPlot* plot );
|
||||
static void plotCurvesInQwt( RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||
static void plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr,
|
||||
double swat,
|
||||
double sgas,
|
||||
@@ -127,7 +127,7 @@ private slots:
|
||||
void slotShowCurveSelectionWidgets( int state );
|
||||
|
||||
private:
|
||||
RiaEclipseUnitTools::UnitSystem m_unitSystem;
|
||||
RiaDefines::EclipseUnitSystem m_unitSystem;
|
||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> m_allCurvesArr;
|
||||
double m_swat;
|
||||
double m_sgas;
|
||||
|
||||
@@ -485,7 +485,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
QString resultValueText;
|
||||
|
||||
if ( m_viewWithFaultsSettings->currentFaultResultColors()->resultVariable() ==
|
||||
RiaDefines::formationAllanResultName() )
|
||||
RiaResultNames::formationAllanResultName() )
|
||||
{
|
||||
std::pair<int, int> fmIndexPair =
|
||||
eclipseCase->allanDiagramData()->formationIndexCombinationFromCategory(
|
||||
@@ -504,7 +504,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
// clang-format on
|
||||
}
|
||||
else if ( m_viewWithFaultsSettings->currentFaultResultColors()->resultVariable() ==
|
||||
RiaDefines::formationBinaryAllanResultName() )
|
||||
RiaResultNames::formationBinaryAllanResultName() )
|
||||
{
|
||||
resultValueText = ( *nncValues )[m_nncIndex] == 0 ? "Same formation" : "Different formation";
|
||||
}
|
||||
@@ -597,7 +597,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
{
|
||||
if ( resultColors->hasStaticResult() )
|
||||
{
|
||||
if ( resultColors->resultVariable().compare( RiaDefines::combinedTransmissibilityResultName(),
|
||||
if ( resultColors->resultVariable().compare( RiaResultNames::combinedTransmissibilityResultName(),
|
||||
Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> transResultAccessor =
|
||||
@@ -606,7 +606,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress(
|
||||
RiaDefines::combinedTransmissibilityResultName() ) );
|
||||
RiaResultNames::combinedTransmissibilityResultName() ) );
|
||||
{
|
||||
double scalarValue = transResultAccessor->cellFaceScalar( cellIndex, cvf::StructGridInterface::POS_I );
|
||||
resultInfoText->append( QString( "Tran X : %1\n" ).arg( scalarValue ) );
|
||||
@@ -620,7 +620,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( resultColors->resultVariable().compare( RiaDefines::combinedMultResultName(),
|
||||
else if ( resultColors->resultVariable().compare( RiaResultNames::combinedMultResultName(),
|
||||
Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> multResultAccessor =
|
||||
@@ -629,7 +629,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress(
|
||||
RiaDefines::combinedMultResultName() ) );
|
||||
RiaResultNames::combinedMultResultName() ) );
|
||||
{
|
||||
double scalarValue = multResultAccessor->cellFaceScalar( cellIndex, cvf::StructGridInterface::POS_I );
|
||||
resultInfoText->append( QString( "MULTX : %1\n" ).arg( scalarValue ) );
|
||||
@@ -649,7 +649,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( resultColors->resultVariable().compare( RiaDefines::combinedRiTranResultName(),
|
||||
else if ( resultColors->resultVariable().compare( RiaResultNames::combinedRiTranResultName(),
|
||||
Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> transResultAccessor =
|
||||
@@ -658,7 +658,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress(
|
||||
RiaDefines::combinedRiTranResultName() ) );
|
||||
RiaResultNames::combinedRiTranResultName() ) );
|
||||
{
|
||||
double scalarValue = transResultAccessor->cellFaceScalar( cellIndex, cvf::StructGridInterface::POS_I );
|
||||
resultInfoText->append( QString( "riTran X : %1\n" ).arg( scalarValue ) );
|
||||
@@ -672,7 +672,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( resultColors->resultVariable().compare( RiaDefines::combinedRiMultResultName(),
|
||||
else if ( resultColors->resultVariable().compare( RiaResultNames::combinedRiMultResultName(),
|
||||
Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> resultAccessor =
|
||||
@@ -681,7 +681,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress(
|
||||
RiaDefines::combinedRiMultResultName() ) );
|
||||
RiaResultNames::combinedRiMultResultName() ) );
|
||||
{
|
||||
double scalarValue = resultAccessor->cellFaceScalar( cellIndex, cvf::StructGridInterface::POS_I );
|
||||
resultInfoText->append( QString( "riMult X : %1\n" ).arg( scalarValue ) );
|
||||
@@ -695,7 +695,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( resultColors->resultVariable().compare( RiaDefines::combinedRiAreaNormTranResultName(),
|
||||
else if ( resultColors->resultVariable().compare( RiaResultNames::combinedRiAreaNormTranResultName(),
|
||||
Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> resultAccessor =
|
||||
@@ -704,7 +704,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress(
|
||||
RiaDefines::combinedRiAreaNormTranResultName() ) );
|
||||
RiaResultNames::combinedRiAreaNormTranResultName() ) );
|
||||
{
|
||||
double scalarValue = resultAccessor->cellFaceScalar( cellIndex, cvf::StructGridInterface::POS_I );
|
||||
resultInfoText->append( QString( "riTransByArea X : %1\n" ).arg( scalarValue ) );
|
||||
|
||||
@@ -145,7 +145,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuEclipseSele
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( eclResDef->hasDynamicResult() && !RiaDefines::isPerCellFaceResult( eclResDef->resultVariable() ) &&
|
||||
else if ( eclResDef->hasDynamicResult() && !RiaResultNames::isPerCellFaceResult( eclResDef->resultVariable() ) &&
|
||||
eclResDef->eclipseCase() && eclResDef->eclipseCase()->eclipseCaseData() )
|
||||
{
|
||||
RiaDefines::PorosityModelType porosityModel = eclResDef->porosityModel();
|
||||
|
||||
Reference in New Issue
Block a user