diff options
Diffstat (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h')
-rw-r--r-- | gr-qtgui/lib/WaterfallDisplayPlot.h | 110 |
1 files changed, 52 insertions, 58 deletions
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h index d189ca2cbd..6637adc594 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ b/gr-qtgui/lib/WaterfallDisplayPlot.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. + * Copyright 2008-2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,18 +20,15 @@ * Boston, MA 02110-1301, USA. */ -#ifndef WATERFALL_DISPLAY_PLOT_HPP -#define WATERFALL_DISPLAY_PLOT_HPP +#ifndef WATERFALL_DISPLAY_PLOT_H +#define WATERFALL_DISPLAY_PLOT_H #include <stdint.h> #include <cstdio> -#include <qwt_plot.h> +#include <vector> #include <qwt_plot_spectrogram.h> -#include <qwt_plot_zoomer.h> -#include <qwt_plot_panner.h> -#include <qtgui_util.h> -#include <waterfallGlobalData.h> - +#include "DisplayPlot.h" +#include "waterfallGlobalData.h" #include <gruel/high_res_timer.h> #if QWT_VERSION < 0x060000 @@ -40,88 +37,85 @@ #include <qwt_compat.h> #endif -class WaterfallDisplayPlot:public QwtPlot{ +class WaterfallDisplayPlot: public DisplayPlot +{ Q_OBJECT + Q_PROPERTY ( int intensity_color_map_type1 READ getIntensityColorMapType1 WRITE setIntensityColorMapType1 ) + Q_PROPERTY ( QColor low_intensity_color READ getUserDefinedLowIntensityColor WRITE setUserDefinedLowIntensityColor ) + Q_PROPERTY ( QColor high_intensity_color READ getUserDefinedHighIntensityColor WRITE setUserDefinedHighIntensityColor ) + + public: - WaterfallDisplayPlot(QWidget*); + WaterfallDisplayPlot(int nplots, QWidget*); virtual ~WaterfallDisplayPlot(); - void Reset(); + void resetAxis(); - void SetFrequencyRange(const double, const double, - const double, const bool, + void setFrequencyRange(const double, const double, const double units=1000.0, const std::string &strunits = "kHz"); - double GetStartFrequency()const; - double GetStopFrequency()const; + double getStartFrequency() const; + double getStopFrequency() const; - void PlotNewData(const double* dataPoints, const int64_t numDataPoints, - const double timePerFFT, const gruel::high_res_timer_type timestamp, + void plotNewData(const std::vector<double*> dataPoints, + const int64_t numDataPoints, + const double timePerFFT, + const gruel::high_res_timer_type timestamp, const int droppedFrames); - void SetIntensityRange(const double minIntensity, const double maxIntensity); + // to be removed + void plotNewData(const double* dataPoints, + const int64_t numDataPoints, + const double timePerFFT, + const gruel::high_res_timer_type timestamp, + const int droppedFrames); - virtual void replot(void); + void setIntensityRange(const double minIntensity, const double maxIntensity); + double getMinIntensity(int which) const; + double getMaxIntensity(int which) const; - int GetIntensityColorMapType()const; - void SetIntensityColorMapType( const int, const QColor, const QColor ); - const QColor GetUserDefinedLowIntensityColor()const; - const QColor GetUserDefinedHighIntensityColor()const; + void replot(void); + void clearData(); - 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 - }; + int getIntensityColorMapType(int) const; + int getIntensityColorMapType1() const; + const QColor getUserDefinedLowIntensityColor() const; + const QColor getUserDefinedHighIntensityColor() const; -public slots: - void resizeSlot( QSize *s ); + int getAlpha(int which); + void setAlpha(int which, int alpha); - // 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); - void OnPickerPointSelected6(const QPointF & p); +public slots: + void setIntensityColorMapType(const int, const int, const QColor, const QColor); + void setIntensityColorMapType1(int); + void setUserDefinedLowIntensityColor(QColor); + void setUserDefinedHighIntensityColor(QColor); signals: - void UpdatedLowerIntensityLevel(const double); - void UpdatedUpperIntensityLevel(const double); - void plotPointSelected(const QPointF p); - -protected: + void updatedLowerIntensityLevel(const double); + void updatedUpperIntensityLevel(const double); private: - void _UpdateIntensityRangeDisplay(); + void _updateIntensityRangeDisplay(); double _startFrequency; double _stopFrequency; int _xAxisMultiplier; - QwtPlotPanner* _panner; - QwtPlotZoomer* _zoomer; - - QwtDblClickPlotPicker *_picker; - - WaterfallData *d_data; + std::vector<WaterfallData*> d_data; #if QWT_VERSION < 0x060000 - PlotWaterfall *d_spectrogram; + std::vector<PlotWaterfall*> d_spectrogram; #else - QwtPlotSpectrogram *d_spectrogram; + std::vector<QwtPlotSpectrogram*> d_spectrogram; #endif gruel::high_res_timer_type _lastReplot; - bool _useCenterFrequencyFlag; - - int64_t _numPoints; - - int _intensityColorMapType; + std::vector<int> _intensityColorMapType; QColor _userDefinedLowIntensityColor; QColor _userDefinedHighIntensityColor; }; -#endif /* WATERFALL_DISPLAY_PLOT_HPP */ +#endif /* WATERFALL_DISPLAY_PLOT_H */ |