diff --git a/gui/src/plotwidget.cpp b/gui/src/plotwidget.cpp index 343d5447d1..ea2d8dca14 100644 --- a/gui/src/plotwidget.cpp +++ b/gui/src/plotwidget.cpp @@ -109,18 +109,22 @@ void PlotWidget::setupOpenGLCanvas() void PlotWidget::plotChannelChangeXAxis(PlotChannel *c, PlotAxis *x) { + m_navigator->removeChannel(c); m_tracker->removeChannel(c); c->xAxis()->setVisible(false); c->setXAxis(x); + m_navigator->addChannel(c); m_tracker->addChannel(c); showAxisLabels(); } void PlotWidget::plotChannelChangeYAxis(PlotChannel *c, PlotAxis *y) { + m_navigator->removeChannel(c); m_tracker->removeChannel(c); c->yAxis()->setVisible(false); c->setYAxis(y); + m_navigator->addChannel(c); m_tracker->addChannel(c); showAxisLabels(); } diff --git a/plugins/adc/src/freq/fftplotmanager.cpp b/plugins/adc/src/freq/fftplotmanager.cpp index cd7df5f156..c73f7ff62f 100644 --- a/plugins/adc/src/freq/fftplotmanager.cpp +++ b/plugins/adc/src/freq/fftplotmanager.cpp @@ -63,7 +63,7 @@ void FFTPlotManager::removePlot(uint32_t uuid) } multiPlotUpdate(); - syncAllPlotNavigatorsAndCursors(); + // syncAllPlotNavigatorsAndCursors(); } FFTPlotComponent *FFTPlotManager::plot(uint32_t uuid) @@ -89,13 +89,7 @@ void FFTPlotManager::syncNavigatorAndCursors(PlotComponent *p) if(p == m_primary) return; - auto plt = dynamic_cast(p); - QSet set; - set.insert(m_primary->plot(0)->xAxis()->axisId()); - // set.insert(m_primary->plot(0)->yAxis()->axisId()); - set.insert(p->plot(0)->xAxis()->axisId()); - // set.insert(p->plot(0)->yAxis()->axisId()); - PlotNavigator::syncPlotNavigators(m_primary->plot(0)->navigator(), p->plot(0)->navigator(), &set); + PlotNavigator::syncPlotNavigators(m_primary->plot(0)->navigator(), p->plot(0)->navigator()); CursorController::syncXCursorControllers(m_primary->cursor(), p->cursor()); } diff --git a/plugins/adc/src/time/timeplotmanager.cpp b/plugins/adc/src/time/timeplotmanager.cpp index 22d4ea5b52..c6fd0f011b 100644 --- a/plugins/adc/src/time/timeplotmanager.cpp +++ b/plugins/adc/src/time/timeplotmanager.cpp @@ -72,7 +72,7 @@ void TimePlotManager::removePlot(uint32_t uuid) } multiPlotUpdate(); - syncAllPlotNavigatorsAndCursors(); + // syncAllPlotNavigatorsAndCursors(); } TimePlotComponent *TimePlotManager::plot(uint32_t uuid) @@ -99,13 +99,7 @@ void TimePlotManager::syncNavigatorAndCursors(PlotComponent *p) if(p == m_primary) return; - auto plt = dynamic_cast(p); - QSet set; - set.insert(m_primary->plot(0)->xAxis()->axisId()); - // set.insert(m_primary->plot(0)->yAxis()->axisId()); - set.insert(p->plot(0)->xAxis()->axisId()); - // set.insert(p->plot(0)->yAxis()->axisId()); - PlotNavigator::syncPlotNavigators(m_primary->plot(0)->navigator(), p->plot(0)->navigator(), &set); + PlotNavigator::syncPlotNavigators(m_primary->plot(0)->navigator(), p->plot(0)->navigator()); CursorController::syncXCursorControllers(m_primary->cursor(), p->cursor()); }