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