diff options
Diffstat (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/WaterfallDisplayPlot.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.cc b/gr-qtgui/lib/WaterfallDisplayPlot.cc index 08a71c023..2234f4238 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.cc +++ b/gr-qtgui/lib/WaterfallDisplayPlot.cc @@ -253,13 +253,9 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent) // Ctrl+RighButton: zoom out to full size _zoomer = new WaterfallZoomer(canvas(), 0); -#if QT_VERSION < 0x040000 + _zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection); _zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton, Qt::ControlModifier); -#else - _zoomer->setMousePattern(QwtEventPattern::MouseSelect2, - Qt::RightButton, Qt::ControlModifier); -#endif _zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton); @@ -267,6 +263,11 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent) _panner->setAxisEnabled(QwtPlot::yRight, false); _panner->setMouseButton(Qt::MidButton); + // emit the position of clicks on widget + _picker = new QwtDblClickPlotPicker(canvas()); + connect(_picker, SIGNAL(selected(const QwtDoublePoint &)), + this, SLOT(OnPickerPointSelected(const QwtDoublePoint &))); + // Avoid jumping when labels with more/less digits // appear/disappear when scrolling vertically @@ -279,6 +280,8 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent) _zoomer->setTrackerPen(c); _UpdateIntensityRangeDisplay(); + + _xAxisMultiplier = 1; } WaterfallDisplayPlot::~WaterfallDisplayPlot() @@ -315,6 +318,8 @@ WaterfallDisplayPlot::SetFrequencyRange(const double constStartFreq, double stopFreq = constStopFreq / units; double centerFreq = constCenterFreq / units; + _xAxisMultiplier = units; + _useCenterFrequencyFlag = useCenterFrequencyFlag; if(_useCenterFrequencyFlag){ @@ -544,4 +549,13 @@ WaterfallDisplayPlot::_UpdateIntensityRangeDisplay() _lastReplot = get_highres_clock(); } +void +WaterfallDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p) +{ + QPointF point = p; + //fprintf(stderr,"OnPickerPointSelected %f %f %d\n", point.x(), point.y(), _xAxisMultiplier); + point.setX(point.x() * _xAxisMultiplier); + emit plotPointSelected(point); +} + #endif /* WATERFALL_DISPLAY_PLOT_C */ |