GNU Radio 3.7.0 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 
00033 static const int SpectrumUpdateEventType = 10005;
00034 static const int SpectrumWindowCaptionEventType = 10008;
00035 static const int SpectrumWindowResetEventType = 10009;
00036 static const int SpectrumFrequencyRangeEventType = 10010;
00037 
00038 class SpectrumUpdateEvent:public QEvent{
00039 
00040 public:
00041   SpectrumUpdateEvent(const float* fftPoints,
00042                       const uint64_t numFFTDataPoints,
00043                       const double* realTimeDomainPoints,
00044                       const double* imagTimeDomainPoints,
00045                       const uint64_t numTimeDomainDataPoints,
00046                       const gr::high_res_timer_type dataTimestamp,
00047                       const bool repeatDataFlag,
00048                       const bool lastOfMultipleUpdateFlag,
00049                       const gr::high_res_timer_type generatedTimestamp,
00050                       const int droppedFFTFrames);
00051 
00052   ~SpectrumUpdateEvent();
00053 
00054   const float* getFFTPoints() const;
00055   const double* getRealTimeDomainPoints() const;
00056   const double* getImagTimeDomainPoints() const;
00057   uint64_t getNumFFTDataPoints() const;
00058   uint64_t getNumTimeDomainDataPoints() const;
00059   gr::high_res_timer_type getDataTimestamp() const;
00060   bool getRepeatDataFlag() const;
00061   bool getLastOfMultipleUpdateFlag() const;
00062   gr::high_res_timer_type getEventGeneratedTimestamp() const;
00063   int getDroppedFFTFrames() const;
00064 
00065 protected:
00066 
00067 private:
00068   float* _fftPoints;
00069   double* _realDataTimeDomainPoints;
00070   double* _imagDataTimeDomainPoints;
00071   uint64_t _numFFTDataPoints;
00072   uint64_t _numTimeDomainDataPoints;
00073   gr::high_res_timer_type _dataTimestamp;
00074   bool _repeatDataFlag;
00075   bool _lastOfMultipleUpdateFlag;
00076   gr::high_res_timer_type _eventGeneratedTimestamp;
00077   int _droppedFFTFrames;
00078 };
00079 
00080 class SpectrumWindowCaptionEvent:public QEvent{
00081 public:
00082   SpectrumWindowCaptionEvent(const QString&);
00083   ~SpectrumWindowCaptionEvent();
00084   QString getLabel();
00085 
00086 protected:
00087 
00088 private:
00089   QString _labelString;
00090 };
00091 
00092 class SpectrumWindowResetEvent:public QEvent{
00093 public:
00094   SpectrumWindowResetEvent();
00095   ~SpectrumWindowResetEvent();
00096 
00097 protected:
00098 
00099 private:
00100 
00101 };
00102 
00103 class SpectrumFrequencyRangeEvent:public QEvent{
00104 public:
00105   SpectrumFrequencyRangeEvent(const double, const double, const double);
00106   ~SpectrumFrequencyRangeEvent();
00107   double GetCenterFrequency()const;
00108   double GetStartFrequency()const;
00109   double GetStopFrequency()const;
00110 
00111 protected:
00112 
00113 private:
00114   double _centerFrequency;
00115   double _startFrequency;
00116   double _stopFrequency;
00117 };
00118 
00119 
00120 class TimeUpdateEvent: public QEvent
00121 {
00122 public:
00123   TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
00124                   const uint64_t numTimeDomainDataPoints);
00125 
00126   ~TimeUpdateEvent();
00127 
00128   int which() const;
00129   const std::vector<double*> getTimeDomainPoints() const;
00130   uint64_t getNumTimeDomainDataPoints() const;
00131   bool getRepeatDataFlag() const;
00132 
00133   static QEvent::Type Type()
00134       { return QEvent::Type(SpectrumUpdateEventType); }
00135 
00136 protected:
00137 
00138 private:
00139   size_t _nplots;
00140   std::vector<double*> _dataTimeDomainPoints;
00141   uint64_t _numTimeDomainDataPoints;
00142 };
00143 
00144 
00145 /********************************************************************/
00146 
00147 
00148 class FreqUpdateEvent: public QEvent
00149 {
00150 public:
00151   FreqUpdateEvent(const std::vector<double*> dataPoints,
00152                   const uint64_t numDataPoints);
00153 
00154   ~FreqUpdateEvent();
00155 
00156   int which() const;
00157   const std::vector<double*> getPoints() const;
00158   uint64_t getNumDataPoints() const;
00159   bool getRepeatDataFlag() const;
00160 
00161   static QEvent::Type Type()
00162   { return QEvent::Type(SpectrumUpdateEventType); }
00163 
00164 protected:
00165 
00166 private:
00167   size_t _nplots;
00168   std::vector<double*> _dataPoints;
00169   uint64_t _numDataPoints;
00170 };
00171 
00172 
00173 /********************************************************************/
00174 
00175 
00176 class ConstUpdateEvent: public QEvent
00177 {
00178 public:
00179   ConstUpdateEvent(const std::vector<double*> realDataPoints,
00180                    const std::vector<double*> imagDataPoints,
00181                    const uint64_t numDataPoints);
00182 
00183   ~ConstUpdateEvent();
00184 
00185   int which() const;
00186   const std::vector<double*> getRealPoints() const;
00187   const std::vector<double*> getImagPoints() const;
00188   uint64_t getNumDataPoints() const;
00189   bool getRepeatDataFlag() const;
00190 
00191   static QEvent::Type Type()
00192   { return QEvent::Type(SpectrumUpdateEventType); }
00193 
00194 protected:
00195 
00196 private:
00197   size_t _nplots;
00198   std::vector<double*> _realDataPoints;
00199   std::vector<double*> _imagDataPoints;
00200   uint64_t _numDataPoints;
00201 };
00202 
00203 
00204 /********************************************************************/
00205 
00206 
00207 class WaterfallUpdateEvent: public QEvent
00208 {
00209 public:
00210   WaterfallUpdateEvent(const std::vector<double*> dataPoints,
00211                        const uint64_t numDataPoints,
00212                        const gr::high_res_timer_type dataTimestamp);
00213 
00214   ~WaterfallUpdateEvent();
00215 
00216   int which() const;
00217   const std::vector<double*> getPoints() const;
00218   uint64_t getNumDataPoints() const;
00219   bool getRepeatDataFlag() const;
00220 
00221   gr::high_res_timer_type getDataTimestamp() const;
00222 
00223   static QEvent::Type Type()
00224   { return QEvent::Type(SpectrumUpdateEventType); }
00225 
00226 protected:
00227 
00228 private:
00229   size_t _nplots;
00230   std::vector<double*> _dataPoints;
00231   uint64_t _numDataPoints;
00232 
00233   gr::high_res_timer_type _dataTimestamp;
00234 };
00235 
00236 
00237 /********************************************************************/
00238 
00239 
00240 class TimeRasterUpdateEvent: public QEvent
00241 {
00242 public:
00243   TimeRasterUpdateEvent(const std::vector<double*> dataPoints,
00244                         const uint64_t numDataPoints);
00245   ~TimeRasterUpdateEvent();
00246 
00247   int which() const;
00248   const std::vector<double*> getPoints() const;
00249   uint64_t getNumDataPoints() const;
00250   bool getRepeatDataFlag() const;
00251 
00252   static QEvent::Type Type()
00253   { return QEvent::Type(SpectrumUpdateEventType); }
00254 
00255 protected:
00256 
00257 private:
00258   size_t _nplots;
00259   std::vector<double*> _dataPoints;
00260   uint64_t _numDataPoints;
00261 };
00262 
00263 
00264 #endif /* SPECTRUM_UPDATE_EVENTS_H */