mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7818 Modeled Well Path : Update location of completions
This commit is contained in:
@@ -18,12 +18,15 @@
|
||||
|
||||
#include "RicCreateMultipleWellPathLaterals.h"
|
||||
|
||||
#include "RicNewWellPathLateralAtDepthFeature.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimWellPathTieIn.h"
|
||||
@@ -133,9 +136,12 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
|
||||
RimModeledWellPath* sourceLateral = m_ui->sourceLateral();
|
||||
|
||||
if ( !sourceLateral ) return;
|
||||
if ( !sourceLateral->wellPathTieIn()->parentWell() ) return;
|
||||
|
||||
auto parentWellPath = sourceLateral->wellPathTieIn()->parentWell();
|
||||
if ( !parentWellPath ) return;
|
||||
|
||||
auto sourceLocationOfFirstWellTarget = sourceLateral->geometryDefinition()->firstActiveTarget()->targetPointXYZ();
|
||||
auto sourceTieInMeasuredDepth = sourceLateral->wellPathTieIn()->tieInMeasuredDepth();
|
||||
|
||||
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
|
||||
if ( wellPathCollection )
|
||||
@@ -146,8 +152,10 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
|
||||
RimModeledWellPath* newModeledWellPath = dynamic_cast<RimModeledWellPath*>(
|
||||
sourceLateral->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
QString name = sourceLateral->name() + QString( " (# %1)" ).arg( index++ );
|
||||
newModeledWellPath->setName( name );
|
||||
auto nameOfNewWell =
|
||||
RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( parentWellPath );
|
||||
newModeledWellPath->setName( nameOfNewWell );
|
||||
|
||||
newModeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( measuredDepth );
|
||||
|
||||
wellPathCollection->addWellPath( newModeledWellPath, false );
|
||||
@@ -156,12 +164,16 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
|
||||
newModeledWellPath->updateReferencePoint();
|
||||
|
||||
updateLocationOfTargets( newModeledWellPath, sourceLocationOfFirstWellTarget );
|
||||
updateLocationOfCompletions( newModeledWellPath, sourceTieInMeasuredDepth );
|
||||
|
||||
newModeledWellPath->updateWellPathVisualization();
|
||||
}
|
||||
|
||||
wellPathCollection->rebuildWellPathNodes();
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( sourceLateral );
|
||||
|
||||
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
|
||||
m_ui->updateConnectedEditors();
|
||||
@@ -191,3 +203,18 @@ void RicCreateMultipleWellPathLaterals::updateLocationOfTargets( RimModeledWellP
|
||||
wellTarget->setPointXYZ( newTargetLocationXYZ );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateMultipleWellPathLaterals::updateLocationOfCompletions( RimModeledWellPath* newModeledWellPath,
|
||||
const double sourceTieInMeasuredDepth )
|
||||
{
|
||||
auto tieInMeasuredDepth = newModeledWellPath->wellPathTieIn()->tieInMeasuredDepth();
|
||||
auto diffMD = tieInMeasuredDepth - sourceTieInMeasuredDepth;
|
||||
|
||||
for ( auto completion : newModeledWellPath->completions()->allCompletionsNoConst() )
|
||||
{
|
||||
completion->applyOffset( diffMD );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,12 @@ protected:
|
||||
private slots:
|
||||
void slotAppendFractures();
|
||||
|
||||
private:
|
||||
void updateLocationOfTargets( RimModeledWellPath* newModeledWellPath,
|
||||
const cvf::Vec3d& sourceLocationOfFirstWellTarget );
|
||||
|
||||
void updateLocationOfCompletions( RimModeledWellPath* newModeledWellPath, const double sourceTieInMeasuredDepth );
|
||||
|
||||
private:
|
||||
std::unique_ptr<RicCreateMultipleWellPathLateralsUi> m_ui;
|
||||
};
|
||||
|
||||
@@ -147,13 +147,13 @@ RiuWellPathSelectionItem* RicNewWellPathLateralAtDepthFeature::wellPathSelection
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentwWellPath )
|
||||
QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath )
|
||||
{
|
||||
if ( !parentwWellPath ) return "";
|
||||
if ( !parentWellPath ) return "";
|
||||
|
||||
QString nameOfNewWell;
|
||||
|
||||
auto topLevelWell = parentwWellPath->topLevelWellPath();
|
||||
auto topLevelWell = parentWellPath->topLevelWellPath();
|
||||
|
||||
QStringList allNames;
|
||||
{
|
||||
@@ -175,7 +175,7 @@ QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSide
|
||||
|
||||
if ( allNames.size() == 1 )
|
||||
{
|
||||
QString name = parentwWellPath->name();
|
||||
QString name = parentWellPath->name();
|
||||
|
||||
if ( name.contains( "Y1" ) )
|
||||
{
|
||||
@@ -183,7 +183,7 @@ QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSide
|
||||
}
|
||||
else
|
||||
{
|
||||
parentwWellPath->setNameNoUpdateOfExportName( name + " Y1" );
|
||||
parentWellPath->setNameNoUpdateOfExportName( name + " Y1" );
|
||||
nameOfNewWell = name + " Y2";
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ public:
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
static RimWellPath* createLateralAtMeasuredDepth( RimWellPath* parentWellPath, double parentWellMD );
|
||||
static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath );
|
||||
|
||||
private:
|
||||
static RiuWellPathSelectionItem* wellPathSelectionItem();
|
||||
static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentwWellPath );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user