mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-17 13:23:28 +00:00
Started working on radiosonde RX
Removed some warnings Better handling of absent map file in GeoMap ?
This commit is contained in:
@@ -173,9 +173,8 @@ void GeoMap::move(const float lon, const float lat) {
|
||||
|
||||
bool GeoMap::init() {
|
||||
auto result = map_file.open("ADSB/world_map.bin");
|
||||
if (result.is_valid()) {
|
||||
if (result.is_valid())
|
||||
return false;
|
||||
}
|
||||
|
||||
map_file.read(&map_width, 2);
|
||||
map_file.read(&map_height, 2);
|
||||
@@ -210,9 +209,9 @@ void GeoMap::draw_bearing(const Point origin, const uint32_t angle, uint32_t siz
|
||||
}
|
||||
|
||||
void GeoMapView::focus() {
|
||||
if (!file_error) {
|
||||
geopos.focus();
|
||||
} else
|
||||
geopos.focus();
|
||||
|
||||
if (!file_error)
|
||||
nav_.display_modal("No map", "No world_map.bin file in\n/ADSB/ directory", ABORT, nullptr);
|
||||
}
|
||||
|
||||
@@ -226,10 +225,7 @@ void GeoMapView::update_position(float lat, float lon) {
|
||||
}
|
||||
|
||||
void GeoMapView::setup() {
|
||||
add_children({
|
||||
&geopos,
|
||||
&geomap
|
||||
});
|
||||
add_child(&geomap);
|
||||
|
||||
geopos.set_altitude(altitude_);
|
||||
geopos.set_lat(lat_);
|
||||
@@ -282,6 +278,8 @@ GeoMapView::GeoMapView(
|
||||
{
|
||||
mode_ = DISPLAY;
|
||||
|
||||
add_child(&geopos);
|
||||
|
||||
file_error = !geomap.init();
|
||||
if (file_error) return;
|
||||
|
||||
@@ -308,6 +306,8 @@ GeoMapView::GeoMapView(
|
||||
{
|
||||
mode_ = PROMPT;
|
||||
|
||||
add_child(&geopos);
|
||||
|
||||
file_error = !geomap.init();
|
||||
if (file_error) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user