Convert to enum class

This commit is contained in:
Magne Sjaastad
2020-04-24 07:13:33 +02:00
parent 83914006fd
commit f89dcf4e52
63 changed files with 513 additions and 450 deletions

View File

@@ -100,8 +100,8 @@ RimWellAllocationPlot::RimWellAllocationPlot()
CAF_PDM_InitFieldNoDefault( &m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "" );
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden( true );
m_accumulatedWellFlowPlot = new RimWellLogPlot;
m_accumulatedWellFlowPlot->setDepthUnit( RiaDefines::UNIT_NONE );
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::CONNECTION_NUMBER );
m_accumulatedWellFlowPlot->setDepthUnit( RiaDefines::DepthUnitType::UNIT_NONE );
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::DepthTypeEnum::CONNECTION_NUMBER );
m_accumulatedWellFlowPlot->setLegendsVisible( false );
m_accumulatedWellFlowPlot->uiCapability()->setUiIconFromResourceString( ":/WellFlowPlot16x16.png" );
@@ -125,8 +125,9 @@ RimWellAllocationPlot::RimWellAllocationPlot()
this->setAsPlotMdiWindow();
m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} );
m_accumulatedWellFlowPlot->setAvailableDepthTypes(
{RiaDefines::CONNECTION_NUMBER, RiaDefines::TRUE_VERTICAL_DEPTH, RiaDefines::PSEUDO_LENGTH} );
m_accumulatedWellFlowPlot->setAvailableDepthTypes( {RiaDefines::DepthTypeEnum::CONNECTION_NUMBER,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
RiaDefines::DepthTypeEnum::PSEUDO_LENGTH} );
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
@@ -282,7 +283,7 @@ void RimWellAllocationPlot::updateFromWell()
auto depthType = accumulatedWellFlowPlot()->depthType();
if ( depthType == RiaDefines::MEASURED_DEPTH ) return;
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) return;
// Create tracks and curves from the calculated data
@@ -300,11 +301,11 @@ void RimWellAllocationPlot::updateFromWell()
accumulatedWellFlowPlot()->addPlot( plotTrack );
const std::vector<double>& depthValues = depthType == RiaDefines::CONNECTION_NUMBER
const std::vector<double>& depthValues = depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER
? wfCalculator->connectionNumbersFromTop( brIdx )
: depthType == RiaDefines::PSEUDO_LENGTH
: depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH
? wfCalculator->pseudoLengthFromTop( brIdx )
: depthType == RiaDefines::TRUE_VERTICAL_DEPTH
: depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH
? wfCalculator->trueVerticalDepth( brIdx )
: std::vector<double>();
@@ -314,7 +315,7 @@ void RimWellAllocationPlot::updateFromWell()
{
std::vector<double> curveDepthValues = depthValues;
std::vector<double> accFlow;
if ( depthType == RiaDefines::CONNECTION_NUMBER )
if ( depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER )
{
accFlow = ( m_flowType == ACCUMULATED
? wfCalculator->accumulatedTracerFlowPrConnection( tracerName, brIdx )
@@ -341,7 +342,8 @@ void RimWellAllocationPlot::updateFromWell()
}
}
}
else if ( depthType == RiaDefines::PSEUDO_LENGTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH ||
depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
accFlow = ( m_flowType == ACCUMULATED
? wfCalculator->accumulatedTracerFlowPrPseudoLength( tracerName, brIdx )

View File

@@ -374,11 +374,11 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
}
QString phaseString = "N/A";
if ( m_phase == RiaDefines::OIL_PHASE )
if ( m_phase == RiaDefines::PhaseType::OIL_PHASE )
phaseString = "Oil";
else if ( m_phase == RiaDefines::GAS_PHASE )
else if ( m_phase == RiaDefines::PhaseType::GAS_PHASE )
phaseString = "Gas";
else if ( m_phase == RiaDefines::WATER_PHASE )
else if ( m_phase == RiaDefines::PhaseType::WATER_PHASE )
phaseString = "Water";
const QString timeStepName = m_case ? m_case->timeStepName( m_timeStepIndex ) : "N/A";

View File

@@ -40,7 +40,7 @@ class RimWellDistributionPlot : public RimPlot
CAF_PDM_HEADER_INIT;
public:
explicit RimWellDistributionPlot( RiaDefines::PhaseType phase = RiaDefines::OIL_PHASE );
explicit RimWellDistributionPlot( RiaDefines::PhaseType phase = RiaDefines::PhaseType::OIL_PHASE );
~RimWellDistributionPlot() override;
void setDataSourceParameters( RimEclipseResultCase* eclipseResultCase, int timeStepIndex, QString targetWellName );

View File

@@ -95,9 +95,9 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
setAsPlotMdiWindow();
addPlot( new RimWellDistributionPlot( RiaDefines::OIL_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::GAS_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::WATER_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::PhaseType::OIL_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::PhaseType::GAS_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::PhaseType::WATER_PHASE ) );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -254,9 +254,9 @@ void RimWellFlowRateCurve::updateStackedPlotData()
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
if ( depthType == RiaDefines::CONNECTION_NUMBER )
if ( depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER )
{
displayUnit = RiaDefines::UNIT_NONE;
displayUnit = RiaDefines::DepthUnitType::UNIT_NONE;
}
std::vector<double> depthValues;
@@ -323,7 +323,7 @@ bool RimWellFlowRateCurve::isUsingConnectionNumberDepthType() const
{
RimWellLogPlot* wellLogPlot;
firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::CONNECTION_NUMBER )
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER )
{
return true;
}
@@ -350,7 +350,7 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString&
const std::vector<double>& depthValues,
const std::vector<double>& flowRates )
{
this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::UNIT_NONE, false );
this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::DepthUnitType::UNIT_NONE, false );
m_curveAutoName = curveName;
}

