#12214 Make old project files work with new categories

Lumped vectors was moved from well vectors into well completions. Old well completion vectors are moved into new Well Connections.
This commit is contained in:
Magne Sjaastad committed 2025-03-14 16:09:30 +01:00
1 parent f1d2018fb4
commit 4a946f8856
2 files changed
+29

No files matched your search

@@ -18,6 +18,7 @@
#include "RimSummaryAddress.h"
#include "RiaLogging.h"
#include "Summary/RiaSummaryDefines.h"
#include <QRegularExpression>
@@ -264,3 +265,30 @@ QString RimSummaryAddress::iconResourceText() const
return ":/DataVector.svg";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAddress::initAfterRead()
{
// The changes in this function is related to https://github.com/OPM/ResInsight/issues/12214
//
// Lumped connection vectors was previously displayed as well vectors. Move them into well completions and extract the well
// completion number.
if ( m_vectorName().contains( "__" ) && m_category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL )
{
RiaLogging::info( "Converting lumped vector with '*L__N' syntax into Well Completion." + m_vectorName() );
m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION;
m_wellCompletionNumber = m_vectorName().split( "__" ).last().toInt();
m_vectorName = m_vectorName().split( "__" ).first();
}
// Lumped connection vectors was previously displayed as well completion vectors. Move them into well completions
if ( m_vectorName().startsWith( "C" ) && m_category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION )
{
RiaLogging::info( "Converting completion vector starting with 'C' syntax into Well Connection." + m_vectorName() );
m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_CONNECTION;
}
}
@@ -62,6 +62,7 @@ protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QString iconResourceText() const;
void initAfterRead() override;
private:
caf::PdmField<caf::AppEnum<RifEclipseSummaryAddressDefines::SummaryCategory>> m_category;