AISView RecentEntry UI selection by encoder.

This commit is contained in:
Jared Boone
2015-12-05 14:24:41 -08:00
parent 27684069c5
commit 9791d64b50
2 changed files with 56 additions and 2 deletions
+14 -1
View File
@@ -37,6 +37,8 @@ using namespace lpc43xx;
#include <list>
#include <utility>
#include <iterator>
namespace baseband {
namespace ais {
@@ -130,9 +132,15 @@ public:
void on_focus() override;
void on_blur() override;
bool on_encoder(const EncoderEvent event) override;
private:
AISModel model;
using EntryKey = baseband::ais::MMSI;
EntryKey selected_key;
const EntryKey invalid_key = 0xffffffff;
bool has_focus = false;
struct Position {
@@ -160,9 +168,14 @@ private:
}
};
std::list<RecentEntry> recent;
using RecentEntries = std::list<RecentEntry>;
RecentEntries recent;
void on_packet(const baseband::ais::Packet& packet);
RecentEntries::iterator selected_entry();
void advance(const int32_t amount);
};
} /* namespace ui */