| 786 | } |
| 787 | |
| 788 | void Viewport:: mouseMoveEvent(QMouseEvent *event) |
| 789 | { |
| 790 | assert(event); |
| 791 | _hover_hit = false; |
| 792 | int mode = _view.session().get_device()->get_work_mode(); |
| 793 | |
| 794 | if (event->buttons() & Qt::LeftButton) { |
| 795 | if (_type == TIME_VIEW) { |
| 796 | if (_action_type == NO_ACTION) { |
| 797 | int64_t x = _mouse_down_offset + (_mouse_down_point - event->pos()).x(); |
| 798 | _view.set_scale_offset(_view.scale(), x); |
| 799 | } |
| 800 | _drag_strength = (_mouse_down_point - event->pos()).x(); |
| 801 | } |
| 802 | else if (_type == FFT_VIEW) { |
| 803 | for(auto t: _view.session().get_spectrum_traces()) { |
| 804 | if(t->enabled()) { |
| 805 | double delta = (_mouse_point - event->pos()).x(); |
| 806 | t->set_offset(delta); |
| 807 | break; |
| 808 | } |
| 809 | } |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | if (_type == TIME_VIEW) { |
| 814 | if ((event->buttons() & Qt::LeftButton) || |
| 815 | !(event->buttons() | Qt::NoButton)) { |
| 816 | if (_action_type == DSO_TRIG_MOVE) { |
| 817 | if (_drag_sig && _drag_sig->signal_type() == SR_CHANNEL_DSO) { |
| 818 | view::DsoSignal *dsoSig = (view::DsoSignal*)_drag_sig; |
| 819 | dsoSig->set_trig_vpos(event->pos().y()); |
| 820 | _dso_trig_moved = true; |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | if (_action_type == CURS_MOVE) { |
| 825 | TimeMarker* grabbed_marker = _view.get_ruler()->get_grabbed_cursor(); |
| 826 | if (grabbed_marker) { |
| 827 | int curX = _view.hover_point().x(); |
| 828 | uint64_t index0 = 0, index1 = 0, index2 = 0; |
| 829 | bool logic = false; |
| 830 | |
| 831 | for(auto s : _view.session().get_signals()) { |
| 832 | if (mode == LOGIC && s->signal_type() == SR_CHANNEL_LOGIC) { |
| 833 | view::LogicSignal *logicSig = (view::LogicSignal*)s; |
| 834 | if (logicSig->measure(event->pos(), index0, index1, index2)) { |
| 835 | logic = true; |
| 836 | break; |
| 837 | } |
| 838 | } |
| 839 | if (mode == DSO && s->signal_type() == SR_CHANNEL_DSO) { |
| 840 | view::DsoSignal *dsoSig = (view::DsoSignal*)s; |
| 841 | curX = min(dsoSig->get_view_rect().right(), curX); |
| 842 | |
| 843 | if (curX < dsoSig->get_view_rect().left()){ |
| 844 | curX = dsoSig->get_view_rect().left(); |
| 845 | } |
nothing calls this directly
no test coverage detected