GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
26 #include <stdint.h>
27 #include <QEvent>
28 #include <QString>
29 #include <complex>
30 #include <vector>
32 #include <gnuradio/qtgui/api.h>
33 #include <gnuradio/tags.h>
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 public:
43  SpectrumUpdateEvent(const float* fftPoints,
44  const uint64_t numFFTDataPoints,
45  const double* realTimeDomainPoints,
46  const double* imagTimeDomainPoints,
47  const uint64_t numTimeDomainDataPoints,
48  const gr::high_res_timer_type dataTimestamp,
49  const bool repeatDataFlag,
50  const bool lastOfMultipleUpdateFlag,
51  const gr::high_res_timer_type generatedTimestamp,
52  const int droppedFFTFrames);
53 
55 
56  const float* getFFTPoints() const;
57  const double* getRealTimeDomainPoints() const;
58  const double* getImagTimeDomainPoints() const;
59  uint64_t getNumFFTDataPoints() const;
60  uint64_t getNumTimeDomainDataPoints() const;
62  bool getRepeatDataFlag() const;
63  bool getLastOfMultipleUpdateFlag() const;
65  int getDroppedFFTFrames() const;
66 
67 protected:
68 
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 public:
84  SpectrumWindowCaptionEvent(const QString&);
86  QString getLabel();
87 
88 protected:
89 
90 private:
91  QString _labelString;
92 };
93 
94 class SpectrumWindowResetEvent:public QEvent{
95 public:
98 
99 protected:
100 
101 private:
102 
103 };
104 
105 class SpectrumFrequencyRangeEvent:public QEvent{
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 
115 private:
116  double _centerFrequency;
117  double _startFrequency;
118  double _stopFrequency;
119 };
120 
121 
122 class TimeUpdateEvent: public QEvent
123 {
124 public:
125  TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
126  const uint64_t numTimeDomainDataPoints,
127  const std::vector< std::vector<gr::tag_t> > tags);
128 
130 
131  int which() const;
132  const std::vector<double*> getTimeDomainPoints() const;
133  uint64_t getNumTimeDomainDataPoints() const;
134  bool getRepeatDataFlag() const;
135 
136  const std::vector< std::vector<gr::tag_t> > getTags() const;
137 
138  static QEvent::Type Type()
139  { return QEvent::Type(SpectrumUpdateEventType); }
140 
141 protected:
142 
143 private:
144  size_t _nplots;
145  std::vector<double*> _dataTimeDomainPoints;
146  uint64_t _numTimeDomainDataPoints;
147  std::vector< std::vector<gr::tag_t> > _tags;
148 };
149 
150 
151 /********************************************************************/
152 
153 
154 class FreqUpdateEvent: public QEvent
155 {
156 public:
157  FreqUpdateEvent(const std::vector<double*> dataPoints,
158  const uint64_t numDataPoints);
159 
161 
162  int which() const;
163  const std::vector<double*> getPoints() const;
164  uint64_t getNumDataPoints() const;
165  bool getRepeatDataFlag() const;
166 
167  static QEvent::Type Type()
168  { return QEvent::Type(SpectrumUpdateEventType); }
169 
170 protected:
171 
172 private:
173  size_t _nplots;
174  std::vector<double*> _dataPoints;
175  uint64_t _numDataPoints;
176 };
177 
178 
179 class SetFreqEvent:public QEvent
180 {
181 public:
182  SetFreqEvent(const double, const double);
183  ~SetFreqEvent();
184  double getCenterFrequency() const;
185  double getBandwidth() const;
186 
187 private:
188  double _centerFrequency;
189  double _bandwidth;
190 };
191 
192 
193 /********************************************************************/
194 
195 
196 class QTGUI_API ConstUpdateEvent: public QEvent
197 {
198 public:
199  ConstUpdateEvent(const std::vector<double*> realDataPoints,
200  const std::vector<double*> imagDataPoints,
201  const uint64_t numDataPoints);
202 
203  ~ConstUpdateEvent();
204 
205  int which() const;
206  const std::vector<double*> getRealPoints() const;
207  const std::vector<double*> getImagPoints() const;
208  uint64_t getNumDataPoints() const;
209  bool getRepeatDataFlag() const;
210 
211  static QEvent::Type Type()
212  { return QEvent::Type(SpectrumUpdateEventType); }
213 
214 protected:
215 
216 private:
217  size_t _nplots;
218  std::vector<double*> _realDataPoints;
219  std::vector<double*> _imagDataPoints;
220  uint64_t _numDataPoints;
221 };
222 
223 
224 /********************************************************************/
225 
226 
227 class WaterfallUpdateEvent: public QEvent
228 {
229 public:
230  WaterfallUpdateEvent(const std::vector<double*> dataPoints,
231  const uint64_t numDataPoints,
232  const gr::high_res_timer_type dataTimestamp);
233 
235 
236  int which() const;
237  const std::vector<double*> getPoints() const;
238  uint64_t getNumDataPoints() const;
239  bool getRepeatDataFlag() const;
240 
242 
243  static QEvent::Type Type()
244  { return QEvent::Type(SpectrumUpdateEventType); }
245 
246 protected:
247 
248 private:
249  size_t _nplots;
250  std::vector<double*> _dataPoints;
251  uint64_t _numDataPoints;
252 
253  gr::high_res_timer_type _dataTimestamp;
254 };
255 
256 
257 /********************************************************************/
258 
259 
260 class TimeRasterUpdateEvent: public QEvent
261 {
262 public:
263  TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
264  const uint64_t numDataPoints);
266 
267  int which() const;
268  const std::vector<double*> getPoints() const;
269  uint64_t getNumDataPoints() const;
270  bool getRepeatDataFlag() const;
271 
272  static QEvent::Type Type()
273  { return QEvent::Type(SpectrumUpdateEventType); }
274 
275 protected:
276 
277 private:
278  size_t _nplots;
279  std::vector<double*> _dataPoints;
280  uint64_t _numDataPoints;
281 };
282 
283 
284 class TimeRasterSetSize: public QEvent
285 {
286 public:
287  TimeRasterSetSize(const double nrows,
288  const double ncols);
290 
291  double nRows() const;
292  double nCols() const;
293 
294  static QEvent::Type Type()
295  { return QEvent::Type(SpectrumUpdateEventType+1); }
296 
297 private:
298  double _nrows;
299  double _ncols;
300 };
301 
302 
303 /********************************************************************/
304 
305 
306 class HistogramUpdateEvent: public QEvent
307 {
308 public:
309  HistogramUpdateEvent(const std::vector<double*> points,
310  const uint64_t npoints);
311 
313 
314  int which() const;
315  const std::vector<double*> getDataPoints() const;
316  uint64_t getNumDataPoints() const;
317  bool getRepeatDataFlag() const;
318 
319  static QEvent::Type Type()
320  { return QEvent::Type(SpectrumUpdateEventType); }
321 
322 protected:
323 
324 private:
325  size_t _nplots;
326  std::vector<double*> _points;
327  uint64_t _npoints;
328 };
329 
330 
331 class HistogramSetAccumulator: public QEvent
332 {
333 public:
334  HistogramSetAccumulator(const bool en);
336 
337  bool getAccumulator() const;
338 
339  static QEvent::Type Type()
340  { return QEvent::Type(SpectrumUpdateEventType+1); }
341 
342 private:
343  bool _en;
344 };
345 
346 class HistogramClearEvent: public QEvent
347 {
348 public:
350  : QEvent(QEvent::Type(SpectrumUpdateEventType+2))
351  {}
352 
354 
355  static QEvent::Type Type()
356  { return QEvent::Type(SpectrumUpdateEventType+2); }
357 };
358 
359 
360 /********************************************************************/
361 
362 
363 class NumberUpdateEvent: public QEvent
364 {
365 public:
366  NumberUpdateEvent(const std::vector<float> samples);
368 
369  int which() const;
370  const std::vector<float> getSamples() const;
371 
372  static QEvent::Type Type()
373  { return QEvent::Type(SpectrumUpdateEventType); }
374 
375 protected:
376 
377 private:
378  size_t _nplots;
379  std::vector<float> _samples;
380 };
381 
382 
383 
384 #endif /* SPECTRUM_UPDATE_EVENTS_H */
FreqUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
int which() const
Definition: spectrumUpdateEvents.h:105
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:272
const std::vector< double * > getPoints() const
gr::high_res_timer_type getDataTimestamp() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:243
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:294
static const int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:38
double getBandwidth() const
uint64_t getNumDataPoints() const
uint64_t getNumDataPoints() const
double GetCenterFrequency() const
~HistogramClearEvent()
Definition: spectrumUpdateEvents.h:353
Definition: spectrumUpdateEvents.h:94
int which() const
Definition: spectrumUpdateEvents.h:306
double getCenterFrequency() const
static const int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:35
Definition: spectrumUpdateEvents.h:196
Definition: spectrumUpdateEvents.h:346
const std::vector< float > getSamples() const
const std::vector< double * > getDataPoints() const
static const int SpectrumWindowResetEventType
Definition: spectrumUpdateEvents.h:37
int which() const
WaterfallUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const gr::high_res_timer_type dataTimestamp)
int which() const
const std::vector< double * > getPoints() const
uint64_t getNumTimeDomainDataPoints() const
double GetStartFrequency() const
Definition: spectrumUpdateEvents.h:331
Definition: spectrumUpdateEvents.h:122
uint64_t getNumDataPoints() const
double nRows() const
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
bool getRepeatDataFlag() const
const std::vector< std::vector< gr::tag_t > > getTags() const
TimeUpdateEvent(const std::vector< double * > timeDomainPoints, const uint64_t numTimeDomainDataPoints, const std::vector< std::vector< gr::tag_t > > tags)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:372
const double * getImagTimeDomainPoints() const
bool getRepeatDataFlag() const
bool getRepeatDataFlag() const
Definition: spectrumUpdateEvents.h:179
bool getRepeatDataFlag() const
Definition: spectrumUpdateEvents.h:363
HistogramClearEvent()
Definition: spectrumUpdateEvents.h:349
SetFreqEvent(const double, const double)
bool getRepeatDataFlag() const
gr::high_res_timer_type getDataTimestamp() const
Definition: spectrumUpdateEvents.h:154
const std::vector< double * > getTimeDomainPoints() const
HistogramSetAccumulator(const bool en)
Definition: spectrumUpdateEvents.h:82
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:355
SpectrumWindowCaptionEvent(const QString &)
Definition: spectrumUpdateEvents.h:284
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:167
Definition: spectrumUpdateEvents.h:260
gr::high_res_timer_type getEventGeneratedTimestamp() const
Definition: spectrumUpdateEvents.h:40
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
TimeRasterSetSize(const double nrows, const double ncols)
static const int SpectrumWindowCaptionEventType
Definition: spectrumUpdateEvents.h:36
TimeRasterUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
Definition: spectrumUpdateEvents.h:227
bool getRepeatDataFlag() const
bool getAccumulator() const
bool getLastOfMultipleUpdateFlag() const
int getDroppedFFTFrames() const
const double * getRealTimeDomainPoints() const
uint64_t getNumDataPoints() const
NumberUpdateEvent(const std::vector< float > samples)
SpectrumFrequencyRangeEvent(const double, const double, const double)
const std::vector< double * > getPoints() const
double nCols() const
uint64_t getNumFFTDataPoints() const
uint64_t getNumTimeDomainDataPoints() const
const float * getFFTPoints() const
double GetStopFrequency() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:138
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:319
int which() const
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:339
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:211