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); } //--------------------------------------------------------------------------------------------------