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

Method reload_value

DSView/pv/dialogs/calibration.cpp:331–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void 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
362void Calibration::on_reset()
363{

Callers

nothing calls this directly

Calls 6

get_channelsMethod · 0.80
get_config_uint64Method · 0.80
get_config_uint16Method · 0.80
setRangeMethod · 0.80
setValueMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected