| 329 | } |
| 330 | |
| 331 | void Calibration::reload_value() |
| 332 | { |
| 333 | for (const GSList *l = _device_agent->get_channels(); l; l = l->next) { |
| 334 | sr_channel *const probe = (sr_channel*)l->data; |
| 335 | assert(probe); |
| 336 | |
| 337 | uint64_t vgain = 0, vgain_default = 0; |
| 338 | int vgain_range = 0; |
| 339 | _device_agent->get_config_uint64(SR_CONF_PROBE_VGAIN, vgain, probe, NULL); |
| 340 | _device_agent->get_config_uint64(SR_CONF_PROBE_VGAIN_DEFAULT, vgain_default, probe, NULL); |
| 341 | _device_agent->get_config_uint16(SR_CONF_PROBE_VGAIN_RANGE, vgain_range, probe, NULL); |
| 342 | |
| 343 | int voff = 0; |
| 344 | int voff_range = 0; |
| 345 | |
| 346 | _device_agent->get_config_uint16(SR_CONF_PROBE_PREOFF, voff, probe, NULL); |
| 347 | _device_agent->get_config_uint16(SR_CONF_PROBE_PREOFF_MARGIN, voff_range, probe, NULL); |
| 348 | |
| 349 | for(std::list<QSlider*>::iterator i = _slider_list.begin(); |
| 350 | i != _slider_list.end(); i++) { |
| 351 | if ((*i)->objectName() == VGAIN+probe->index) { |
| 352 | (*i)->setRange(-vgain_range/2, vgain_range/2); |
| 353 | (*i)->setValue(vgain - vgain_default); |
| 354 | } else if ((*i)->objectName() == VOFF+probe->index) { |
| 355 | (*i)->setRange(0, voff_range); |
| 356 | (*i)->setValue(voff); |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | void Calibration::on_reset() |
| 363 | { |
nothing calls this directly
no test coverage detected