added lat/lon/course to Walkersclock GPS displays

pull/678/head
hughbarney 2021-02-23 22:22:53 +00:00
parent 012560e863
commit 5186c0d87c
3 changed files with 25 additions and 3 deletions

View File

@ -2822,8 +2822,8 @@
"name": "Walkers Clock",
"shortName":"Walkers Clock",
"icon": "walkersclock48.png",
"version":"0.02",
"description": "A larg font watch, displays steps, can switch GPS on/off, displays grid reference",
"version":"0.03",
"description": "A large font watch, displays steps, can switch GPS on/off, displays grid reference",
"type":"clock",
"tags": "clock, gps, tools, outdoors",
"readme": "README.md",

View File

@ -1,2 +1,3 @@
0.01: First version of the Walkers Clock
0.02: Fixed screen flicker
0.03: Added display of GPS fix lat/lon and course

View File

@ -34,8 +34,10 @@ const GPS_SATS = "gps_sats";
const GPS_RUNNING = "gps_running";
const GDISP_OS = "g_osref";
const GDISP_LATLN = "g_latln";
const GDISP_SPEED = "g_speed";
const GDISP_ALT = "g_alt";
const GDISP_COURSE = "g_course";
const Y_TIME = 40;
const Y_ACTIVITY = 120;
@ -138,14 +140,21 @@ function drawActivity() {
case GDISP_OS:
activityStr = ref;
break;
case GDISP_LATLN:
g.setFontVector(26);
activityStr = last_fix.lat.toFixed(4) + ", " + last_fix.lon.toFixed(4);
break;
case GDISP_SPEED:
speed = last_fix.speed;
speed = speed.toFixed(1);
activityStr = speed + "kph"
activityStr = speed + "kph";
break;
case GDISP_ALT:
activityStr = last_fix.alt + "m";
break;
case GDISP_COURSE:
activityStr = last_fix.course;
break;
}
g.clearRect(0, Y_ACTIVITY, 239, Y_MODELINE - 1);
@ -203,12 +212,18 @@ function drawInfo() {
case GDISP_OS:
str = "GPS: Grid";
break;
case GDISP_LATLN:
str = "GPS: Lat,Lon";
break;
case GDISP_SPEED:
str = "GPS: Speed";
break;
case GDISP_ALT:
str = "GPS: Alt";
break;
case GDISP_COURSE:
str = "GPS: Course";
break;
}
drawModeLine(str,col);
return;
@ -280,6 +295,12 @@ function changeInfoMode() {
gpsDisplay = GDISP_ALT;
break;
case GDISP_ALT:
gpsDisplay = GDISP_COURSE;
break;
case GDISP_COURSE:
gpsDisplay = GDISP_LATLN;
break;
case GDISP_LATLN:
default:
gpsDisplay = GDISP_OS;
break;