MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / removeNavigators

Method removeNavigators

gui/src/plotnavigator.cpp:221–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221void PlotNavigator::removeNavigators(QwtAxisId axisId, PlotChannel *channel)
222{
223 // remove axes if there aren't other channels using them
224 bool found = false;
225
226 for(PlotChannel *ch : *m_channels) {
227 if((ch->xAxis()->axisId() == axisId) || (ch->yAxis()->axisId() == axisId)) {
228 found = true;
229 }
230 }
231
232 QList<Navigator *> toDelete;
233 for(Navigator *nav : *m_navigators) {
234 if((!found && nav->magnifier->getXAxis() == axisId) ||
235 (!found && nav->magnifier->getYAxis() == axisId)) {
236 toDelete.push_back(nav);
237 }
238 }
239
240 for(Navigator *n : toDelete) {
241 m_navigators->remove(n);
242 delete n;
243 m_axes->remove(axisId);
244 }
245}
246
247void PlotNavigator::onReset()
248{

Callers

nothing calls this directly

Calls 6

axisIdMethod · 0.80
xAxisMethod · 0.45
yAxisMethod · 0.45
getXAxisMethod · 0.45
getYAxisMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected