| 186 | } |
| 187 | |
| 188 | QPointF AnalogSignal::get_point(uint64_t index, float &value) |
| 189 | { |
| 190 | QPointF pt = QPointF(-1, -1); |
| 191 | |
| 192 | if (!enabled()) |
| 193 | return pt; |
| 194 | |
| 195 | const int order = _data->get_ch_order(get_index()); |
| 196 | if (order == -1) |
| 197 | return pt; |
| 198 | |
| 199 | const double scale = _view->scale(); |
| 200 | assert(scale > 0); |
| 201 | const int64_t pixels_offset = _view->offset(); |
| 202 | const double samplerate = _view->session().cur_snap_samplerate(); |
| 203 | const double samples_per_pixel = samplerate * scale; |
| 204 | |
| 205 | if (index >= _data->get_sample_count()) |
| 206 | return pt; |
| 207 | |
| 208 | const uint64_t ring_index = (uint64_t)(_data->get_ring_start() + floor(index)) % _data->get_sample_count(); |
| 209 | value = *(_data->get_samples(ring_index) + order * _data->get_unit_bytes()); |
| 210 | |
| 211 | const int height = get_totalHeight(); |
| 212 | const float top = get_y() - height * 0.5; |
| 213 | const float bottom = get_y() + height * 0.5; |
| 214 | const int hw_offset = get_hw_offset(); |
| 215 | const float x = (index / samples_per_pixel - pixels_offset); |
| 216 | const float y = min(max(top, get_zero_vpos() + (value - hw_offset)* _scale), bottom); |
| 217 | pt = QPointF(x, y); |
| 218 | |
| 219 | return pt; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Probe options |
nothing calls this directly
no test coverage detected