From 9c0fa50834549a70beb36def737280c80507b662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Mon, 16 Oct 2017 14:01:45 +0200 Subject: [PATCH] #2001 RFT plot. Use only TVD depth type --- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 1 + .../ProjectDataModel/RimWellLogPlot.cpp | 27 +++++++++++++++++++ .../ProjectDataModel/RimWellLogPlot.h | 4 +++ 3 files changed, 32 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index 9b46af6d7d..def1798e58 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -71,6 +71,7 @@ RimWellRftPlot::RimWellRftPlot() CAF_PDM_InitFieldNoDefault(&m_wellLogPlot, "WellLog", "WellLog", "", "", ""); m_wellLogPlot.uiCapability()->setUiHidden(true); m_wellLogPlot = new RimWellLogPlot(); + m_wellLogPlot->setDepthType(RimWellLogPlot::TRUE_VERTICAL_DEPTH); CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "WellName", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_branchIndex, "BranchIndex", "BranchIndex", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index f72d300979..9f7ad14e62 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -34,6 +34,7 @@ #include "cvfAssert.h" #include +#include "RimWellRftPlot.h" #define RI_LOGPLOT_MINDEPTH_DEFAULT 0.0 #define RI_LOGPLOT_MAXDEPTH_DEFAULT 1000.0 @@ -124,6 +125,7 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c RimWellAllocationPlot* wellAllocPlot; firstAncestorOrThisOfType(wellAllocPlot); if (wellAllocPlot) wellAllocPlot->loadDataAndUpdate(); + else if (isRftPlotChild()) rftPlot()->loadDataAndUpdate(); else updateTracks(); } if ( changedField == &m_depthUnit) @@ -152,6 +154,7 @@ QList RimWellLogPlot::calculateValueOptions(const caf::P for (size_t i = 0; i < DepthAppEnum::size(); ++i) { DepthTypeEnum enumVal = DepthAppEnum::fromIndex(i); + if (m_disabledDepthTypes.count( enumVal) == 0) { options.push_back(caf::PdmOptionItemInfo(DepthAppEnum::uiText(enumVal), enumVal)); @@ -471,6 +474,24 @@ QString RimWellLogPlot::asciiDataForPlotExport() const return out; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellRftPlot* RimWellLogPlot::rftPlot() const +{ + RimWellRftPlot* rftPlot; + firstAncestorOrThisOfType(rftPlot); + return rftPlot; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellLogPlot::isRftPlotChild() const +{ + return rftPlot() != nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -777,6 +798,12 @@ void RimWellLogPlot::updateDisabledDepthTypes() m_depthType = CONNECTION_NUMBER; } } + else if (isRftPlotChild()) + { + m_disabledDepthTypes.insert(MEASURED_DEPTH); + m_disabledDepthTypes.insert(PSEUDO_LENGTH); + m_disabledDepthTypes.insert(CONNECTION_NUMBER); + } else { m_disabledDepthTypes.insert(PSEUDO_LENGTH); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index 8da3f9c58d..04f5da2cce 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -31,6 +31,7 @@ class RiuWellLogPlot; class RimWellLogTrack; +class RimWellRftPlot; //================================================================================================== @@ -101,6 +102,9 @@ public: QString asciiDataForPlotExport() const; + RimWellRftPlot* rftPlot() const; + bool isRftPlotChild() const; + protected: // Overridden PDM methods