From e4864323913b49e24820e40c4fdec8dddecaaeb5 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 3 Apr 2019 12:27:49 +0200 Subject: [PATCH] #4276 RFT-plot: Add support for Measured Depth as Y-axis --- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 27 +++++++++++++++++++ .../ProjectDataModel/Flow/RimWellRftPlot.h | 1 + .../ProjectDataModel/RimWellLogPlot.cpp | 20 +++++++------- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index a2a5e0bfb5..955fccafe1 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -856,12 +856,39 @@ void RimWellRftPlot::onLoadDataAndUpdate() updateMdiWindowVisibility(); updateFormationsOnPlot(); + if (m_wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH) + { + assignWellPathToExtractionCurves(); + } + m_wellLogPlot->loadDataAndUpdate(); updateEditorsFromCurves(); updateWidgetTitleWindowTitle(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellRftPlot::assignWellPathToExtractionCurves() +{ + RimProject* proj = RiaApplication::instance()->project(); + RimWellPath* wellPath = proj->wellPathByName(m_wellPathNameOrSimWellName); + + if (wellPath) + { + for (RimWellLogCurve* curve : m_wellLogPlot->trackByIndex(0)->curvesVector()) + { + auto extractionCurve = dynamic_cast(curve); + if (extractionCurve) + { + extractionCurve->setTrajectoryType(RimWellLogExtractionCurve::WELL_PATH); + extractionCurve->setWellPath(wellPath); + } + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h index 93d322267d..367b7b2830 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h @@ -106,6 +106,7 @@ private: void updateEditorsFromCurves(); void updateWidgetTitleWindowTitle(); void syncCurvesFromUiSelection(); + void assignWellPathToExtractionCurves(); std::set selectedCurveDefs() const; std::set curveDefsFromCurves() const; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 1e7d6ec55b..4cc20d5ba7 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -178,13 +178,17 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c { RimWellAllocationPlot* wellAllocPlot; firstAncestorOrThisOfType(wellAllocPlot); - if (wellAllocPlot) wellAllocPlot->loadDataAndUpdate(); - else if (isRftPlotChild()) rftPlot()->loadDataAndUpdate(); - else + if (wellAllocPlot) { - updateTracks(); - updateDepthZoom(); + wellAllocPlot->loadDataAndUpdate(); } + else if (isRftPlotChild()) + { + rftPlot()->loadDataAndUpdate(); + } + + updateTracks(); + updateDepthZoom(); } else if ( changedField == &m_depthUnit) { @@ -586,8 +590,7 @@ void RimWellLogPlot::uiOrderingForDepthAxis(caf::PdmUiOrdering& uiOrdering) { caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Depth Axis"); - RimWellRftPlot* rftp = rftPlot(); - if (!(rftp || pltPlot())) + if (!pltPlot()) { gridGroup->add(&m_depthType); } @@ -595,7 +598,7 @@ void RimWellLogPlot::uiOrderingForDepthAxis(caf::PdmUiOrdering& uiOrdering) RimWellAllocationPlot* wap; firstAncestorOrThisOfType(wap); - if (!(wap || rftp)) + if (!wap) { gridGroup->add(&m_depthUnit); } @@ -1127,7 +1130,6 @@ void RimWellLogPlot::updateDisabledDepthTypes() } else if (isRftPlotChild()) { - m_disabledDepthTypes.insert(MEASURED_DEPTH); m_disabledDepthTypes.insert(PSEUDO_LENGTH); m_disabledDepthTypes.insert(CONNECTION_NUMBER); }