mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Convert to enum class
This commit is contained in:
@@ -567,7 +567,7 @@ bool RiaApplication::loadProject( const QString& projectFileName,
|
||||
// If load action is specified to recalculate statistics, do it now.
|
||||
// Apparently this needs to be done before the views are loaded, lest the number of time steps for statistics will
|
||||
// be clamped
|
||||
if ( loadAction & int( ProjectLoadAction::PLA_CALCULATE_STATISTICS ) )
|
||||
if ( loadAction == ProjectLoadAction::PLA_CALCULATE_STATISTICS )
|
||||
{
|
||||
for ( size_t oilFieldIdx = 0; oilFieldIdx < m_project->oilFields().size(); oilFieldIdx++ )
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
|
||||
{
|
||||
eclipseCase->eclipseCaseData()
|
||||
->results( RiaDefines::MATRIX_MODEL )
|
||||
->clearScalarResult( RiaDefines::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName() );
|
||||
->clearScalarResult( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName() );
|
||||
|
||||
// Delete virtual perforation transmissibilities, as these are the basis for the computation of completion type
|
||||
eclipseCase->eclipseCaseData()->setVirtualPerforationTransmissibilities( nullptr );
|
||||
|
||||
@@ -27,16 +27,16 @@ namespace caf
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::ResultCatType>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::DYNAMIC_NATIVE, "DYNAMIC_NATIVE", "Dynamic" );
|
||||
addItem( RiaDefines::STATIC_NATIVE, "STATIC_NATIVE", "Static" );
|
||||
addItem( RiaDefines::SOURSIMRL, "SOURSIMRL", "SourSimRL" );
|
||||
addItem( RiaDefines::GENERATED, "GENERATED", "Generated" );
|
||||
addItem( RiaDefines::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property" );
|
||||
addItem( RiaDefines::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names" );
|
||||
addItem( RiaDefines::ALLEN_DIAGRAMS, "ALLEN_DIAGRAMS", "Allen Diagrams" );
|
||||
addItem( RiaDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics" );
|
||||
addItem( RiaDefines::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding" );
|
||||
setDefault( RiaDefines::DYNAMIC_NATIVE );
|
||||
addItem( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "DYNAMIC_NATIVE", "Dynamic" );
|
||||
addItem( RiaDefines::ResultCatType::STATIC_NATIVE, "STATIC_NATIVE", "Static" );
|
||||
addItem( RiaDefines::ResultCatType::SOURSIMRL, "SOURSIMRL", "SourSimRL" );
|
||||
addItem( RiaDefines::ResultCatType::GENERATED, "GENERATED", "Generated" );
|
||||
addItem( RiaDefines::ResultCatType::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property" );
|
||||
addItem( RiaDefines::ResultCatType::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names" );
|
||||
addItem( RiaDefines::ResultCatType::ALLEN_DIAGRAMS, "ALLEN_DIAGRAMS", "Allen Diagrams" );
|
||||
addItem( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics" );
|
||||
addItem( RiaDefines::ResultCatType::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding" );
|
||||
setDefault( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
enum ResultCatType
|
||||
enum class ResultCatType
|
||||
{
|
||||
DYNAMIC_NATIVE,
|
||||
STATIC_NATIVE,
|
||||
|
||||
@@ -254,7 +254,7 @@ QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions( const caf
|
||||
|
||||
const RigEclipseResultInfo* resInfo = caseData->resultInfo( resultAddr );
|
||||
|
||||
QString posText = caf::AppEnum<RiaDefines::ResultCatType>::uiTextFromIndex( resInfo->resultType() );
|
||||
QString posText = caf::AppEnum<RiaDefines::ResultCatType>::uiText( resInfo->resultType() );
|
||||
QString resultsText = QString( "%1, %2" ).arg( posText ).arg( resInfo->resultName() );
|
||||
if ( inUse )
|
||||
{
|
||||
|
||||
@@ -270,7 +270,7 @@ bool RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( const QString
|
||||
|
||||
RimEclipseView* riv = rimInputReservoir->createAndAddReservoirView();
|
||||
|
||||
riv->cellResult()->setResultType( RiaDefines::INPUT_PROPERTY );
|
||||
riv->cellResult()->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
|
||||
|
||||
riv->loadDataAndUpdate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user