#2261 Well Paths: Change newestAddedWellPath to mostRecentlyUpdatedWellPath

This commit is contained in:
Rebecca Cox 2018-01-29 11:24:12 +01:00 committed by Bjørn Erik Jensen
parent 27192e8096
commit 20e5c27209
4 changed files with 10 additions and 13 deletions

View File

@ -77,7 +77,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked)
if (oilField->wellPathCollection->wellPaths().size() > 0)
{
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
if (wellPath)
{
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);

View File

@ -70,7 +70,7 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
if (oilField->wellPathCollection->wellPaths().size() > 0)
{
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
if (wellPath)
{
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);

View File

@ -101,7 +101,7 @@ RimWellPathCollection::RimWellPathCollection()
m_wellPathImporter = new RifWellPathImporter;
m_wellPathFormationsImporter = new RifWellPathFormationsImporter;
m_newestAddedWellPath = nullptr;
m_mostRecentlyUpdatedWellPath = nullptr;
}
@ -268,23 +268,20 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
// Let name from well path file override name from well log file
existingWellPath->setName(wellPath->name());
m_mostRecentlyUpdatedWellPath = existingWellPath;
delete wellPath;
}
else
{
wellPath->wellPathColor = cvf::Color3f(interpolatedWellColors[wpIdx]);
wellPath->setUnitSystem(findUnitSystemForWellPath(wellPath));
m_mostRecentlyUpdatedWellPath = wellPath;
wellPaths.push_back(wellPath);
}
progress.incrementProgress();
}
if (!wellPaths.empty())
{
m_newestAddedWellPath = wellPaths[wellPaths.size() - 1];
}
this->sortWellsByName();
}
@ -360,7 +357,7 @@ void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths)
QString wellFormationsCount = QString("%1").arg(it->second->formationNamesCount());
m_newestAddedWellPath = wellPath;
m_mostRecentlyUpdatedWellPath = wellPath;
outputMessage += it->first + "\t\t";
outputMessage += wellPath->name() + " \t\t\t";
@ -520,9 +517,9 @@ void RimWellPathCollection::deleteAllWellPaths()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellPathCollection::newestAddedWellPath()
RimWellPath* RimWellPathCollection::mostRecentlyUpdatedWellPath()
{
return m_newestAddedWellPath;
return m_mostRecentlyUpdatedWellPath;
}
//--------------------------------------------------------------------------------------------------

View File

@ -93,7 +93,7 @@ public:
void removeWellPath(RimWellPath* wellPath);
void deleteAllWellPaths();
RimWellPath* newestAddedWellPath();
RimWellPath* mostRecentlyUpdatedWellPath();
void readWellPathFormationFiles();
void reloadAllWellPathFormations();
@ -136,5 +136,5 @@ private:
RifWellPathImporter* m_wellPathImporter;
RifWellPathFormationsImporter* m_wellPathFormationsImporter;
caf::PdmPointer<RimWellPath> m_newestAddedWellPath;
caf::PdmPointer<RimWellPath> m_mostRecentlyUpdatedWellPath;
};