From 0171589c727a8a325022fea191d90127e5229207 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Mon, 29 Jan 2018 10:16:12 +0100 Subject: [PATCH 1/6] Add option to avoid updating parent plot --- ApplicationCode/ProjectDataModel/RimPlotCurve.cpp | 11 +++++++---- ApplicationCode/ProjectDataModel/RimPlotCurve.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp index 208c921970..d5a3f5d08f 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp @@ -135,7 +135,7 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con { if (changedField == &m_showCurve) { - this->updateCurveVisibility(); + this->updateCurveVisibility(true); if (m_showCurve()) loadDataAndUpdate(true); } else if (changedField == &m_curveName) @@ -180,7 +180,7 @@ caf::PdmFieldHandle* RimPlotCurve::objectToggleField() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPlotCurve::updateCurveVisibility() +void RimPlotCurve::updateCurveVisibility(bool updateParent) { bool isVisibleInPossibleParent = true; @@ -199,7 +199,10 @@ void RimPlotCurve::updateCurveVisibility() m_qwtPlotCurve->detach(); } - updateZoomInParentPlot(); + if (updateParent) + { + updateZoomInParentPlot(); + } } //-------------------------------------------------------------------------------------------------- @@ -207,7 +210,7 @@ void RimPlotCurve::updateCurveVisibility() //-------------------------------------------------------------------------------------------------- void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend) { - this->updateCurveVisibility(); + this->updateCurveVisibility(updatePlotLegend); if (updatePlotLegend) { diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.h b/ApplicationCode/ProjectDataModel/RimPlotCurve.h index ee58669c7e..f3c6126389 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.h @@ -92,7 +92,7 @@ public: QString curveName() const { return m_curveName; } - void updateCurveVisibility(); + void updateCurveVisibility(bool updateParent); void updateLegendEntryVisibilityAndPlotLegend(); void updateLegendEntryVisibilityNoPlotUpdate(); From b7a316589ab0e0ce730efcf860f388e8d6b4b9f9 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Mon, 29 Jan 2018 10:17:38 +0100 Subject: [PATCH 2/6] #2319 PLT/Well log plot: Remove auto scale on scroll. Make auto scale from file work --- .../ProjectDataModel/RimWellLogPlot.cpp | 27 ++++++++++++++----- .../ProjectDataModel/RimWellLogPlot.h | 2 ++ .../UserInterface/RiuWellLogPlot.cpp | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index cfe4e53150..9be63af1f9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -147,6 +147,14 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c { rftPlot->updateConnectedEditors(); } + + RimWellPltPlot* pltPlot(nullptr); + this->firstAncestorOrThisOfType(pltPlot); + + if (pltPlot) + { + pltPlot->updateConnectedEditors(); + } } //-------------------------------------------------------------------------------------------------- @@ -294,6 +302,7 @@ void RimWellLogPlot::setDepthZoomByFactorAndCenter(double zoomFactor, double zoo double newMaximum = zoomCenter + (m_maxVisibleDepth - zoomCenter)*zoomFactor; setDepthZoomMinMax(newMinimum, newMaximum); + setDepthAutoZoom(false); } //-------------------------------------------------------------------------------------------------- @@ -303,6 +312,7 @@ void RimWellLogPlot::panDepth(double panFactor) { double delta = panFactor*(m_maxVisibleDepth - m_minVisibleDepth); setDepthZoomMinMax(m_minVisibleDepth + delta, m_maxVisibleDepth + delta); + setDepthAutoZoom(false); } //-------------------------------------------------------------------------------------------------- @@ -383,9 +393,7 @@ bool RimWellLogPlot::hasAvailableDepthRange() const //-------------------------------------------------------------------------------------------------- void RimWellLogPlot::zoomAll() { - m_isAutoScaleDepthEnabled = true; - m_isAutoScaleDepthEnabled.uiCapability()->updateConnectedEditors(); - + setDepthAutoZoom(true); updateDepthZoom(); } @@ -397,6 +405,15 @@ QWidget* RimWellLogPlot::viewWidget() return m_viewer; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogPlot::setDepthAutoZoom(bool on) +{ + m_isAutoScaleDepthEnabled = on; + m_isAutoScaleDepthEnabled.uiCapability()->updateConnectedEditors(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -594,11 +611,7 @@ void RimWellLogPlot::onLoadDataAndUpdate() { updateMdiWindowVisibility(); - bool tempAutoScale = m_isAutoScaleDepthEnabled; - m_isAutoScaleDepthEnabled = false; updateTracks(); - - m_isAutoScaleDepthEnabled = tempAutoScale; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index b92ac0d402..da12f14bff 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -99,6 +99,8 @@ public: virtual void zoomAll() override; virtual QWidget* viewWidget() override; + void setDepthAutoZoom(bool on); + QString asciiDataForPlotExport() const; diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp index eaa8fb7819..34a3f8484d 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp @@ -264,6 +264,7 @@ void RiuWellLogPlot::slotSetMinDepth(int value) double delta = value - minimumDepth; m_plotDefinition->setDepthZoomMinMax(minimumDepth + delta, maximumDepth + delta); + m_plotDefinition->setDepthAutoZoom(false); } //-------------------------------------------------------------------------------------------------- From 438ee340e3b7dd19a57d3ea4306eec603b30a4e7 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Mon, 29 Jan 2018 10:47:54 +0100 Subject: [PATCH 3/6] Rename variable --- ApplicationCode/ProjectDataModel/RimPlotCurve.cpp | 4 ++-- ApplicationCode/ProjectDataModel/RimPlotCurve.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp index d5a3f5d08f..b856cc3633 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp @@ -180,7 +180,7 @@ caf::PdmFieldHandle* RimPlotCurve::objectToggleField() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPlotCurve::updateCurveVisibility(bool updateParent) +void RimPlotCurve::updateCurveVisibility(bool updateParentPlot) { bool isVisibleInPossibleParent = true; @@ -199,7 +199,7 @@ void RimPlotCurve::updateCurveVisibility(bool updateParent) m_qwtPlotCurve->detach(); } - if (updateParent) + if (updateParentPlot) { updateZoomInParentPlot(); } diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.h b/ApplicationCode/ProjectDataModel/RimPlotCurve.h index f3c6126389..0cd9c4495a 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.h @@ -92,7 +92,7 @@ public: QString curveName() const { return m_curveName; } - void updateCurveVisibility(bool updateParent); + void updateCurveVisibility(bool updateParentPlot); void updateLegendEntryVisibilityAndPlotLegend(); void updateLegendEntryVisibilityNoPlotUpdate(); From d67e1a7d139ac6b3af273ab0433cbaf5a59375f8 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Mon, 29 Jan 2018 11:24:12 +0100 Subject: [PATCH 4/6] #2261 Well Paths: Change newestAddedWellPath to mostRecentlyUpdatedWellPath --- .../RicWellPathFormationsImportFileFeature.cpp | 2 +- .../RicWellPathsImportFileFeature.cpp | 2 +- .../ProjectDataModel/RimWellPathCollection.cpp | 15 ++++++--------- .../ProjectDataModel/RimWellPathCollection.h | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp index 71aeba0909..43bf2004ed 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp @@ -77,7 +77,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked) if (oilField->wellPathCollection->wellPaths().size() > 0) { - RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath(); + RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath(); if (wellPath) { RiuMainWindow::instance()->selectAsCurrentItem(wellPath); diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp index bb8cbda1ae..3168992c9c 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp @@ -70,7 +70,7 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked) if (oilField->wellPathCollection->wellPaths().size() > 0) { - RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath(); + RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath(); if (wellPath) { RiuMainWindow::instance()->selectAsCurrentItem(wellPath); diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index 95d17ab4d8..6b0a745863 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -101,7 +101,7 @@ RimWellPathCollection::RimWellPathCollection() m_wellPathImporter = new RifWellPathImporter; m_wellPathFormationsImporter = new RifWellPathFormationsImporter; - m_newestAddedWellPath = nullptr; + m_mostRecentlyUpdatedWellPath = nullptr; } @@ -268,23 +268,20 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector& wellP // Let name from well path file override name from well log file existingWellPath->setName(wellPath->name()); + m_mostRecentlyUpdatedWellPath = existingWellPath; delete wellPath; } else { wellPath->wellPathColor = cvf::Color3f(interpolatedWellColors[wpIdx]); wellPath->setUnitSystem(findUnitSystemForWellPath(wellPath)); + m_mostRecentlyUpdatedWellPath = wellPath; wellPaths.push_back(wellPath); } progress.incrementProgress(); } - if (!wellPaths.empty()) - { - m_newestAddedWellPath = wellPaths[wellPaths.size() - 1]; - } - this->sortWellsByName(); } @@ -360,7 +357,7 @@ void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths) QString wellFormationsCount = QString("%1").arg(it->second->formationNamesCount()); - m_newestAddedWellPath = wellPath; + m_mostRecentlyUpdatedWellPath = wellPath; outputMessage += it->first + "\t\t"; outputMessage += wellPath->name() + " \t\t\t"; @@ -520,9 +517,9 @@ void RimWellPathCollection::deleteAllWellPaths() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellPath* RimWellPathCollection::newestAddedWellPath() +RimWellPath* RimWellPathCollection::mostRecentlyUpdatedWellPath() { - return m_newestAddedWellPath; + return m_mostRecentlyUpdatedWellPath; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index b798c2a689..a4b4c87479 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -93,7 +93,7 @@ public: void removeWellPath(RimWellPath* wellPath); void deleteAllWellPaths(); - RimWellPath* newestAddedWellPath(); + RimWellPath* mostRecentlyUpdatedWellPath(); void readWellPathFormationFiles(); void reloadAllWellPathFormations(); @@ -136,5 +136,5 @@ private: RifWellPathImporter* m_wellPathImporter; RifWellPathFormationsImporter* m_wellPathFormationsImporter; - caf::PdmPointer m_newestAddedWellPath; + caf::PdmPointer m_mostRecentlyUpdatedWellPath; }; From 4a4dab3f1c19b21e394ea85dd7fed8cb447bbfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Mon, 29 Jan 2018 11:23:21 +0100 Subject: [PATCH 5/6] #2408 summary plot. Update qwt axis when duplicating curves --- .../ProjectDataModel/Summary/RimSummaryCurveCollection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index 28c4af2a5c..e8a7c4670e 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -98,6 +98,7 @@ void RimSummaryCurveCollection::loadDataAndUpdate(bool updateParentPlot) for (RimSummaryCurve* curve : m_curves) { curve->loadDataAndUpdate(false); + curve->updateQwtPlotAxis(); } if ( updateParentPlot ) From ecfd1ad8170bcc32863dfd525337e7b1c9bf59fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Mon, 29 Jan 2018 12:46:10 +0100 Subject: [PATCH 6/6] #2368 summary plot. Fix right axis properties update issue --- ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp index d25812a444..7e13a3facd 100644 --- a/ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -140,7 +140,9 @@ void RiuSummaryQwtPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInte zoomWindow.setTop(leftAxis.maxValue()); zoomWindow.setBottom(leftAxis.minValue()); + m_zoomerLeft->blockSignals(true); m_zoomerLeft->zoom(zoomWindow); + m_zoomerLeft->blockSignals(false); } { @@ -150,8 +152,10 @@ void RiuSummaryQwtPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInte zoomWindow.setTop(rightAxis.maxValue()); zoomWindow.setBottom(rightAxis.minValue()); + // No need to block signal since there is no connected slot m_zoomerRight->zoom(zoomWindow); } + } //--------------------------------------------------------------------------------------------------