Add missing message handler for wideband spectrum.

Spectrum processing was not enabled, and hence wideband spectrum was not being displayed.
This commit is contained in:
Jared Boone 2016-01-11 16:31:49 -08:00
parent 55e3a70fde
commit 1f3c182b7f
2 changed files with 22 additions and 1 deletions

View file

@ -64,7 +64,24 @@ void WidebandSpectrum::execute(const buffer_c8_t& buffer) {
} }
void WidebandSpectrum::on_message(const Message* const message) { void WidebandSpectrum::on_message(const Message* const message) {
if( message->id == Message::ID::UpdateSpectrum ) { switch(message->id) {
case Message::ID::UpdateSpectrum:
channel_spectrum.update(); channel_spectrum.update();
break;
case Message::ID::SpectrumStreamingConfig:
streaming_config(*reinterpret_cast<const SpectrumStreamingConfigMessage*>(message));
break;
default:
break;
}
}
void WidebandSpectrum::streaming_config(const SpectrumStreamingConfigMessage& message) {
if( message.mode == SpectrumStreamingConfigMessage::Mode::Running ) {
channel_spectrum.start();
} else {
channel_spectrum.stop();
} }
} }

View file

@ -25,6 +25,8 @@
#include "baseband_processor.hpp" #include "baseband_processor.hpp"
#include "spectrum_collector.hpp" #include "spectrum_collector.hpp"
#include "message.hpp"
#include <cstddef> #include <cstddef>
#include <array> #include <array>
#include <complex> #include <complex>
@ -39,6 +41,8 @@ private:
SpectrumCollector channel_spectrum; SpectrumCollector channel_spectrum;
std::array<complex16_t, 256> spectrum; std::array<complex16_t, 256> spectrum;
void streaming_config(const SpectrumStreamingConfigMessage& message);
}; };
#endif/*__PROC_WIDEBAND_SPECTRUM_H__*/ #endif/*__PROC_WIDEBAND_SPECTRUM_H__*/