GeoPos stored a coordinate's sign only in its degrees NumberField, which
is an int32_t and therefore has no negative zero. Any coordinate whose
integer degrees part is 0 but which is negative (i.e. strictly between
0.0 and -1.0) could not be represented at all:
- set_lat()/set_lon() passed the raw float to the degrees field, so
-0.2933 truncated to 0 and the sign was gone before it reached the
widget.
- lat()/lon() then decided the sign with `field_lon_degrees.value() < 0`,
which is false for 0, so the value came back positive.
The reporter's airport is at longitude -0.2933, which was impossible to
enter in the ADSB Tx app.
Give each coordinate an explicit hemisphere field (N/S and E/W) and make
the degrees field an unsigned magnitude:
- The hemisphere OptionsField is the single source of the sign, so
"negative with zero degrees" is now representable.
- set_lat()/set_lon() derive the hemisphere from the sign of the input
and feed the fields the magnitude.
- lat()/lon() read the hemisphere instead of inferring the sign from
the degrees value.
- The minutes on_wrap handlers no longer need to flip the carry
direction based on the degrees sign, since degrees is now a
magnitude; the carry is the same in both hemispheres.
- The degrees fields no longer loop, so carrying below 0 clamps at 0
instead of wrapping round to 90/180.
The hemisphere indicator occupies the column that the 4-wide signed
degrees field used for its minus sign, so the row layout, the degree
symbol and the decimal readout all stay where they were.
Fixes#3234
Replace Alt: with CoG: and Spd: with SoG: in the Map view to better align with standard marine navigation terminology and the AIS Rx screen.
- Alt (Altitude) → CoG (Course over Ground)
- Spd (Speed) → SoG (Speed over Ground)
Rationale: AIS is primarily used for marine navigation where altitude is typically zero (sea level), while Course over Ground is essential navigation information. This change provides consistency with the AIS Rx screen which already displays CoG and SoG.
Modified files:
- firmware/application/ui/ui_geomap.hpp
- firmware/standalone/common/ui/ui_geomap.hpp
* Update geomap view position on GPS data reception
* Refactor timestamp and temperature/humidity display formatting in SondeView
* Implement battery voltage reading for Meteomodem M20
* Enhance GPS data validation and update OSM zoom handling
- Introduced a new method to validate GPS data in the Packet structure.
- Updated the SondeView to use the new GPS validation method.
- Modified GeoMap to improve handling of OSM zoom levels and ensure consistent usage of real zoom values.
- Adjusted battery voltage calculation for Meteomodem M20 to ensure correct scaling.
* Add serial number extraction for Meteomodem M20 support
* Add support for Meteomodem M20 temperature and humidity readings
* Update log file naming to include timestamp in SondeView
* Add pressure reading support for Meteomodem M20 and update UI
* Update SondeView UI layout and enhance Meteomodem M20 packet handling
* Add vertical speed calculation and display to SondeView
* Fix set_fsk function parameter type for samplesPerSymbol
* Increase Geomap zoom-in ability
* Use floating point for current position
* Show grid squares when zoomed in too much for map
* Zoom in fast after exceeding map resolution & clean up redundant code
* Revert order of functions to make it easier to review
* Changed grid color for better contrast with markers
* Optimizations
* Set x_pos/x_pos to center pixel versus upper left corner
* Show more distant planes when zoomed out
* Correct pixel offset when zooming in
* Fix oops in x_pos/y_pos centering change
* Wrapping support for lat/lon fields
* Wrapping support (for Geomap lat/lon fields)
* Handle wrapping for negative lat/lon
* Initial commit for keyboard emulation
* Added on_keyboard to some widgets
* TextEdit partly
* Multi key send at once
* Frequency control support
* Fix encoder emulation
* Add keyboard to geomap
* More widgets
* Added fonts viewer (debug) app
* Added fonts viewer (debug) app
* Clang
* Use degree symbol vs asterisk for latitude/longitude degrees
* Save a few bytes by not overriding on_key
* Save a few bytes by not overriding on_key
* Clang
* Consolidate styles into a Styles class and clean up code
* Format
* Add style_bg_dark_grey for nav bar
* Fix bugs found in PR
* Rename styles
* Add bg_white style
---------
Co-authored-by: kallanreed <kallanreed@outlook.com>
Co-authored-by: gullradriel <3157857+gullradriel@users.noreply.github.com>