MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / get_point

Method get_point

DSView/pv/view/dsosignal.cpp:1470–1492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1468}
1469
1470QPointF DsoSignal::get_point(uint64_t index, float &value)
1471{
1472 QPointF pt = QPointF(-1, -1);
1473
1474 if (!enabled())
1475 return pt;
1476
1477 if (_data->empty())
1478 return pt;
1479
1480 if (index >= _data->get_sample_count())
1481 return pt;
1482
1483 value = *_data->get_samples(index, index, get_index());
1484 const float top = get_view_rect().top();
1485 const float bottom = get_view_rect().bottom();
1486 const int hw_offset = get_hw_offset();
1487 const float x = _view->index2pixel(index);
1488 const float y = min(max(top, get_zero_vpos() + (value - hw_offset)* _scale), bottom);
1489 pt = QPointF(x, y);
1490
1491 return pt;
1492}
1493
1494double DsoSignal::get_voltage(uint64_t index)
1495{

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.80
get_sample_countMethod · 0.80
index2pixelMethod · 0.80
get_samplesMethod · 0.45

Tested by

no test coverage detected