GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
spectrumUpdateEvents.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2014 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 
27 #include <gnuradio/qtgui/api.h>
28 #include <gnuradio/tags.h>
29 #include <stdint.h>
30 #include <QEvent>
31 #include <QString>
32 #include <complex>
33 #include <vector>
34 
35 static const int SpectrumUpdateEventType = 10005;
36 static const int SpectrumWindowCaptionEventType = 10008;
37 static const int SpectrumWindowResetEventType = 10009;
38 static const int SpectrumFrequencyRangeEventType = 10010;
39 
40 class SpectrumUpdateEvent : public QEvent
41 {
42 
43 public:
44  SpectrumUpdateEvent(const float* fftPoints,
45  const uint64_t numFFTDataPoints,
46  const double* realTimeDomainPoints,
47  const double* imagTimeDomainPoints,
48  const uint64_t numTimeDomainDataPoints,
49  const gr::high_res_timer_type dataTimestamp,
50  const bool repeatDataFlag,
51  const bool lastOfMultipleUpdateFlag,
52  const gr::high_res_timer_type generatedTimestamp,
53  const int droppedFFTFrames);
54 
56 
57  const float* getFFTPoints() const;
58  const double* getRealTimeDomainPoints() const;
59  const double* getImagTimeDomainPoints() const;
60  uint64_t getNumFFTDataPoints() const;
61  uint64_t getNumTimeDomainDataPoints() const;
63  bool getRepeatDataFlag() const;
64  bool getLastOfMultipleUpdateFlag() const;
66  int getDroppedFFTFrames() const;
67 
68 protected:
69 private:
70  float* _fftPoints;
71  double* _realDataTimeDomainPoints;
72  double* _imagDataTimeDomainPoints;
73  uint64_t _numFFTDataPoints;
74  uint64_t _numTimeDomainDataPoints;
75  gr::high_res_timer_type _dataTimestamp;
76  bool _repeatDataFlag;
77  bool _lastOfMultipleUpdateFlag;
78  gr::high_res_timer_type _eventGeneratedTimestamp;
79  int _droppedFFTFrames;
80 };
81 
82 class SpectrumWindowCaptionEvent : public QEvent
83 {
84 public:
85  SpectrumWindowCaptionEvent(const QString&);
87  QString getLabel();
88 
89 protected:
90 private:
91  QString _labelString;
92 };
93 
94 class SpectrumWindowResetEvent : public QEvent
95 {
96 public:
99 
100 protected:
101 private:
102 };
103 
104 class SpectrumFrequencyRangeEvent : public QEvent
105 {
106 public:
107  SpectrumFrequencyRangeEvent(const double, const double, const double);
109  double GetCenterFrequency() const;
110  double GetStartFrequency() const;
111  double GetStopFrequency() const;
112 
113 protected:
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  const std::vector<std::vector<gr::tag_t>> tags);
127 
128  ~TimeUpdateEvent();
129 
130  int which() const;
131  const std::vector<double*> getTimeDomainPoints() const;
132  uint64_t getNumTimeDomainDataPoints() const;
133  bool getRepeatDataFlag() const;
134 
135  const std::vector<std::vector<gr::tag_t>> getTags() const;
136 
137  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
138 
139 protected:
140 private:
141  size_t _nplots;
142  std::vector<double*> _dataTimeDomainPoints;
143  uint64_t _numTimeDomainDataPoints;
144  std::vector<std::vector<gr::tag_t>> _tags;
145 };
146 
147 
148 /********************************************************************/
149 
150 
151 class FreqUpdateEvent : public QEvent
152 {
153 public:
154  FreqUpdateEvent(const std::vector<double*> dataPoints, const uint64_t numDataPoints);
155 
156  ~FreqUpdateEvent();
157 
158  int which() const;
159  const std::vector<double*> getPoints() const;
160  uint64_t getNumDataPoints() const;
161  bool getRepeatDataFlag() const;
162 
163  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
164 
165 protected:
166 private:
167  size_t _nplots;
168  std::vector<double*> _dataPoints;
169  uint64_t _numDataPoints;
170 };
171 
172 
173 class SetFreqEvent : public QEvent
174 {
175 public:
176  SetFreqEvent(const double, const double);
177  ~SetFreqEvent();
178  double getCenterFrequency() const;
179  double getBandwidth() const;
180 
181 private:
182  double _centerFrequency;
183  double _bandwidth;
184 };
185 
186 
187 /********************************************************************/
188 
189 
190 class QTGUI_API ConstUpdateEvent : public QEvent
191 {
192 public:
193  ConstUpdateEvent(const std::vector<double*> realDataPoints,
194  const std::vector<double*> imagDataPoints,
195  const uint64_t numDataPoints);
196 
197  ~ConstUpdateEvent();
198 
199  int which() const;
200  const std::vector<double*> getRealPoints() const;
201  const std::vector<double*> getImagPoints() const;
202  uint64_t getNumDataPoints() const;
203  bool getRepeatDataFlag() const;
204 
205  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
206 
207 protected:
208 private:
209  size_t _nplots;
210  std::vector<double*> _realDataPoints;
211  std::vector<double*> _imagDataPoints;
212  uint64_t _numDataPoints;
213 };
214 
215 
216 /********************************************************************/
217 
218 
219 class WaterfallUpdateEvent : public QEvent
220 {
221 public:
222  WaterfallUpdateEvent(const std::vector<double*> dataPoints,
223  const uint64_t numDataPoints,
224  const gr::high_res_timer_type dataTimestamp);
225 
227 
228  int which() const;
229  const std::vector<double*> getPoints() const;
230  uint64_t getNumDataPoints() const;
231  bool getRepeatDataFlag() const;
232 
234 
235  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
236 
237 protected:
238 private:
239  size_t _nplots;
240  std::vector<double*> _dataPoints;
241  uint64_t _numDataPoints;
242 
243  gr::high_res_timer_type _dataTimestamp;
244 };
245 
246 
247 /********************************************************************/
248 
249 
250 class TimeRasterUpdateEvent : public QEvent
251 {
252 public:
253  TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
254  const uint64_t numDataPoints);
256 
257  int which() const;
258  const std::vector<double*> getPoints() const;
259  uint64_t getNumDataPoints() const;
260  bool getRepeatDataFlag() const;
261 
262  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
263 
264 protected:
265 private:
266  size_t _nplots;
267  std::vector<double*> _dataPoints;
268  uint64_t _numDataPoints;
269 };
270 
271 
272 class TimeRasterSetSize : public QEvent
273 {
274 public:
275  TimeRasterSetSize(const double nrows, const double ncols);
277 
278  double nRows() const;
279  double nCols() const;
280 
281  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
282 
283 private:
284  double _nrows;
285  double _ncols;
286 };
287 
288 
289 /********************************************************************/
290 
291 
292 class HistogramUpdateEvent : public QEvent
293 {
294 public:
295  HistogramUpdateEvent(const std::vector<double*> points, const uint64_t npoints);
296 
298 
299  int which() const;
300  const std::vector<double*> getDataPoints() const;
301  uint64_t getNumDataPoints() const;
302  bool getRepeatDataFlag() const;
303 
304  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
305 
306 protected:
307 private:
308  size_t _nplots;
309  std::vector<double*> _points;
310  uint64_t _npoints;
311 };
312 
313 
314 class HistogramSetAccumulator : public QEvent
315 {
316 public:
317  HistogramSetAccumulator(const bool en);
319 
320  bool getAccumulator() const;
321 
322  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
323 
324 private:
325  bool _en;
326 };
327 
328 class HistogramClearEvent : public QEvent
329 {
330 public:
331  HistogramClearEvent() : QEvent(QEvent::Type(SpectrumUpdateEventType + 2)) {}
332 
334 
335  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 2); }
336 };
337 
338 
339 /********************************************************************/
340 
341 
342 class NumberUpdateEvent : public QEvent
343 {
344 public:
345  NumberUpdateEvent(const std::vector<float> samples);
347 
348  int which() const;
349  const std::vector<float> getSamples() const;
350 
351  static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
352 
353 protected:
354 private:
355  size_t _nplots;
356  std::vector<float> _samples;
357 };
358 
359 
360 #endif /* SPECTRUM_UPDATE_EVENTS_H */
const float * getFFTPoints() const
uint64_t getNumFFTDataPoints() const
Definition: spectrumUpdateEvents.h:104
const double * getRealTimeDomainPoints() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:262
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:235
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:281
static const int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:38
~HistogramClearEvent()
Definition: spectrumUpdateEvents.h:333
Definition: spectrumUpdateEvents.h:94
gr::high_res_timer_type getDataTimestamp() const
Definition: spectrumUpdateEvents.h:292
static const int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:35
Definition: spectrumUpdateEvents.h:190
Definition: spectrumUpdateEvents.h:328
static const int SpectrumWindowResetEventType
Definition: spectrumUpdateEvents.h:37
uint64_t getNumTimeDomainDataPoints() const
Definition: spectrumUpdateEvents.h:314
Definition: spectrumUpdateEvents.h:121
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:351
bool getLastOfMultipleUpdateFlag() const
Definition: spectrumUpdateEvents.h:173
Definition: spectrumUpdateEvents.h:342
HistogramClearEvent()
Definition: spectrumUpdateEvents.h:331
const double * getImagTimeDomainPoints() const
Definition: spectrumUpdateEvents.h:151
Definition: spectrumUpdateEvents.h:82
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:335
Definition: spectrumUpdateEvents.h:272
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:163
Definition: spectrumUpdateEvents.h:250
Definition: spectrumUpdateEvents.h:40
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
static const int SpectrumWindowCaptionEventType
Definition: spectrumUpdateEvents.h:36
Definition: spectrumUpdateEvents.h:219
bool getRepeatDataFlag() const
gr::high_res_timer_type getEventGeneratedTimestamp() const
int getDroppedFFTFrames() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:137
SpectrumUpdateEvent(const float *fftPoints, const uint64_t numFFTDataPoints, const double *realTimeDomainPoints, const double *imagTimeDomainPoints, const uint64_t numTimeDomainDataPoints, const gr::high_res_timer_type dataTimestamp, const bool repeatDataFlag, const bool lastOfMultipleUpdateFlag, const gr::high_res_timer_type generatedTimestamp, const int droppedFFTFrames)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:304
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:322
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:205