diff options
Diffstat (limited to 'gr-qtgui')
-rw-r--r-- | gr-qtgui/lib/spectrumUpdateEvents.cc | 56 | ||||
-rw-r--r-- | gr-qtgui/lib/spectrumUpdateEvents.h | 26 |
2 files changed, 82 insertions, 0 deletions
diff --git a/gr-qtgui/lib/spectrumUpdateEvents.cc b/gr-qtgui/lib/spectrumUpdateEvents.cc index 53a205fb7..ab5ef3be5 100644 --- a/gr-qtgui/lib/spectrumUpdateEvents.cc +++ b/gr-qtgui/lib/spectrumUpdateEvents.cc @@ -177,4 +177,60 @@ SpectrumFrequencyRangeEvent::GetStopFrequency() const return _stopFrequency; } + +/***************************************************************************/ + +TimeUpdateEvent::TimeUpdateEvent(const gr_complex *timeDomainPoints, + const uint64_t numTimeDomainDataPoints, + const timespec dataTimestamp, + const bool repeatDataFlag) + : QEvent(QEvent::Type(10005)) +{ + if(numTimeDomainDataPoints < 1) { + _numTimeDomainDataPoints = 1; + } + else { + _numTimeDomainDataPoints = numTimeDomainDataPoints; + } + + _dataTimeDomainPoints = new gr_complex[_numTimeDomainDataPoints]; + memset(_dataTimeDomainPoints, 0x0, _numTimeDomainDataPoints*sizeof(gr_complex)); + if(numTimeDomainDataPoints > 0) { + memcpy(_dataTimeDomainPoints, timeDomainPoints, + numTimeDomainDataPoints*sizeof(gr_complex)); + } + + _dataTimestamp = dataTimestamp; + _repeatDataFlag = repeatDataFlag; +} + +TimeUpdateEvent::~TimeUpdateEvent() +{ + delete[] _dataTimeDomainPoints; +} + +const gr_complex* +TimeUpdateEvent::getTimeDomainPoints() const +{ + return _dataTimeDomainPoints; +} + +uint64_t +TimeUpdateEvent::getNumTimeDomainDataPoints() const +{ + return _numTimeDomainDataPoints; +} + +timespec +TimeUpdateEvent::getDataTimestamp() const +{ + return _dataTimestamp; +} + +bool +TimeUpdateEvent::getRepeatDataFlag() const +{ + return _repeatDataFlag; +} + #endif /* SPECTRUM_UPDATE_EVENTS_C */ diff --git a/gr-qtgui/lib/spectrumUpdateEvents.h b/gr-qtgui/lib/spectrumUpdateEvents.h index ccc072c3e..fcebd5d5a 100644 --- a/gr-qtgui/lib/spectrumUpdateEvents.h +++ b/gr-qtgui/lib/spectrumUpdateEvents.h @@ -6,6 +6,7 @@ #include <QString> #include <complex> #include <highResTimeFunctions.h> +#include <gr_complex.h> class SpectrumUpdateEvent:public QEvent{ @@ -89,4 +90,29 @@ private: }; +class TimeUpdateEvent: public QEvent +{ +public: + TimeUpdateEvent(const gr_complex *timeDomainPoints, + const uint64_t numTimeDomainDataPoints, + const timespec dataTimestamp, + const bool repeatDataFlag); + + ~TimeUpdateEvent(); + + const gr_complex *getTimeDomainPoints() const; + uint64_t getNumTimeDomainDataPoints() const; + timespec getDataTimestamp() const; + bool getRepeatDataFlag() const; + +protected: + +private: + gr_complex *_dataTimeDomainPoints; + uint64_t _numTimeDomainDataPoints; + timespec _dataTimestamp; + bool _repeatDataFlag; +}; + + #endif /* SPECTRUM_UPDATE_EVENTS_H */ |