From b6366761fc23af86dc689e9924764504ea68f8af Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 16:13:52 +1200 Subject: [PATCH 1/8] Update app.js --- apps/speedalt2/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/speedalt2/app.js b/apps/speedalt2/app.js index ed16131a4..4cdf71913 100644 --- a/apps/speedalt2/app.js +++ b/apps/speedalt2/app.js @@ -5,8 +5,9 @@ Mike Bennett mike[at]kereru.com 1.14 : Add VMG screen 1.34 : Add bluetooth data stream for Droidscript 1.43 : Keep GPS in SuperE mode while using Droiscript screen mirroring +1.50 : Add cfg.wptSfx one char suffix to append to waypoints.json filename. Protects speedalt2 waypoints from other apps that use the same file name for waypoints. */ -var v = '1.49'; +var v = '1.50'; var vDroid = '1.50'; // Required DroidScript program version /*kalmanjs, Wouter Bulten, MIT, https://github.com/wouterbulten/kalmanjs */ @@ -209,7 +210,7 @@ function nxtWp(){ } function loadWp() { - var w = require("Storage").readJSON('waypoints.json')||[{name:"NONE"}]; + var w = require("Storage").readJSON('waypoints'+cfg.wptSfx+'.json')||[{name:"NONE"}]; if (cfg.wp>=w.length) cfg.wp=0; if (cfg.wp<0) cfg.wp = w.length-1; savSettings(); @@ -718,6 +719,7 @@ cfg.primSpd = cfg.primSpd||0; // 1 = Spd in primary, 0 = Spd in secondary cfg.spdFilt = cfg.spdFilt==undefined?true:cfg.spdFilt; cfg.altFilt = cfg.altFilt==undefined?true:cfg.altFilt; cfg.touch = cfg.touch==undefined?true:cfg.touch; +cfg.wptSfx = cfg.wptSfx==undefined?'':cfg.wptSfx; if ( cfg.spdFilt ) var spdFilter = new KalmanFilter({R: 0.1 , Q: 1 }); if ( cfg.altFilt ) var altFilter = new KalmanFilter({R: 0.01, Q: 2 }); From 864fa672aba173fd7082fe9f1c8e3e2f1f5a13cb Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 16:17:40 +1200 Subject: [PATCH 2/8] Update ChangeLog --- apps/speedalt2/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/speedalt2/ChangeLog b/apps/speedalt2/ChangeLog index 73e9bfc40..fe20dcf3d 100644 --- a/apps/speedalt2/ChangeLog +++ b/apps/speedalt2/ChangeLog @@ -13,3 +13,4 @@ 1.14: Add VMG and coordinates screens 1.43: Adds mirroring of the watch face to an Android device. See README.md 1.49: Droidscript mirroring prog automatically uses last connection address. Auto connects when run. +1.50: Add configuration item Waypoints Suffix. A one character suffix to append to the waypoints.json file. A number of other apps also use this file name. Using the file name suffix allows the speedalt2 waypoints to be retained if one of these other apps is installed for a different use. From 1ac9864bae22ec6aa82fe8a1ba9496e5aa55e766 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 16:35:04 +1200 Subject: [PATCH 3/8] Update settings.js --- apps/speedalt2/settings.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/speedalt2/settings.js b/apps/speedalt2/settings.js index babb03061..1bdb58f9d 100644 --- a/apps/speedalt2/settings.js +++ b/apps/speedalt2/settings.js @@ -30,6 +30,11 @@ writeSettings(); } + function setSfx(s) { + settings.wptSfx = s; + writeSettings(); + } + const appMenu = { '': {'title': 'GPS Adv Sprt II'}, @@ -38,6 +43,7 @@ 'Units' : function() { E.showMenu(unitsMenu); }, 'Colours' : function() { E.showMenu(colMenu); }, 'Kalman Filter' : function() { E.showMenu(kalMenu); }, + 'Wpt File Suffix' : function() { E.showMenu(sfxMenu); }, 'Touch' : { value : settings.touch, format : v => v?"On":"Off", @@ -69,6 +75,15 @@ 'Inverted' : function() { setColour(3); } }; + const sfxMenu = { + '': {'title': 'Wpt File Suffix'}, + '< Back': function() { E.showMenu(appMenu); }, + 'Default' : function() { setSfx(''); }, + '1' : function() { setSfx('1'); }, + '2' : function() { setSfx('2'); }, + '3' : function() { setSfx('3'); } + }; + const kalMenu = { '': {'title': 'Kalman Filter'}, '< Back': function() { E.showMenu(appMenu); }, From 445b21fc076c3272d2cef95c7672ae5c86fd24d5 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 16:36:11 +1200 Subject: [PATCH 4/8] Update metadata.json --- apps/speedalt2/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt2/metadata.json b/apps/speedalt2/metadata.json index 4ace46854..801d65fb0 100644 --- a/apps/speedalt2/metadata.json +++ b/apps/speedalt2/metadata.json @@ -2,7 +2,7 @@ "id": "speedalt2", "name": "GPS Adventure Sports II", "shortName":"GPS Adv Sport II", - "version":"1.49", + "version":"1.50", "description": "GPS speed, altitude and distance to waypoint display. Designed for easy viewing and use during outdoor activities such as para-gliding, hang-gliding, sailing, cycling etc.", "icon": "app.png", "type": "app", From 824705203842e6f93297164ba0852900e7468880 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 16:53:56 +1200 Subject: [PATCH 5/8] Update ChangeLog --- apps/speedalt2/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt2/ChangeLog b/apps/speedalt2/ChangeLog index fe20dcf3d..9e2abb4ef 100644 --- a/apps/speedalt2/ChangeLog +++ b/apps/speedalt2/ChangeLog @@ -13,4 +13,4 @@ 1.14: Add VMG and coordinates screens 1.43: Adds mirroring of the watch face to an Android device. See README.md 1.49: Droidscript mirroring prog automatically uses last connection address. Auto connects when run. -1.50: Add configuration item Waypoints Suffix. A one character suffix to append to the waypoints.json file. A number of other apps also use this file name. Using the file name suffix allows the speedalt2 waypoints to be retained if one of these other apps is installed for a different use. +1.50: Add configuration item Wpt File Suffix. A one character suffix to append to the waypoints.json file. A number of other apps also use this file name. Using the file name suffix allows the speedalt2 waypoints to be retained if one of these other apps is installed for a different use. From fa77e25b103432830bad03d469dd870e113896f3 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 23 May 2022 17:00:01 +1200 Subject: [PATCH 6/8] Update README.md --- apps/speedalt2/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/speedalt2/README.md b/apps/speedalt2/README.md index e1c6b0a5a..76532bc40 100644 --- a/apps/speedalt2/README.md +++ b/apps/speedalt2/README.md @@ -80,6 +80,8 @@ The [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app in the App Sample waypoints.json (My sailing waypoints) +**Note** : The waypoints.json file is used by a number of different gps apps. The setting 'Wpt File Suffix' allows one of waypoints1.json, waypoints2.json or waypoints3.json to be used instead. This allows the other apps to be used with a different set of waypoints without losing the speedalt2 waypoint set. +
 [
   {

From c6f45f06a0a0b5b8fcdb9749e3005814347fd1e3 Mon Sep 17 00:00:00 2001
From: nujw 
Date: Mon, 23 May 2022 17:02:25 +1200
Subject: [PATCH 7/8] Update README.md

---
 apps/speedalt2/README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/speedalt2/README.md b/apps/speedalt2/README.md
index 76532bc40..c124e0c00 100644
--- a/apps/speedalt2/README.md
+++ b/apps/speedalt2/README.md
@@ -78,9 +78,11 @@ Waypoints are used in Distance and VMG modes. Create a file waypoints.json and w
 
 The [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app in the App Loader has a really nice waypoints file editor. (Must be connected to your Bangle.JS and then click on the Download icon.)
 
-Sample waypoints.json (My sailing waypoints)
+By default the waypoints file is called waypoints.json
 
 **Note** : The waypoints.json file is used by a number of different gps apps. The setting 'Wpt File Suffix' allows one of waypoints1.json, waypoints2.json or waypoints3.json to be used instead. This allows the other apps to be used with a different set of waypoints without losing the speedalt2 waypoint set. 
+ 
+Sample waypoints.json (My sailing waypoints)
 
 
 [

From 9973435b69f744bbdc420d02f20cd9f96f12b97e Mon Sep 17 00:00:00 2001
From: nujw 
Date: Tue, 24 May 2022 09:37:47 +1200
Subject: [PATCH 8/8] Update metadata.json

---
 apps/speedalt2/metadata.json | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/apps/speedalt2/metadata.json b/apps/speedalt2/metadata.json
index 801d65fb0..0de0b28bb 100644
--- a/apps/speedalt2/metadata.json
+++ b/apps/speedalt2/metadata.json
@@ -15,5 +15,10 @@
     {"name":"speedalt2.img","url":"app-icon.js","evaluate":true},
     {"name":"speedalt2.settings.js","url":"settings.js"}
   ],
-  "data": [{"name":"speedalt2.json"}]
+  "data": [
+    {"name":"speedalt2.json"},
+    {"name":"waypoints1.json"},
+    {"name":"waypoints2.json"},
+    {"name":"waypoints3.json"}
+  ]
 }