From 95f7f40b15c6d00d265c571e0d9ef2a007299b18 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Fri, 3 Nov 2017 08:58:08 +0100 Subject: [PATCH] #2002 RFT Plot: Add visible x range and new logic for formations --- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 55 ++-------------- .../ProjectDataModel/Flow/RimWellRftPlot.h | 3 - .../ProjectDataModel/RimWellLogTrack.cpp | 66 +++++++------------ .../ProjectDataModel/RimWellLogTrack.h | 8 +-- 4 files changed, 33 insertions(+), 99 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index ff7408ec59..b6d8a96acd 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -94,9 +94,6 @@ RimWellRftPlot::RimWellRftPlot() m_selectedTimeSteps.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false); - CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show Formations", "", "", ""); - CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", ""); - this->setAsPlotMdiWindow(); m_selectedSourcesOrTimeStepsFieldsChanged = false; } @@ -1085,15 +1082,6 @@ QList RimWellRftPlot::calculateValueOptions(const caf::P options.push_front(caf::PdmOptionItemInfo("None", -1)); } } - else if (fieldNeedingOptions == &m_formationCase) - { - for (RifWellRftAddress source : selectedSources()) - { - RifWellRftAddress addr = RifWellRftAddress(RifWellRftAddress::RFT, source.eclCase()); - //caf::PdmOptionItemInfo item = caf::PdmOptionItemInfo(source.eclCase()->caseUserDescription(), QVariant::fromValue(addr)); - options.push_back(caf::PdmOptionItemInfo(source.eclCase()->caseUserDescription(), source.eclCase(), false, source.eclCase()->uiIcon())); - } - } return options; } @@ -1136,39 +1124,6 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c { //m_wellLogPlot->setShowDescription(m_showPlotTitle); } - else if (changedField == &m_showFormations) - { - if (m_wellLogPlot->trackCount()) - { - RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); - if (m_formationCase != nullptr) - { - track->setCase(m_formationCase()); - } - else if (!m_selectedSources().empty()) - { - m_formationCase = m_selectedSources().at(0).eclCase(); - track->setCase(m_formationCase); - } - - if (!m_wellName().isEmpty()) - { - track->setSimWellName(m_wellName); - } - - track->setBranchIndex(m_branchIndex()); - track->setShowFormations(m_showFormations()); - } - - } - else if (changedField == &m_formationCase) - { - if (m_wellLogPlot->trackCount()) - { - RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); - updateConnectedEditors(); - } - } } //-------------------------------------------------------------------------------------------------- @@ -1215,10 +1170,12 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& //uiOrdering.add(&m_showPlotTitle); - caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Formation Names Properties"); - - formationGroup->add(&m_showFormations); - formationGroup->add(&m_formationCase); + if (m_wellLogPlot && m_wellLogPlot->trackCount() > 0) + { + RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); + track->uiOrderingForShowFormationNamesAndCase(uiConfigName, uiOrdering); + track->uiOrderingForVisibleXRange(uiConfigName, uiOrdering); + } uiOrdering.skipRemainingFields(true); } diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h index def3c0ae4e..d055429261 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h @@ -166,8 +166,5 @@ private: std::map> m_timeStepsToAddresses; - caf::PdmField m_showFormations; - caf::PdmPtrField m_formationCase; - bool m_selectedSourcesOrTimeStepsFieldsChanged; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 2d10738324..f3c4560c64 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -107,7 +107,7 @@ RimWellLogTrack::RimWellLogTrack() CAF_PDM_InitField(&m_simWellName, "SimulationWellName", QString("None"), " ", "", "", ""); CAF_PDM_InitField(&m_branchIndex, "Branch", 0, " ", "", "", ""); - CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Formation Case", "", "", ""); m_case.uiCapability()->setUiTreeChildrenHidden(true); m_simulationWellChosen = false; @@ -464,42 +464,6 @@ void RimWellLogTrack::loadDataAndUpdate() updateFormationNamesOnPlot(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setShowFormations(bool show /*= true*/) -{ - m_showFormations = show; - loadDataAndUpdate(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setCase(RimCase* rimCase) -{ - m_case = rimCase; - - QList options; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setSimWellName(const QString& simWellName) -{ - m_simWellName = simWellName; - m_trajectoryType = RimWellLogTrack::SIMULATION_WELL; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setBranchIndex(int branchIndex) -{ - m_branchIndex = branchIndex; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -702,11 +666,7 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& } } - caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Visible X Axis Range"); - gridGroup->add(&m_isAutoScaleXEnabled); - gridGroup->add(&m_isLogarithmicScaleEnabled); - gridGroup->add(&m_visibleXRangeMin); - gridGroup->add(&m_visibleXRangeMax); + uiOrderingForVisibleXRange(uiConfigName, uiOrdering); uiOrdering.skipRemainingFields(true); } @@ -833,6 +793,28 @@ std::vector RimWellLogTrack::curvesVector() return curvesVector; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Formation Names Properties"); + formationGroup->add(&m_showFormations); + formationGroup->add(&m_case); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::uiOrderingForVisibleXRange(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Visible X Axis Range"); + gridGroup->add(&m_isAutoScaleXEnabled); + gridGroup->add(&m_isLogarithmicScaleEnabled); + gridGroup->add(&m_visibleXRangeMin); + gridGroup->add(&m_visibleXRangeMax); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index bf8bd97dad..cce6e46d75 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -83,11 +83,6 @@ public: void loadDataAndUpdate(); - void setShowFormations(bool show = true); - void setCase(RimCase* rimCase); - void setSimWellName(const QString& simWellName); - void setBranchIndex(int branchIndex); - void availableDepthRange(double* minimumDepth, double* maximumDepth); void updateXZoomAndParentPlotDepthZoom(); void updateXZoom(); @@ -103,6 +98,9 @@ public: QString description(); std::vector curvesVector(); + void uiOrderingForShowFormationNamesAndCase(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); + void uiOrderingForVisibleXRange(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); + private: virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;