GNU Radio Manual and C++ API Reference 3.10.5.1
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef SPECTRUM_UPDATE_EVENTS_H
12#define SPECTRUM_UPDATE_EVENTS_H
13
15#include <gnuradio/qtgui/api.h>
16#include <gnuradio/tags.h>
17#include <volk/volk_alloc.hh>
18#include <QEvent>
19#include <QString>
20#include <complex>
21#include <cstdint>
22#include <vector>
23
24static constexpr int SpectrumUpdateEventType = 10005;
25static constexpr int SpectrumWindowCaptionEventType = 10008;
26static constexpr int SpectrumWindowResetEventType = 10009;
27static constexpr int SpectrumFrequencyRangeEventType = 10010;
28
29class SpectrumUpdateEvent : public QEvent
30{
31
32public:
33 SpectrumUpdateEvent(const float* fftPoints,
34 const uint64_t numFFTDataPoints,
35 const double* realTimeDomainPoints,
36 const double* imagTimeDomainPoints,
37 const uint64_t numTimeDomainDataPoints,
38 const gr::high_res_timer_type dataTimestamp,
39 const bool repeatDataFlag,
40 const bool lastOfMultipleUpdateFlag,
41 const gr::high_res_timer_type generatedTimestamp,
42 const int droppedFFTFrames);
43
45
46 const float* getFFTPoints() const;
47 const double* getRealTimeDomainPoints() const;
48 const double* getImagTimeDomainPoints() const;
49 uint64_t getNumFFTDataPoints() const;
52 bool getRepeatDataFlag() const;
56
57protected:
58private:
59 std::vector<float> d_fft_points;
60 std::vector<double> d_real_data_time_domain_points;
61 std::vector<double> d_imag_data_time_domain_points;
62 gr::high_res_timer_type _dataTimestamp;
63 bool _repeatDataFlag;
64 bool _lastOfMultipleUpdateFlag;
65 gr::high_res_timer_type _eventGeneratedTimestamp;
66 int _droppedFFTFrames;
67};
68
69class SpectrumWindowCaptionEvent : public QEvent
70{
71public:
74 QString getLabel();
75
76protected:
77private:
78 QString _labelString;
79};
80
81class SpectrumWindowResetEvent : public QEvent
82{
83public:
86
87protected:
88private:
89};
90
91class SpectrumFrequencyRangeEvent : public QEvent
92{
93public:
94 SpectrumFrequencyRangeEvent(const double, const double, const double);
96 double GetCenterFrequency() const;
97 double GetStartFrequency() const;
98 double GetStopFrequency() const;
99
100protected:
101private:
102 double _centerFrequency;
103 double _startFrequency;
104 double _stopFrequency;
105};
106
107
108class TimeUpdateEvent : public QEvent
109{
110public:
111 TimeUpdateEvent(const std::vector<volk::vector<double>> timeDomainPoints,
112 const uint64_t numTimeDomainDataPoints,
113 const std::vector<std::vector<gr::tag_t>> tags);
114
116
117 int which() const;
118 const std::vector<double*> getTimeDomainPoints() const;
120 bool getRepeatDataFlag() const;
121
122 const std::vector<std::vector<gr::tag_t>> getTags() const;
123
124 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
125
126protected:
127private:
128 size_t _nplots;
129 std::vector<double*> _dataTimeDomainPoints;
130 uint64_t _numTimeDomainDataPoints;
131 std::vector<std::vector<gr::tag_t>> _tags;
132};
133
134
135/********************************************************************/
136
137
138class FreqUpdateEvent : public QEvent
139{
140public:
141 FreqUpdateEvent(const std::vector<volk::vector<double>> dataPoints,
142 const uint64_t numDataPoints);
143
145
146 int which() const;
147 const std::vector<double*> getPoints() const;
148 uint64_t getNumDataPoints() const;
149 bool getRepeatDataFlag() const;
150
151 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
152
153protected:
154private:
155 size_t _nplots;
156 std::vector<double*> _dataPoints;
157 uint64_t _numDataPoints;
158};
159
160
161class SetFreqEvent : public QEvent
162{
163public:
164 SetFreqEvent(const double, const double);
165 ~SetFreqEvent() override;
166 double getCenterFrequency() const;
167 double getBandwidth() const;
168
169private:
170 double _centerFrequency;
171 double _bandwidth;
172};
173
174
175/********************************************************************/
176
177
178class QTGUI_API ConstUpdateEvent : public QEvent
179{
180public:
181 ConstUpdateEvent(const std::vector<volk::vector<double>> realDataPoints,
182 const std::vector<volk::vector<double>> imagDataPoints,
183 const uint64_t numDataPoints);
184
186
187 int which() const;
188 const std::vector<double*> getRealPoints() const;
189 const std::vector<double*> getImagPoints() const;
190 uint64_t getNumDataPoints() const;
191 bool getRepeatDataFlag() const;
192
193 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
194
195protected:
196private:
197 size_t _nplots;
198 std::vector<double*> _realDataPoints;
199 std::vector<double*> _imagDataPoints;
200 uint64_t _numDataPoints;
201};
202
203
204/********************************************************************/
205
206
207class WaterfallUpdateEvent : public QEvent
208{
209public:
210 WaterfallUpdateEvent(const std::vector<volk::vector<double>> dataPoints,
211 const uint64_t numDataPoints,
212 const gr::high_res_timer_type dataTimestamp);
213
215
216 int which() const;
217 const std::vector<double*> getPoints() const;
218 uint64_t getNumDataPoints() const;
219 bool getRepeatDataFlag() const;
220
222
223 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
224
225protected:
226private:
227 size_t _nplots;
228 std::vector<double*> _dataPoints;
229 uint64_t _numDataPoints;
230
231 gr::high_res_timer_type _dataTimestamp;
232};
233
234
235/********************************************************************/
236
237
238class TimeRasterUpdateEvent : public QEvent
239{
240public:
241 TimeRasterUpdateEvent(const std::vector<volk::vector<double>> dataPoints,
242 const uint64_t numDataPoints);
244
245 int which() const;
246 const std::vector<double*> getPoints() const;
247 uint64_t getNumDataPoints() const;
248 bool getRepeatDataFlag() const;
249
250 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
251
252protected:
253private:
254 size_t _nplots;
255 std::vector<double*> _dataPoints;
256 uint64_t _numDataPoints;
257};
258
259
260class TimeRasterSetSize : public QEvent
261{
262public:
263 TimeRasterSetSize(const double nrows, const double ncols);
265
266 double nRows() const;
267 double nCols() const;
268
269 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
270
271private:
272 double _nrows;
273 double _ncols;
274};
275
276
277/********************************************************************/
278
279
280class HistogramUpdateEvent : public QEvent
281{
282public:
283 HistogramUpdateEvent(const std::vector<volk::vector<double>> points,
284 const uint64_t npoints);
285
287
288 int which() const;
289 const std::vector<double*> getDataPoints() const;
290 uint64_t getNumDataPoints() const;
291 bool getRepeatDataFlag() const;
292
293 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
294
295protected:
296private:
297 size_t _nplots;
298 std::vector<double*> _points;
299 uint64_t _npoints;
300};
301
302
303class HistogramSetAccumulator : public QEvent
304{
305public:
308
309 bool getAccumulator() const;
310
311 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
312
313private:
314 bool _en;
315};
316
317class HistogramClearEvent : public QEvent
318{
319public:
321
323
324 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 2); }
325};
326
327
328/********************************************************************/
329
330
331class NumberUpdateEvent : public QEvent
332{
333public:
334 NumberUpdateEvent(const std::vector<float> samples);
336
337 int which() const;
338 const std::vector<float> getSamples() const;
339
340 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
341
342protected:
343private:
344 size_t _nplots;
345 std::vector<float> _samples;
346};
347
348
349#endif /* SPECTRUM_UPDATE_EVENTS_H */
Definition: spectrumUpdateEvents.h:179
int which() const
~ConstUpdateEvent() override
ConstUpdateEvent(const std::vector< volk::vector< double > > realDataPoints, const std::vector< volk::vector< double > > imagDataPoints, const uint64_t numDataPoints)
const std::vector< double * > getImagPoints() const
bool getRepeatDataFlag() const
const std::vector< double * > getRealPoints() const
uint64_t getNumDataPoints() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:193
Definition: spectrumUpdateEvents.h:139
const std::vector< double * > getPoints() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:151
~FreqUpdateEvent() override
int which() const
uint64_t getNumDataPoints() const
bool getRepeatDataFlag() const
FreqUpdateEvent(const std::vector< volk::vector< double > > dataPoints, const uint64_t numDataPoints)
Definition: spectrumUpdateEvents.h:318
~HistogramClearEvent() override
Definition: spectrumUpdateEvents.h:322
HistogramClearEvent()
Definition: spectrumUpdateEvents.h:320
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:324
Definition: spectrumUpdateEvents.h:304
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:311
bool getAccumulator() const
HistogramSetAccumulator(const bool en)
~HistogramSetAccumulator() override
Definition: spectrumUpdateEvents.h:281
HistogramUpdateEvent(const std::vector< volk::vector< double > > points, const uint64_t npoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:293
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
const std::vector< double * > getDataPoints() const
~HistogramUpdateEvent() override
Definition: spectrumUpdateEvents.h:332
~NumberUpdateEvent() override
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:340
const std::vector< float > getSamples() const
NumberUpdateEvent(const std::vector< float > samples)
int which() const
Definition: spectrumUpdateEvents.h:162
~SetFreqEvent() override
SetFreqEvent(const double, const double)
double getBandwidth() const
double getCenterFrequency() const
Definition: spectrumUpdateEvents.h:92
~SpectrumFrequencyRangeEvent() override
double GetCenterFrequency() const
SpectrumFrequencyRangeEvent(const double, const double, const double)
double GetStartFrequency() const
double GetStopFrequency() const
Definition: spectrumUpdateEvents.h:30
int getDroppedFFTFrames() const
~SpectrumUpdateEvent() override
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
Definition: spectrumUpdateEvents.h:70
SpectrumWindowCaptionEvent(const QString &)
~SpectrumWindowCaptionEvent() override
Definition: spectrumUpdateEvents.h:82
~SpectrumWindowResetEvent() override
Definition: spectrumUpdateEvents.h:261
double nCols() const
~TimeRasterSetSize() override
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:269
double nRows() const
TimeRasterSetSize(const double nrows, const double ncols)
Definition: spectrumUpdateEvents.h:239
TimeRasterUpdateEvent(const std::vector< volk::vector< double > > dataPoints, const uint64_t numDataPoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:250
~TimeRasterUpdateEvent() override
const std::vector< double * > getPoints() const
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
Definition: spectrumUpdateEvents.h:109
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:124
const std::vector< double * > getTimeDomainPoints() const
uint64_t getNumTimeDomainDataPoints() const
TimeUpdateEvent(const std::vector< volk::vector< double > > timeDomainPoints, const uint64_t numTimeDomainDataPoints, const std::vector< std::vector< gr::tag_t > > tags)
const std::vector< std::vector< gr::tag_t > > getTags() const
int which() const
~TimeUpdateEvent() override
bool getRepeatDataFlag() const
Definition: spectrumUpdateEvents.h:208
~WaterfallUpdateEvent() override
const std::vector< double * > getPoints() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:223
WaterfallUpdateEvent(const std::vector< volk::vector< double > > dataPoints, const uint64_t numDataPoints, const gr::high_res_timer_type dataTimestamp)
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:18
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:40
static constexpr int SpectrumWindowCaptionEventType
Definition: spectrumUpdateEvents.h:25
static constexpr int SpectrumWindowResetEventType
Definition: spectrumUpdateEvents.h:26
static constexpr int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:27
static constexpr int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:24