Make updating of well log plots more robust

1. Don't update tracks in RimWellLogPlot::createViewWidget.
 * We haven't set up the MDI windows properly yet.
 * Instead implement updateVIewWidgetAfterCreation override and do update tracks there.
2.  Perform calculateAvailableDepthRange in applyZoomAllDepths
3. Do replot of track widgets twice when changing visible range. Need to investigate this one further.
This commit is contained in:
Gaute Lindkvist 2018-06-29 11:47:28 +02:00
parent ec63f0c28e
commit fc821ea524
3 changed files with 13 additions and 5 deletions

View File

@ -220,6 +220,14 @@ QImage RimWellLogPlot::snapshotWindowContent()
return image;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateViewWidgetAfterCreation()
{
recreateTrackPlots();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -702,6 +710,8 @@ void RimWellLogPlot::applyDepthZoomFromVisibleDepth()
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::applyZoomAllDepths()
{
calculateAvailableDepthRange();
if (hasAvailableDepthRange())
{
setDepthZoomMinMax(m_minAvailableDepth, m_maxAvailableDepth + 0.01*(m_maxAvailableDepth - m_minAvailableDepth));
@ -759,9 +769,6 @@ QString RimWellLogPlot::description() const
QWidget* RimWellLogPlot::createViewWidget(QWidget* mainWindowParent)
{
m_viewer = new RiuWellLogPlot(this, mainWindowParent);
recreateTrackPlots();
return m_viewer;
}

View File

@ -126,7 +126,7 @@ protected:
virtual void onLoadDataAndUpdate() override;
virtual QImage snapshotWindowContent() override;
virtual void updateViewWidgetAfterCreation() override;
private:
void applyZoomAllDepths();

View File

@ -283,11 +283,12 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
else if (changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax)
{
m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax);
m_wellLogTrackPlotWidget->replot();
m_isAutoScaleXEnabled = false;
updateEditors();
updateParentPlotLayout();
updateAxisAndGridTickIntervals();
m_wellLogTrackPlotWidget->replot();
m_wellLogTrackPlotWidget->replot(); // TODO: See if we can get rid of duplicate replot
}
else if (changedField == &m_isAutoScaleXEnabled)
{