Janitor : Use enum class

This commit is contained in:
Magne Sjaastad 2021-05-26 10:56:21 +02:00
parent 19d650f619
commit 3fca5f15ae
18 changed files with 100 additions and 90 deletions

View File

@ -183,4 +183,13 @@ enum class RINavigationPolicy : short
NAVIGATION_POLICY_RMS NAVIGATION_POLICY_RMS
}; };
enum class WellProductionType : short
{
PRODUCER,
OIL_INJECTOR,
GAS_INJECTOR,
WATER_INJECTOR,
UNDEFINED_PRODUCTION_TYPE
};
}; // namespace RiaDefines }; // namespace RiaDefines

View File

@ -188,8 +188,9 @@ std::vector<QString>
{ {
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED; RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED;
const RigWellResultFrame::WellProductionType prodType = simWellData->wellProductionType( timeStep ); const RiaDefines::WellProductionType prodType = simWellData->wellProductionType( timeStep );
if ( prodType == RigWellResultFrame::PRODUCER || prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ) if ( prodType == RiaDefines::WellProductionType::PRODUCER ||
prodType == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
{ {
requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR; requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR;
} }

View File

@ -1684,23 +1684,23 @@ void RifReaderEclipseOutput::readWellCells( const ecl_grid_type* mainEclGrid, bo
well_type_enum ert_well_type = well_state_get_type( ert_well_state ); well_type_enum ert_well_type = well_state_get_type( ert_well_state );
if ( ert_well_type == ECL_WELL_PRODUCER ) if ( ert_well_type == ECL_WELL_PRODUCER )
{ {
wellResFrame.m_productionType = RigWellResultFrame::PRODUCER; wellResFrame.m_productionType = RiaDefines::WellProductionType::PRODUCER;
} }
else if ( ert_well_type == ECL_WELL_WATER_INJECTOR ) else if ( ert_well_type == ECL_WELL_WATER_INJECTOR )
{ {
wellResFrame.m_productionType = RigWellResultFrame::WATER_INJECTOR; wellResFrame.m_productionType = RiaDefines::WellProductionType::WATER_INJECTOR;
} }
else if ( ert_well_type == ECL_WELL_GAS_INJECTOR ) else if ( ert_well_type == ECL_WELL_GAS_INJECTOR )
{ {
wellResFrame.m_productionType = RigWellResultFrame::GAS_INJECTOR; wellResFrame.m_productionType = RiaDefines::WellProductionType::GAS_INJECTOR;
} }
else if ( ert_well_type == ECL_WELL_OIL_INJECTOR ) else if ( ert_well_type == ECL_WELL_OIL_INJECTOR )
{ {
wellResFrame.m_productionType = RigWellResultFrame::OIL_INJECTOR; wellResFrame.m_productionType = RiaDefines::WellProductionType::OIL_INJECTOR;
} }
else else
{ {
wellResFrame.m_productionType = RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE; wellResFrame.m_productionType = RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE;
} }
wellResFrame.m_isOpen = well_state_is_open( ert_well_state ); wellResFrame.m_isOpen = well_state_is_open( ert_well_state );

View File

@ -435,19 +435,19 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
{ {
switch ( wResFrame.m_productionType ) switch ( wResFrame.m_productionType )
{ {
case RigWellResultFrame::PRODUCER: case RiaDefines::WellProductionType::PRODUCER:
cellState = producerState; cellState = producerState;
break; break;
case RigWellResultFrame::OIL_INJECTOR: case RiaDefines::WellProductionType::OIL_INJECTOR:
cellState = hcInjectorState; cellState = hcInjectorState;
break; break;
case RigWellResultFrame::GAS_INJECTOR: case RiaDefines::WellProductionType::GAS_INJECTOR:
cellState = hcInjectorState; cellState = hcInjectorState;
break; break;
case RigWellResultFrame::WATER_INJECTOR: case RiaDefines::WellProductionType::WATER_INJECTOR:
cellState = waterInjectorState; cellState = waterInjectorState;
break; break;
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE: case RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE:
cellState = defaultState; cellState = defaultState;
break; break;
} }

View File

@ -64,11 +64,11 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
if ( !m_rimWell->simWellData()->hasWellResult( frameIndex ) ) return; if ( !m_rimWell->simWellData()->hasWellResult( frameIndex ) ) return;
if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) return; if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) return;
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == if ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ) RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
return; return;
bool isProducer = bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER ); RiaDefines::WellProductionType::PRODUCER );
double pipeRadius = m_rimWell->pipeRadius(); double pipeRadius = m_rimWell->pipeRadius();
cvf::Vec3d wellHeadTop; cvf::Vec3d wellHeadTop;
@ -133,11 +133,11 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
if ( !otherWell->simWellData()->hasWellResult( frameIndex ) ) continue; if ( !otherWell->simWellData()->hasWellResult( frameIndex ) ) continue;
if ( !otherWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) continue; if ( !otherWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) continue;
if ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == if ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ) RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
continue; continue;
bool isOtherProducer = bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER ); RiaDefines::WellProductionType::PRODUCER );
{ {
std::string otherWellName = otherWell->name().toStdString(); std::string otherWellName = otherWell->name().toStdString();

View File

@ -315,8 +315,9 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
} }
// Add visual indicator for well type injector // Add visual indicator for well type injector
if ( productionType == RigWellResultFrame::OIL_INJECTOR || productionType == RigWellResultFrame::GAS_INJECTOR || if ( productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
productionType == RigWellResultFrame::WATER_INJECTOR ) productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
cvf::GeometryBuilderFaceList builder; cvf::GeometryBuilderFaceList builder;
cvf::Vec3f pos( 0.0, 0.0, 0.0 ); cvf::Vec3f pos( 0.0, 0.0, 0.0 );
@ -514,17 +515,17 @@ RimSimWellInViewCollection* RivWellDiskPartMgr::simWellInViewCollection()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
cvf::Color4f RivWellDiskPartMgr::getWellInjectionColor( RigWellResultFrame::WellProductionType productionType ) cvf::Color4f RivWellDiskPartMgr::getWellInjectionColor( RiaDefines::WellProductionType productionType )
{ {
if ( productionType == RigWellResultFrame::OIL_INJECTOR ) if ( productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
{ {
return cvf::Color4f( cvf::Color3::ORANGE ); return cvf::Color4f( cvf::Color3::ORANGE );
} }
else if ( productionType == RigWellResultFrame::GAS_INJECTOR ) else if ( productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
{ {
return cvf::Color4f( cvf::Color3::RED ); return cvf::Color4f( cvf::Color3::RED );
} }
else if ( productionType == RigWellResultFrame::WATER_INJECTOR ) else if ( productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
return cvf::Color4f( cvf::Color3::BLUE ); return cvf::Color4f( cvf::Color3::BLUE );
} }

View File

@ -18,12 +18,11 @@
#pragma once #pragma once
#include "RigWellResultPoint.h"
#include "cafPdmPointer.h" #include "cafPdmPointer.h"
#include "cvfObject.h" #include "cvfObject.h"
#include "cvfString.h" #include "cvfString.h"
#include "cvfVector3.h"
namespace cvf namespace cvf
{ {
@ -39,9 +38,15 @@ namespace caf
class DisplayCoordTransform; class DisplayCoordTransform;
} }
namespace RiaDefines
{
enum class WellProductionType : short;
}
class Rim3dView; class Rim3dView;
class RimSimWellInView; class RimSimWellInView;
class RimSimWellInViewCollection; class RimSimWellInViewCollection;
class RigWellResultFrame;
class RivWellDiskPartMgr : public cvf::Object class RivWellDiskPartMgr : public cvf::Object
{ {
@ -65,7 +70,7 @@ private:
Rim3dView* viewWithSettings(); Rim3dView* viewWithSettings();
RimSimWellInViewCollection* simWellInViewCollection(); RimSimWellInViewCollection* simWellInViewCollection();
static cvf::Color4f getWellInjectionColor( RigWellResultFrame::WellProductionType productionType ); static cvf::Color4f getWellInjectionColor( RiaDefines::WellProductionType productionType );
static QString formatNumber( double num ); static QString formatNumber( double num );
static double baseScaleFactor(); static double baseScaleFactor();

View File

@ -191,7 +191,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
textPosition.z() += 1.2 * arrowLength; textPosition.z() += 1.2 * arrowLength;
cvf::Mat4f matr; cvf::Mat4f matr;
if ( wellResultFrame.m_productionType != RigWellResultFrame::PRODUCER ) if ( wellResultFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER )
{ {
matr = cvf::Mat4f::fromRotation( cvf::Vec3f( 1.0f, 0.0f, 0.0f ), cvf::Math::toRadians( 180.0f ) ); matr = cvf::Mat4f::fromRotation( cvf::Vec3f( 1.0f, 0.0f, 0.0f ), cvf::Math::toRadians( 180.0f ) );
} }
@ -205,7 +205,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
matr( 1, 1 ) *= ijScaleFactor; matr( 1, 1 ) *= ijScaleFactor;
matr( 2, 2 ) *= arrowLength; matr( 2, 2 ) *= arrowLength;
if ( wellResultFrame.m_productionType != RigWellResultFrame::PRODUCER ) if ( wellResultFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER )
{ {
arrowPosition.z() += arrowLength; arrowPosition.z() += arrowLength;
} }
@ -253,19 +253,19 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
{ {
if ( wellResultFrame.m_isOpen ) if ( wellResultFrame.m_isOpen )
{ {
if ( wellResultFrame.m_productionType == RigWellResultFrame::PRODUCER ) if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
{ {
headColor = cvf::Color4f( cvf::Color3::GREEN ); headColor = cvf::Color4f( cvf::Color3::GREEN );
} }
else if ( wellResultFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR ) else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
{ {
headColor = cvf::Color4f( cvf::Color3::ORANGE ); headColor = cvf::Color4f( cvf::Color3::ORANGE );
} }
else if ( wellResultFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR ) else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
{ {
headColor = cvf::Color4f( cvf::Color3::RED ); headColor = cvf::Color4f( cvf::Color3::RED );
} }
else if ( wellResultFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR ) else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
headColor = cvf::Color4f( cvf::Color3::BLUE ); headColor = cvf::Color4f( cvf::Color3::BLUE );
} }

View File

@ -209,16 +209,16 @@ cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame& wel
{ {
switch ( wellResultFrame.m_productionType ) switch ( wellResultFrame.m_productionType )
{ {
case RigWellResultFrame::PRODUCER: case RiaDefines::WellProductionType::PRODUCER:
cellColor = cvf::Color3f::GREEN; cellColor = cvf::Color3f::GREEN;
break; break;
case RigWellResultFrame::OIL_INJECTOR: case RiaDefines::WellProductionType::OIL_INJECTOR:
cellColor = cvf::Color3f::RED; cellColor = cvf::Color3f::RED;
break; break;
case RigWellResultFrame::GAS_INJECTOR: case RiaDefines::WellProductionType::GAS_INJECTOR:
cellColor = cvf::Color3f::RED; cellColor = cvf::Color3f::RED;
break; break;
case RigWellResultFrame::WATER_INJECTOR: case RiaDefines::WellProductionType::WATER_INJECTOR:
cellColor = cvf::Color3f::BLUE; cellColor = cvf::Color3f::BLUE;
break; break;
} }

View File

@ -179,8 +179,9 @@ std::map<std::string, std::vector<int>> RimFlowDiagSolution::allTracerActiveCell
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) continue; if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) continue;
const RigWellResultFrame& wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex ); const RigWellResultFrame& wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
bool isInjectorWell = ( wellResFrame.m_productionType != RigWellResultFrame::PRODUCER && bool isInjectorWell =
wellResFrame.m_productionType != RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ); ( wellResFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER &&
wellResFrame.m_productionType != RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
std::string wellName = simWellData[wIdx]->m_wellName.toStdString(); std::string wellName = simWellData[wIdx]->m_wellName.toStdString();
std::string wellNameXf = addCrossFlowEnding( simWellData[wIdx]->m_wellName ).toStdString(); std::string wellNameXf = addCrossFlowEnding( simWellData[wIdx]->m_wellName ).toStdString();
@ -242,16 +243,16 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
tracerStatus = TracerStatusType::CLOSED; tracerStatus = TracerStatusType::CLOSED;
for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps ) for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps )
{ {
if ( wellResFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR || if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
wellResFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR || wellResFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
wellResFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR ) wellResFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
if ( tracerStatus == TracerStatusType::PRODUCER ) if ( tracerStatus == TracerStatusType::PRODUCER )
tracerStatus = TracerStatusType::VARYING; tracerStatus = TracerStatusType::VARYING;
else else
tracerStatus = TracerStatusType::INJECTOR; tracerStatus = TracerStatusType::INJECTOR;
} }
else if ( wellResFrame.m_productionType == RigWellResultFrame::PRODUCER ) else if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
{ {
if ( tracerStatus == TracerStatusType::INJECTOR ) if ( tracerStatus == TracerStatusType::INJECTOR )
tracerStatus = TracerStatusType::VARYING; tracerStatus = TracerStatusType::VARYING;
@ -298,16 +299,16 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
const RigWellResultFrame& wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex ); const RigWellResultFrame& wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
if ( wellResFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR || if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
wellResFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR || wellResFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
wellResFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR ) wellResFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER; if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
return TracerStatusType::INJECTOR; return TracerStatusType::INJECTOR;
} }
else if ( wellResFrame.m_productionType == RigWellResultFrame::PRODUCER || else if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER ||
wellResFrame.m_productionType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ) wellResFrame.m_productionType == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
{ {
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::INJECTOR; if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::INJECTOR;

View File

@ -260,9 +260,9 @@ void RimWellAllocationPlot::updateFromWell()
if ( tracerFractionCellValues.size() ) if ( tracerFractionCellValues.size() )
{ {
bool isProducer = bool isProducer = ( simWellData->wellProductionType( m_timeStep ) == RiaDefines::WellProductionType::PRODUCER ||
( simWellData->wellProductionType( m_timeStep ) == RigWellResultFrame::PRODUCER || simWellData->wellProductionType( m_timeStep ) ==
simWellData->wellProductionType( m_timeStep ) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ); RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
RigEclCellIndexCalculator cellIdxCalc( m_case->eclipseCaseData()->mainGrid(), RigEclCellIndexCalculator cellIdxCalc( m_case->eclipseCaseData()->mainGrid(),
m_case->eclipseCaseData()->activeCellInfo( m_case->eclipseCaseData()->activeCellInfo(
RiaDefines::PorosityModelType::MATRIX_MODEL ) ); RiaDefines::PorosityModelType::MATRIX_MODEL ) );
@ -444,8 +444,9 @@ std::map<QString, const std::vector<double>*>
{ {
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED; RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED;
const RigWellResultFrame::WellProductionType prodType = simWellData->wellProductionType( m_timeStep ); const RiaDefines::WellProductionType prodType = simWellData->wellProductionType( m_timeStep );
if ( prodType == RigWellResultFrame::PRODUCER || prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE ) if ( prodType == RiaDefines::WellProductionType::PRODUCER ||
prodType == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
{ {
requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR; requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR;
} }
@ -593,23 +594,23 @@ QString RimWellAllocationPlot::wellStatusTextForTimeStep( const QString&
{ {
const RigWellResultFrame& wellResultFrame = simWellData->wellResultFrame( timeStep ); const RigWellResultFrame& wellResultFrame = simWellData->wellResultFrame( timeStep );
RigWellResultFrame::WellProductionType prodType = wellResultFrame.m_productionType; RiaDefines::WellProductionType prodType = wellResultFrame.m_productionType;
switch ( prodType ) switch ( prodType )
{ {
case RigWellResultFrame::PRODUCER: case RiaDefines::WellProductionType::PRODUCER:
statusText = "Producer"; statusText = "Producer";
break; break;
case RigWellResultFrame::OIL_INJECTOR: case RiaDefines::WellProductionType::OIL_INJECTOR:
statusText = "Oil Injector"; statusText = "Oil Injector";
break; break;
case RigWellResultFrame::GAS_INJECTOR: case RiaDefines::WellProductionType::GAS_INJECTOR:
statusText = "Gas Injector"; statusText = "Gas Injector";
break; break;
case RigWellResultFrame::WATER_INJECTOR: case RiaDefines::WellProductionType::WATER_INJECTOR:
statusText = "Water Injector"; statusText = "Water Injector";
break; break;
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE: case RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE:
break; break;
default: default:
break; break;

View File

@ -102,9 +102,9 @@ bool RimSimWellInViewTools::isInjector( RimSimWellInView* well )
{ {
const RigWellResultFrame& wrf = wRes->wellResultFrame( currentTimeStep ); const RigWellResultFrame& wrf = wRes->wellResultFrame( currentTimeStep );
if ( wrf.m_productionType == RigWellResultFrame::OIL_INJECTOR || if ( wrf.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
wrf.m_productionType == RigWellResultFrame::GAS_INJECTOR || wrf.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
wrf.m_productionType == RigWellResultFrame::WATER_INJECTOR ) wrf.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{ {
return true; return true;
} }

View File

@ -409,11 +409,11 @@ void RimStreamlineInViewCollection::findStartCells( int
if ( point.isValid() && point.m_isOpen ) if ( point.isValid() && point.m_isOpen )
{ {
RigCell cell = grids[point.m_gridIndex]->cell( point.m_gridCellIndex ); RigCell cell = grids[point.m_gridIndex]->cell( point.m_gridCellIndex );
if ( frame.m_productionType == RigWellResultFrame::WellProductionType::PRODUCER ) if ( frame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
{ {
outProducerCells.push_back( std::pair<QString, RigCell>( swdata->m_wellName, cell ) ); outProducerCells.push_back( std::pair<QString, RigCell>( swdata->m_wellName, cell ) );
} }
else if ( frame.m_productionType != RigWellResultFrame::WellProductionType::UNDEFINED_PRODUCTION_TYPE ) else if ( frame.m_productionType != RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
{ {
outInjectorCells.push_back( std::pair<QString, RigCell>( swdata->m_wellName, cell ) ); outInjectorCells.push_back( std::pair<QString, RigCell>( swdata->m_wellName, cell ) );
} }

View File

@ -400,7 +400,7 @@ void RigReservoirBuilderMock::addWellData( RigEclipseCaseData* eclipseCase, RigG
{ {
RigWellResultFrame& wellCells = wellCellsTimeHistory->m_wellCellsTimeSteps[timeIdx]; RigWellResultFrame& wellCells = wellCellsTimeHistory->m_wellCellsTimeSteps[timeIdx];
wellCells.m_productionType = RigWellResultFrame::PRODUCER; wellCells.m_productionType = RiaDefines::WellProductionType::PRODUCER;
wellCells.m_isOpen = true; wellCells.m_isOpen = true;
wellCells.m_wellHead.m_gridIndex = 0; wellCells.m_wellHead.m_gridIndex = 0;

View File

@ -311,7 +311,7 @@ bool RigSimWellData::isMultiSegmentWell() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigWellResultFrame::WellProductionType RigSimWellData::wellProductionType( size_t resultTimeStepIndex ) const RiaDefines::WellProductionType RigSimWellData::wellProductionType( size_t resultTimeStepIndex ) const
{ {
if ( hasWellResult( resultTimeStepIndex ) ) if ( hasWellResult( resultTimeStepIndex ) )
{ {
@ -320,7 +320,7 @@ RigWellResultFrame::WellProductionType RigSimWellData::wellProductionType( size_
} }
else else
{ {
return RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE; return RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE;
} }
} }

View File

@ -41,9 +41,9 @@ public:
bool hasWellResult( size_t resultTimeStepIndex ) const; bool hasWellResult( size_t resultTimeStepIndex ) const;
bool hasAnyValidCells( size_t resultTimeStepIndex ) const; bool hasAnyValidCells( size_t resultTimeStepIndex ) const;
const RigWellResultFrame& wellResultFrame( size_t resultTimeStepIndex ) const; const RigWellResultFrame& wellResultFrame( size_t resultTimeStepIndex ) const;
bool isOpen( size_t resultTimeStepIndex ) const; bool isOpen( size_t resultTimeStepIndex ) const;
RigWellResultFrame::WellProductionType wellProductionType( size_t resultTimeStepIndex ) const; RiaDefines::WellProductionType wellProductionType( size_t resultTimeStepIndex ) const;
const RigWellResultFrame& staticWellCells() const; const RigWellResultFrame& staticWellCells() const;

View File

@ -18,6 +18,8 @@
#pragma once #pragma once
#include "RiaDefines.h"
#include "cvfVector3.h" #include "cvfVector3.h"
#include <QDateTime> #include <QDateTime>
@ -83,19 +85,9 @@ struct RigWellResultBranch
//================================================================================================== //==================================================================================================
class RigWellResultFrame class RigWellResultFrame
{ {
public:
enum WellProductionType
{
PRODUCER,
OIL_INJECTOR,
GAS_INJECTOR,
WATER_INJECTOR,
UNDEFINED_PRODUCTION_TYPE
};
public: public:
RigWellResultFrame() RigWellResultFrame()
: m_productionType( UNDEFINED_PRODUCTION_TYPE ) : m_productionType( RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
, m_isOpen( false ) , m_isOpen( false )
{ {
} }
@ -103,11 +95,11 @@ public:
const RigWellResultPoint* findResultCellWellHeadIncluded( size_t gridIndex, size_t gridCellIndex ) const; const RigWellResultPoint* findResultCellWellHeadIncluded( size_t gridIndex, size_t gridCellIndex ) const;
const RigWellResultPoint* findResultCellWellHeadExcluded( size_t gridIndex, size_t gridCellIndex ) const; const RigWellResultPoint* findResultCellWellHeadExcluded( size_t gridIndex, size_t gridCellIndex ) const;
RigWellResultPoint wellHeadOrStartCell() const; RigWellResultPoint wellHeadOrStartCell() const;
WellProductionType m_productionType; RiaDefines::WellProductionType m_productionType;
bool m_isOpen; bool m_isOpen;
RigWellResultPoint m_wellHead; RigWellResultPoint m_wellHead;
QDateTime m_timestamp; QDateTime m_timestamp;
std::vector<RigWellResultBranch> m_wellResultBranches; std::vector<RigWellResultBranch> m_wellResultBranches;
}; };

View File

@ -176,16 +176,16 @@ public:
{ {
switch ( currentWellResult->wellResultFrame( tsIdx ).m_productionType ) switch ( currentWellResult->wellResultFrame( tsIdx ).m_productionType )
{ {
case RigWellResultFrame::PRODUCER: case RiaDefines::WellProductionType::PRODUCER:
wellType = "Producer"; wellType = "Producer";
break; break;
case RigWellResultFrame::OIL_INJECTOR: case RiaDefines::WellProductionType::OIL_INJECTOR:
wellType = "OilInjector"; wellType = "OilInjector";
break; break;
case RigWellResultFrame::WATER_INJECTOR: case RiaDefines::WellProductionType::WATER_INJECTOR:
wellType = "WaterInjector"; wellType = "WaterInjector";
break; break;
case RigWellResultFrame::GAS_INJECTOR: case RiaDefines::WellProductionType::GAS_INJECTOR:
wellType = "GasInjector"; wellType = "GasInjector";
break; break;
} }