Removing Waterfall3DPlot. The qwt_plot3d is too much of a hassle to deal with and...
[debian/gnuradio] / gr-qtgui / src / lib / spectrumdisplayform.h
1 #ifndef SPECTRUM_DISPLAY_FORM_H
2 #define SPECTRUM_DISPLAY_FORM_H
3
4 #include "spectrumdisplayform_ui.h"
5
6 class SpectrumGUIClass;
7 #include <SpectrumGUIClass.h>
8
9 #include <SpectrumGUIClass.h>
10 #include <FrequencyDisplayPlot.h>
11 #include <WaterfallDisplayPlot.h>
12 #include <TimeDomainDisplayPlot.h>
13 #include <ConstellationDisplayPlot.h>
14 #include <QValidator>
15 #include <QTimer>
16 #include <vector>
17
18 class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
19 {
20   Q_OBJECT
21
22   public:
23   SpectrumDisplayForm(bool useOpenGL = true, QWidget* parent = 0);
24   ~SpectrumDisplayForm();
25   
26   void setSystem( SpectrumGUIClass * newSystem, const uint64_t numFFTDataPoints,
27                   const uint64_t numTimeDomainDataPoints );
28
29   int GetAverageCount();
30   void SetAverageCount( const int newCount );
31   void Reset();
32   void AverageDataReset();
33   void ResizeBuffers( const uint64_t numFFTDataPoints,
34                       const uint64_t numTimeDomainDataPoints );
35   
36 public slots:
37   void resizeEvent( QResizeEvent * e );
38   void customEvent( QEvent * e );
39   void AvgLineEdit_valueChanged( int valueString );
40   void MaxHoldCheckBox_toggled( bool newState );
41   void MinHoldCheckBox_toggled( bool newState );
42   void MinHoldResetBtn_clicked();
43   void MaxHoldResetBtn_clicked();
44   void TabChanged(int index);
45
46   void SetFrequencyRange( const double newCenterFrequency,
47                           const double newStartFrequency,
48                           const double newStopFrequency );
49   void closeEvent( QCloseEvent * e );
50   void WindowTypeChanged( int newItem );
51   void UseRFFrequenciesCB( bool useRFFlag );
52   void waterfallMaximumIntensityChangedCB(double);
53   void waterfallMinimumIntensityChangedCB(double);
54   void WaterfallIntensityColorTypeChanged(int);
55   void WaterfallAutoScaleBtnCB();
56   void FFTComboBoxSelectedCB(const QString&);
57
58   void ToggleTabFrequency(const bool state);
59   void ToggleTabWaterfall(const bool state);
60   void ToggleTabTime(const bool state);
61   void ToggleTabConstellation(const bool state);
62
63   void SetTimeDomainAxis(double min, double max);
64   void SetConstellationAxis(double xmin, double xmax,
65                             double ymin, double ymax);
66   void SetConstellationPenSize(int size);
67   void SetFrequencyAxis(double min, double max);
68   void SetUpdateTime(double t);
69
70 private slots:
71   void newFrequencyData( const SpectrumUpdateEvent* );
72   void UpdateGuiTimer();
73
74 protected:
75
76 private:
77   void _AverageHistory( const double * newBuffer );
78
79   bool _useOpenGL;
80   int _historyEntryCount;
81   int _historyEntry;
82   std::vector<double*>* _historyVector;
83   double* _averagedValues;
84   uint64_t _numRealDataPoints;
85   double* _realFFTDataPoints;
86   QIntValidator* _intValidator;
87   FrequencyDisplayPlot* _frequencyDisplayPlot;
88   WaterfallDisplayPlot* _waterfallDisplayPlot;
89   TimeDomainDisplayPlot* _timeDomainDisplayPlot;
90   ConstellationDisplayPlot* _constellationDisplayPlot;
91   SpectrumGUIClass* _system;
92   bool _systemSpecifiedFlag;
93   double _centerFrequency;
94   double _startFrequency;
95   double _noiseFloorAmplitude;
96   double _peakFrequency;
97   double _peakAmplitude;
98   static int _openGLWaterfall3DFlag;
99   double _stopFrequency;
100   
101   //SpectrumUpdateEvent _lastSpectrumEvent;
102   
103   // whether or not to use a particular display
104   int d_plot_fft;
105   int d_plot_waterfall;
106   int d_plot_waterfall3d;
107   int d_plot_time;
108   int d_plot_constellation;
109
110   QTimer *displayTimer;
111   double d_update_time;
112 };
113
114 #endif /* SPECTRUM_DISPLAY_FORM_H */