From befadabc2f18b483c71250adfd7dbf42f66b16f0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 27 Mar 2011 12:55:16 -0400 Subject: gr-qtgui: restructuring qtgui directory to new layout. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 gr-qtgui/lib/WaterfallDisplayPlot.h (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h new file mode 100644 index 000000000..6b4e978bb --- /dev/null +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -0,0 +1,84 @@ +#ifndef WATERFALL_DISPLAY_PLOT_HPP +#define WATERFALL_DISPLAY_PLOT_HPP + +#include +#include +#include +#include +#include + +#include + +#include + +class WaterfallDisplayPlot:public QwtPlot{ + Q_OBJECT + +public: + WaterfallDisplayPlot(QWidget*); + virtual ~WaterfallDisplayPlot(); + + void Reset(); + + void SetFrequencyRange(const double, const double, + const double, const bool, + const double units=1000.0, + const std::string &strunits = "kHz"); + double GetStartFrequency()const; + double GetStopFrequency()const; + + void PlotNewData(const double* dataPoints, const int64_t numDataPoints, + const double timePerFFT, const timespec timestamp, + const int droppedFrames); + + void SetIntensityRange(const double minIntensity, const double maxIntensity); + + virtual void replot(void); + + int GetIntensityColorMapType()const; + void SetIntensityColorMapType( const int, const QColor, const QColor ); + const QColor GetUserDefinedLowIntensityColor()const; + const QColor GetUserDefinedHighIntensityColor()const; + + enum{ + INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0, + INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1, + INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2, + INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3, + INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4 + }; + +public slots: + void resizeSlot( QSize *s ); + +signals: + void UpdatedLowerIntensityLevel(const double); + void UpdatedUpperIntensityLevel(const double); + +protected: + +private: + void _UpdateIntensityRangeDisplay(); + + double _startFrequency; + double _stopFrequency; + + PlotWaterfall *d_spectrogram; + + QwtPlotPanner* _panner; + QwtPlotZoomer* _zoomer; + + WaterfallData* _waterfallData; + + timespec _lastReplot; + + bool _useCenterFrequencyFlag; + + int64_t _numPoints; + + int _intensityColorMapType; + QColor _userDefinedLowIntensityColor; + QColor _userDefinedHighIntensityColor; +}; + +#endif /* WATERFALL_DISPLAY_PLOT_HPP */ -- cgit From 41ad09b4f22228dd555ea73f2078cb9ff056b979 Mon Sep 17 00:00:00 2001 From: Mike Cornelius Date: Mon, 11 Apr 2011 00:48:29 -0400 Subject: gr-qtgui: adding double-click point selector to main gui widgets. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 6b4e978bb..faa48d6aa 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -50,10 +51,12 @@ public: public slots: void resizeSlot( QSize *s ); - + void OnPickerPointSelected(const QwtDoublePoint & p); + signals: void UpdatedLowerIntensityLevel(const double); void UpdatedUpperIntensityLevel(const double); + void plotPointSelected(const QPointF p); protected: @@ -62,12 +65,15 @@ private: double _startFrequency; double _stopFrequency; + int _xAxisMultiplier; PlotWaterfall *d_spectrogram; QwtPlotPanner* _panner; QwtPlotZoomer* _zoomer; + QwtDblClickPlotPicker *_picker; + WaterfallData* _waterfallData; timespec _lastReplot; -- cgit From 7ba2647977f9b302969208fa8548d1ca8dcddd4b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 18 Apr 2011 23:07:31 -0400 Subject: gr-qtgui: adding copyright dates to qtgui files. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index faa48d6aa..583bf9407 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -1,3 +1,25 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #ifndef WATERFALL_DISPLAY_PLOT_HPP #define WATERFALL_DISPLAY_PLOT_HPP -- cgit From 697562c3d4319ab6f13e4c2910a853409731595d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 7 Jun 2011 21:48:02 -0400 Subject: qtgui: replace timespec with typedef so its easier to replace --- gr-qtgui/lib/WaterfallDisplayPlot.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 583bf9407..435453fcc 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -51,7 +51,7 @@ public: double GetStopFrequency()const; void PlotNewData(const double* dataPoints, const int64_t numDataPoints, - const double timePerFFT, const timespec timestamp, + const double timePerFFT, const highres_timespec timestamp, const int droppedFrames); void SetIntensityRange(const double minIntensity, const double maxIntensity); @@ -98,7 +98,7 @@ private: WaterfallData* _waterfallData; - timespec _lastReplot; + highres_timespec _lastReplot; bool _useCenterFrequencyFlag; -- cgit From bbf11bb338a4a88a1f270f77649212fea0b0cab0 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 7 Jun 2011 22:55:41 -0400 Subject: qtgui: removed all traces of highResTimeFunctions.h --- gr-qtgui/lib/WaterfallDisplayPlot.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 435453fcc..0c6a521b1 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -32,7 +32,7 @@ #include #include -#include +#include class WaterfallDisplayPlot:public QwtPlot{ Q_OBJECT @@ -51,7 +51,7 @@ public: double GetStopFrequency()const; void PlotNewData(const double* dataPoints, const int64_t numDataPoints, - const double timePerFFT, const highres_timespec timestamp, + const double timePerFFT, const gruel::high_res_timer_type timestamp, const int droppedFrames); void SetIntensityRange(const double minIntensity, const double maxIntensity); @@ -98,7 +98,7 @@ private: WaterfallData* _waterfallData; - highres_timespec _lastReplot; + gruel::high_res_timer_type _lastReplot; bool _useCenterFrequencyFlag; -- cgit From 25fd6e0324dc8296b66a3c9b8e628d6738f15fe7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 15 Oct 2011 18:23:04 -0400 Subject: qtgui: wip: updating qtgui to work with QWT 6 (and trying to maintain backwards compatability to 5.2). This wip works for just the fft plots. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 0c6a521b1..17eba13b2 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -34,6 +34,10 @@ #include +#if QWT_VERSION >= 0x060000 +#include +#endif + class WaterfallDisplayPlot:public QwtPlot{ Q_OBJECT @@ -73,7 +77,7 @@ public: public slots: void resizeSlot( QSize *s ); - void OnPickerPointSelected(const QwtDoublePoint & p); + void OnPickerPointSelected(const QPointF & p); signals: void UpdatedLowerIntensityLevel(const double); -- cgit From 4496fae2deea200755225c007a26f4c7be0470e9 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 16:32:41 -0400 Subject: qtgui: waterfall plot mostly working under qwt6 (plots, but updates to scale and color not working yet). --- gr-qtgui/lib/WaterfallDisplayPlot.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 17eba13b2..90a72ff2e 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -26,11 +26,13 @@ #include #include #include +#include #include #include #include -#include +//#include +#include #include @@ -93,14 +95,13 @@ private: double _stopFrequency; int _xAxisMultiplier; - PlotWaterfall *d_spectrogram; - QwtPlotPanner* _panner; QwtPlotZoomer* _zoomer; QwtDblClickPlotPicker *_picker; - WaterfallData* _waterfallData; + WaterfallData *d_data; + QwtPlotSpectrogram *d_spectrogram; gruel::high_res_timer_type _lastReplot; -- cgit From 0319e05a4bb9a41082d00e334ac1647314dfaacd Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 18:39:45 -0400 Subject: qtgui: wip: working to make plots backwards compatible with qwt 5.2. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 90a72ff2e..611566995 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -79,7 +79,11 @@ public: public slots: void resizeSlot( QSize *s ); +#if QWT_VERSION < 0x060000 + void OnPickerPointSelected(const QwtDoublePoint & p); +#else void OnPickerPointSelected(const QPointF & p); +#endif signals: void UpdatedLowerIntensityLevel(const double); -- cgit From 45c2212608ca66b5fadbc860771e042198e1ebcd Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 19:45:29 -0400 Subject: qtgui: more compatability issues. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 611566995..0458597b0 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -29,14 +29,14 @@ #include #include #include - #include -//#include #include #include -#if QWT_VERSION >= 0x060000 +#if QWT_VERSION < 0x060000 +#include +#else #include #endif @@ -79,6 +79,7 @@ public: public slots: void resizeSlot( QSize *s ); + #if QWT_VERSION < 0x060000 void OnPickerPointSelected(const QwtDoublePoint & p); #else @@ -105,7 +106,12 @@ private: QwtDblClickPlotPicker *_picker; WaterfallData *d_data; + +#if QWT_VERSION < 0x060000 + PlotWaterfall *d_spectrogram; +#else QwtPlotSpectrogram *d_spectrogram; +#endif gruel::high_res_timer_type _lastReplot; -- cgit From 3710dd6d3fb30966dfc0f32876a52703a9a85a60 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 25 Oct 2011 11:57:02 -0400 Subject: qtgui: Fixing slot names that can't be #if'd out for compatibility between Qwt 5.2 and 6.0. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index 0458597b0..b78c750ff 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -80,11 +80,11 @@ public: public slots: void resizeSlot( QSize *s ); -#if QWT_VERSION < 0x060000 + // Because of the preprocessing of slots in QT, these are no + // easily separated by the version check. Make one for each + // version until it's worked out. void OnPickerPointSelected(const QwtDoublePoint & p); -#else - void OnPickerPointSelected(const QPointF & p); -#endif + void OnPickerPointSelected6(const QPointF & p); signals: void UpdatedLowerIntensityLevel(const double); -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- gr-qtgui/lib/WaterfallDisplayPlot.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h') diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index b78c750ff..d189ca2cb 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -49,9 +49,9 @@ public: void Reset(); - void SetFrequencyRange(const double, const double, + void SetFrequencyRange(const double, const double, const double, const bool, - const double units=1000.0, + const double units=1000.0, const std::string &strunits = "kHz"); double GetStartFrequency()const; double GetStopFrequency()const; @@ -85,7 +85,7 @@ public slots: // version until it's worked out. void OnPickerPointSelected(const QwtDoublePoint & p); void OnPickerPointSelected6(const QPointF & p); - + signals: void UpdatedLowerIntensityLevel(const double); void UpdatedUpperIntensityLevel(const double); -- cgit