AISView displays list of most recent packets -- MMSI and name or call sign.

Formerly scrolling console of packets.
This commit is contained in:
Jared Boone
2015-12-03 20:34:02 -08:00
parent 0cad2847f8
commit 3644bfd983
2 changed files with 92 additions and 26 deletions
+31 -1
View File
@@ -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);
};