mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#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:
@@ -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();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user