| 1425 | } |
| 1426 | |
| 1427 | bool 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 | |
| 1459 | bool DsoSignal::get_hover(uint64_t &index, QPointF &p, double &value) |
| 1460 | { |
nothing calls this directly
no test coverage detected