summaryrefslogtreecommitdiff
path: root/gr-qtgui
diff options
context:
space:
mode:
authorTom Rondeau2010-05-10 19:48:41 -0400
committerTom Rondeau2010-05-10 19:48:41 -0400
commit89ceb6c846e5b859d8fdef4fef84093f18efd3da (patch)
tree8a99c1d158ecafe4319fb073f884118fd19bc5e1 /gr-qtgui
parenta45e2a94328fee03910e9dbfa04b48bf9ba15f61 (diff)
downloadgnuradio-89ceb6c846e5b859d8fdef4fef84093f18efd3da.tar.gz
gnuradio-89ceb6c846e5b859d8fdef4fef84093f18efd3da.tar.bz2
gnuradio-89ceb6c846e5b859d8fdef4fef84093f18efd3da.zip
Simple code cleanup.
Diffstat (limited to 'gr-qtgui')
-rw-r--r--gr-qtgui/src/lib/spectrumUpdateEvents.cc19
-rw-r--r--gr-qtgui/src/lib/spectrumUpdateEvents.h33
2 files changed, 34 insertions, 18 deletions
diff --git a/gr-qtgui/src/lib/spectrumUpdateEvents.cc b/gr-qtgui/src/lib/spectrumUpdateEvents.cc
index 350e3eeb2..53a205fb7 100644
--- a/gr-qtgui/src/lib/spectrumUpdateEvents.cc
+++ b/gr-qtgui/src/lib/spectrumUpdateEvents.cc
@@ -15,15 +15,19 @@ SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
const int droppedFFTFrames)
: QEvent(QEvent::Type(10005))
{
- _numFFTDataPoints = numFFTDataPoints;
- if(_numFFTDataPoints < 1){
+ if(numFFTDataPoints < 1) {
_numFFTDataPoints = 1;
}
+ else {
+ _numFFTDataPoints = numFFTDataPoints;
+ }
- _numTimeDomainDataPoints = numTimeDomainDataPoints;
- if(_numTimeDomainDataPoints < 1){
+ if(numTimeDomainDataPoints < 1) {
_numTimeDomainDataPoints = 1;
}
+ else {
+ _numTimeDomainDataPoints = numTimeDomainDataPoints;
+ }
_fftPoints = new std::complex<float>[_numFFTDataPoints];
_fftPoints[0] = std::complex<float>(0,0);
@@ -31,14 +35,14 @@ SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
_realDataTimeDomainPoints = new double[_numTimeDomainDataPoints];
memset(_realDataTimeDomainPoints, 0x0, _numTimeDomainDataPoints*sizeof(double));
- if(numTimeDomainDataPoints > 0){
+ if(numTimeDomainDataPoints > 0) {
memcpy(_realDataTimeDomainPoints, realTimeDomainPoints,
numTimeDomainDataPoints*sizeof(double));
}
_imagDataTimeDomainPoints = new double[_numTimeDomainDataPoints];
memset(_imagDataTimeDomainPoints, 0x0, _numTimeDomainDataPoints*sizeof(double));
- if(numTimeDomainDataPoints > 0){
+ if(numTimeDomainDataPoints > 0) {
memcpy(_imagDataTimeDomainPoints, imagTimeDomainPoints,
numTimeDomainDataPoints*sizeof(double));
}
@@ -49,7 +53,8 @@ SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
_droppedFFTFrames = droppedFFTFrames;
}
-SpectrumUpdateEvent::~SpectrumUpdateEvent(){
+SpectrumUpdateEvent::~SpectrumUpdateEvent()
+{
delete[] _fftPoints;
delete[] _realDataTimeDomainPoints;
delete[] _imagDataTimeDomainPoints;
diff --git a/gr-qtgui/src/lib/spectrumUpdateEvents.h b/gr-qtgui/src/lib/spectrumUpdateEvents.h
index 9c46d4bf3..ccc072c3e 100644
--- a/gr-qtgui/src/lib/spectrumUpdateEvents.h
+++ b/gr-qtgui/src/lib/spectrumUpdateEvents.h
@@ -10,18 +10,29 @@
class SpectrumUpdateEvent:public QEvent{
public:
- SpectrumUpdateEvent(const std::complex<float>* fftPoints, const uint64_t numFFTDataPoints, const double* realTimeDomainPoints, const double* imagTimeDomainPoints, const uint64_t numTimeDomainDataPoints, const timespec dataTimestamp, const bool repeatDataFlag, const bool lastOfMultipleUpdateFlag, const timespec generatedTimestamp, const int droppedFFTFrames);
+ SpectrumUpdateEvent(const std::complex<float>* fftPoints,
+ const uint64_t numFFTDataPoints,
+ const double* realTimeDomainPoints,
+ const double* imagTimeDomainPoints,
+ const uint64_t numTimeDomainDataPoints,
+ const timespec dataTimestamp,
+ const bool repeatDataFlag,
+ const bool lastOfMultipleUpdateFlag,
+ const timespec generatedTimestamp,
+ const int droppedFFTFrames);
+
~SpectrumUpdateEvent();
- const std::complex<float>* getFFTPoints()const;
- const double* getRealTimeDomainPoints()const;
- const double* getImagTimeDomainPoints()const;
- uint64_t getNumFFTDataPoints()const;
- uint64_t getNumTimeDomainDataPoints()const;
- timespec getDataTimestamp()const;
- bool getRepeatDataFlag()const;
- bool getLastOfMultipleUpdateFlag()const;
- timespec getEventGeneratedTimestamp()const;
- int getDroppedFFTFrames()const;
+
+ const std::complex<float>* getFFTPoints() const;
+ const double* getRealTimeDomainPoints() const;
+ const double* getImagTimeDomainPoints() const;
+ uint64_t getNumFFTDataPoints() const;
+ uint64_t getNumTimeDomainDataPoints() const;
+ timespec getDataTimestamp() const;
+ bool getRepeatDataFlag() const;
+ bool getLastOfMultipleUpdateFlag() const;
+ timespec getEventGeneratedTimestamp() const;
+ int getDroppedFFTFrames() const;
protected: