GNU Radio 3.7.2 C++ API
spectrumUpdateEvents.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2013 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 /********************************************************************/
180 
181 
182 class QTGUI_API ConstUpdateEvent: public QEvent
183 {
184 public:
185  ConstUpdateEvent(const std::vector<double*> realDataPoints,
186  const std::vector<double*> imagDataPoints,
187  const uint64_t numDataPoints);
188 
189  ~ConstUpdateEvent();
190 
191  int which() const;
192  const std::vector<double*> getRealPoints() const;
193  const std::vector<double*> getImagPoints() const;
194  uint64_t getNumDataPoints() const;
195  bool getRepeatDataFlag() const;
196 
197  static QEvent::Type Type()
198  { return QEvent::Type(SpectrumUpdateEventType); }
199 
200 protected:
201 
202 private:
203  size_t _nplots;
204  std::vector<double*> _realDataPoints;
205  std::vector<double*> _imagDataPoints;
206  uint64_t _numDataPoints;
207 };
208 
209 
210 /********************************************************************/
211 
212 
213 class WaterfallUpdateEvent: public QEvent
214 {
215 public:
216  WaterfallUpdateEvent(const std::vector<double*> dataPoints,
217  const uint64_t numDataPoints,
218  const gr::high_res_timer_type dataTimestamp);
219 
221 
222  int which() const;
223  const std::vector<double*> getPoints() const;
224  uint64_t getNumDataPoints() const;
225  bool getRepeatDataFlag() const;
226 
228 
229  static QEvent::Type Type()
230  { return QEvent::Type(SpectrumUpdateEventType); }
231 
232 protected:
233 
234 private:
235  size_t _nplots;
236  std::vector<double*> _dataPoints;
237  uint64_t _numDataPoints;
238 
239  gr::high_res_timer_type _dataTimestamp;
240 };
241 
242 
243 /********************************************************************/
244 
245 
246 class TimeRasterUpdateEvent: public QEvent
247 {
248 public:
249  TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
250  const uint64_t numDataPoints);
252 
253  int which() const;
254  const std::vector<double*> getPoints() const;
255  uint64_t getNumDataPoints() const;
256  bool getRepeatDataFlag() const;
257 
258  static QEvent::Type Type()
259  { return QEvent::Type(SpectrumUpdateEventType); }
260 
261 protected:
262 
263 private:
264  size_t _nplots;
265  std::vector<double*> _dataPoints;
266  uint64_t _numDataPoints;
267 };
268 
269 
270 /********************************************************************/
271 
272 
273 class HistogramUpdateEvent: public QEvent
274 {
275 public:
276  HistogramUpdateEvent(const std::vector<double*> points,
277  const uint64_t npoints);
278 
280 
281  int which() const;
282  const std::vector<double*> getDataPoints() const;
283  uint64_t getNumDataPoints() const;
284  bool getRepeatDataFlag() const;
285 
286  static QEvent::Type Type()
287  { return QEvent::Type(SpectrumUpdateEventType); }
288 
289 protected:
290 
291 private:
292  size_t _nplots;
293  std::vector<double*> _points;
294  uint64_t _npoints;
295 };
296 
297 
298 #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:258
const std::vector< double * > getPoints() const
gr::high_res_timer_type getDataTimestamp() const
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:229
static const int SpectrumFrequencyRangeEventType
Definition: spectrumUpdateEvents.h:38
uint64_t getNumDataPoints() const
uint64_t getNumDataPoints() const
double GetCenterFrequency() const
Definition: spectrumUpdateEvents.h:94
int which() const
Definition: spectrumUpdateEvents.h:273
static const int SpectrumUpdateEventType
Definition: spectrumUpdateEvents.h:35
Definition: spectrumUpdateEvents.h:182
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)
const double * getImagTimeDomainPoints() const
bool getRepeatDataFlag() const
bool getRepeatDataFlag() const
bool getRepeatDataFlag() const
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:246
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:213
bool getRepeatDataFlag() const
bool getLastOfMultipleUpdateFlag() const
int getDroppedFFTFrames() const
const double * getRealTimeDomainPoints() const
uint64_t getNumDataPoints() const
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:286
HistogramUpdateEvent(const std::vector< double * > points, const uint64_t npoints)
static QEvent::Type Type()
Definition: spectrumUpdateEvents.h:197