| 254 | } |
| 255 | |
| 256 | void 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 | |
| 306 | bool TriggerDock::commit_trigger() |
| 307 | { |
no test coverage detected