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

Method prevDevice

core/src/devicebrowser.cpp:165–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void DeviceBrowser::prevDevice()
166{
167 int maxIdx = list.size();
168 int nextIdx = currentIdx;
169
170 do { // find next visible and enabled button
171 nextIdx = (nextIdx - 1) % maxIdx;
172 nextIdx = (nextIdx < 0) ? nextIdx + maxIdx : nextIdx; // wrap around negative
173 } while(!(list.at(nextIdx)->isVisible() && list.at(nextIdx)->isEnabled()));
174
175 QString nextId = getIdOfIndex(nextIdx);
176 Q_EMIT requestDevice(nextId, -1); // start animation
177 list[nextIdx]->setChecked(true); // set checked afterwards
178}
179
180void DeviceBrowser::forwardRequestDeviceWithDirection()
181{

Callers

nothing calls this directly

Calls 3

setCheckedMethod · 0.80
isVisibleMethod · 0.45
isEnabledMethod · 0.45

Tested by

no test coverage detected