GNU Radio Manual and C++ API Reference 3.9.8.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 * 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 <QEvent>
18#include <QString>
19#include <complex>
20#include <cstdint>
21#include <vector>
22
23static constexpr int SpectrumUpdateEventType = 10005;
24static constexpr int SpectrumWindowCaptionEventType = 10008;
25static constexpr int SpectrumWindowResetEventType = 10009;
26static constexpr int SpectrumFrequencyRangeEventType = 10010;
27
28class SpectrumUpdateEvent : public QEvent
29{
30
31public:
32 SpectrumUpdateEvent(const float* fftPoints,
33 const uint64_t numFFTDataPoints,
34 const double* realTimeDomainPoints,
35 const double* imagTimeDomainPoints,
36 const uint64_t numTimeDomainDataPoints,
37 const gr::high_res_timer_type dataTimestamp,
38 const bool repeatDataFlag,
39 const bool lastOfMultipleUpdateFlag,
40 const gr::high_res_timer_type generatedTimestamp,
41 const int droppedFFTFrames);
42
44
45 const float* getFFTPoints() const;
46 const double* getRealTimeDomainPoints() const;
47 const double* getImagTimeDomainPoints() const;
48 uint64_t getNumFFTDataPoints() const;
51 bool getRepeatDataFlag() const;
55
56protected:
57private:
58 float* _fftPoints;
59 double* _realDataTimeDomainPoints;
60 double* _imagDataTimeDomainPoints;
61 uint64_t _numFFTDataPoints;
62 uint64_t _numTimeDomainDataPoints;
63 gr::high_res_timer_type _dataTimestamp;
64 bool _repeatDataFlag;
65 bool _lastOfMultipleUpdateFlag;
66 gr::high_res_timer_type _eventGeneratedTimestamp;
67 int _droppedFFTFrames;
68};
69
70class SpectrumWindowCaptionEvent : public QEvent
71{
72public:
75 QString getLabel();
76
77protected:
78private:
79 QString _labelString;
80};
81
82class SpectrumWindowResetEvent : public QEvent
83{
84public:
87
88protected:
89private:
90};
91
92class SpectrumFrequencyRangeEvent : public QEvent
93{
94public:
95 SpectrumFrequencyRangeEvent(const double, const double, const double);
97 double GetCenterFrequency() const;
98 double GetStartFrequency() const;
99 double GetStopFrequency() const;
100
101protected:
102private:
103 double _centerFrequency;
104 double _startFrequency;
105 double _stopFrequency;
106};
107
108
109class TimeUpdateEvent : public QEvent
110{
111public:
112 TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
113 const uint64_t numTimeDomainDataPoints,
114 const std::vector<std::vector<gr::tag_t>> tags);
115
117
118 int which() const;
119 const std::vector<double*> getTimeDomainPoints() const;
121 bool getRepeatDataFlag() const;
122
123 const std::vector<std::vector<gr::tag_t>> getTags() const;
124
125 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
126
127protected:
128private:
129 size_t _nplots;
130 std::vector<double*> _dataTimeDomainPoints;
131 uint64_t _numTimeDomainDataPoints;
132 std::vector<std::vector<gr::tag_t>> _tags;
133};
134
135
136/********************************************************************/
137
138
139class FreqUpdateEvent : public QEvent
140{
141public:
142 FreqUpdateEvent(const std::vector<double*> dataPoints, 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<double*> realDataPoints,
182 const std::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<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<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<double*> points, const uint64_t npoints);
284
286
287 int which() const;
288 const std::vector<double*> getDataPoints() const;
289 uint64_t getNumDataPoints() const;
290 bool getRepeatDataFlag() const;
291
292 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
293
294protected:
295private:
296 size_t _nplots;
297 std::vector<double*> _points;
298 uint64_t _npoints;
299};
300
301
302class HistogramSetAccumulator : public QEvent
303{
304public:
307
308 bool getAccumulator() const;
309
310 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 1); }
311
312private:
313 bool _en;
314};
315
316class HistogramClearEvent : public QEvent
317{
318public:
320
322
323 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType + 2); }
324};
325
326
327/********************************************************************/
328
329
330class NumberUpdateEvent : public QEvent
331{
332public:
333 NumberUpdateEvent(const std::vector<float> samples);
335
336 int which() const;
337 const std::vector<float> getSamples() const;
338
339 static QEvent::Type Type() { return QEvent::Type(SpectrumUpdateEventType); }
340
341protected:
342private:
343 size_t _nplots;
344 std::vector<float> _samples;
345};
346
347
348#endif /* SPECTRUM_UPDATE_EVENTS_H */
Definition: spectrumUpdateEvents.h:179
int which() const
~ConstUpdateEvent() override
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:193
Definition: spectrumUpdateEvents.h:140
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< double * > dataPoints, const uint64_t numDataPoints)
Definition: spectrumUpdateEvents.h:317
~HistogramClearEvent() override
Definition: spectrumUpdateEvents.h:321
HistogramClearEvent()
Definition: spectrumUpdateEvents.h:319
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:323
Definition: spectrumUpdateEvents.h:303
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:310
bool getAccumulator() const
HistogramSetAccumulator(const bool en)
~HistogramSetAccumulator() override
Definition: spectrumUpdateEvents.h:281
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:292
bool getRepeatDataFlag() const
uint64_t getNumDataPoints() const
const std::vector< double * > getDataPoints() const
~HistogramUpdateEvent() override
Definition: spectrumUpdateEvents.h:331
~NumberUpdateEvent() override
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:339
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:93
~SpectrumFrequencyRangeEvent() override
double GetCenterFrequency() const
SpectrumFrequencyRangeEvent(const double, const double, const double)
double GetStartFrequency() const
double GetStopFrequency() const
Definition: spectrumUpdateEvents.h:29
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:71
SpectrumWindowCaptionEvent(const QString &)
~SpectrumWindowCaptionEvent() override
Definition: spectrumUpdateEvents.h:83
~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< 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:110
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:125
const std::vector< double * > getTimeDomainPoints() const
uint64_t getNumTimeDomainDataPoints() const
const std::vector< std::vector< gr::tag_t > > getTags() const
int which() const
~TimeUpdateEvent() override
bool getRepeatDataFlag() const
TimeUpdateEvent(const std::vector< double * > timeDomainPoints, const uint64_t numTimeDomainDataPoints, const std::vector< std::vector< gr::tag_t > > tags)
Definition: spectrumUpdateEvents.h:208
~WaterfallUpdateEvent() override
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:223
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:39
static constexpr int SpectrumWindowCaptionEventType
Definition: spectrumUpdateEvents.h:24
static constexpr int SpectrumWindowResetEventType
Definition: spectrumUpdateEvents.h:25
static constexpr int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:26
static constexpr int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:23