Reduce memory use for summary address object

* Use one common variable for object name, use three ints
* Move enums to separate file
* Refactor use of enums
* Move implementation to cpp
* Refactor includes
This commit is contained in:
Magne Sjaastad
2023-08-21 07:12:08 +02:00
committed by GitHub
parent 1b886c1a1e
commit 96b3bef878
70 changed files with 1252 additions and 1038 deletions

View File

@@ -29,9 +29,9 @@
namespace caf
{
template <>
void caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::setUp()
void caf::AppEnum<RifEclipseSummaryAddressDefines::SummaryVarCategory>::setUp()
{
using RifAdr = RifEclipseSummaryAddress;
using RifAdr = RifEclipseSummaryAddressDefines::SummaryVarCategory;
addItem( RifAdr::SUMMARY_FIELD, "SUMMARY_FIELD", RiaDefines::summaryField() );
addItem( RifAdr::SUMMARY_AQUIFER, "SUMMARY_AQUIFER", RiaDefines::summaryAquifer() );
@@ -82,7 +82,7 @@ RimSummaryAddress::RimSummaryAddress()
CAF_PDM_InitField( &m_caseId, "CaseId", -1, "CaseId" );
CAF_PDM_InitField( &m_ensembleId, "EnsembleId", -1, "EnsembleId" );
m_category = RifEclipseSummaryAddress::SUMMARY_INVALID;
m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID;
m_regionNumber = -1;
m_regionNumber2 = -1;
m_wellSegmentNumber = -1;
@@ -186,14 +186,14 @@ RiaDefines::PhaseType RimSummaryAddress::addressPhaseType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddress::SummaryVarCategory category ) const
QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const
{
// Return the keyword text for supported field replacement in plot templates
if ( category == RifEclipseSummaryAddress::SUMMARY_WELL ) return m_wellName.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_GROUP ) return m_groupName.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_REGION ) return m_regionNumber.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK ) return m_networkName.keyword();
if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) return m_wellName.keyword();
if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) return m_groupName.keyword();
if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) return m_regionNumber.keyword();
if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) return m_networkName.keyword();
return {};
}