summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/spectrumUpdateEvents.cc
diff options
context:
space:
mode:
authorManoj Gudi2013-10-07 20:19:55 +0530
committerManoj Gudi2013-10-07 20:20:35 +0530
commit1826d0763c8595997f5f4af1fdb0354e9c0998ad (patch)
treeacbd852cd5a1bf17241b1038b5e37a0e72e64612 /gr-qtgui/lib/spectrumUpdateEvents.cc
parent452defdb4a78e9e826740ddf4b9673e926c568a4 (diff)
parent24b640997ba7fee0c725e65f401f5cbebdab8d08 (diff)
downloadgnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.gz
gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.bz2
gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.zip
README change
Diffstat (limited to 'gr-qtgui/lib/spectrumUpdateEvents.cc')
-rw-r--r--gr-qtgui/lib/spectrumUpdateEvents.cc223
1 files changed, 223 insertions, 0 deletions
diff --git a/gr-qtgui/lib/spectrumUpdateEvents.cc b/gr-qtgui/lib/spectrumUpdateEvents.cc
new file mode 100644
index 000000000..bec39747b
--- /dev/null
+++ b/gr-qtgui/lib/spectrumUpdateEvents.cc
@@ -0,0 +1,223 @@
+#ifndef SPECTRUM_UPDATE_EVENTS_C
+#define SPECTRUM_UPDATE_EVENTS_C
+
+#include <spectrumUpdateEvents.h>
+
+SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
+ const uint64_t numFFTDataPoints,
+ const double* realTimeDomainPoints,
+ const double* imagTimeDomainPoints,
+ const uint64_t numTimeDomainDataPoints,
+ const gruel::high_res_timer_type dataTimestamp,
+ const bool repeatDataFlag,
+ const bool lastOfMultipleUpdateFlag,
+ const gruel::high_res_timer_type generatedTimestamp,
+ const int droppedFFTFrames)
+ : QEvent(QEvent::Type(10005))
+{
+ if(numFFTDataPoints < 1) {
+ _numFFTDataPoints = 1;
+ }
+ else {
+ _numFFTDataPoints = numFFTDataPoints;
+ }
+
+ if(numTimeDomainDataPoints < 1) {
+ _numTimeDomainDataPoints = 1;
+ }
+ else {
+ _numTimeDomainDataPoints = numTimeDomainDataPoints;
+ }
+
+ _fftPoints = new std::complex<float>[_numFFTDataPoints];
+ _fftPoints[0] = std::complex<float>(0,0);
+ memcpy(_fftPoints, fftPoints, numFFTDataPoints*sizeof(std::complex<float>));
+
+ _realDataTimeDomainPoints = new double[_numTimeDomainDataPoints];
+ memset(_realDataTimeDomainPoints, 0x0, _numTimeDomainDataPoints*sizeof(double));
+ if(numTimeDomainDataPoints > 0) {
+ memcpy(_realDataTimeDomainPoints, realTimeDomainPoints,
+ numTimeDomainDataPoints*sizeof(double));
+ }
+
+ _imagDataTimeDomainPoints = new double[_numTimeDomainDataPoints];
+ memset(_imagDataTimeDomainPoints, 0x0, _numTimeDomainDataPoints*sizeof(double));
+ if(numTimeDomainDataPoints > 0) {
+ memcpy(_imagDataTimeDomainPoints, imagTimeDomainPoints,
+ numTimeDomainDataPoints*sizeof(double));
+ }
+ _dataTimestamp = dataTimestamp;
+ _repeatDataFlag = repeatDataFlag;
+ _lastOfMultipleUpdateFlag = lastOfMultipleUpdateFlag;
+ _eventGeneratedTimestamp = generatedTimestamp;
+ _droppedFFTFrames = droppedFFTFrames;
+}
+
+SpectrumUpdateEvent::~SpectrumUpdateEvent()
+{
+ delete[] _fftPoints;
+ delete[] _realDataTimeDomainPoints;
+ delete[] _imagDataTimeDomainPoints;
+}
+
+const std::complex<float>*
+SpectrumUpdateEvent::getFFTPoints() const
+{
+ return _fftPoints;
+}
+
+const double*
+SpectrumUpdateEvent::getRealTimeDomainPoints() const
+{
+ return _realDataTimeDomainPoints;
+}
+
+const double*
+SpectrumUpdateEvent::getImagTimeDomainPoints() const
+{
+ return _imagDataTimeDomainPoints;
+}
+
+uint64_t
+SpectrumUpdateEvent::getNumFFTDataPoints() const
+{
+ return _numFFTDataPoints;
+}
+
+uint64_t
+SpectrumUpdateEvent::getNumTimeDomainDataPoints() const
+{
+ return _numTimeDomainDataPoints;
+}
+
+gruel::high_res_timer_type
+SpectrumUpdateEvent::getDataTimestamp() const
+{
+ return _dataTimestamp;
+}
+
+bool
+SpectrumUpdateEvent::getRepeatDataFlag() const
+{
+ return _repeatDataFlag;
+}
+
+bool
+SpectrumUpdateEvent::getLastOfMultipleUpdateFlag() const
+{
+ return _lastOfMultipleUpdateFlag;
+}
+
+gruel::high_res_timer_type
+SpectrumUpdateEvent::getEventGeneratedTimestamp() const
+{
+ return _eventGeneratedTimestamp;
+}
+
+int
+SpectrumUpdateEvent::getDroppedFFTFrames() const
+{
+ return _droppedFFTFrames;
+}
+
+SpectrumWindowCaptionEvent::SpectrumWindowCaptionEvent(const QString& newLbl)
+ : QEvent(QEvent::Type(10008))
+{
+ _labelString = newLbl;
+}
+
+SpectrumWindowCaptionEvent::~SpectrumWindowCaptionEvent()
+{
+}
+
+QString
+SpectrumWindowCaptionEvent::getLabel()
+{
+ return _labelString;
+}
+
+SpectrumWindowResetEvent::SpectrumWindowResetEvent()
+ : QEvent(QEvent::Type(10009))
+{
+}
+
+SpectrumWindowResetEvent::~SpectrumWindowResetEvent()
+{
+}
+
+SpectrumFrequencyRangeEvent::SpectrumFrequencyRangeEvent(const double centerFreq,
+ const double startFreq,
+ const double stopFreq)
+ : QEvent(QEvent::Type(10010))
+{
+ _centerFrequency = centerFreq;
+ _startFrequency = startFreq;
+ _stopFrequency = stopFreq;
+}
+
+SpectrumFrequencyRangeEvent::~SpectrumFrequencyRangeEvent()
+{
+}
+
+double
+SpectrumFrequencyRangeEvent::GetCenterFrequency() const
+{
+ return _centerFrequency;
+}
+
+double
+SpectrumFrequencyRangeEvent::GetStartFrequency() const
+{
+ return _startFrequency;
+}
+
+double
+SpectrumFrequencyRangeEvent::GetStopFrequency() const
+{
+ return _stopFrequency;
+}
+
+
+/***************************************************************************/
+#include <iostream>
+TimeUpdateEvent::TimeUpdateEvent(const std::vector<double*> timeDomainPoints,
+ const uint64_t numTimeDomainDataPoints)
+ : QEvent(QEvent::Type(10005))
+{
+ if(numTimeDomainDataPoints < 1) {
+ _numTimeDomainDataPoints = 1;
+ }
+ else {
+ _numTimeDomainDataPoints = numTimeDomainDataPoints;
+ }
+
+ _nplots = timeDomainPoints.size();
+ for(size_t i = 0; i < _nplots; i++) {
+ _dataTimeDomainPoints.push_back(new double[_numTimeDomainDataPoints]);
+ if(numTimeDomainDataPoints > 0) {
+ memcpy(_dataTimeDomainPoints[i], timeDomainPoints[i],
+ _numTimeDomainDataPoints*sizeof(double));
+ }
+ }
+}
+
+TimeUpdateEvent::~TimeUpdateEvent()
+{
+ for(size_t i = 0; i < _nplots; i++) {
+ delete[] _dataTimeDomainPoints[i];
+ }
+}
+
+const std::vector<double*>
+TimeUpdateEvent::getTimeDomainPoints() const
+{
+ return _dataTimeDomainPoints;
+}
+
+uint64_t
+TimeUpdateEvent::getNumTimeDomainDataPoints() const
+{
+ return _numTimeDomainDataPoints;
+}
+
+#endif /* SPECTRUM_UPDATE_EVENTS_C */