Skip to content

Commit

Permalink
adc: Fixed plot navigator sync
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Popa <[email protected]>
  • Loading branch information
andrei47w committed Sep 12, 2024
1 parent df62562 commit 8c50df4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
4 changes: 4 additions & 0 deletions gui/src/plotwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
10 changes: 2 additions & 8 deletions plugins/adc/src/freq/fftplotmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void FFTPlotManager::removePlot(uint32_t uuid)
}

multiPlotUpdate();
syncAllPlotNavigatorsAndCursors();
// syncAllPlotNavigatorsAndCursors();
}

FFTPlotComponent *FFTPlotManager::plot(uint32_t uuid)
Expand All @@ -89,13 +89,7 @@ void FFTPlotManager::syncNavigatorAndCursors(PlotComponent *p)
if(p == m_primary)
return;

auto plt = dynamic_cast<FFTPlotComponent *>(p);
QSet<QwtAxisId> 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());
}

Expand Down
10 changes: 2 additions & 8 deletions plugins/adc/src/time/timeplotmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void TimePlotManager::removePlot(uint32_t uuid)
}

multiPlotUpdate();
syncAllPlotNavigatorsAndCursors();
// syncAllPlotNavigatorsAndCursors();
}

TimePlotComponent *TimePlotManager::plot(uint32_t uuid)
Expand All @@ -99,13 +99,7 @@ void TimePlotManager::syncNavigatorAndCursors(PlotComponent *p)
if(p == m_primary)
return;

auto plt = dynamic_cast<TimePlotComponent *>(p);
QSet<QwtAxisId> 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());
}

Expand Down

0 comments on commit 8c50df4

Please sign in to comment.