From 88530214039dbc16b72bcf24f36e5920c9a7cc66 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Thu, 2 Nov 2017 12:30:17 +0100 Subject: [PATCH] #2073 WLP: Add PL (Pseudo Length) to depth axis if a simulation well is used as extraction curve or rft curve --- .../RimWellLogExtractionCurve.cpp | 16 ++++++++++++++ .../ProjectDataModel/RimWellLogRftCurve.cpp | 21 +++++++++++++++++++ .../ProjectDataModel/RimWellLogRftCurve.h | 2 ++ 3 files changed, 39 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 0103566feb..4509a49587 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -296,6 +296,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) if (isCurveVisible()) { // Make sure we have set correct case data into the result definitions. + bool isUsingPseudoLength = false; RimGeoMechCase* geomCase = dynamic_cast(m_case.value()); RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); @@ -323,6 +324,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) eclipseCase->caseUserDescription(), m_generatedSimulationWellPathBranches[m_branchIndex].p(), eclipseCase->eclipseCaseData()); + isUsingPseudoLength = true; } } cvf::ref geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase); @@ -394,6 +396,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) if(wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH) { m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->trueDepthPlotValues(displayUnit).data(), static_cast(m_curveData->xPlotValues().size())); + isUsingPseudoLength = false; } else if (wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH) { @@ -402,6 +405,19 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices()); + if (isUsingPseudoLength) + { + RimWellLogTrack* wellLogTrack; + firstAncestorOrThisOfType(wellLogTrack); + CVF_ASSERT(wellLogTrack); + + RiuWellLogTrack* viewer = wellLogTrack->viewer(); + if (viewer) + { + viewer->setDepthTitle("PL/" + wellLogPlot->depthPlotTitle()); + } + } + updateZoomInParentPlot(); setLogScaleFromSelectedResult(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp index 919c214f83..6bc352924f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp @@ -28,6 +28,7 @@ #include "RimTools.h" #include "RimWellLogPlot.h" #include "RimWellLogPlotCollection.h" +#include "RimWellLogTrack.h" #include "RimWellPath.h" #include "RigEclipseCaseData.h" @@ -38,6 +39,7 @@ #include "RigWellPathIntersectionTools.h" #include "RiuLineSegmentQwtPlotCurve.h" +#include "RiuWellLogTrack.h" #include "RifEclipseRftAddress.h" #include "RifReaderEclipseRft.h" @@ -89,6 +91,8 @@ RimWellLogRftCurve::RimWellLogRftCurve() CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "Well Name", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_wellLogChannelName, "WellLogChannelName", "Well Property", "", "", ""); + + m_isUsingPseudoLength = false; } //-------------------------------------------------------------------------------------------------- @@ -263,6 +267,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate(bool updateParentPlot) { RimWellLogCurve::updateCurvePresentation(); + m_isUsingPseudoLength = false; + if (isCurveVisible()) { m_curveData = new RigWellLogCurveData; @@ -298,6 +304,20 @@ void RimWellLogRftCurve::onLoadDataAndUpdate(bool updateParentPlot) else { m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->trueDepthPlotValues(displayUnit).data(), static_cast(m_curveData->xPlotValues().size())); + m_isUsingPseudoLength = false; + } + + if (m_isUsingPseudoLength) + { + RimWellLogTrack* wellLogTrack; + firstAncestorOrThisOfType(wellLogTrack); + CVF_ASSERT(wellLogTrack); + + RiuWellLogTrack* viewer = wellLogTrack->viewer(); + if (viewer) + { + viewer->setDepthTitle("PL/" + wellLogPlot->depthPlotTitle()); + } } m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices()); @@ -463,6 +483,7 @@ RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor() if (wellPaths.size() == 0) return nullptr; eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_wellName(), QString("Find or create sim well extractor"), wellPaths[0], m_eclipseResultCase->eclipseCaseData()); + m_isUsingPseudoLength = true; } return eclExtractor; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.h index b1a1383001..6d130e6a74 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.h @@ -90,6 +90,8 @@ private: caf::PdmField m_timeStep; caf::PdmField m_wellName; caf::PdmField< caf::AppEnum< RifEclipseRftAddress::RftWellLogChannelName > > m_wellLogChannelName; + + bool m_isUsingPseudoLength; };