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

Method get_voltage

DSView/pv/view/dsosignal.cpp:1494–1515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1492}
1493
1494double DsoSignal::get_voltage(uint64_t index)
1495{
1496 if (!enabled())
1497 return 1;
1498
1499 if (_data->empty())
1500 return 1;
1501
1502 if (index >= _data->get_sample_count())
1503 return 1;
1504
1505 assert(_data);
1506
1507 const double value = *_data->get_samples(index, index, get_index());
1508 const int hw_offset = get_hw_offset();
1509 uint64_t k = _data->get_measure_voltage_factor(this->get_index());
1510 float data_scale = _data->get_data_scale(this->get_index());
1511
1512 return (hw_offset - value) * data_scale *
1513 k *_vDial->get_factor() *
1514 DS_CONF_DSO_VDIVS / get_view_rect().height();
1515}
1516
1517QString DsoSignal::get_voltage(double v, int p, bool scaled)
1518{

Callers 1

paintMethod · 0.45

Calls 7

emptyMethod · 0.80
get_sample_countMethod · 0.80
get_data_scaleMethod · 0.80
get_samplesMethod · 0.45
get_indexMethod · 0.45
get_factorMethod · 0.45

Tested by

no test coverage detected