Skip to content

Commit

Permalink
#2261 Well Paths: Change newestAddedWellPath to mostRecentlyUpdatedWe…
Browse files Browse the repository at this point in the history
…llPath
  • Loading branch information
Rebecca Cox committed Jan 29, 2018
1 parent 438ee34 commit d67e1a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 6 additions & 9 deletions ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RimWellPathCollection::RimWellPathCollection()

m_wellPathImporter = new RifWellPathImporter;
m_wellPathFormationsImporter = new RifWellPathFormationsImporter;
m_newestAddedWellPath = nullptr;
m_mostRecentlyUpdatedWellPath = nullptr;
}


Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -520,9 +517,9 @@ void RimWellPathCollection::deleteAllWellPaths()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellPathCollection::newestAddedWellPath()
RimWellPath* RimWellPathCollection::mostRecentlyUpdatedWellPath()
{
return m_newestAddedWellPath;
return m_mostRecentlyUpdatedWellPath;
}

//--------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions ApplicationCode/ProjectDataModel/RimWellPathCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class RimWellPathCollection : public caf::PdmObject
void removeWellPath(RimWellPath* wellPath);
void deleteAllWellPaths();

RimWellPath* newestAddedWellPath();
RimWellPath* mostRecentlyUpdatedWellPath();

void readWellPathFormationFiles();
void reloadAllWellPathFormations();
Expand Down Expand Up @@ -136,5 +136,5 @@ class RimWellPathCollection : public caf::PdmObject

RifWellPathImporter* m_wellPathImporter;
RifWellPathFormationsImporter* m_wellPathFormationsImporter;
caf::PdmPointer<RimWellPath> m_newestAddedWellPath;
caf::PdmPointer<RimWellPath> m_mostRecentlyUpdatedWellPath;
};

0 comments on commit d67e1a7

Please sign in to comment.