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

Method connectSignals

gui/src/cursorcontroller.cpp:70–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void CursorController::connectSignals(CursorSettings *cursorSettings)
71{
72 // x controls
73 connect(cursorSettings->getXEn(), &QAbstractButton::toggled, this, &CursorController::xEnToggled);
74 connect(cursorSettings->getXLock(), &QAbstractButton::toggled, this, &CursorController::xLockToggled);
75 connect(cursorSettings->getXTrack(), &QAbstractButton::toggled, plotCursors, &PlotCursors::enableTracking);
76
77 // y controls
78 connect(cursorSettings->getYEn(), &QAbstractButton::toggled, this, &CursorController::yEnToggled);
79 connect(cursorSettings->getYLock(), &QAbstractButton::toggled, this, &CursorController::yLockToggled);
80
81 // readouts controls
82 connect(cursorSettings->getReadoutsDrag(), &QAbstractButton::toggled, this,
83 &CursorController::readoutsDragToggled);
84
85 // update session in case the settings are conncted to multiple controllers
86 connect(cursorSettings, &CursorSettings::sessionUpdated, this, [=]() { setVisible(isVisible()); });
87 cursorSettings->updateSession();
88
89 // cursor movement
90 connect(y1Cursor, &PlotAxisHandle::scalePosChanged, this, [=](double pos) {
91 if(yLock) {
92 y2Cursor->setPositionSilent(pos - yLockGap);
93 plotCursorReadouts->setY2(y2Cursor->getPosition());
94 }
95 plotCursorReadouts->setY1(pos);
96 });
97 connect(y2Cursor, &PlotAxisHandle::scalePosChanged, this, [=](double pos) {
98 if(yLock) {
99 y1Cursor->setPositionSilent(pos + yLockGap);
100 plotCursorReadouts->setY1(y1Cursor->getPosition());
101 }
102 plotCursorReadouts->setY2(pos);
103 });
104 connect(x1Cursor, &PlotAxisHandle::scalePosChanged, this, [=](double pos) {
105 if(xLock) {
106 x2Cursor->setPositionSilent(pos - LockGap);
107 plotCursorReadouts->setX2(x2Cursor->getPosition());
108 }
109 plotCursorReadouts->setX1(pos);
110 });
111 connect(x2Cursor, &PlotAxisHandle::scalePosChanged, this, [=](double pos) {
112 if(xLock) {
113 x1Cursor->setPositionSilent(pos + LockGap);
114 plotCursorReadouts->setX1(x1Cursor->getPosition());
115 }
116 plotCursorReadouts->setX2(pos);
117 });
118
119 for(PlotChannel *ch : m_plot->getChannels()) {
120 onAddedChannel(ch);
121 }
122 connect(m_plot, &PlotWidget::addedChannel, this, &CursorController::onAddedChannel);
123 connect(m_plot, &PlotWidget::removedChannel, this, &CursorController::onRemovedChannel);
124 connect(m_plot, &PlotWidget::channelSelected, this, &CursorController::onSelectedChannel);
125}
126
127void CursorController::xEnToggled(bool toggled)

Callers

nothing calls this directly

Calls 15

getXEnMethod · 0.80
getXLockMethod · 0.80
getXTrackMethod · 0.80
getYEnMethod · 0.80
getYLockMethod · 0.80
getReadoutsDragMethod · 0.80
updateSessionMethod · 0.80
setPositionSilentMethod · 0.80
setY2Method · 0.80
setY1Method · 0.80
setX2Method · 0.80
setX1Method · 0.80

Tested by

no test coverage detected