Improve how wells are connected during import

When importing new wells, consider all wells when connecting multi segment wells
Make sure that import of individual well paths will give the same ordering as importing all wells in a single operation.
This commit is contained in:
Magne Sjaastad
2023-03-07 12:51:14 +01:00
committed by GitHub
parent fc7bde8d35
commit 51331facac
13 changed files with 98 additions and 88 deletions

View File

@@ -81,7 +81,7 @@ RimStimPlanModel* RicNewStimPlanModelFeature::addStimPlanModel( RimWellPath*
stimPlanModel->setThicknessDirectionWellPath( thicknessDirectionWellPath );
std::vector<RimWellPath*> wellPaths = { thicknessDirectionWellPath };
wellPathCollection->addWellPaths( wellPaths, false );
wellPathCollection->addWellPaths( wellPaths );
if ( project )
{

View File

@@ -127,9 +127,8 @@ void RicCreateEnsembleWellLogFeature::executeCommand( const RicCreateEnsembleWel
// Load well path from file
QStringList wellPathFilePaths;
wellPathFilePaths << ui.wellPathFilePath();
bool importGrouped = false;
QStringList errorMessages;
std::vector<RimWellPath*> wellPaths = RicImportWellPaths::importWellPaths( wellPathFilePaths, importGrouped, &errorMessages );
std::vector<RimWellPath*> wellPaths = RicImportWellPaths::importWellPaths( wellPathFilePaths, &errorMessages );
if ( wellPaths.empty() ) return;
wellPath = wellPaths[0];

View File

@@ -118,7 +118,7 @@ void RicWellPathsImportSsihubFeature::onActionTriggered( bool isChecked )
if ( wellPaths.size() > 0 )
{
QStringList errorMessages;
app->addWellPathsToModel( wellPaths, false, &errorMessages );
app->addWellPathsToModel( wellPaths, &errorMessages );
app->project()->scheduleCreateDisplayModelAndRedrawAllViews();
}

View File

@@ -163,7 +163,7 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
newModeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( measuredDepth );
wellPathCollection->addWellPath( newModeledWellPath, false );
wellPathCollection->addWellPath( newModeledWellPath );
newModeledWellPath->resolveReferencesRecursively();
newModeledWellPath->updateReferencePoint();

View File

@@ -66,7 +66,6 @@ RicImportWellPaths::RicImportWellPaths()
{
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPathFolder, "wellPathFolder", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPathFiles, "wellPathFiles", "" );
CAF_PDM_InitScriptableField( &m_importGrouped, "importGrouped", false, "" );
}
//--------------------------------------------------------------------------------------------------
@@ -124,7 +123,7 @@ caf::PdmScriptResponse RicImportWellPaths::execute()
caf::PdmScriptResponse response;
if ( !wellPathFiles.empty() )
{
std::vector<RimWellPath*> importedWellPaths = importWellPaths( wellPathFiles, m_importGrouped(), &warningMessages );
std::vector<RimWellPath*> importedWellPaths = importWellPaths( wellPathFiles, &warningMessages );
if ( !importedWellPaths.empty() )
{
RicImportWellPathsResult* wellPathsResult = new RicImportWellPathsResult;
@@ -157,15 +156,14 @@ caf::PdmScriptResponse RicImportWellPaths::execute()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*>
RicImportWellPaths::importWellPaths( const QStringList& wellPathFilePaths, bool importGrouped, QStringList* errorMessages )
std::vector<RimWellPath*> RicImportWellPaths::importWellPaths( const QStringList& wellPathFilePaths, QStringList* errorMessages )
{
RiaApplication* app = RiaApplication::instance();
// Remember the path to next time
app->setLastUsedDialogDirectory( "WELLPATH_DIR", QFileInfo( wellPathFilePaths.last() ).absolutePath() );
std::vector<RimWellPath*> wellPaths = app->addWellPathsToModel( wellPathFilePaths, importGrouped, errorMessages );
std::vector<RimWellPath*> wellPaths = app->addWellPathsToModel( wellPathFilePaths, errorMessages );
RimProject* project = app->project();

View File

@@ -42,7 +42,7 @@ public:
RicImportWellPaths();
caf::PdmScriptResponse execute() override;
static std::vector<RimWellPath*> importWellPaths( const QStringList& wellPathFilePaths, bool importGrouped, QStringList* errorMessages );
static std::vector<RimWellPath*> importWellPaths( const QStringList& wellPathFilePaths, QStringList* errorMessages );
protected:
static QStringList wellPathNameFilters();
@@ -54,5 +54,4 @@ protected:
protected:
caf::PdmField<QString> m_wellPathFolder;
caf::PdmField<std::vector<QString>> m_wellPathFiles;
caf::PdmField<bool> m_importGrouped;
};

View File

@@ -80,7 +80,7 @@ void RicNewEditableWellPathFeature::onActionTriggered( bool isChecked )
newWellPaths.back()->setName( "Well-" + QString::number( modelledWellpathCount + 1 ) );
newModeledWellPath->setWellPathColor( RiaColorTables::editableWellPathsPaletteColors().cycledColor3f( modelledWellpathCount ) );
wellPathCollection->addWellPaths( newWellPaths, false );
wellPathCollection->addWellPaths( newWellPaths );
wellPathCollection->uiCapability()->updateConnectedEditors();
newModeledWellPath->geometryDefinition()->enableTargetPointPicking( true );

View File

@@ -116,8 +116,7 @@ RimModeledWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasured
newModeledWellPath->createWellPathGeometry();
bool importGrouped = false;
wellPathColl->addWellPath( newModeledWellPath, importGrouped );
wellPathColl->addWellPath( newModeledWellPath );
wellPathColl->updateAllRequiredEditors();
project->scheduleCreateDisplayModelAndRedrawAllViews();

View File

@@ -155,7 +155,7 @@ RimModeledWellPath* RicPasteModeledWellPathFeature::duplicateAndInitializeWellPa
QString name = sourceWellPath->name() + "(copy)";
destinationWellPath->setName( name );
wpc->addWellPath( destinationWellPath, false );
wpc->addWellPath( destinationWellPath );
// Resolve references, will connect to the fracture template
destinationWellPath->resolveReferencesRecursively();