Removing Waterfall3DPlot. The qwt_plot3d is too much of a hassle to deal with and...
[debian/gnuradio] / gr-qtgui / src / lib / SpectrumGUIClass.h
1 #ifndef SPECTRUM_GUI_CLASS_HPP
2 #define SPECTRUM_GUI_CLASS_HPP
3
4 //#include <mutexClass.hpp>
5 #include <qwidget.h>
6 #include <qapplication.h>
7 #include <qlabel.h>
8 #include <qslider.h>
9 #include <spectrumUpdateEvents.h>
10
11 //#include <Windowing.hpp>
12
13 class SpectrumDisplayForm;
14 #include <spectrumdisplayform.h>
15
16 #include <cmath>
17
18 #include <complex>
19 #include <vector>
20 #include <string>
21
22 class SpectrumGUIClass
23 {
24 public:
25   SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize,
26                    const double newCenterFrequency,
27                    const double newStartFrequency, 
28                    const double newStopFrequency);
29   ~SpectrumGUIClass();
30   void Reset();
31
32   void OpenSpectrumWindow(QWidget*,
33                           const bool frequency=true, const bool waterfall=true,
34                           const bool time=true, const bool constellation=true,
35                           const bool use_openGL=true);
36   void SetDisplayTitle(const std::string);
37
38   bool GetWindowOpenFlag();
39   void SetWindowOpenFlag(const bool);
40
41   void SetFrequencyRange(const double, const double, const double);
42   double GetStartFrequency()const;
43   double GetStopFrequency()const;
44   double GetCenterFrequency()const;
45
46   void UpdateWindow(const bool, const std::complex<float>*,
47                     const uint64_t, const float*,
48                     const uint64_t, const float*,
49                     const uint64_t,
50                     const timespec, const bool);
51
52   float GetPowerValue()const;
53   void SetPowerValue(const float);
54
55   int GetWindowType()const;
56   void SetWindowType(const int);
57
58   int GetFFTSize()const;
59   int GetFFTSizeIndex()const;
60   void SetFFTSize(const int);
61
62   timespec GetLastGUIUpdateTime()const;
63   void SetLastGUIUpdateTime(const timespec);
64
65   unsigned int GetPendingGUIUpdateEvents()const;
66   void IncrementPendingGUIUpdateEvents();
67   void DecrementPendingGUIUpdateEvents();
68   void ResetPendingGUIUpdateEvents();
69
70   static const long MAX_FFT_SIZE = /*1048576*/32768;
71   static const long MIN_FFT_SIZE = 1024;
72
73   QWidget* qwidget();
74
75   void SetTimeDomainAxis(double min, double max);
76   void SetConstellationAxis(double xmin, double xmax,
77                             double ymin, double ymax);
78   void SetConstellationPenSize(int size);
79   void SetFrequencyAxis(double min, double max);
80
81   void SetUpdateTime(double t);
82
83 protected:
84
85 private:
86
87   //MutexClass* _windowStateLock;
88   int64_t _dataPoints;
89   std::string _title;
90   double _centerFrequency;
91   double _startFrequency;
92   double _stopFrequency;
93   float _powerValue;
94   bool _windowOpennedFlag;
95   int _windowType;
96   int64_t _lastDataPointCount;
97   int _fftSize;
98   timespec _lastGUIUpdateTime;
99   unsigned int _pendingGUIUpdateEventsCount;
100   int _droppedEntriesCount;
101   bool _fftBuffersCreatedFlag;
102   double _updateTime;
103
104   SpectrumDisplayForm* _spectrumDisplayForm;
105
106   std::complex<float>* _fftPoints;
107   double* _realTimeDomainPoints;
108   double* _imagTimeDomainPoints;
109 };
110
111 #endif /* SPECTRUM_GUI_CLASS_HPP */