mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7727 Well Path : Simplify access to all well paths
This commit is contained in:
parent
087cf41773
commit
afb293db52
@ -144,23 +144,19 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
|
||||
{
|
||||
caf::ProgressInfo progress( topLevelWellPaths.size(), "Extracting Completion Data For Well Paths" );
|
||||
|
||||
for ( RimWellPath* wellPath : topLevelWellPaths )
|
||||
for ( RimWellPath* topLevelWellPath : topLevelWellPaths )
|
||||
{
|
||||
std::vector<RimWellPath*> allWellPathLaterals;
|
||||
if ( wellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() )
|
||||
if ( topLevelWellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() )
|
||||
{
|
||||
auto tieInWells = wellPath->wellPathLateralsRecursively();
|
||||
for ( auto w : tieInWells )
|
||||
{
|
||||
allWellPathLaterals.push_back( w );
|
||||
}
|
||||
allWellPathLaterals = topLevelWellPath->wellPathLateralsRecursively();
|
||||
}
|
||||
else
|
||||
{
|
||||
int caseId = exportSettings.caseToApply->caseId();
|
||||
QString format = QString(
|
||||
"Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"" );
|
||||
QString errMsg = format.arg( wellPath->name() ).arg( caseId );
|
||||
QString errMsg = format.arg( topLevelWellPath->name() ).arg( caseId );
|
||||
RiaLogging::error( errMsg );
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ bool RicDeleteSubItemsFeature::hasDeletableSubItems( caf::PdmUiItem* uiItem )
|
||||
|
||||
{
|
||||
auto collection = dynamic_cast<RimWellPathCollection*>( uiItem );
|
||||
if ( collection && !collection->topLevelWellPaths().empty() )
|
||||
if ( collection && !collection->allWellPaths().empty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ std::vector<RimWellPath*> RicImportWellPaths::importWellPaths( const QStringList
|
||||
project->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
RimOilField* oilField = project->activeOilField();
|
||||
|
||||
if ( oilField && !oilField->wellPathCollection->topLevelWellPaths().empty() )
|
||||
if ( oilField && !oilField->wellPathCollection->allWellPaths().empty() )
|
||||
{
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
|
||||
if ( wellPath )
|
||||
|
@ -78,7 +78,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( !oilField ) return;
|
||||
|
||||
if ( oilField->wellPathCollection->topLevelWellPaths().size() > 0 )
|
||||
if ( oilField->wellPathCollection->allWellPaths().size() > 0 )
|
||||
{
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
|
||||
if ( wellPath )
|
||||
|
@ -270,7 +270,7 @@ std::vector<RimWellPath*>
|
||||
scheduleRedrawAffectedViews();
|
||||
updateAllRequiredEditors();
|
||||
|
||||
return topLevelWellPaths();
|
||||
return allWellPaths();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -285,22 +285,12 @@ void RimWellPathCollection::addWellPath( gsl::not_null<RimWellPath*> wellPath, b
|
||||
m_mostRecentlyUpdatedWellPath = wellPath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RimWellPathCollection::topLevelWellPaths() const
|
||||
{
|
||||
return m_wellPaths.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RimWellPathCollection::allWellPaths() const
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
descendantsOfType( wellPaths );
|
||||
return wellPaths;
|
||||
return m_wellPaths.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -94,7 +94,6 @@ public:
|
||||
|
||||
void loadDataAndUpdate();
|
||||
std::vector<RimWellPath*> addWellPaths( QStringList filePaths, bool importGrouped, QStringList* errorMessages );
|
||||
std::vector<RimWellPath*> topLevelWellPaths() const;
|
||||
std::vector<RimWellPath*> allWellPaths() const;
|
||||
void removeWellPath( gsl::not_null<RimWellPath*> wellPath );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user