Add extra info from serial (#1754)

* Inject GPS postition from serial
This commit is contained in:
Totoo 2024-01-11 17:46:35 +01:00 committed by GitHub
parent 49e719ded8
commit 831dbeaab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 154 additions and 0 deletions

View file

@ -185,6 +185,9 @@ class GeoMap : public Widget {
bool on_encoder(const EncoderEvent delta) override;
bool on_keyboard(const KeyboardEvent event) override;
void update_my_position(float lat, float lon, int32_t altitude);
void update_my_orientation(uint16_t angle);
bool init();
void set_mode(GeoMapMode mode);
void set_manual_panning(bool v);
@ -212,6 +215,7 @@ class GeoMap : public Widget {
void draw_bearing(const Point origin, const uint16_t angle, uint32_t size, const Color color);
void draw_marker(Painter& painter, const ui::Point itemPoint, const uint16_t itemAngle, const std::string itemTag, const Color color = Color::red(), const Color fontColor = Color::white(), const Color backColor = Color::black());
void draw_markers(Painter& painter);
void draw_mypos();
void map_read_line(ui::Color* buffer, uint16_t pixels);
bool manual_panning_{false};
@ -233,6 +237,12 @@ class GeoMap : public Widget {
uint16_t angle_{};
std::string tag_{};
// the portapack's position data ( for example injected from serial )
float my_lat{200};
float my_lon{200};
int32_t my_altitude{0};
uint16_t my_angle{400};
int markerListLen{0};
GeoMarker markerList[NumMarkerListElements];
bool markerListUpdated{false};
@ -267,6 +277,8 @@ class GeoMapView : public View {
void focus() override;
void update_position(float lat, float lon, uint16_t angle, int32_t altitude, int32_t speed = 0);
void update_my_position(float lat, float lon, int32_t altitude);
void update_my_orientation(uint16_t angle);
std::string title() const override { return "Map view"; };