From 3ab8badb6ad9c1338a2ebe40df200907f105a6af Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 8 Jul 2022 16:02:50 +0200 Subject: [PATCH] Fixed waterfall being cleared for no reason --- core/src/signal_path/iq_frontend.cpp | 6 +++--- core/src/signal_path/iq_frontend.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/signal_path/iq_frontend.cpp b/core/src/signal_path/iq_frontend.cpp index 6c29eaf4..c77ce160 100644 --- a/core/src/signal_path/iq_frontend.cpp +++ b/core/src/signal_path/iq_frontend.cpp @@ -178,7 +178,7 @@ void IQFrontEnd::removeVFO(std::string name) { void IQFrontEnd::setFFTSize(int size) { _fftSize = size; - updateFFTPath(); + updateFFTPath(true); } void IQFrontEnd::setFFTRate(double rate) { @@ -260,7 +260,7 @@ void IQFrontEnd::handler(dsp::complex_t* data, int count, void* ctx) { _this->_releaseFFTBuffer(_this->_fftCtx); } -void IQFrontEnd::updateFFTPath() { +void IQFrontEnd::updateFFTPath(bool updateWaterfall) { // Temp stop branch reshape.tempStop(); fftSink.tempStop(); @@ -295,7 +295,7 @@ void IQFrontEnd::updateFFTPath() { dsp::buffer::clear(fftInBuf, _fftSize - _nzFFTSize, _nzFFTSize); // Update waterfall (TODO: This is annoying, it makes this module non testable and will constantly clear the waterfall for any reason) - gui::waterfall.setRawFFTSize(_fftSize); + if (updateWaterfall) { gui::waterfall.setRawFFTSize(_fftSize); } // Restart branch reshape.tempStart(); diff --git a/core/src/signal_path/iq_frontend.h b/core/src/signal_path/iq_frontend.h index fedce21f..4a603271 100644 --- a/core/src/signal_path/iq_frontend.h +++ b/core/src/signal_path/iq_frontend.h @@ -48,7 +48,7 @@ public: protected: static void handler(dsp::complex_t* data, int count, void* ctx); - void updateFFTPath(); + void updateFFTPath(bool updateWaterfall = false); static inline double genDCBlockRate(double sampleRate) { return 50.0 / sampleRate;