GNU Radio 3.7.1 C++ API
spectrumUpdateEvents.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008-2013 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef SPECTRUM_UPDATE_EVENTS_H
00024 #define SPECTRUM_UPDATE_EVENTS_H
00025 
00026 #include <stdint.h>
00027 #include <QEvent>
00028 #include <QString>
00029 #include <complex>
00030 #include <vector>
00031 #include <gnuradio/high_res_timer.h>
00032 #include <gnuradio/qtgui/api.h>
00033 
00034 static const int SpectrumUpdateEventType = 10005;
00035 static const int SpectrumWindowCaptionEventType = 10008;
00036 static const int SpectrumWindowResetEventType = 10009;
00037 static const int SpectrumFrequencyRangeEventType = 10010;
00038 
00039 class SpectrumUpdateEvent:public QEvent{
00040 
00041 public:
00042   SpectrumUpdateEvent(const float* fftPoints,
00043                       const uint64_t numFFTDataPoints,
00044                       const double* realTimeDomainPoints,
00045                       const double* imagTimeDomainPoints,
00046                       const uint64_t numTimeDomainDataPoints,
00047                       const gr::high_res_timer_type dataTimestamp,
00048                       const bool repeatDataFlag,
00049                       const bool lastOfMultipleUpdateFlag,
00050                       const gr::high_res_timer_type generatedTimestamp,
00051                       const int droppedFFTFrames);
00052 
00053   ~SpectrumUpdateEvent();
00054 
00055   const float* getFFTPoints() const;
00056   const double* getRealTimeDomainPoints() const;
00057   const double* getImagTimeDomainPoints() const;
00058   uint64_t getNumFFTDataPoints() const;
00059   uint64_t getNumTimeDomainDataPoints() const;
00060   gr::high_res_timer_type getDataTimestamp() const;
00061   bool getRepeatDataFlag() const;
00062   bool getLastOfMultipleUpdateFlag() const;
00063   gr::high_res_timer_type getEventGeneratedTimestamp() const;
00064   int getDroppedFFTFrames() const;
00065 
00066 protected:
00067 
00068 private:
00069   float* _fftPoints;
00070   double* _realDataTimeDomainPoints;
00071   double* _imagDataTimeDomainPoints;
00072   uint64_t _numFFTDataPoints;
00073   uint64_t _numTimeDomainDataPoints;
00074   gr::high_res_timer_type _dataTimestamp;
00075   bool _repeatDataFlag;
00076   bool _lastOfMultipleUpdateFlag;
00077   gr::high_res_timer_type _eventGeneratedTimestamp;
00078   int _droppedFFTFrames;
00079 };
00080 
00081 class SpectrumWindowCaptionEvent:public QEvent{
00082 public:
00083   SpectrumWindowCaptionEvent(const QString&);
00084   ~SpectrumWindowCaptionEvent();
00085   QString getLabel();
00086 
00087 protected:
00088 
00089 private:
00090   QString _labelString;
00091 };
00092 
00093 class SpectrumWindowResetEvent:public QEvent{
00094 public:
00095   SpectrumWindowResetEvent();
00096   ~SpectrumWindowResetEvent();
00097 
00098 protected:
00099 
00100 private:
00101 
00102 };
00103 
00104 class SpectrumFrequencyRangeEvent:public QEvent{
00105 public:
00106   SpectrumFrequencyRangeEvent(const double, const double, const double);
00107   ~SpectrumFrequencyRangeEvent();
00108   double GetCenterFrequency()const;
00109   double GetStartFrequency()const;
00110   double GetStopFrequency()const;
00111 
00112 protected:
00113 
00114 private:
00115   double _centerFrequency;
00116   double _startFrequency;
00117   double _stopFrequency;
00118 };
00119 
00120 
00121 class TimeUpdateEvent: public QEvent
00122 {
00123 public:
00124   TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
00125                   const uint64_t numTimeDomainDataPoints);
00126 
00127   ~TimeUpdateEvent();
00128 
00129   int which() const;
00130   const std::vector<double*> getTimeDomainPoints() const;
00131   uint64_t getNumTimeDomainDataPoints() const;
00132   bool getRepeatDataFlag() const;
00133 
00134   static QEvent::Type Type()
00135       { return QEvent::Type(SpectrumUpdateEventType); }
00136 
00137 protected:
00138 
00139 private:
00140   size_t _nplots;
00141   std::vector<double*> _dataTimeDomainPoints;
00142   uint64_t _numTimeDomainDataPoints;
00143 };
00144 
00145 
00146 /********************************************************************/
00147 
00148 
00149 class FreqUpdateEvent: public QEvent
00150 {
00151 public:
00152   FreqUpdateEvent(const std::vector<double*> dataPoints,
00153                   const uint64_t numDataPoints);
00154 
00155   ~FreqUpdateEvent();
00156 
00157   int which() const;
00158   const std::vector<double*> getPoints() const;
00159   uint64_t getNumDataPoints() const;
00160   bool getRepeatDataFlag() const;
00161 
00162   static QEvent::Type Type()
00163   { return QEvent::Type(SpectrumUpdateEventType); }
00164 
00165 protected:
00166 
00167 private:
00168   size_t _nplots;
00169   std::vector<double*> _dataPoints;
00170   uint64_t _numDataPoints;
00171 };
00172 
00173 
00174 /********************************************************************/
00175 
00176 
00177 class QTGUI_API ConstUpdateEvent: public QEvent
00178 {
00179 public:
00180   ConstUpdateEvent(const std::vector<double*> realDataPoints,
00181                    const std::vector<double*> imagDataPoints,
00182                    const uint64_t numDataPoints);
00183 
00184   ~ConstUpdateEvent();
00185 
00186   int which() const;
00187   const std::vector<double*> getRealPoints() const;
00188   const std::vector<double*> getImagPoints() const;
00189   uint64_t getNumDataPoints() const;
00190   bool getRepeatDataFlag() const;
00191 
00192   static QEvent::Type Type()
00193   { return QEvent::Type(SpectrumUpdateEventType); }
00194 
00195 protected:
00196 
00197 private:
00198   size_t _nplots;
00199   std::vector<double*> _realDataPoints;
00200   std::vector<double*> _imagDataPoints;
00201   uint64_t _numDataPoints;
00202 };
00203 
00204 
00205 /********************************************************************/
00206 
00207 
00208 class WaterfallUpdateEvent: public QEvent
00209 {
00210 public:
00211   WaterfallUpdateEvent(const std::vector<double*> dataPoints,
00212                        const uint64_t numDataPoints,
00213                        const gr::high_res_timer_type dataTimestamp);
00214 
00215   ~WaterfallUpdateEvent();
00216 
00217   int which() const;
00218   const std::vector<double*> getPoints() const;
00219   uint64_t getNumDataPoints() const;
00220   bool getRepeatDataFlag() const;
00221 
00222   gr::high_res_timer_type getDataTimestamp() const;
00223 
00224   static QEvent::Type Type()
00225   { return QEvent::Type(SpectrumUpdateEventType); }
00226 
00227 protected:
00228 
00229 private:
00230   size_t _nplots;
00231   std::vector<double*> _dataPoints;
00232   uint64_t _numDataPoints;
00233 
00234   gr::high_res_timer_type _dataTimestamp;
00235 };
00236 
00237 
00238 /********************************************************************/
00239 
00240 
00241 class TimeRasterUpdateEvent: public QEvent
00242 {
00243 public:
00244   TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
00245                         const uint64_t numDataPoints);
00246   ~TimeRasterUpdateEvent();
00247 
00248   int which() const;
00249   const std::vector<double*> getPoints() const;
00250   uint64_t getNumDataPoints() const;
00251   bool getRepeatDataFlag() const;
00252 
00253   static QEvent::Type Type()
00254   { return QEvent::Type(SpectrumUpdateEventType); }
00255 
00256 protected:
00257 
00258 private:
00259   size_t _nplots;
00260   std::vector<double*> _dataPoints;
00261   uint64_t _numDataPoints;
00262 };
00263 
00264 
00265 /********************************************************************/
00266 
00267 
00268 class HistogramUpdateEvent: public QEvent
00269 {
00270 public:
00271   HistogramUpdateEvent(const std::vector<double*> points,
00272                        const uint64_t npoints);
00273 
00274   ~HistogramUpdateEvent();
00275 
00276   int which() const;
00277   const std::vector<double*> getDataPoints() const;
00278   uint64_t getNumDataPoints() const;
00279   bool getRepeatDataFlag() const;
00280 
00281   static QEvent::Type Type()
00282   { return QEvent::Type(SpectrumUpdateEventType); }
00283 
00284 protected:
00285 
00286 private:
00287   size_t _nplots;
00288   std::vector<double*> _points;
00289   uint64_t _npoints;
00290 };
00291 
00292 
00293 #endif /* SPECTRUM_UPDATE_EVENTS_H */