mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 09:09:29 +00:00
AISView displays list of most recent packets -- MMSI and name or call sign.
Formerly scrolling console of packets.
This commit is contained in:
@@ -34,6 +34,7 @@ using namespace lpc43xx;
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <bitset>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
namespace baseband {
|
||||
@@ -115,14 +116,43 @@ private:
|
||||
|
||||
namespace ui {
|
||||
|
||||
class AISView : public Console {
|
||||
class AISView : public View {
|
||||
public:
|
||||
void on_show() override;
|
||||
void on_hide() override;
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
private:
|
||||
AISModel model;
|
||||
|
||||
struct Position {
|
||||
rtc::RTC timestamp { };
|
||||
baseband::ais::Latitude latitude { 0 };
|
||||
baseband::ais::Longitude longitude { 0 };
|
||||
};
|
||||
|
||||
struct RecentEntry {
|
||||
baseband::ais::MMSI mmsi;
|
||||
std::string name;
|
||||
std::string call_sign;
|
||||
std::string destination;
|
||||
Position last_position;
|
||||
size_t received_count;
|
||||
int8_t navigational_status;
|
||||
|
||||
RecentEntry(
|
||||
const baseband::ais::MMSI& mmsi
|
||||
) : mmsi { mmsi },
|
||||
last_position { },
|
||||
received_count { 0 },
|
||||
navigational_status { -1 }
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
std::list<RecentEntry> recent;
|
||||
|
||||
void log(const baseband::ais::Packet& packet);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user