From ae372a4a79a1891c0ec735b06a403564354f1385 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Sun, 5 Nov 2017 11:29:23 +0100 Subject: [PATCH] #2039 #2035 RFT/PLT Plot: Set default values for formation names --- .../ProjectDataModel/RimWellLogTrack.cpp | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 1404c0c01b..8d6869c44f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -40,6 +40,7 @@ #include "RimEclipseCase.h" #include "RimGeoMechCase.h" #include "RimMainPlotCollection.h" +#include "RimOilField.h" #include "RimProject.h" #include "RimTools.h" #include "RimWellFlowRateCurve.h" @@ -47,6 +48,8 @@ #include "RimWellLogPlot.h" #include "RimWellLogPlotCollection.h" #include "RimWellPath.h" +#include "RimWellPathCollection.h" +#include "RimWellPltPlot.h" #include "RimWellRftPlot.h" #include "RiuMainWindow.h" @@ -472,11 +475,44 @@ void RimWellLogTrack::loadDataAndUpdate() RimWellRftPlot* rftPlot(nullptr); firstAncestorOrThisOfType(rftPlot); - if (rftPlot) + RimWellPltPlot* pltPlot; + rftPlot ? pltPlot = nullptr : firstAncestorOrThisOfType(pltPlot); + + if (rftPlot || pltPlot) { - m_trajectoryType = RimWellLogTrack::SIMULATION_WELL; - m_simWellName = rftPlot->currentWellName(); - m_branchIndex = rftPlot->branchIndex(); + RimProject* proj = RiaApplication::instance()->project(); + RimOilField* oilField = proj->activeOilField(); + + RimWellPathCollection* wellPathCollection = oilField->wellPathCollection(); + RimWellPath* wellPath; + + QString wellName; + + if (rftPlot) + { + wellName = rftPlot->currentWellName(); + m_branchIndex = rftPlot->branchIndex(); + } + else + { + wellName = pltPlot->currentWellName(); + m_branchIndex = pltPlot->branchIndex(); + } + + wellPath = wellPathCollection->wellPathByName(wellName); + + if (wellPath) + { + m_trajectoryType = RimWellLogTrack::WELL_PATH; + m_wellPath = wellPath; + } + else + { + m_trajectoryType == RimWellLogTrack::SIMULATION_WELL; + m_simulationWellChosen = true; + m_simWellName = wellName; + m_branchIndex = rftPlot->branchIndex(); + } } if (m_showFormations)