diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp index 8187a381e4..885dcd3bc4 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp @@ -51,6 +51,7 @@ void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked) RimWellLogPlotTrace* plotTrace = new RimWellLogPlotTrace(); plot->addTrace(plotTrace); + plotTrace->setDescription(QString("Track %1").arg(plot->traceCount())); plot->loadDataAndUpdate(); plot->updateConnectedEditors(); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTraceFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTraceFeature.cpp index dbd6a61f71..2d413afeb0 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTraceFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTraceFeature.cpp @@ -51,7 +51,7 @@ void RicNewWellLogPlotTraceFeature::onActionTriggered(bool isChecked) { RimWellLogPlotTrace* plotTrace = new RimWellLogPlotTrace; wellLogPlot->addTrace(plotTrace); - plotTrace->setUiName(QString("Trace %1").arg(wellLogPlot->traceCount())); + plotTrace->setDescription(QString("Track %1").arg(wellLogPlot->traceCount())); wellLogPlot->updateConnectedEditors(); RicNewWellLogCurveExtractionFeature::addCurve(plotTrace); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp index 9c052e4581..2791f16120 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp @@ -44,6 +44,8 @@ RimWellLogPlotTrace::RimWellLogPlotTrace() { CAF_PDM_InitObject("Trace", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_userName, "TrackDescription", "Name", "", "", ""); + CAF_PDM_InitField(&m_show, "Show", true, "Show trace", "", "", ""); m_show.uiCapability()->setUiHidden(true); @@ -62,6 +64,14 @@ RimWellLogPlotTrace::~RimWellLogPlotTrace() delete m_viewer; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogPlotTrace::setDescription(const QString& description) +{ + m_userName = description; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -86,6 +96,14 @@ caf::PdmFieldHandle* RimWellLogPlotTrace::objectToggleField() return &m_show; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimWellLogPlotTrace::userDescriptionField() +{ + return &m_userName; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.h b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.h index 41f5ecc6e9..13f6363485 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.h @@ -43,6 +43,8 @@ public: RimWellLogPlotTrace(); virtual ~RimWellLogPlotTrace(); + void setDescription(const QString& description); + void addCurve(RimWellLogPlotCurve* curve); size_t curveCount() { return curves.size(); } @@ -64,9 +66,11 @@ protected: // Overridden PDM methods virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual caf::PdmFieldHandle* objectToggleField(); + virtual caf::PdmFieldHandle* userDescriptionField(); private: caf::PdmField m_show; + caf::PdmField m_userName; caf::PdmChildArrayField curves; caf::PdmField m_minimumValue; caf::PdmField m_maximumValue;