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