mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Remove duplicated code
This commit is contained in:
parent
9d58769f89
commit
098fda9816
@ -284,3 +284,16 @@ QString RiaDefines::defaultDirectoryLabel( RiaDefines::ImportFileType fileType )
|
|||||||
|
|
||||||
return defaultDirLabel;
|
return defaultDirLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RiaDefines::isInjector( WellProductionType wellProductionType )
|
||||||
|
{
|
||||||
|
if ( wellProductionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||||
|
wellProductionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||||
|
wellProductionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -192,4 +192,6 @@ enum class WellProductionType : short
|
|||||||
UNDEFINED_PRODUCTION_TYPE
|
UNDEFINED_PRODUCTION_TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool isInjector( WellProductionType wellProductionType );
|
||||||
|
|
||||||
}; // namespace RiaDefines
|
}; // namespace RiaDefines
|
||||||
|
@ -316,9 +316,7 @@ 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 == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
if ( RiaDefines::isInjector( productionType ) )
|
||||||
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 );
|
||||||
|
@ -244,9 +244,7 @@ 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 == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
if ( RiaDefines::isInjector( wellResFrame.m_productionType ) )
|
||||||
wellResFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
|
||||||
wellResFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
|
||||||
{
|
{
|
||||||
if ( tracerStatus == TracerStatusType::PRODUCER )
|
if ( tracerStatus == TracerStatusType::PRODUCER )
|
||||||
tracerStatus = TracerStatusType::VARYING;
|
tracerStatus = TracerStatusType::VARYING;
|
||||||
@ -300,9 +298,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
|||||||
|
|
||||||
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
||||||
|
|
||||||
if ( wellResFrame->m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
if ( RiaDefines::isInjector( wellResFrame->m_productionType ) )
|
||||||
wellResFrame->m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
|
||||||
wellResFrame->m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
|
||||||
{
|
{
|
||||||
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
|
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
|
||||||
|
|
||||||
|
@ -103,9 +103,7 @@ bool RimSimWellInViewTools::isInjector( RimSimWellInView* well )
|
|||||||
{
|
{
|
||||||
const RigWellResultFrame* wrf = wRes->wellResultFrame( currentTimeStep );
|
const RigWellResultFrame* wrf = wRes->wellResultFrame( currentTimeStep );
|
||||||
|
|
||||||
if ( wrf->m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
if ( RiaDefines::isInjector( wrf->m_productionType ) )
|
||||||
wrf->m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
|
||||||
wrf->m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user