From 7ba23a7f18a6b707671ffa969d7dc2906ac407d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Hagen?= Date: Thu, 10 Sep 2015 15:29:50 +0200 Subject: [PATCH] (#438) Added depth type enum field to well log plot --- .../ProjectDataModel/RimWellLogPlot.cpp | 19 ++++++++++++++++++- .../ProjectDataModel/RimWellLogPlot.h | 16 +++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index a872a0d060..40bc780717 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -34,6 +34,19 @@ #define RI_LOGPLOT_MINDEPTH_DEFAULT 0.0 #define RI_LOGPLOT_MAXDEPTH_DEFAULT 1000.0 +namespace caf { + + template<> + void caf::AppEnum< RimWellLogPlot::DepthTypeEnum >::setUp() + { + addItem(RimWellLogPlot::MEASURED_DEPTH, "MEASURED_DEPTH", "Measured Depth"); + addItem(RimWellLogPlot::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth"); + setDefault(RimWellLogPlot::MEASURED_DEPTH); + } + +} // End namespace caf + + CAF_PDM_SOURCE_INIT(RimWellLogPlot, "WellLogPlot"); //-------------------------------------------------------------------------------------------------- @@ -49,8 +62,12 @@ RimWellLogPlot::RimWellLogPlot() m_showWindow.uiCapability()->setUiHidden(true); CAF_PDM_InitField(&m_userName, "PlotDescription", QString("Well Log Plot"),"Name", "", "", ""); + + caf::AppEnum< RimWellLogPlot::DepthTypeEnum > depthType = MEASURED_DEPTH; + CAF_PDM_InitField(&m_depthType, "DepthType", depthType, "Depth type", "", "", ""); + CAF_PDM_InitField(&m_minimumVisibleDepth, "MinimumDepth", 0.0, "Minimum depth", "", "", ""); - CAF_PDM_InitField(&m_maximumVisibleDepth, "MaximumDepth", 1000.0, "Maximum depth", "", "", ""); + CAF_PDM_InitField(&m_maximumVisibleDepth, "MaximumDepth", 1000.0, "Maximum depth", "", "", ""); CAF_PDM_InitFieldNoDefault(&traces, "Traces", "", "", "", ""); traces.uiCapability()->setUiHidden(true); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index 5248eabff0..af47a72a41 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -22,6 +22,7 @@ #include "cafPdmObject.h" #include "cafPdmField.h" #include "cafPdmChildArrayField.h" +#include "cafAppEnum.h" #include @@ -36,6 +37,14 @@ class RimWellLogPlotTrace; class RimWellLogPlot : public caf::PdmObject { CAF_PDM_HEADER_INIT; + +public: + enum DepthTypeEnum + { + MEASURED_DEPTH, + TRUE_VERTICAL_DEPTH + }; + public: RimWellLogPlot(); virtual ~RimWellLogPlot(); @@ -88,9 +97,10 @@ private: caf::PdmChildArrayField traces; - caf::PdmField m_userName; - caf::PdmField m_minimumVisibleDepth; - caf::PdmField m_maximumVisibleDepth; + caf::PdmField m_userName; + caf::PdmField< caf::AppEnum< DepthTypeEnum > > m_depthType; + caf::PdmField m_minimumVisibleDepth; + caf::PdmField m_maximumVisibleDepth; double m_depthRangeMinimum; double m_depthRangeMaximum;