MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / device_updated

Method device_updated

DSView/pv/dock/triggerdock.cpp:256–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void TriggerDock::device_updated()
257{
258 uint64_t hw_depth;
259 bool stream = false;
260 uint8_t maxRange;
261 uint64_t sample_limits;
262 int mode = _session->get_device()->get_work_mode();
263 bool ret;
264 int ch_num;
265
266 ret = _session->get_device()->get_config_uint64(SR_CONF_HW_DEPTH, hw_depth);
267
268 if (ret) {
269 if (mode == LOGIC) {
270 _session->get_device()->get_config_bool(SR_CONF_STREAM, stream);
271 sample_limits = _session->get_device()->get_sample_limit();
272
273 _adv_radioButton->setEnabled(!stream);
274 _position_spinBox->setEnabled(!stream);
275 _position_slider->setEnabled(!stream);
276
277 if (stream)
278 maxRange = 1;
279 else if (hw_depth >= sample_limits)
280 maxRange = DS_MAX_TRIG_PERCENT;
281 else
282 maxRange = ceil(hw_depth * DS_MAX_TRIG_PERCENT / sample_limits);
283
284 _position_spinBox->setRange(MinTrigPosition, maxRange);
285 _position_slider->setRange(MinTrigPosition, maxRange);
286
287 if (_session->get_device()->is_virtual() || stream) {
288 _simple_radioButton->setChecked(true);
289 simple_trigger();
290 }
291 }
292 }
293
294 ret = _session->get_device()->get_config_int16(SR_CONF_TOTAL_CH_NUM, ch_num);
295 if (ret) {
296 if (ch_num != _cur_ch_num) {
297 _cur_ch_num = ch_num;
298 setup_adv_tab();
299 retranslateUi();
300 }
301 }
302
303 this->setEnabled(_session->is_loop_mode() == false);
304}
305
306bool TriggerDock::commit_trigger()
307{

Callers 3

load_config_from_jsonMethod · 0.80
reset_all_viewMethod · 0.80
OnMessageMethod · 0.80

Calls 9

get_work_modeMethod · 0.80
get_deviceMethod · 0.80
get_config_uint64Method · 0.80
get_config_boolMethod · 0.80
get_sample_limitMethod · 0.80
setRangeMethod · 0.80
is_virtualMethod · 0.80
get_config_int16Method · 0.80
is_loop_modeMethod · 0.80

Tested by

no test coverage detected