Imported Upstream version 3.2.2
[debian/gnuradio] / gr-qtgui / src / lib / WaterfallDisplayPlot.h
1 #ifndef WATERFALL_DISPLAY_PLOT_HPP
2 #define WATERFALL_DISPLAY_PLOT_HPP
3
4 #include <cstdio>
5 #include <qwt_plot.h>
6 #include <qwt_plot_zoomer.h>
7 #include <qwt_plot_panner.h>
8
9 #include <plot_waterfall.h>
10
11 #include <highResTimeFunctions.h>
12
13 class WaterfallDisplayPlot:public QwtPlot{
14   Q_OBJECT
15
16 public:
17   WaterfallDisplayPlot(QWidget*);
18   virtual ~WaterfallDisplayPlot();
19
20   void Reset();
21
22   void SetFrequencyRange(const double, const double, 
23                          const double, const bool,
24                          const double units=1000.0, 
25                          const std::string &strunits = "kHz");
26   double GetStartFrequency()const;
27   double GetStopFrequency()const;
28
29   void PlotNewData(const double* dataPoints, const int64_t numDataPoints,
30                    const double timePerFFT, const timespec timestamp,
31                    const int droppedFrames);
32
33   void SetIntensityRange(const double minIntensity, const double maxIntensity);
34
35   virtual void replot(void);
36
37   int GetIntensityColorMapType()const;
38   void SetIntensityColorMapType( const int, const QColor, const QColor );
39   const QColor GetUserDefinedLowIntensityColor()const;
40   const QColor GetUserDefinedHighIntensityColor()const;
41
42   static const int INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0;
43   static const int INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1;
44   static const int INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2;
45   static const int INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3;
46   static const int INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4;
47
48 signals:
49   void UpdatedLowerIntensityLevel(const double);
50   void UpdatedUpperIntensityLevel(const double);
51
52 protected:
53
54 private:
55   void _UpdateIntensityRangeDisplay();
56
57   double _startFrequency;
58   double _stopFrequency;
59
60   PlotWaterfall *d_spectrogram;
61
62   QwtPlotPanner* _panner;
63   QwtPlotZoomer* _zoomer;
64
65   WaterfallData* _waterfallData;
66
67   timespec _lastReplot;
68
69   int64_t _numPoints;
70
71   double _displayIntervalTime;
72
73   int _intensityColorMapType;
74   QColor _userDefinedLowIntensityColor;
75   QColor _userDefinedHighIntensityColor;
76 };
77
78 #endif /* WATERFALL_DISPLAY_PLOT_HPP */