GPS + orientation for Sonde (#1757)

* RadioSonde has gpsdata
* Orientation update in Sonde
This commit is contained in:
Totoo 2024-01-11 22:17:06 +01:00 committed by GitHub
parent 831dbeaab5
commit 3943848add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 6 deletions

View file

@ -90,7 +90,7 @@ SondeView::SondeView(NavigationView& nav)
};
button_see_map.on_select = [this, &nav](Button&) {
nav.push<GeoMapView>(
geomap_view_ = nav.push<GeoMapView>(
sonde_id,
gps_info.alt,
GeoPos::alt_unit::METERS,
@ -98,6 +98,9 @@ SondeView::SondeView(NavigationView& nav)
gps_info.lat,
gps_info.lon,
999); // set a dummy heading out of range to draw a cross...probably not ideal?
nav.set_on_pop([this]() {
geomap_view_ = nullptr;
});
};
logger = std::make_unique<SondeLogger>();
@ -124,6 +127,17 @@ SondeView::~SondeView() {
audio::output::stop();
}
void SondeView::on_gps(const GPSPosDataMessage* msg) {
if (!geomap_view_)
return;
geomap_view_->update_my_position(msg->lat, msg->lon, msg->altitude);
}
void SondeView::on_orientation(const OrientationDataMessage* msg) {
if (!geomap_view_)
return;
geomap_view_->update_my_orientation(msg->angle, true);
}
void SondeView::focus() {
field_frequency.focus();
}