mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-22 05:44:31 -04:00
Fix ADS-B not updating Altitude in Map #473
This commit will fix altitude not automatically updating when in Map mode. Also set default altitude for AIS to 0.
This commit is contained in:
parent
f42479c190
commit
7af7279ea4
5 changed files with 7 additions and 5 deletions
|
@ -240,7 +240,7 @@ AISRecentEntryDetailView::AISRecentEntryDetailView(NavigationView& nav) {
|
||||||
|
|
||||||
void AISRecentEntryDetailView::update_position() {
|
void AISRecentEntryDetailView::update_position() {
|
||||||
if (send_updates)
|
if (send_updates)
|
||||||
geomap_view->update_position(ais::format::latlon_float(entry_.last_position.latitude.normalized()), ais::format::latlon_float(entry_.last_position.longitude.normalized()), (float)entry_.last_position.true_heading);
|
geomap_view->update_position(ais::format::latlon_float(entry_.last_position.latitude.normalized()), ais::format::latlon_float(entry_.last_position.longitude.normalized()), (float)entry_.last_position.true_heading, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AISRecentEntryDetailView::focus() {
|
void AISRecentEntryDetailView::focus() {
|
||||||
|
|
|
@ -261,7 +261,7 @@ void ADSBRxDetailsView::update(const AircraftRecentEntry& entry) {
|
||||||
text_frame_pos_odd.set(to_string_hex_array(entry_copy.frame_pos_odd.get_raw_data(), 14));
|
text_frame_pos_odd.set(to_string_hex_array(entry_copy.frame_pos_odd.get_raw_data(), 14));
|
||||||
|
|
||||||
if (send_updates)
|
if (send_updates)
|
||||||
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, entry_copy.velo.heading);
|
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, entry_copy.velo.heading, entry_copy.pos.altitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
ADSBRxDetailsView::~ADSBRxDetailsView() {
|
ADSBRxDetailsView::~ADSBRxDetailsView() {
|
||||||
|
|
|
@ -351,7 +351,7 @@ void APRSDetailsView::update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_updates)
|
if (send_updates)
|
||||||
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, 0);
|
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
APRSDetailsView::~APRSDetailsView() {
|
APRSDetailsView::~APRSDetailsView() {
|
||||||
|
|
|
@ -253,14 +253,16 @@ void GeoMapView::focus() {
|
||||||
nav_.display_modal("No map", "No world_map.bin file in\n/ADSB/ directory", ABORT, nullptr);
|
nav_.display_modal("No map", "No world_map.bin file in\n/ADSB/ directory", ABORT, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoMapView::update_position(float lat, float lon, uint16_t angle) {
|
void GeoMapView::update_position(float lat, float lon, uint16_t angle, int32_t altitude) {
|
||||||
lat_ = lat;
|
lat_ = lat;
|
||||||
lon_ = lon;
|
lon_ = lon;
|
||||||
|
altitude_ = altitude;
|
||||||
|
|
||||||
// Stupid hack to avoid an event loop
|
// Stupid hack to avoid an event loop
|
||||||
geopos.set_report_change(false);
|
geopos.set_report_change(false);
|
||||||
geopos.set_lat(lat_);
|
geopos.set_lat(lat_);
|
||||||
geopos.set_lon(lon_);
|
geopos.set_lon(lon_);
|
||||||
|
geopos.set_altitude(altitude_);
|
||||||
geopos.set_report_change(true);
|
geopos.set_report_change(true);
|
||||||
|
|
||||||
geomap.set_angle(angle);
|
geomap.set_angle(angle);
|
||||||
|
|
|
@ -177,7 +177,7 @@ public:
|
||||||
|
|
||||||
void focus() override;
|
void focus() override;
|
||||||
|
|
||||||
void update_position(float lat, float lon, uint16_t angle);
|
void update_position(float lat, float lon, uint16_t angle, int32_t altitude);
|
||||||
|
|
||||||
std::string title() const override { return "Map view"; };
|
std::string title() const override { return "Map view"; };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue