mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-04-23 05:31:28 +00:00
Make MMSI-formatting function.
Only render nine digits, left zero pad.
This commit is contained in:
parent
4205793b54
commit
64b9bfa35f
@ -156,6 +156,12 @@ static std::string format_latlon_normalized(const int32_t normalized) {
|
|||||||
return to_string_dec_int(degrees) + "." + to_string_dec_int(fraction, 6, '0');
|
return to_string_dec_int(degrees) + "." + to_string_dec_int(fraction, 6, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string format_mmsi(
|
||||||
|
const MMSI& mmsi
|
||||||
|
) {
|
||||||
|
return to_string_dec_uint(mmsi, 9, '0');
|
||||||
|
}
|
||||||
|
|
||||||
static std::string format_datetime(
|
static std::string format_datetime(
|
||||||
const DateTime& datetime
|
const DateTime& datetime
|
||||||
) {
|
) {
|
||||||
@ -405,7 +411,7 @@ void AISView::paint(Painter& painter) {
|
|||||||
|
|
||||||
auto p = r.pos;
|
auto p = r.pos;
|
||||||
for(const auto entry : recent) {
|
for(const auto entry : recent) {
|
||||||
std::string line = to_string_dec_uint(entry.mmsi, 10) + " ";
|
std::string line = baseband::ais::format_mmsi(entry.mmsi) + " ";
|
||||||
if( !entry.name.empty() ) {
|
if( !entry.name.empty() ) {
|
||||||
line += entry.name;
|
line += entry.name;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user