#7309 Fracture: Add option to auto-update well/fracture intersection from template.

This commit is contained in:
Kristian Bendiksen
2021-02-01 10:44:28 +01:00
committed by Magne Sjaastad
parent 6fad32e734
commit e2c7d11049
6 changed files with 66 additions and 4 deletions

View File

@@ -116,6 +116,14 @@ RimFracture::RimFracture()
m_createStimPlanFractureTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() ); m_createStimPlanFractureTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
m_createStimPlanFractureTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); m_createStimPlanFractureTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
CAF_PDM_InitField( &m_autoUpdateWellPathDepthAtFractureFromTemplate,
"AutoUpdateWellPathDepthAtFractureFromTemplate",
true,
"Auto-Update From Template",
"",
"",
"" );
CAF_PDM_InitField( &m_wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Well/Fracture Intersection Depth", "", "", "" ); CAF_PDM_InitField( &m_wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Well/Fracture Intersection Depth", "", "", "" );
m_wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); m_wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
@@ -270,6 +278,16 @@ void RimFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
RicNewStimPlanFractureTemplateFeature::createNewTemplateForFractureAndUpdate( this ); RicNewStimPlanFractureTemplateFeature::createNewTemplateForFractureAndUpdate( this );
} }
else if ( changedField == &m_autoUpdateWellPathDepthAtFractureFromTemplate )
{
if ( m_autoUpdateWellPathDepthAtFractureFromTemplate && m_fractureTemplate() )
{
m_wellPathDepthAtFracture = m_fractureTemplate->wellPathDepthAtFracture();
}
updateFractureGrid();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
else if ( changedField == &m_wellPathDepthAtFracture ) else if ( changedField == &m_wellPathDepthAtFracture )
{ {
updateFractureGrid(); updateFractureGrid();
@@ -556,7 +574,18 @@ void RimFracture::setFractureTemplateNoUpdate( RimFractureTemplate* fractureTemp
return; return;
} }
if ( m_fractureTemplate )
{
m_fractureTemplate->wellPathDepthAtFractureChanged.disconnect( this );
}
m_fractureTemplate = fractureTemplate; m_fractureTemplate = fractureTemplate;
if ( m_fractureTemplate )
{
m_fractureTemplate->wellPathDepthAtFractureChanged.connect( this,
&RimFracture::onWellPathDepthAtFractureInTemplateChanged );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -948,4 +977,23 @@ void RimFracture::initAfterRead()
} }
} }
} }
if ( m_fractureTemplate() )
{
m_fractureTemplate->wellPathDepthAtFractureChanged.connect( this,
&RimFracture::onWellPathDepthAtFractureInTemplateChanged );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFracture::onWellPathDepthAtFractureInTemplateChanged( const caf::SignalEmitter* emitter, double newDepth )
{
if ( m_autoUpdateWellPathDepthAtFractureFromTemplate )
{
m_wellPathDepthAtFracture = newDepth;
updateFractureGrid();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
} }

View File

@@ -157,11 +157,14 @@ private:
cvf::BoundingBox boundingBoxInDomainCoords() const override; cvf::BoundingBox boundingBoxInDomainCoords() const override;
void onWellPathDepthAtFractureInTemplateChanged( const caf::SignalEmitter* emitter, double newDepth );
protected: protected:
caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate; caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate;
caf::PdmField<bool> m_editFractureTemplate; caf::PdmField<bool> m_editFractureTemplate;
caf::PdmField<bool> m_createEllipseFractureTemplate; caf::PdmField<bool> m_createEllipseFractureTemplate;
caf::PdmField<bool> m_createStimPlanFractureTemplate; caf::PdmField<bool> m_createStimPlanFractureTemplate;
caf::PdmField<bool> m_autoUpdateWellPathDepthAtFractureFromTemplate;
caf::PdmField<double> m_wellPathDepthAtFracture; caf::PdmField<double> m_wellPathDepthAtFracture;
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition; caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
caf::PdmField<caf::AppEnum<RiaDefines::EclipseUnitSystem>> m_fractureUnit; caf::PdmField<caf::AppEnum<RiaDefines::EclipseUnitSystem>> m_fractureUnit;

View File

@@ -107,6 +107,7 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimFractureTemplate, "RimFractureTemplate" );
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFractureTemplate::RimFractureTemplate() RimFractureTemplate::RimFractureTemplate()
: wellPathDepthAtFractureChanged( this )
{ {
CAF_PDM_InitObject( "Fracture Template", ":/FractureTemplate16x16.png", "", "" ); CAF_PDM_InitObject( "Fracture Template", ":/FractureTemplate16x16.png", "", "" );
@@ -348,6 +349,11 @@ void RimFractureTemplate::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
} }
} }
if ( changedField == &m_wellPathDepthAtFracture )
{
wellPathDepthAtFractureChanged.send( newValue.toDouble() );
}
for ( RimFracture* fracture : fracturesUsingThisTemplate() ) for ( RimFracture* fracture : fracturesUsingThisTemplate() )
{ {
fracture->clearCachedNonDarcyProperties(); fracture->clearCachedNonDarcyProperties();

View File

@@ -27,6 +27,7 @@
#include "cafPdmFieldHandle.h" #include "cafPdmFieldHandle.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cafPdmProxyValueField.h" #include "cafPdmProxyValueField.h"
#include "cafSignal.h"
#include "cvfObject.h" #include "cvfObject.h"
#include "cvfVector3.h" #include "cvfVector3.h"
@@ -124,6 +125,8 @@ public:
RimFractureTemplate(); RimFractureTemplate();
~RimFractureTemplate() override; ~RimFractureTemplate() override;
caf::Signal<double> wellPathDepthAtFractureChanged;
int id() const; int id() const;
QString name() const; QString name() const;
QString nameAndUnit() const; QString nameAndUnit() const;

View File

@@ -387,13 +387,13 @@ void RimStimPlanFractureTemplate::computeDepthOfWellPathAtFracture()
if ( firstTvd != HUGE_VAL && lastTvd != HUGE_VAL ) if ( firstTvd != HUGE_VAL && lastTvd != HUGE_VAL )
{ {
m_wellPathDepthAtFracture = ( firstTvd + lastTvd ) / 2; m_wellPathDepthAtFracture.setValueWithFieldChanged( ( firstTvd + lastTvd ) / 2 );
} }
else else
{ {
firstTvd = m_stimPlanFractureDefinitionData->minDepth(); firstTvd = m_stimPlanFractureDefinitionData->minDepth();
lastTvd = m_stimPlanFractureDefinitionData->maxDepth(); lastTvd = m_stimPlanFractureDefinitionData->maxDepth();
m_wellPathDepthAtFracture = ( firstTvd + lastTvd ) / 2; m_wellPathDepthAtFracture.setValueWithFieldChanged( ( firstTvd + lastTvd ) / 2 );
} }
} }
} }

View File

@@ -275,7 +275,9 @@ void RimWellPathFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup( "Fracture Center Info" ); caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup( "Fracture Center Info" );
fractureCenterGroup->add( &m_uiAnchorPosition ); fractureCenterGroup->add( &m_uiAnchorPosition );
uiOrdering.add( &m_autoUpdateWellPathDepthAtFractureFromTemplate );
uiOrdering.add( &m_wellPathDepthAtFracture ); uiOrdering.add( &m_wellPathDepthAtFracture );
m_wellPathDepthAtFracture.uiCapability()->setUiReadOnly( m_autoUpdateWellPathDepthAtFractureFromTemplate() );
uiOrdering.skipRemainingFields( true ); uiOrdering.skipRemainingFields( true );
} }