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

Method addAxis

gui/src/widgets/menuplotaxisrangecontrol.cpp:48–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void MenuPlotAxisRangeControl::addAxis(PlotAxis *ax)
49{
50 // Connects
51
52 if(connections.contains(ax))
53 return;
54
55 connections[ax] << connect(m_min, &MenuSpinbox::valueChanged, ax, &PlotAxis::setMin);
56 connections[ax] << connect(m_min, &MenuSpinbox::valueChanged, this,
57 [=](double) { Q_EMIT intervalChanged(m_min->value(), m_max->value()); });
58 connections[ax] << connect(ax, &PlotAxis::minChanged, this, [=]() {
59 QSignalBlocker b(m_min);
60 m_min->setValue(ax->min());
61 Q_EMIT intervalChanged(m_min->value(), m_max->value());
62 });
63
64 connections[ax] << connect(m_max, &MenuSpinbox::valueChanged, ax, &PlotAxis::setMax);
65 connections[ax] << connect(m_max, &MenuSpinbox::valueChanged, this,
66 [=](double) { Q_EMIT intervalChanged(m_min->value(), m_max->value()); });
67 connections[ax] << connect(ax, &PlotAxis::maxChanged, this, [=]() {
68 QSignalBlocker b(m_max);
69 m_max->setValue(ax->max());
70 Q_EMIT intervalChanged(m_min->value(), m_max->value());
71 });
72}
73
74void MenuPlotAxisRangeControl::removeAxis(PlotAxis *ax)
75{

Callers 3

addChannelToPlotMethod · 0.80
addChannelToPlotMethod · 0.80
addChannelToPlotMethod · 0.80

Calls 6

connectFunction · 0.50
containsMethod · 0.45
valueMethod · 0.45
setValueMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected