From 45103da3544a5762b8f0ab6623993d08f796651a Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Fri, 6 Sep 2019 10:59:04 +0200 Subject: [PATCH] Fix crashes related to name config and make name correct for old plots when loading --- .../ProjectDataModel/Flow/RimWellAllocationPlot.cpp | 2 ++ .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 4 ++-- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 7 ++++--- .../GridCrossPlots/RimGridCrossPlot.cpp | 7 ++++--- .../GridCrossPlots/RimGridCrossPlot.h | 2 +- .../GridCrossPlots/RimGridCrossPlotDataSet.cpp | 6 +++--- .../GridCrossPlots/RimGridCrossPlotDataSet.h | 2 +- ApplicationCode/ProjectDataModel/Rim3dView.cpp | 2 +- .../ProjectDataModel/Rim3dWellLogExtractionCurve.cpp | 2 +- .../ProjectDataModel/Rim3dWellLogFileCurve.cpp | 3 +-- .../ProjectDataModel/Rim3dWellLogRftCurve.cpp | 2 +- ApplicationCode/ProjectDataModel/RimNameConfig.cpp | 7 ++++--- ApplicationCode/ProjectDataModel/RimNameConfig.h | 4 ++-- .../ProjectDataModel/RimViewNameConfig.cpp | 4 ++-- ApplicationCode/ProjectDataModel/RimViewNameConfig.h | 2 +- .../RimWellLogExtractionCurveNameConfig.cpp | 4 ++-- .../RimWellLogExtractionCurveNameConfig.h | 2 +- .../RimWellLogFileCurveNameConfig.cpp | 4 ++-- .../ProjectDataModel/RimWellLogFileCurveNameConfig.h | 2 +- ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp | 12 ++++++------ .../ProjectDataModel/RimWellLogPlotNameConfig.cpp | 4 ++-- .../ProjectDataModel/RimWellLogPlotNameConfig.h | 2 +- .../RimWellLogRftCurveNameConfig.cpp | 4 ++-- .../ProjectDataModel/RimWellLogRftCurveNameConfig.h | 2 +- 24 files changed, 48 insertions(+), 44 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 97e84a7497..80ac94e0f0 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -113,6 +113,8 @@ RimWellAllocationPlot::RimWellAllocationPlot() m_tofAccumulatedPhaseFractionsPlot.uiCapability()->setUiHidden(true); m_tofAccumulatedPhaseFractionsPlot = new RimTofAccumulatedPhaseFractionsPlot; + m_nameConfig->setCustomName("Well Allocation Plot"); + this->setAsPlotMdiWindow(); } diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index cc51cc2eb7..22d322c342 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -107,8 +107,6 @@ RimWellPltPlot::RimWellPltPlot() CAF_PDM_InitFieldNoDefault(&m_wellLogPlot_OBSOLETE, "WellLog", "WellLog", "", "", ""); m_wellLogPlot_OBSOLETE.uiCapability()->setUiHidden(true); - m_wellLogPlot_OBSOLETE = new RimWellLogPlot(); - m_wellLogPlot_OBSOLETE->setDepthType(RimWellLogPlot::MEASURED_DEPTH); m_wellLogPlot_OBSOLETE.xmlCapability()->setIOWritable(false); CAF_PDM_InitFieldNoDefault(&m_wellPathName, "WellName", "Well Name", "", "", ""); @@ -135,6 +133,8 @@ RimWellPltPlot::RimWellPltPlot() m_phases = std::vector>({FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER}); m_phases.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); + m_nameConfig->setCustomName("PLT Plot"); + this->setAsPlotMdiWindow(); m_doInitAfterLoad = false; m_isOnLoad = true; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index fce4e889ae..33415a85c6 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -74,7 +74,7 @@ const char RimWellRftPlot::PLOT_NAME_QFORMAT_STRING[] = "RFT: %1"; RimWellRftPlot::RimWellRftPlot() : RimWellLogPlot() { - CAF_PDM_InitObject("Well Allocation Plot", ":/RFTPlot16x16.png", "", ""); + CAF_PDM_InitObject("RFT Plot", ":/RFTPlot16x16.png", "", ""); CAF_PDM_InitField(&m_showPlotTitle_OBSOLETE, "ShowPlotTitle", false, "Show Plot Title", "", "", ""); m_showPlotTitle_OBSOLETE.xmlCapability()->setIOWritable(false); @@ -84,8 +84,6 @@ RimWellRftPlot::RimWellRftPlot() CAF_PDM_InitFieldNoDefault(&m_wellLogPlot_OBSOLETE, "WellLog", "Well Log", "", "", ""); m_wellLogPlot_OBSOLETE.uiCapability()->setUiHidden(true); - m_wellLogPlot_OBSOLETE = new RimWellLogPlot(); - m_wellLogPlot_OBSOLETE->setDepthType(RimWellLogPlot::TRUE_VERTICAL_DEPTH); m_wellLogPlot_OBSOLETE.xmlCapability()->setIOWritable(false); m_depthType = RimWellLogPlot::TRUE_VERTICAL_DEPTH; @@ -112,6 +110,9 @@ RimWellRftPlot::RimWellRftPlot() m_selectedTimeSteps.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false); + m_nameConfig->setCustomName("RFT Plot"); + m_trackLegendsHorizontal = true; + this->setAsPlotMdiWindow(); m_isOnLoad = true; } diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index 736571b5ab..54766f0ef4 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -60,6 +60,7 @@ RimGridCrossPlot::RimGridCrossPlot() CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "Name Config", "", "", ""); m_nameConfig.uiCapability()->setUiTreeHidden(true); m_nameConfig.uiCapability()->setUiTreeChildrenHidden(true); + m_nameConfig = new RimGridCrossPlotNameConfig(); CAF_PDM_InitFieldNoDefault(&m_xAxisProperties, "xAxisProperties", "X Axis", "", "", ""); m_xAxisProperties.uiCapability()->setUiTreeHidden(true); @@ -76,7 +77,7 @@ RimGridCrossPlot::RimGridCrossPlot() CAF_PDM_InitFieldNoDefault(&m_crossPlotDataSets, "CrossPlotCurve", "Cross Plot Data Set", "", "", ""); m_crossPlotDataSets.uiCapability()->setUiHidden(true); - m_nameConfig = new RimGridCrossPlotNameConfig(this); + } //-------------------------------------------------------------------------------------------------- @@ -959,8 +960,8 @@ CAF_PDM_SOURCE_INIT(RimGridCrossPlotNameConfig, "RimGridCrossPlotNameConfig"); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimGridCrossPlotNameConfig::RimGridCrossPlotNameConfig(RimNameConfigHolderInterface* holder /*= nullptr*/) - : RimNameConfig(holder) +RimGridCrossPlotNameConfig::RimGridCrossPlotNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Cross Plot Name Generator", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h index ea4b199e05..99c4241211 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h @@ -39,7 +39,7 @@ class RimGridCrossPlotNameConfig : public RimNameConfig { CAF_PDM_HEADER_INIT; public: - RimGridCrossPlotNameConfig(RimNameConfigHolderInterface* holder = nullptr); + RimGridCrossPlotNameConfig(); public: caf::PdmField addDataSetNames; diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp index c1de85dcdb..d639f173f7 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.cpp @@ -114,7 +114,7 @@ RimGridCrossPlotDataSet::RimGridCrossPlotDataSet() m_groupingProperty->setTernaryEnabled(false); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "Name", "", "", ""); - m_nameConfig = new RimGridCrossPlotDataSetNameConfig(this); + m_nameConfig = new RimGridCrossPlotDataSetNameConfig(); m_nameConfig.uiCapability()->setUiTreeHidden(true); m_nameConfig.uiCapability()->setUiTreeChildrenHidden(true); @@ -1367,8 +1367,8 @@ CAF_PDM_SOURCE_INIT(RimGridCrossPlotDataSetNameConfig, "RimGridCrossPlotCurveSet //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimGridCrossPlotDataSetNameConfig::RimGridCrossPlotDataSetNameConfig(RimNameConfigHolderInterface* parent) - : RimNameConfig(parent) +RimGridCrossPlotDataSetNameConfig::RimGridCrossPlotDataSetNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Cross Plot Data Set NameGenerator", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.h b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.h index 1f3ed999e2..296c5e9bc0 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.h +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotDataSet.h @@ -58,7 +58,7 @@ class RimGridCrossPlotDataSetNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - RimGridCrossPlotDataSetNameConfig(RimNameConfigHolderInterface* parent = nullptr); + RimGridCrossPlotDataSetNameConfig(); caf::PdmField addCaseName; caf::PdmField addAxisVariables; diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.cpp b/ApplicationCode/ProjectDataModel/Rim3dView.cpp index e98faaadee..d9ca288a0f 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dView.cpp @@ -86,7 +86,7 @@ Rim3dView::Rim3dView(void) CVF_ASSERT(preferences); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", ""); - m_nameConfig = new RimViewNameConfig(this); + m_nameConfig = new RimViewNameConfig(); CAF_PDM_InitField(&m_name_OBSOLETE, "UserDescription", QString(""), "Name", "", "", ""); m_name_OBSOLETE.xmlCapability()->setIOWritable(false); diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp index f40afa0626..200a9841df 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp @@ -87,7 +87,7 @@ Rim3dWellLogExtractionCurve::Rim3dWellLogExtractionCurve() m_geomResultDefinition->setAddWellPathDerivedResults(true); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", ""); - m_nameConfig = new RimWellLogExtractionCurveNameConfig(this); + m_nameConfig = new RimWellLogExtractionCurveNameConfig(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp index 47121f150c..86f6b6be2e 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp @@ -46,7 +46,7 @@ Rim3dWellLogFileCurve::Rim3dWellLogFileCurve() CAF_PDM_InitFieldNoDefault(&m_wellLogFile, "WellLogFile", "Well Log File", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", ""); - m_nameConfig = new RimWellLogFileCurveNameConfig(this); + m_nameConfig = new RimWellLogFileCurveNameConfig(); } //-------------------------------------------------------------------------------------------------- @@ -54,7 +54,6 @@ Rim3dWellLogFileCurve::Rim3dWellLogFileCurve() //-------------------------------------------------------------------------------------------------- Rim3dWellLogFileCurve::~Rim3dWellLogFileCurve() { - delete m_nameConfig; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp index 4aa7a490f3..795b010993 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp @@ -55,7 +55,7 @@ Rim3dWellLogRftCurve::Rim3dWellLogRftCurve() m_2dWellLogRftCurve.xmlCapability()->disableIO(); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", ""); - m_nameConfig = new RimWellLogRftCurveNameConfig(this); + m_nameConfig = new RimWellLogRftCurveNameConfig(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimNameConfig.cpp index 421898af2e..6fe4d63a76 100644 --- a/ApplicationCode/ProjectDataModel/RimNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimNameConfig.cpp @@ -31,8 +31,7 @@ CAF_PDM_SOURCE_INIT(RimNameConfig, "RimCurveNameConfig"); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimNameConfig::RimNameConfig(const RimNameConfigHolderInterface* configHolder /*= nullptr*/) - : m_configHolder(configHolder) +RimNameConfig::RimNameConfig() { CAF_PDM_InitObject("Curve Name Generator", "", "", ""); @@ -106,7 +105,9 @@ void RimNameConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField, co //-------------------------------------------------------------------------------------------------- QString RimNameConfig::autoName() const { - return m_configHolder->createAutoName(); + RimNameConfigHolderInterface* plotHolder; + this->firstAncestorOrThisOfTypeAsserted(plotHolder); + return plotHolder->createAutoName(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimNameConfig.h b/ApplicationCode/ProjectDataModel/RimNameConfig.h index 2b3eb91dab..c4e8a62dc1 100644 --- a/ApplicationCode/ProjectDataModel/RimNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimNameConfig.h @@ -44,8 +44,9 @@ class RimNameConfig : public caf::PdmObject CAF_PDM_HEADER_INIT; public: - RimNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + RimNameConfig(); ~RimNameConfig() override; + QString customName() const; void setCustomName(const QString& name); virtual void enableAllAutoNameTags(bool enable) {} @@ -66,7 +67,6 @@ protected: caf::PdmField m_customName; caf::PdmProxyValueField m_autoName; - const RimNameConfigHolderInterface* m_configHolder; }; diff --git a/ApplicationCode/ProjectDataModel/RimViewNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimViewNameConfig.cpp index 6eca52db7f..99cebb3b47 100644 --- a/ApplicationCode/ProjectDataModel/RimViewNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimViewNameConfig.cpp @@ -28,8 +28,8 @@ CAF_PDM_SOURCE_INIT(RimViewNameConfig, "RimViewNameConfig"); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimViewNameConfig::RimViewNameConfig(const RimNameConfigHolderInterface* configHolder) - : RimNameConfig(configHolder) +RimViewNameConfig::RimViewNameConfig() + : RimNameConfig() , m_hideCaseNameField(false) , m_hideAggregationTypeField(false) , m_hidePropertyField(false) diff --git a/ApplicationCode/ProjectDataModel/RimViewNameConfig.h b/ApplicationCode/ProjectDataModel/RimViewNameConfig.h index 4adeeaf157..4d5d6d4b14 100644 --- a/ApplicationCode/ProjectDataModel/RimViewNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimViewNameConfig.h @@ -29,7 +29,7 @@ class RimViewNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - explicit RimViewNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + explicit RimViewNameConfig(); void setAddCaseName(bool add); bool addCaseName() const; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp index d33847ba00..aa555fe29f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp @@ -28,8 +28,8 @@ CAF_PDM_SOURCE_INIT(RimWellLogExtractionCurveNameConfig, "RimWellLogExtractionCu //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogExtractionCurveNameConfig::RimWellLogExtractionCurveNameConfig(const RimNameConfigHolderInterface* configHolder) - : RimNameConfig(configHolder) +RimWellLogExtractionCurveNameConfig::RimWellLogExtractionCurveNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Well Log Extraction Curve Name Generator", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h index 93422083bb..0b86ca3b1a 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h @@ -29,7 +29,7 @@ class RimWellLogExtractionCurveNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - RimWellLogExtractionCurveNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + RimWellLogExtractionCurveNameConfig(); bool addCaseName() const; bool addProperty() const; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp index d78732b015..23fe5484df 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp @@ -28,8 +28,8 @@ CAF_PDM_SOURCE_INIT(RimWellLogFileCurveNameConfig, "RimWellLogFileCurveNameConfi //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogFileCurveNameConfig::RimWellLogFileCurveNameConfig(const RimNameConfigHolderInterface* configHolder) - : RimNameConfig(configHolder) +RimWellLogFileCurveNameConfig::RimWellLogFileCurveNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Well Log File Curve Name Generator", "", "", ""); m_customName = "Las Curve"; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h b/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h index 02e335b98e..d3352c9912 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h @@ -29,6 +29,6 @@ class RimWellLogFileCurveNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - RimWellLogFileCurveNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + RimWellLogFileCurveNameConfig(); }; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index ce463e1abc..1c8c129113 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -83,10 +83,10 @@ RimWellLogPlot::RimWellLogPlot() m_userName_OBSOLETE.xmlCapability()->setIOWritable(false); CAF_PDM_InitFieldNoDefault(&m_commonDataSource, "CommonDataSource", "Data Source", "", "Change the Data Source of All Curves in the Plot", ""); - m_commonDataSource = new RimWellLogCurveCommonDataSource; m_commonDataSource.uiCapability()->setUiTreeHidden(true); m_commonDataSource.uiCapability()->setUiTreeChildrenHidden(true); m_commonDataSource.xmlCapability()->disableIO(); + m_commonDataSource = new RimWellLogCurveCommonDataSource; caf::AppEnum< RimWellLogPlot::DepthTypeEnum > depthType = MEASURED_DEPTH; CAF_PDM_InitField(&m_depthType, "DepthType", depthType, "Type", "", "", ""); @@ -108,9 +108,9 @@ RimWellLogPlot::RimWellLogPlot() m_tracks.uiCapability()->setUiHidden(true); CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", ""); - m_nameConfig = new RimWellLogPlotNameConfig(this); m_nameConfig.uiCapability()->setUiTreeHidden(true); m_nameConfig.uiCapability()->setUiTreeChildrenHidden(true); + m_nameConfig = new RimWellLogPlotNameConfig(); m_minAvailableDepth = HUGE_VAL; m_maxAvailableDepth = -HUGE_VAL; @@ -121,7 +121,9 @@ RimWellLogPlot::RimWellLogPlot() //-------------------------------------------------------------------------------------------------- RimWellLogPlot& RimWellLogPlot::operator=(RimWellLogPlot&& rhs) { - m_userName_OBSOLETE = rhs.m_userName_OBSOLETE(); + // Don't copy the obsoleted m_userName_OBSOLETE + // It had its own implementation in the RFT/PLT/WAP plots + auto dataSource = rhs.m_commonDataSource(); rhs.m_commonDataSource.removeChildObject(dataSource); m_commonDataSource = dataSource; @@ -146,7 +148,7 @@ RimWellLogPlot& RimWellLogPlot::operator=(RimWellLogPlot&& rhs) auto nameConfig = rhs.m_nameConfig(); rhs.m_nameConfig.removeChildObject(nameConfig); - m_nameConfig = nameConfig; + m_nameConfig = nameConfig; m_minAvailableDepth = rhs.m_minAvailableDepth; m_maxAvailableDepth = rhs.m_maxAvailableDepth; @@ -587,8 +589,6 @@ void RimWellLogPlot::uiOrderingForPlotSettings(caf::PdmUiOrdering& uiOrdering) titleAndLegendsGroup->add(&m_trackLegendsHorizontal); titleAndLegendsGroup->add(&m_showTitleInPlot); m_nameConfig->uiOrdering("", *titleAndLegendsGroup); - - } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp index 2649ed1ca2..8bc92e9315 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp @@ -28,8 +28,8 @@ CAF_PDM_SOURCE_INIT(RimWellLogPlotNameConfig, "RimWellLogPlotNameConfig"); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogPlotNameConfig::RimWellLogPlotNameConfig(const RimNameConfigHolderInterface* configHolder) - : RimNameConfig(configHolder) +RimWellLogPlotNameConfig::RimWellLogPlotNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Well Log Plot Name Generator", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.h b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.h index 337c9703b8..ed2c34fb86 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.h @@ -29,7 +29,7 @@ class RimWellLogPlotNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - RimWellLogPlotNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + RimWellLogPlotNameConfig(); bool addCaseName() const; bool addWellName() const; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp index 22851c48f7..2f7389898b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp @@ -28,8 +28,8 @@ CAF_PDM_SOURCE_INIT(RimWellLogRftCurveNameConfig, "RimWellLogRftCurveNameConfig" //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogRftCurveNameConfig::RimWellLogRftCurveNameConfig(const RimNameConfigHolderInterface* configHolder) - : RimNameConfig(configHolder) +RimWellLogRftCurveNameConfig::RimWellLogRftCurveNameConfig() + : RimNameConfig() { CAF_PDM_InitObject("Well Log Rft Curve Name Generator", "", "", ""); m_customName = "Rft Curve"; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h b/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h index 438f874e4d..e86339354d 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h @@ -29,6 +29,6 @@ class RimWellLogRftCurveNameConfig : public RimNameConfig CAF_PDM_HEADER_INIT; public: - RimWellLogRftCurveNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr); + RimWellLogRftCurveNameConfig(); };