Merging qtdevel2 branch -r10565:10849. This adds a lot of fixes and capabilities...
[debian/gnuradio] / gr-qtgui / src / lib / FrequencyDisplayPlot.h
1 #ifndef FREQUENCY_DISPLAY_PLOT_HPP
2 #define FREQUENCY_DISPLAY_PLOT_HPP
3
4 #include <qwt_plot.h>
5 #include <qwt_painter.h>
6 #include <qwt_plot_canvas.h>
7 #include <qwt_plot_curve.h>
8 #include <qwt_scale_engine.h>
9 #include <qwt_scale_widget.h>
10 #include <qwt_plot_zoomer.h>
11 #include <qwt_plot_panner.h>
12 #include <qwt_plot_marker.h>
13 #include <highResTimeFunctions.h>
14 #include <qwt_symbol.h>
15
16 class FrequencyDisplayPlot:public QwtPlot{
17   Q_OBJECT
18
19 public:
20   FrequencyDisplayPlot(QWidget*);
21   virtual ~FrequencyDisplayPlot();
22
23   void SetFrequencyRange(const double, const double, 
24                          const double, const bool,
25                          const double units=1000.0, 
26                          const std::string &strunits = "kHz");
27   double GetStartFrequency()const;
28   double GetStopFrequency()const;
29
30   void PlotNewData(const double* dataPoints, const int64_t numDataPoints,
31                    const double noiseFloorAmplitude, const double peakFrequency,
32                    const double peakAmplitude);
33   
34   void ClearMaxData();
35   void ClearMinData();
36   
37   void SetMaxFFTVisible(const bool);
38   void SetMinFFTVisible(const bool);
39                                    
40   virtual void replot();
41
42 public slots:
43   void SetLowerIntensityLevel(const double);
44   void SetUpperIntensityLevel(const double);
45
46 protected:
47
48 private:
49   void _resetXAxisPoints();
50   
51   double _startFrequency;
52   double _stopFrequency;
53
54   QwtPlotCurve* _fft_plot_curve;
55   QwtPlotCurve* _min_fft_plot_curve;
56   QwtPlotCurve* _max_fft_plot_curve;
57
58   QwtPlotMarker* _lower_intensity_marker;
59   QwtPlotMarker* _upper_intensity_marker;
60
61   QwtPlotPanner* _panner;
62   QwtPlotZoomer* _zoomer;
63
64   QwtPlotMarker *_markerPeakAmplitude;
65   QwtPlotMarker *_markerNoiseFloorAmplitude;
66   
67   double* _dataPoints;
68   double* _xAxisPoints;
69
70   double* _minFFTPoints;
71   double* _maxFFTPoints;
72   int64_t _numPoints;
73
74   double _peakFrequency;
75   double _peakAmplitude;
76
77   double _noiseFloorAmplitude;
78
79   timespec _lastReplot;
80
81   bool _useCenterFrequencyFlag;
82
83   double _displayIntervalTime;
84 };
85
86 #endif /* FREQUENCY_DISPLAY_PLOT_HPP */