Merge remote-tracking branch 'origin/2018.01.01-patch' into dev

This commit is contained in:
Rebecca Cox 2018-01-29 10:21:35 +01:00
commit a1f969fc11
5 changed files with 31 additions and 12 deletions

View File

@ -135,7 +135,7 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
{ {
if (changedField == &m_showCurve) if (changedField == &m_showCurve)
{ {
this->updateCurveVisibility(); this->updateCurveVisibility(true);
if (m_showCurve()) loadDataAndUpdate(true); if (m_showCurve()) loadDataAndUpdate(true);
} }
else if (changedField == &m_curveName) else if (changedField == &m_curveName)
@ -180,7 +180,7 @@ caf::PdmFieldHandle* RimPlotCurve::objectToggleField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurveVisibility() void RimPlotCurve::updateCurveVisibility(bool updateParent)
{ {
bool isVisibleInPossibleParent = true; bool isVisibleInPossibleParent = true;
@ -199,7 +199,10 @@ void RimPlotCurve::updateCurveVisibility()
m_qwtPlotCurve->detach(); m_qwtPlotCurve->detach();
} }
updateZoomInParentPlot(); if (updateParent)
{
updateZoomInParentPlot();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -207,7 +210,7 @@ void RimPlotCurve::updateCurveVisibility()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend) void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend)
{ {
this->updateCurveVisibility(); this->updateCurveVisibility(updatePlotLegend);
if (updatePlotLegend) if (updatePlotLegend)
{ {

View File

@ -92,7 +92,7 @@ public:
QString curveName() const { return m_curveName; } QString curveName() const { return m_curveName; }
void updateCurveVisibility(); void updateCurveVisibility(bool updateParent);
void updateLegendEntryVisibilityAndPlotLegend(); void updateLegendEntryVisibilityAndPlotLegend();
void updateLegendEntryVisibilityNoPlotUpdate(); void updateLegendEntryVisibilityNoPlotUpdate();

View File

@ -147,6 +147,14 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
{ {
rftPlot->updateConnectedEditors(); 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; double newMaximum = zoomCenter + (m_maxVisibleDepth - zoomCenter)*zoomFactor;
setDepthZoomMinMax(newMinimum, newMaximum); setDepthZoomMinMax(newMinimum, newMaximum);
setDepthAutoZoom(false);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -303,6 +312,7 @@ void RimWellLogPlot::panDepth(double panFactor)
{ {
double delta = panFactor*(m_maxVisibleDepth - m_minVisibleDepth); double delta = panFactor*(m_maxVisibleDepth - m_minVisibleDepth);
setDepthZoomMinMax(m_minVisibleDepth + delta, m_maxVisibleDepth + delta); setDepthZoomMinMax(m_minVisibleDepth + delta, m_maxVisibleDepth + delta);
setDepthAutoZoom(false);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -383,9 +393,7 @@ bool RimWellLogPlot::hasAvailableDepthRange() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::zoomAll() void RimWellLogPlot::zoomAll()
{ {
m_isAutoScaleDepthEnabled = true; setDepthAutoZoom(true);
m_isAutoScaleDepthEnabled.uiCapability()->updateConnectedEditors();
updateDepthZoom(); updateDepthZoom();
} }
@ -397,6 +405,15 @@ QWidget* RimWellLogPlot::viewWidget()
return m_viewer; return m_viewer;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::setDepthAutoZoom(bool on)
{
m_isAutoScaleDepthEnabled = on;
m_isAutoScaleDepthEnabled.uiCapability()->updateConnectedEditors();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -594,11 +611,7 @@ void RimWellLogPlot::onLoadDataAndUpdate()
{ {
updateMdiWindowVisibility(); updateMdiWindowVisibility();
bool tempAutoScale = m_isAutoScaleDepthEnabled;
m_isAutoScaleDepthEnabled = false;
updateTracks(); updateTracks();
m_isAutoScaleDepthEnabled = tempAutoScale;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -99,6 +99,8 @@ public:
virtual void zoomAll() override; virtual void zoomAll() override;
virtual QWidget* viewWidget() override; virtual QWidget* viewWidget() override;
void setDepthAutoZoom(bool on);
QString asciiDataForPlotExport() const; QString asciiDataForPlotExport() const;

View File

@ -264,6 +264,7 @@ void RiuWellLogPlot::slotSetMinDepth(int value)
double delta = value - minimumDepth; double delta = value - minimumDepth;
m_plotDefinition->setDepthZoomMinMax(minimumDepth + delta, maximumDepth + delta); m_plotDefinition->setDepthZoomMinMax(minimumDepth + delta, maximumDepth + delta);
m_plotDefinition->setDepthAutoZoom(false);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------