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

Method measure

DSView/pv/view/dsosignal.cpp:1427–1457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1425}
1426
1427bool DsoSignal::measure(const QPointF &p)
1428{
1429 _hover_en = false;
1430
1431 if (!enabled() || !show())
1432 return false;
1433
1434 if (session->is_stopped_status() == false)
1435 return false;
1436
1437 const QRectF window = get_view_rect();
1438 if (!window.contains(p))
1439 return false;
1440
1441 if (_data->empty())
1442 return false;
1443
1444 _hover_index = _view->pixel2index(p.x());
1445 if (_hover_index >= _data->get_sample_count())
1446 return false;
1447
1448 int chan_index = get_index();
1449 if (_data->has_data(chan_index) == false){
1450 dsv_err("channel %d have no data.", chan_index);
1451 return false;
1452 }
1453
1454 _hover_point = get_point(_hover_index, _hover_value);
1455 _hover_en = true;
1456 return true;
1457}
1458
1459bool DsoSignal::get_hover(uint64_t &index, QPointF &p, double &value)
1460{

Callers

nothing calls this directly

Calls 5

is_stopped_statusMethod · 0.80
emptyMethod · 0.80
pixel2indexMethod · 0.80
get_sample_countMethod · 0.80
has_dataMethod · 0.45

Tested by

no test coverage detected