Imported Upstream version 3.2.2
[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 <Waterfall3DDisplayPlot.h>
13 #include <TimeDomainDisplayPlot.h>
14 #include <ConstellationDisplayPlot.h>
15 #include <QValidator>
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_textChanged( const QString & valueString );
40   void MaxHoldCheckBox_toggled( bool newState );
41   void MinHoldCheckBox_toggled( bool newState );
42   void MinHoldResetBtn_clicked();
43   void MaxHoldResetBtn_clicked();
44   void PowerLineEdit_textChanged( const QString& valueString );
45   void SetFrequencyRange( const double newCenterFrequency,
46                           const double newStartFrequency,
47                           const double newStopFrequency );
48   void closeEvent( QCloseEvent * e );
49   void WindowTypeChanged( int newItem );
50   void UseRFFrequenciesCB( bool useRFFlag );
51   void waterfallMaximumIntensityChangedCB(double);
52   void waterfallMinimumIntensityChangedCB(double);
53   void WaterfallIntensityColorTypeChanged(int);
54   void WaterfallAutoScaleBtnCB();
55   void waterfall3DMaximumIntensityChangedCB(double);
56   void waterfall3DMinimumIntensityChangedCB(double);
57   void Waterfall3DIntensityColorTypeChanged(int);
58   void Waterfall3DAutoScaleBtnCB();
59   void FFTComboBoxSelectedCB(const QString&);
60
61   void ToggleTabFrequency(const bool state);
62   void ToggleTabWaterfall(const bool state);
63   void ToggleTabWaterfall3D(const bool state);
64   void ToggleTabTime(const bool state);
65   void ToggleTabConstellation(const bool state);
66
67   void SetTimeDomainAxis(double min, double max);
68   void SetConstellationAxis(double xmin, double xmax,
69                             double ymin, double ymax);
70   void SetFrequencyAxis(double min, double max);
71
72 private slots:
73   void newFrequencyData( const SpectrumUpdateEvent* );
74
75 protected:
76
77 private:
78   void _AverageHistory( const double * newBuffer );
79
80   bool _useOpenGL;
81   int _historyEntryCount;
82   int _historyEntry;
83   std::vector<double*>* _historyVector;
84   double* _averagedValues;
85   uint64_t _numRealDataPoints;
86   double* _realFFTDataPoints;
87   QIntValidator* _intValidator;
88   FrequencyDisplayPlot* _frequencyDisplayPlot;
89   WaterfallDisplayPlot* _waterfallDisplayPlot;
90   Waterfall3DDisplayPlot* _waterfall3DDisplayPlot;
91   TimeDomainDisplayPlot* _timeDomainDisplayPlot;
92   ConstellationDisplayPlot* _constellationDisplayPlot;
93   SpectrumGUIClass* _system;
94   bool _systemSpecifiedFlag;
95   double _centerFrequency;
96   double _startFrequency;
97   double _noiseFloorAmplitude;
98   double _peakFrequency;
99   double _peakAmplitude;
100   static int _openGLWaterfall3DFlag;
101   double _stopFrequency;
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
111 #endif /* SPECTRUM_DISPLAY_FORM_H */