Convert to enum class

This commit is contained in:
Magne Sjaastad
2020-04-23 23:25:22 +02:00
parent 8aa36ee31e
commit 3f88fe197a
56 changed files with 696 additions and 542 deletions

View File

@@ -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++ )
{

View File

@@ -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 );

View File

@@ -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 <>

View File

@@ -25,7 +25,7 @@
namespace RiaDefines
{
enum ResultCatType
enum class ResultCatType
{
DYNAMIC_NATIVE,
STATIC_NATIVE,

View File

@@ -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 )
{

View File

@@ -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();