Bringing out set axis function to the qtgui sinks for user-settable axis ranges.
[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(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 newStartFrequency,
46                           const double newStopFrequency,
47                           const double newCenterFrequency );
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
71 private slots:
72   void newFrequencyData( const SpectrumUpdateEvent* );
73
74 protected:
75
76 private:
77     void _AverageHistory( const double * newBuffer );
78
79   int _historyEntryCount;
80   int _historyEntry;
81   std::vector<double*>* _historyVector;
82   double* _averagedValues;
83   uint64_t _numRealDataPoints;
84   double* _realFFTDataPoints;
85   QIntValidator* _intValidator;
86   FrequencyDisplayPlot* _frequencyDisplayPlot;
87   WaterfallDisplayPlot* _waterfallDisplayPlot;
88   Waterfall3DDisplayPlot* _waterfall3DDisplayPlot;
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   // whether or not to use a particular display
102   int d_plot_fft;
103   int d_plot_waterfall;
104   int d_plot_waterfall3d;
105   int d_plot_time;
106   int d_plot_constellation;
107 };
108
109 #endif /* SPECTRUM_DISPLAY_FORM_H */