(#396) Fixed updating of plot traces when adding curves

Made sure that plot traces are updated as expected when adding curves to
plot traces with index > 0.
This commit is contained in:
Pål Hagen
2015-09-07 18:00:04 +02:00
parent 1b9977239d
commit eda2ce27d6
4 changed files with 13 additions and 10 deletions

View File

@@ -175,22 +175,24 @@ void RimWellLogExtractionCurve::updatePlotData()
if (filteredValues.size()) if (filteredValues.size())
{ {
RimWellLogPlotTrace* plotTrace;
firstAnchestorOrThisOfType(plotTrace);
RimWellLogPlot* wellLogPlot; RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot); firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot) if (wellLogPlot && plotTrace)
{ {
bool setDepthRange = !wellLogPlot->hasAvailableDepthRange(); bool setDepthRange = !wellLogPlot->hasAvailableDepthRange();
wellLogPlot->updateAvailableDepthRange(); wellLogPlot->updateAvailableDepthRange();
if (setDepthRange && wellLogPlot->traceCount() == 1) if (setDepthRange)
{ {
RimWellLogPlotTrace* plotTrace; wellLogPlot->setVisibleDepthRangeFromContents();
firstAnchestorOrThisOfType(plotTrace); }
if (plotTrace && plotTrace->curveCount() == 1) else if (plotTrace->curveCount() == 1)
{ {
wellLogPlot->setVisibleDepthRangeFromContents(); plotTrace->updateAxisRanges();
}
} }
} }
} }

View File

@@ -208,7 +208,7 @@ void RimWellLogPlotTrace::updateAxisRanges()
double minimumDepth, maximumDepth; double minimumDepth, maximumDepth;
wellLogPlot->visibleDepthRange(&minimumDepth, &maximumDepth); wellLogPlot->visibleDepthRange(&minimumDepth, &maximumDepth);
m_viewer->setAxisScale(QwtPlot::yLeft, minimumDepth, maximumDepth); m_viewer->setDepthRange(minimumDepth, maximumDepth);
rangesChanged = true; rangesChanged = true;
} }

View File

@@ -77,6 +77,7 @@ void RiuWellLogPlot::setDepthRange(double minDepth, double maxDepth)
for (int tpIdx = 0; tpIdx < m_tracePlots.count(); tpIdx++) for (int tpIdx = 0; tpIdx < m_tracePlots.count(); tpIdx++)
{ {
m_tracePlots[tpIdx]->setDepthRange(minDepth, maxDepth); m_tracePlots[tpIdx]->setDepthRange(minDepth, maxDepth);
m_tracePlots[tpIdx]->replot();
} }
updateScrollBar(minDepth, maxDepth); updateScrollBar(minDepth, maxDepth);

View File

@@ -118,7 +118,7 @@ void RiuWellLogTracePlot::setDepthRange(double minDepth, double maxDepth)
{ {
// Note: Y-axis is inverted // Note: Y-axis is inverted
setAxisScale(QwtPlot::yLeft, maxDepth, minDepth); setAxisScale(QwtPlot::yLeft, maxDepth, minDepth);
replot(); //replot();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------