GNU Radio 3.7.2git-47-g5cfb1151 C++ API
spectrumUpdateEvents.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SPECTRUM_UPDATE_EVENTS_H
24 #define SPECTRUM_UPDATE_EVENTS_H
25 
26 #include <stdint.h>
27 #include <QEvent>
28 #include <QString>
29 #include <complex>
30 #include <vector>
32 #include <gnuradio/qtgui/api.h>
33 
34 static const int SpectrumUpdateEventType = 10005;
35 static const int SpectrumWindowCaptionEventType = 10008;
36 static const int SpectrumWindowResetEventType = 10009;
37 static const int SpectrumFrequencyRangeEventType = 10010;
38 
39 class SpectrumUpdateEvent:public QEvent{
40 
41 public:
42  SpectrumUpdateEvent(const float* fftPoints,
43  const uint64_t numFFTDataPoints,
44  const double* realTimeDomainPoints,
45  const double* imagTimeDomainPoints,
46  const uint64_t numTimeDomainDataPoints,
47  const gr::high_res_timer_type dataTimestamp,
48  const bool repeatDataFlag,
49  const bool lastOfMultipleUpdateFlag,
50  const gr::high_res_timer_type generatedTimestamp,
51  const int droppedFFTFrames);
52 
54 
55  const float* getFFTPoints() const;
56  const double* getRealTimeDomainPoints() const;
57  const double* getImagTimeDomainPoints() const;
61  bool getRepeatDataFlag() const;
62  bool getLastOfMultipleUpdateFlag() const;
64  int getDroppedFFTFrames() const;
65 
66 protected:
67 
68 private:
69  float* _fftPoints;
70  double* _realDataTimeDomainPoints;
71  double* _imagDataTimeDomainPoints;
72  uint64_t _numFFTDataPoints;
73  uint64_t _numTimeDomainDataPoints;
74  gr::high_res_timer_type _dataTimestamp;
75  bool _repeatDataFlag;
76  bool _lastOfMultipleUpdateFlag;
77  gr::high_res_timer_type _eventGeneratedTimestamp;
78  int _droppedFFTFrames;
79 };
80 
81 class SpectrumWindowCaptionEvent:public QEvent{
82 public:
83  SpectrumWindowCaptionEvent(const QString&);
85  QString getLabel();
86 
87 protected:
88 
89 private:
90  QString _labelString;
91 };
92 
93 class SpectrumWindowResetEvent:public QEvent{
94 public:
97 
98 protected:
99 
100 private:
101 
102 };
103 
104 class SpectrumFrequencyRangeEvent:public QEvent{
105 public:
106  SpectrumFrequencyRangeEvent(const double, const double, const double);
108  double GetCenterFrequency()const;
109  double GetStartFrequency()const;
110  double GetStopFrequency()const;
111 
112 protected:
113 
114 private:
115  double _centerFrequency;
116  double _startFrequency;
117  double _stopFrequency;
118 };
119 
120 
121 class TimeUpdateEvent: public QEvent
122 {
123 public:
124  TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
125  const uint64_t numTimeDomainDataPoints);
126 
128 
129  int which() const;
130  const std::vector<double*> getTimeDomainPoints() const;
132  bool getRepeatDataFlag() const;
133 
134  static QEvent::Type Type()
136 
137 protected:
138 
139 private:
140  size_t _nplots;
141  std::vector<double*> _dataTimeDomainPoints;
142  uint64_t _numTimeDomainDataPoints;
143 };
144 
145 
146 /********************************************************************/
147 
148 
149 class FreqUpdateEvent: public QEvent
150 {
151 public:
152  FreqUpdateEvent(const std::vector<double*> dataPoints,
153  const uint64_t numDataPoints);
154 
156 
157  int which() const;
158  const std::vector<double*> getPoints() const;
159  uint64_t getNumDataPoints() const;
160  bool getRepeatDataFlag() const;
161 
162  static QEvent::Type Type()
164 
165 protected:
166 
167 private:
168  size_t _nplots;
169  std::vector<double*> _dataPoints;
170  uint64_t _numDataPoints;
171 };
172 
173 
174 /********************************************************************/
175 
176 
177 class QTGUI_API ConstUpdateEvent: public QEvent
178 {
179 public:
180  ConstUpdateEvent(const std::vector<double*> realDataPoints,
181  const std::vector<double*> imagDataPoints,
182  const uint64_t numDataPoints);
183 
184  ~ConstUpdateEvent();
185 
186  int which() const;
187  const std::vector<double*> getRealPoints() const;
188  const std::vector<double*> getImagPoints() const;
189  uint64_t getNumDataPoints() const;
190  bool getRepeatDataFlag() const;
191 
192  static QEvent::Type Type()
193  { return QEvent::Type(SpectrumUpdateEventType); }
194 
195 protected:
196 
197 private:
198  size_t _nplots;
199  std::vector<double*> _realDataPoints;
200  std::vector<double*> _imagDataPoints;
201  uint64_t _numDataPoints;
202 };
203 
204 
205 /********************************************************************/
206 
207 
208 class WaterfallUpdateEvent: public QEvent
209 {
210 public:
211  WaterfallUpdateEvent(const std::vector<double*> dataPoints,
212  const uint64_t numDataPoints,
213  const gr::high_res_timer_type dataTimestamp);
214 
216 
217  int which() const;
218  const std::vector<double*> getPoints() const;
219  uint64_t getNumDataPoints() const;
220  bool getRepeatDataFlag() const;
221 
223 
224  static QEvent::Type Type()
226 
227 protected:
228 
229 private:
230  size_t _nplots;
231  std::vector<double*> _dataPoints;
232  uint64_t _numDataPoints;
233 
234  gr::high_res_timer_type _dataTimestamp;
235 };
236 
237 
238 /********************************************************************/
239 
240 
241 class TimeRasterUpdateEvent: public QEvent
242 {
243 public:
244  TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
245  const uint64_t numDataPoints);
247 
248  int which() const;
249  const std::vector<double*> getPoints() const;
250  uint64_t getNumDataPoints() const;
251  bool getRepeatDataFlag() const;
252 
253  static QEvent::Type Type()
255 
256 protected:
257 
258 private:
259  size_t _nplots;
260  std::vector<double*> _dataPoints;
261  uint64_t _numDataPoints;
262 };
263 
264 
265 /********************************************************************/
266 
267 
268 class HistogramUpdateEvent: public QEvent
269 {
270 public:
271  HistogramUpdateEvent(const std::vector<double*> points,
272  const uint64_t npoints);
273 
275 
276  int which() const;
277  const std::vector<double*> getDataPoints() const;
278  uint64_t getNumDataPoints() const;
279  bool getRepeatDataFlag() const;
280 
281  static QEvent::Type Type()
283 
284 protected:
285 
286 private:
287  size_t _nplots;
288  std::vector<double*> _points;
289  uint64_t _npoints;
290 };
291 
292 
293 #endif /* SPECTRUM_UPDATE_EVENTS_H */