GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
Loading...
Searching...
No Matches
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
35static const int SpectrumUpdateEventType = 10005;
36static const int SpectrumWindowCaptionEventType = 10008;
37static const int SpectrumWindowResetEventType = 10009;
38static const int SpectrumFrequencyRangeEventType = 10010;
39
40class SpectrumUpdateEvent : public QEvent
41{
42
43public:
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;
63 bool getRepeatDataFlag() const;
67
68protected:
69private:
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
82class SpectrumWindowCaptionEvent : public QEvent
83{
84public:
87 QString getLabel();
88
89protected:
90private:
91 QString _labelString;
92};
93
94class SpectrumWindowResetEvent : public QEvent
95{
96public:
99
100protected:
101private:
102};
103
104class SpectrumFrequencyRangeEvent : public QEvent
105{
106public:
107 SpectrumFrequencyRangeEvent(const double, const double, const double);
109 double GetCenterFrequency() const;
110 double GetStartFrequency() const;
111 double GetStopFrequency() const;
112
113protected:
114private:
115 double _centerFrequency;
116 double _startFrequency;
117 double _stopFrequency;
118};
119
120
121class TimeUpdateEvent : public QEvent
122{
123public:
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;
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
139protected:
140private:
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
151class FreqUpdateEvent : public QEvent
152{
153public:
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
165protected:
166private:
167 size_t _nplots;
168 std::vector<double*> _dataPoints;
169 uint64_t _numDataPoints;
170};
171
172
173class SetFreqEvent : public QEvent
174{
175public:
176 SetFreqEvent(const double, const double);
178 double getCenterFrequency() const;
179 double getBandwidth() const;
180
181private:
182 double _centerFrequency;
183 double _bandwidth;
184};
185
186
187/********************************************************************/
188
189
190class QTGUI_API ConstUpdateEvent : public QEvent
191{
192public:
193 ConstUpdateEvent(const std::vector<double*> realDataPoints,
194 const std::vector<double*> imagDataPoints,
195 const uint64_t numDataPoints);
196
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
207protected:
208private:
209 size_t _nplots;
210 std::vector<double*> _realDataPoints;
211 std::vector<double*> _imagDataPoints;
212 uint64_t _numDataPoints;
213};
214
215
216/********************************************************************/
217
218
219class WaterfallUpdateEvent : public QEvent
220{
221public:
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
237protected:
238private:
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
250class TimeRasterUpdateEvent : public QEvent
251{
252public:
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
264protected:
265private:
266 size_t _nplots;
267 std::vector<double*> _dataPoints;
268 uint64_t _numDataPoints;
269};
270
271
272class TimeRasterSetSize : public QEvent
273{
274public:
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
283private:
284 double _nrows;
285 double _ncols;
286};
287
288
289/********************************************************************/
290
291
292class HistogramUpdateEvent : public QEvent
293{
294public:
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
306protected:
307private:
308 size_t _nplots;
309 std::vector<double*> _points;
310 uint64_t _npoints;
311};
312
313
314class HistogramSetAccumulator : public QEvent
315{
316public:
319
320 bool getAccumulator() const;
321
322 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
323
324private:
325 bool _en;
326};
327
328class HistogramClearEvent : public QEvent
329{
330public:
332
334
335 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 2); }
336};
337
338
339/********************************************************************/
340
341
342class NumberUpdateEvent : public QEvent
343{
344public:
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
353protected:
354private:
355 size_t _nplots;
356 std::vector<float> _samples;
357};
358
359
360#endif /* SPECTRUM_UPDATE_EVENTS_H */
int which() const
const std::vector< double * > getImagPoints() const
ConstUpdateEvent(const std::vector< double * > realDataPoints, const std::vector< double * > imagDataPoints, const uint64_t numDataPoints)
bool getRepeatDataFlag() const
const std::vector< double * > getRealPoints() const
uint64_t getNumDataPoints() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:205
const std::vector< double * > getPoints() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:163
int which() const
uint64_t getNumDataPoints() const
bool getRepeatDataFlag() const
FreqUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
HistogramClearEvent()
Definition spectrumUpdateEvents.h:331
~HistogramClearEvent()
Definition spectrumUpdateEvents.h:333
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:335
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:322
bool getAccumulator() const
HistogramSetAccumulator(const bool en)
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:304
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
const std::vector< double * > getDataPoints() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:351
const std::vector< float > getSamples() const
NumberUpdateEvent(const std::vector< float > samples)
int which() const
SetFreqEvent(const double, const double)
double getBandwidth() const
double getCenterFrequency() const
double GetCenterFrequency() const
SpectrumFrequencyRangeEvent(const double, const double, const double)
double GetStartFrequency() const
double GetStopFrequency() const
int getDroppedFFTFrames() const
gr::high_res_timer_type getEventGeneratedTimestamp() const
uint64_t getNumFFTDataPoints() const
bool getRepeatDataFlag() const
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)
gr::high_res_timer_type getDataTimestamp() const
const double * getRealTimeDomainPoints() const
bool getLastOfMultipleUpdateFlag() const
const float * getFFTPoints() const
uint64_t getNumTimeDomainDataPoints() const
const double * getImagTimeDomainPoints() const
SpectrumWindowCaptionEvent(const QString &)
double nCols() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:281
double nRows() const
TimeRasterSetSize(const double nrows, const double ncols)
TimeRasterUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints)
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:262
const std::vector< double * > getPoints() const
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:137
const std::vector< double * > getTimeDomainPoints() const
uint64_t getNumTimeDomainDataPoints() const
const std::vector< std::vector< gr::tag_t > > getTags() const
int which() const
bool getRepeatDataFlag() const
TimeUpdateEvent(const std::vector< double * > timeDomainPoints, const uint64_t numTimeDomainDataPoints, const std::vector< std::vector< gr::tag_t > > tags)
WaterfallUpdateEvent(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const gr::high_res_timer_type dataTimestamp)
const std::vector< double * > getPoints() const
static QEvent::Type Type()
Definition spectrumUpdateEvents.h:235
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
gr::high_res_timer_type getDataTimestamp() const
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:30
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition high_res_timer.h:49
static const int SpectrumFrequencyRangeEventType
Definition spectrumUpdateEvents.h:38
static const int SpectrumWindowResetEventType
Definition spectrumUpdateEvents.h:37
static const int SpectrumUpdateEventType
Definition spectrumUpdateEvents.h:35
static const int SpectrumWindowCaptionEventType
Definition spectrumUpdateEvents.h:36