Fixing displayed pen and x-axis to report the right units and scaling of frequencies.
[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 public slots:
49   void resizeSlot( QSize *s );
50
51 signals:
52   void UpdatedLowerIntensityLevel(const double);
53   void UpdatedUpperIntensityLevel(const double);
54
55 protected:
56
57 private:
58   void _UpdateIntensityRangeDisplay();
59
60   double _startFrequency;
61   double _stopFrequency;
62
63   PlotWaterfall *d_spectrogram;
64
65   QwtPlotPanner* _panner;
66   QwtPlotZoomer* _zoomer;
67
68   WaterfallData* _waterfallData;
69
70   timespec _lastReplot;
71
72   bool _useCenterFrequencyFlag;
73
74   int64_t _numPoints;
75
76   double _displayIntervalTime;
77
78   int _intensityColorMapType;
79   QColor _userDefinedLowIntensityColor;
80   QColor _userDefinedHighIntensityColor;
81 };
82
83 #endif /* WATERFALL_DISPLAY_PLOT_HPP */