waypoints: attempt to fix marking.

master
Pavel Machek 2024-06-03 22:09:28 +02:00
parent c519def208
commit 804f86e6c9
1 changed files with 5 additions and 7 deletions

View File

@ -39,7 +39,7 @@ function mainMenu() {
} }
menu["Remove"]=removeCard; menu["Remove"]=removeCard;
menu["Format"]=setFormat; menu["Format"]=setFormat;
if (textInputInstalled) { if (textInputInstalled && BANGLEJS2) {
menu["Mark GPS"]=markGps; menu["Mark GPS"]=markGps;
} }
g.clear(); g.clear();
@ -47,17 +47,16 @@ function mainMenu() {
} }
function updateGps() { function updateGps() {
let lat = "lat", lon = "lon", alt = "alt", speed = "speed"; let pos = "lat/lon", alt = "alt", speed = "speed";
if (cancel_gps) if (cancel_gps)
return; return;
fix = Bangle.getGPSFix(); fix = Bangle.getGPSFix();
speed = "no fix for " + (getTime() - gps_start).toFixed(0) + "s"; speed = "no fix (" + (getTime() - gps_start).toFixed(0) + "s)";
if (fix && fix.fix && fix.lat) { if (fix && fix.fix && fix.lat) {
lat = "" + lat(fix.lat); pos = "" + lat(fix.lat) + " " + lon(fix.lon);
lon = "" + lon(fix.lon);
alt = "alt " + fix.alt.toFixed(0) + "m"; alt = "alt " + fix.alt.toFixed(0) + "m";
speed = "speed " + fix.speed.toFixed(1) + "kt"; speed = "speed " + fix.speed.toFixed(1) + "kt";
} }
@ -67,8 +66,7 @@ function updateGps() {
.fillRect(0, 0, 176, 120) .fillRect(0, 0, 176, 120)
.setColor(0,0,0) .setColor(0,0,0)
.drawString(key, 0, 0) .drawString(key, 0, 0)
.drawString(lat, 0, 20) .drawString(pos, 0, 20)
.drawString(lon, 0, 40)
.drawString(alt, 0, 60) .drawString(alt, 0, 60)
.drawString(speed, 0, 80); .drawString(speed, 0, 80);