Move Reference Well functionality to WellLogExtractionCurve

* Remove reference well feature from plot objects
* Move Reference Well functionality to WellLogExtractionCurve
* Reset reference well selection if new selected well path equals ref
This commit is contained in:
Jørgen Herje
2023-01-23 15:07:48 +01:00
committed by GitHub
parent f48eca9ef5
commit 632107e77c
9 changed files with 30 additions and 135 deletions

View File

@@ -101,6 +101,8 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
CAF_PDM_InitFieldNoDefault( &m_wellPath, "CurveWellPath", "Well Name" );
m_wellPath.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitFieldNoDefault( &m_refWellPath, "ReferenceWellPath", "Reference Well Path" );
CAF_PDM_InitField( &m_simWellName, "SimulationWellName", QString( "" ), "Well Name" );
CAF_PDM_InitField( &m_branchDetection,
"BranchDetection",
@@ -153,6 +155,7 @@ RimWellLogExtractionCurve::~RimWellLogExtractionCurve()
void RimWellLogExtractionCurve::setWellPath( RimWellPath* wellPath )
{
m_wellPath = wellPath;
if ( m_wellPath == m_refWellPath ) m_refWellPath = nullptr;
}
//--------------------------------------------------------------------------------------------------
@@ -302,6 +305,11 @@ void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* cha
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_wellPath )
{
if ( m_wellPath == m_refWellPath ) m_refWellPath = nullptr;
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_refWellPath )
{
this->loadDataAndUpdate( true );
}
@@ -549,7 +557,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
}
// Reference well adjustment does not support simulated wells
if ( m_trajectoryType == WELL_PATH && wellExtractor.notNull() && refWellExtractor.notNull() && m_useRefWell )
if ( m_trajectoryType == WELL_PATH && wellExtractor.notNull() && refWellExtractor.notNull() )
{
RigEclipseResultAddress indexKResAdr( RiaDefines::ResultCatType::STATIC_NATIVE,
RiaResultNames::indexKResultName() );
@@ -639,7 +647,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
const std::string fieldName = m_geomResultDefinition->resultAddress().fieldName;
const bool isNeglectedFieldName = fieldName == RiaResultNames::wbsAzimuthResult().toStdString() ||
fieldName == RiaResultNames::wbsInclinationResult().toStdString();
if ( !isNeglectedFieldName && wellExtractor.notNull() && refWellExtractor.notNull() && m_useRefWell )
if ( !isNeglectedFieldName && wellExtractor.notNull() && refWellExtractor.notNull() )
{
RigFemResultAddress indexKResAdr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "INDEX", "INDEX_K" );
@@ -968,6 +976,11 @@ QList<caf::PdmOptionItemInfo>
{
RimTools::wellPathOptionItems( &options );
}
if ( fieldNeedingOptions == &m_refWellPath )
{
options.push_back( caf::PdmOptionItemInfo( QString( "None" ), nullptr ) );
RimTools::wellPathOptionItemsSubset( { m_wellPath() }, &options );
}
else if ( fieldNeedingOptions == &m_case )
{
RimTools::caseOptionItems( &options );
@@ -1015,6 +1028,7 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm
if ( m_trajectoryType() == WELL_PATH )
{
curveDataGroup->add( &m_wellPath );
curveDataGroup->add( &m_refWellPath );
RimWellLogCurve::defineUiOrdering( uiConfigName, uiOrdering );
}
else
@@ -1031,6 +1045,7 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm
else if ( geomCase )
{
curveDataGroup->add( &m_wellPath );
curveDataGroup->add( &m_refWellPath );
RimWellLogCurve::defineUiOrdering( uiConfigName, uiOrdering );
m_geomResultDefinition->uiOrdering( uiConfigName, *curveDataGroup );
@@ -1171,7 +1186,7 @@ QString RimWellLogExtractionCurve::createCurveAutoName()
}
}
if ( m_useRefWell && m_refWellPath && !m_refWellPath->name().isEmpty() )
if ( m_refWellPath() != nullptr && !m_refWellPath->name().isEmpty() )
{
generatedCurveName.push_back( QString( "Ref. Well: %1" ).arg( m_refWellPath->name() ) );
}