GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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;
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;
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 /********************************************************************/
285 
286 
287 class HistogramUpdateEvent: public QEvent
288 {
289 public:
290  HistogramUpdateEvent(const std::vector<double*> points,
291  const uint64_t npoints);
292 
294 
295  int which() const;
296  const std::vector<double*> getDataPoints() const;
297  uint64_t getNumDataPoints() const;
298  bool getRepeatDataFlag() const;
299 
300  static QEvent::Type Type()
301  { return QEvent::Type(SpectrumUpdateEventType); }
302 
303 protected:
304 
305 private:
306  size_t _nplots;
307  std::vector<double*> _points;
308  uint64_t _npoints;
309 };
310 
311 
312 /********************************************************************/
313 
314 
315 class NumberUpdateEvent: public QEvent
316 {
317 public:
318  NumberUpdateEvent(const std::vector<float> samples);
320 
321  int which() const;
322  const std::vector<float> getSamples() const;
323 
324  static QEvent::Type Type()
325  { return QEvent::Type(SpectrumUpdateEventType); }
326 
327 protected:
328 
329 private:
330  size_t _nplots;
331  std::vector<float> _samples;
332 };
333 
334 
335 
336 #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 const int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:38
double getBandwidth() const
uint64_t getNumDataPoints() const
uint64_t getNumDataPoints() const
double GetCenterFrequency() const
Definition: spectrumUpdateEvents.h:94
int which() const
Definition: spectrumUpdateEvents.h:287
double getCenterFrequency() const
static const int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:35
Definition: spectrumUpdateEvents.h:196
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:122
uint64_t getNumDataPoints() 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:324
const double * getImagTimeDomainPoints() const
bool getRepeatDataFlag() const
bool getRepeatDataFlag() const
Definition: spectrumUpdateEvents.h:179
bool getRepeatDataFlag() const
Definition: spectrumUpdateEvents.h:315
SetFreqEvent(const double, const double)
bool getRepeatDataFlag() const
unsigned __int64 uint64_t
Definition: stdint.h:90
gr::high_res_timer_type getDataTimestamp() const
Definition: spectrumUpdateEvents.h:154
const std::vector< double * > getTimeDomainPoints() const
Definition: spectrumUpdateEvents.h:82
SpectrumWindowCaptionEvent(const QString &)
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
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 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
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:300
int which() const
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:211