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

Method nextDevice

core/src/devicebrowser.cpp:150–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148QString DeviceBrowser::getIdOfIndex(int idx) { return (list[idx]->property(devBrowserId).toString()); }
149
150void DeviceBrowser::nextDevice()
151{
152 int maxIdx = list.size();
153 int nextIdx = currentIdx;
154
155 do { // find next visible and enabled button
156 nextIdx = (nextIdx + 1) % maxIdx;
157 nextIdx = (nextIdx < 0) ? nextIdx + maxIdx : nextIdx; // wrap around negative
158 } while(!(list.at(nextIdx)->isVisible() && list.at(nextIdx)->isEnabled()));
159
160 QString nextId = getIdOfIndex(nextIdx);
161 Q_EMIT requestDevice(nextId, 1); // start animation
162 list[nextIdx]->setChecked(true); // set checked afterwards
163}
164
165void DeviceBrowser::prevDevice()
166{

Callers

nothing calls this directly

Calls 3

setCheckedMethod · 0.80
isVisibleMethod · 0.45
isEnabledMethod · 0.45

Tested by

no test coverage detected