View File

@@ -140,7 +140,7 @@ RimWellPltPlot::RimWellPltPlot()
m_isOnLoad = true;
m_plotLegendsHorizontal = false;
setAvailableDepthTypes( {RiaDefines::MEASURED_DEPTH} );
setAvailableDepthTypes( {RiaDefines::DepthTypeEnum::MEASURED_DEPTH} );
}
//--------------------------------------------------------------------------------------------------
@@ -169,13 +169,13 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack )
// Todo: Handle different units in the relevant las channels
switch ( source.wellLogFile()->wellLogFileData()->depthUnit() )
{
case RiaDefines::UNIT_METER:
case RiaDefines::DepthUnitType::UNIT_METER:
presentUnitSystems.insert( RiaEclipseUnitTools::UNITS_METRIC );
break;
case RiaDefines::UNIT_FEET:
case RiaDefines::DepthUnitType::UNIT_FEET:
presentUnitSystems.insert( RiaEclipseUnitTools::UNITS_FIELD );
break;
case RiaDefines::UNIT_NONE:
case RiaDefines::DepthUnitType::UNIT_NONE:
presentUnitSystems.insert( RiaEclipseUnitTools::UNITS_UNKNOWN );
break;
}
@@ -657,8 +657,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
RiaEclipseUnitTools::UnitSystem unitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
{
RiaDefines::DepthUnitType depthUnit = wellLogFileData->depthUnit();
if ( depthUnit == RiaDefines::UNIT_FEET ) unitSystem = RiaEclipseUnitTools::UNITS_FIELD;
if ( depthUnit == RiaDefines::UNIT_METER ) unitSystem = RiaEclipseUnitTools::UNITS_METRIC;
if ( depthUnit == RiaDefines::DepthUnitType::UNIT_FEET )
unitSystem = RiaEclipseUnitTools::UNITS_FIELD;
if ( depthUnit == RiaDefines::DepthUnitType::UNIT_METER )
unitSystem = RiaEclipseUnitTools::UNITS_METRIC;
}
for ( const ChannelValNameIdxTuple& channelInfo : sortedChannels )

View File

@@ -95,7 +95,7 @@ RimWellRftPlot::RimWellRftPlot()
m_wellLogPlot_OBSOLETE.uiCapability()->setUiHidden( true );
m_wellLogPlot_OBSOLETE.xmlCapability()->setIOWritable( false );
m_depthType = RiaDefines::TRUE_VERTICAL_DEPTH;
m_depthType = RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH;
CAF_PDM_InitFieldNoDefault( &m_wellPathNameOrSimWellName, "WellName", "Well Name", "", "", "" );
CAF_PDM_InitField( &m_branchIndex, "BranchIndex", 0, "Branch Index", "", "", "" );
@@ -128,7 +128,7 @@ RimWellRftPlot::RimWellRftPlot()
// TODO: may want to support TRUE_VERTICAL_DEPTH_RKB in the future
// It was developed for regular well log plots and requires some more work for RFT plots.
setAvailableDepthTypes( {RiaDefines::MEASURED_DEPTH, RiaDefines::TRUE_VERTICAL_DEPTH} );
setAvailableDepthTypes( {RiaDefines::DepthTypeEnum::MEASURED_DEPTH, RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH} );
m_nameConfig->setCustomName( "RFT Plot" );
m_plotLegendsHorizontal = false;
@@ -647,7 +647,7 @@ void RimWellRftPlot::updateCurvesInPlot( const std::set<RiaRftPltCurveDefinition
}
}
if ( depthType() == RiaDefines::MEASURED_DEPTH )
if ( depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
assignWellPathToExtractionCurves();
}
@@ -1074,7 +1074,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
updateMdiWindowVisibility();
updateFormationsOnPlot();
if ( depthType() == RiaDefines::MEASURED_DEPTH )
if ( depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
assignWellPathToExtractionCurves();
}