mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
Select newest RimWellPath on import of formations and well paths
This commit is contained in:
parent
d2e590875d
commit
e89d2c0717
@ -67,16 +67,11 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked)
|
||||
project->createDisplayModelAndRedrawAllViews();
|
||||
RimOilField* oilField = project->activeOilField();
|
||||
|
||||
if (!oilField)
|
||||
return;
|
||||
if (!oilField) return;
|
||||
|
||||
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||
{
|
||||
RimWellPath* wellPath = nullptr;
|
||||
QString wellPathName = oilField->wellPathCollection->newestAddedWellName();
|
||||
|
||||
wellPath = oilField->wellPathCollection->wellPathByName(wellPathName);
|
||||
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
|
||||
if (wellPath)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||
|
@ -70,12 +70,7 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||
{
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
QString wellPathName = oilField->wellPathCollection->newestAddedWellName();
|
||||
|
||||
wellPath = oilField->wellPathCollection->wellPathByName(wellPathName);
|
||||
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
|
||||
if (wellPath)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||
|
@ -99,8 +99,8 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
wellPaths.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_wellPathImporter = new RifWellPathImporter;
|
||||
m_newestAddedWellName = QString();
|
||||
m_wellPathFormationsImporter = new RifWellPathFormationsImporter;
|
||||
m_newestAddedWellPath = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -249,11 +249,6 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wellPathArray.size());
|
||||
}
|
||||
|
||||
if (!wellPathArray.empty())
|
||||
{
|
||||
m_newestAddedWellName = wellPathArray.back()->name();
|
||||
}
|
||||
|
||||
for (size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++)
|
||||
{
|
||||
RimWellPath* wellPath = wellPathArray[wpIdx];
|
||||
@ -284,6 +279,11 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
if (!wellPaths.empty())
|
||||
{
|
||||
m_newestAddedWellPath = wellPaths[wellPaths.size() - 1];
|
||||
}
|
||||
|
||||
this->sortWellsByName();
|
||||
}
|
||||
|
||||
@ -319,7 +319,6 @@ RimWellLogFile* RimWellPathCollection::addWellLogs(const QStringList& filePaths)
|
||||
}
|
||||
|
||||
wellPath->addWellLogFile(logFileInfo);
|
||||
m_newestAddedWellName = wellPath->name();
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +347,7 @@ void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths)
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
wellPath->setFormationsGeometry(it->second);
|
||||
m_newestAddedWellName = wellPath->name();
|
||||
m_newestAddedWellPath = wellPath;
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,6 +493,14 @@ void RimWellPathCollection::deleteAllWellPaths()
|
||||
m_wellPathImporter->clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellPathCollection::newestAddedWellPath()
|
||||
{
|
||||
return m_newestAddedWellPath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -66,8 +66,6 @@ public:
|
||||
|
||||
void setProject(RimProject* project);
|
||||
|
||||
QString newestAddedWellName() { return m_newestAddedWellName; }
|
||||
|
||||
enum WellVisibilityType
|
||||
{
|
||||
FORCE_ALL_OFF,
|
||||
@ -95,6 +93,8 @@ public:
|
||||
void removeWellPath(RimWellPath* wellPath);
|
||||
void deleteAllWellPaths();
|
||||
|
||||
RimWellPath* newestAddedWellPath();
|
||||
|
||||
void readWellPathFormationFiles();
|
||||
|
||||
RimWellPath* wellPathByName(const QString& wellPathName) const;
|
||||
@ -135,5 +135,5 @@ private:
|
||||
|
||||
RifWellPathImporter* m_wellPathImporter;
|
||||
RifWellPathFormationsImporter* m_wellPathFormationsImporter;
|
||||
QString m_newestAddedWellName;
|
||||
caf::PdmPointer<RimWellPath> m_newestAddedWellPath;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user