Add feature to set parent well

This commit is contained in:
Magne Sjaastad
2024-03-25 10:19:31 +01:00
committed by GitHub
parent 7e60a4185b
commit b57767d895
8 changed files with 238 additions and 4 deletions

View File

@@ -30,8 +30,8 @@
#include "RiuMainWindow.h"
#include "RigWellPathGeometryTools.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiLabelEditor.h"
CAF_PDM_SOURCE_INIT( RimWellPathTieIn, "RimWellPathTieIn" );
@@ -42,7 +42,14 @@ RimWellPathTieIn::RimWellPathTieIn()
{
CAF_PDM_InitObject( "Well Path Tie In", ":/NotDefined.png", "", "Well Path Tie In description" );
CAF_PDM_InitFieldNoDefault( &m_infoLabel, "InfoLabel", "Use right-click menu of well to set parent well." );
m_infoLabel.uiCapability()->setUiEditorTypeName( caf::PdmUiLabelEditor::uiEditorTypeName() );
m_infoLabel.xmlCapability()->disableIO();
m_infoLabel.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
CAF_PDM_InitFieldNoDefault( &m_parentWell, "ParentWellPath", "Parent Well Path" );
m_parentWell.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_childWell, "ChildWellPath", "ChildWellPath" );
CAF_PDM_InitFieldNoDefault( &m_tieInMeasuredDepth, "TieInMeasuredDepth", "Tie In Measured Depth" );
m_tieInMeasuredDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
@@ -161,6 +168,7 @@ const RimWellPathValve* RimWellPathTieIn::outletValve() const
void RimWellPathTieIn::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
auto tieInGroup = uiOrdering.addNewGroup( "Tie In Settings" );
tieInGroup->add( &m_infoLabel );
tieInGroup->add( &m_parentWell );
if ( m_parentWell() != nullptr )
{
@@ -187,6 +195,11 @@ void RimWellPathTieIn::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
//--------------------------------------------------------------------------------------------------
void RimWellPathTieIn::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
// TODO: It is not possible to change the parent well from the UI as the field is set to read only. Refactor and possibly delete this
// method.
// https://github.com/OPM/ResInsight/issues/11312
// https://github.com/OPM/ResInsight/issues/11313
if ( changedField == &m_parentWell )
{
updateFirstTargetFromParentWell();