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 
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 
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:
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 */
TimeRasterUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const
SetFreqEvent::getCenterFrequency
double getCenterFrequency() const
HistogramUpdateEvent::which
int which() const
high_res_timer.h
SpectrumUpdateEvent
Definition: spectrumUpdateEvents.h:40
QTGUI_API
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
TimeRasterUpdateEvent::TimeRasterUpdateEvent
TimeRasterUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
TimeUpdateEvent::TimeUpdateEvent
TimeUpdateEvent(const std::vector< double * > timeDomainPoints, const uint64_t numTimeDomainDataPoints, const std::vector< std::vector< gr::tag_t >> tags)
HistogramUpdateEvent::HistogramUpdateEvent
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
SpectrumWindowCaptionEventType
static const int SpectrumWindowCaptionEventType
Definition: spectrumUpdateEvents.h:36
TimeRasterSetSize::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:281
SpectrumWindowCaptionEvent::~SpectrumWindowCaptionEvent
~SpectrumWindowCaptionEvent()
WaterfallUpdateEvent::~WaterfallUpdateEvent
~WaterfallUpdateEvent()
SpectrumFrequencyRangeEvent::GetCenterFrequency
double GetCenterFrequency() const
SpectrumUpdateEvent::getDataTimestamp
gr::high_res_timer_type getDataTimestamp() const
HistogramSetAccumulator::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:322
WaterfallUpdateEvent::getPoints
const std::vector< double * > getPoints() const
HistogramClearEvent::HistogramClearEvent
HistogramClearEvent()
Definition: spectrumUpdateEvents.h:331
NumberUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:351
SpectrumUpdateEvent::getEventGeneratedTimestamp
gr::high_res_timer_type getEventGeneratedTimestamp() const
NumberUpdateEvent
Definition: spectrumUpdateEvents.h:342
NumberUpdateEvent::which
int which() const
tags.h
FreqUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:163
SpectrumWindowResetEvent::~SpectrumWindowResetEvent
~SpectrumWindowResetEvent()
HistogramSetAccumulator::getAccumulator
bool getAccumulator() const
SpectrumUpdateEvent::getLastOfMultipleUpdateFlag
bool getLastOfMultipleUpdateFlag() const
SpectrumWindowCaptionEvent
Definition: spectrumUpdateEvents.h:82
SpectrumWindowCaptionEvent::SpectrumWindowCaptionEvent
SpectrumWindowCaptionEvent(const QString &)
SetFreqEvent::getBandwidth
double getBandwidth() const
NumberUpdateEvent::~NumberUpdateEvent
~NumberUpdateEvent()
SpectrumUpdateEvent::getRealTimeDomainPoints
const double * getRealTimeDomainPoints() const
HistogramClearEvent
Definition: spectrumUpdateEvents.h:328
TimeRasterUpdateEvent::~TimeRasterUpdateEvent
~TimeRasterUpdateEvent()
SetFreqEvent::~SetFreqEvent
~SetFreqEvent()
TimeRasterSetSize
Definition: spectrumUpdateEvents.h:272
SpectrumWindowResetEvent::SpectrumWindowResetEvent
SpectrumWindowResetEvent()
WaterfallUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:235
SetFreqEvent
Definition: spectrumUpdateEvents.h:173
WaterfallUpdateEvent
Definition: spectrumUpdateEvents.h:219
FreqUpdateEvent::which
int which() const
SpectrumUpdateEvent::SpectrumUpdateEvent
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)
WaterfallUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const
NumberUpdateEvent::getSamples
const std::vector< float > getSamples() const
HistogramClearEvent::~HistogramClearEvent
~HistogramClearEvent()
Definition: spectrumUpdateEvents.h:333
TimeUpdateEvent::getNumTimeDomainDataPoints
uint64_t getNumTimeDomainDataPoints() const
api.h
TimeUpdateEvent::getTimeDomainPoints
const std::vector< double * > getTimeDomainPoints() const
TimeUpdateEvent::~TimeUpdateEvent
~TimeUpdateEvent()
FreqUpdateEvent
Definition: spectrumUpdateEvents.h:151
SpectrumUpdateEvent::getFFTPoints
const float * getFFTPoints() const
TimeUpdateEvent::getTags
const std::vector< std::vector< gr::tag_t > > getTags() const
SpectrumUpdateEvent::getNumFFTDataPoints
uint64_t getNumFFTDataPoints() const
ConstUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:205
TimeUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const
SpectrumFrequencyRangeEvent::GetStartFrequency
double GetStartFrequency() const
SpectrumUpdateEvent::getImagTimeDomainPoints
const double * getImagTimeDomainPoints() const
TimeRasterUpdateEvent::getPoints
const std::vector< double * > getPoints() const
TimeRasterSetSize::~TimeRasterSetSize
~TimeRasterSetSize()
WaterfallUpdateEvent::getDataTimestamp
gr::high_res_timer_type getDataTimestamp() const
SpectrumFrequencyRangeEventType
static const int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:38
HistogramUpdateEvent::getDataPoints
const std::vector< double * > getDataPoints() const
TimeUpdateEvent
Definition: spectrumUpdateEvents.h:121
SpectrumUpdateEvent::getNumTimeDomainDataPoints
uint64_t getNumTimeDomainDataPoints() const
SpectrumFrequencyRangeEvent::GetStopFrequency
double GetStopFrequency() const
WaterfallUpdateEvent::WaterfallUpdateEvent
WaterfallUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const gr::high_res_timer_type dataTimestamp)
HistogramUpdateEvent::getNumDataPoints
uint64_t getNumDataPoints() const
FreqUpdateEvent::~FreqUpdateEvent
~FreqUpdateEvent()
NumberUpdateEvent::NumberUpdateEvent
NumberUpdateEvent(const std::vector< float > samples)
FreqUpdateEvent::getNumDataPoints
uint64_t getNumDataPoints() const
TimeRasterSetSize::nCols
double nCols() const
WaterfallUpdateEvent::getNumDataPoints
uint64_t getNumDataPoints() const
ConstUpdateEvent
Definition: spectrumUpdateEvents.h:190
SpectrumWindowResetEvent
Definition: spectrumUpdateEvents.h:94
WaterfallUpdateEvent::which
int which() const
SpectrumUpdateEventType
static const int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:35
SetFreqEvent::SetFreqEvent
SetFreqEvent(const double, const double)
gr::high_res_timer_type
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
TimeRasterSetSize::TimeRasterSetSize
TimeRasterSetSize(const double nrows, const double ncols)
TimeRasterUpdateEvent::getNumDataPoints
uint64_t getNumDataPoints() const
HistogramClearEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:335
SpectrumWindowResetEventType
static const int SpectrumWindowResetEventType
Definition: spectrumUpdateEvents.h:37
HistogramSetAccumulator::HistogramSetAccumulator
HistogramSetAccumulator(const bool en)
TimeRasterUpdateEvent
Definition: spectrumUpdateEvents.h:250
SpectrumFrequencyRangeEvent::~SpectrumFrequencyRangeEvent
~SpectrumFrequencyRangeEvent()
TimeRasterUpdateEvent::which
int which() const
TimeRasterSetSize::nRows
double nRows() const
SpectrumUpdateEvent::getDroppedFFTFrames
int getDroppedFFTFrames() const
HistogramSetAccumulator
Definition: spectrumUpdateEvents.h:314
TimeRasterUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:262
HistogramUpdateEvent
Definition: spectrumUpdateEvents.h:292
HistogramSetAccumulator::~HistogramSetAccumulator
~HistogramSetAccumulator()
SpectrumFrequencyRangeEvent::SpectrumFrequencyRangeEvent
SpectrumFrequencyRangeEvent(const double, const double, const double)
TimeUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:137
SpectrumFrequencyRangeEvent
Definition: spectrumUpdateEvents.h:104
SpectrumUpdateEvent::~SpectrumUpdateEvent
~SpectrumUpdateEvent()
FreqUpdateEvent::FreqUpdateEvent
FreqUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
HistogramUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const
SpectrumWindowCaptionEvent::getLabel
QString getLabel()
FreqUpdateEvent::getPoints
const std::vector< double * > getPoints() const
HistogramUpdateEvent::Type
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:304
HistogramUpdateEvent::~HistogramUpdateEvent
~HistogramUpdateEvent()
SpectrumUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const
TimeUpdateEvent::which
int which() const
FreqUpdateEvent::getRepeatDataFlag
bool getRepeatDataFlag() const