mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-23 23:38:02 +00:00
AIS decoding and really bad UI.
The decoder needs a serious refactoring/decoupling. The UI just dumps bits of the received packets into a console window, whcih scrolls too quickly in an AIS-dense area with a good antenna.
This commit is contained in:
@@ -167,6 +167,7 @@ CPPSRC = main.cpp \
|
||||
ui_spectrum.cpp \
|
||||
receiver_model.cpp \
|
||||
spectrum_color_lut.cpp \
|
||||
ais_baseband.cpp \
|
||||
../common/utility.cpp \
|
||||
../common/chibios_cpp.cpp \
|
||||
../common/debug.cpp \
|
||||
|
@@ -27,6 +27,8 @@
|
||||
#include "portapack.hpp"
|
||||
using namespace portapack;
|
||||
|
||||
#include "ais_baseband.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
/* BasebandBandwidthField ************************************************/
|
||||
@@ -496,8 +498,8 @@ ReceiverView::~ReceiverView() {
|
||||
void ReceiverView::on_show() {
|
||||
context().message_map.register_handler(Message::ID::FSKPacket,
|
||||
[this](Message* const p) {
|
||||
auto message = static_cast<FSKPacketMessage*>(p);
|
||||
(void)message;
|
||||
const auto message = static_cast<const FSKPacketMessage*>(p);
|
||||
this->on_packet_ais(*message);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -506,7 +508,13 @@ void ReceiverView::on_hide() {
|
||||
context().message_map.unregister_handler(Message::ID::FSKPacket);
|
||||
}
|
||||
|
||||
void ReceiverView::on_packet_ais(const FSKPacketMessage& message) {
|
||||
const auto result = baseband::ais::packet_decode(message.packet.payload, message.packet.bits_received);
|
||||
|
||||
auto console = reinterpret_cast<Console*>(widget_content.get());
|
||||
if( result.first == "OK" ) {
|
||||
console->writeln(result.second);
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiverView::focus() {
|
||||
|
@@ -415,6 +415,7 @@ private:
|
||||
{ " AM ", 0 },
|
||||
{ "NFM ", 1 },
|
||||
{ "WFM ", 2 },
|
||||
{ "AIS ", 3 },
|
||||
{ "SPEC", 4 },
|
||||
}
|
||||
};
|
||||
@@ -470,6 +471,8 @@ private:
|
||||
void on_headphone_volume_changed(int32_t v);
|
||||
// void on_baseband_oversampling_changed(int32_t v);
|
||||
void on_edit_frequency();
|
||||
|
||||
void on_packet_ais(const FSKPacketMessage& message);
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
Reference in New Issue
Block a user