| 1492 | } |
| 1493 | |
| 1494 | double 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 | |
| 1517 | QString DsoSignal::get_voltage(double v, int p, bool scaled) |
| 1518 | { |
no test coverage detected