From 23f7fd5ecd5730ac7813c17dcd1cd4c109cf6cfb Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 14:40:51 +1300 Subject: [PATCH 001/149] Create waypoints.json --- apps/speedalt/waypoints.json | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 apps/speedalt/waypoints.json diff --git a/apps/speedalt/waypoints.json b/apps/speedalt/waypoints.json new file mode 100644 index 000000000..17cd2ca20 --- /dev/null +++ b/apps/speedalt/waypoints.json @@ -0,0 +1,61 @@ +[ + { + "name":"NONE" + }, + { + "name":"Omori", + "lat":-38.9058670, + "lon":175.7613350 + }, + { + "name":"DeltW", + "lat":-38.9438550, + "lon":175.7676930 + }, + { + "name":"DeltE", + "lat":-38.9395240, + "lon":175.7814420 + }, + { + "name":"BClub", + "lat":-38.9446020, + "lon":175.8475720 + }, + { + "name":"Hapua", + "lat":-38.8177750, + "lon":175.8088720 + }, + { + "name":"Nook", + "lat":-38.7848090, + "lon":175.7839440 + }, + { + "name":"ChyBy", + "lat":-38.7975050, + "lon":175.7551960 + }, + { + "name":"Waiha", + "lat":-38.7219630, + "lon":175.7481520 + }, + { + "name":"KwaKw", + "lat":-38.6632310, + "lon":175.8670320 + }, + { + "name":"Hatep", + "lat":-38.8547420, + "lon":176.0089124 + }, + { + "name":"Kinlc", + "lat":-38.6614442, + "lon":175.9161607 + } + +] From c030bed00c7a0ee6c21bbb8f96ac795e873832f4 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 16:31:31 +1300 Subject: [PATCH 002/149] Added distance units. --- apps/speedalt/settings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index 21171edee..01de13c27 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -43,6 +43,9 @@ 'Knots (spd)' : function() { setUnits(1.852,'knots'); }, 'Mph (spd)' : function() { setUnits(1.60934,'mph'); }, 'm/s (spd)' : function() { setUnits(3.6,'m/s'); }, + 'Km (dist)' : function() { setUnits(1000,'km'); }, + 'Miles (dist)' : function() { setUnits(1609.344,'miles'); }, + 'Nm (dist)' : function() { setUnits(1852.001,'nm'); }, 'Meters (alt)' : function() { setUnitsAlt(1,'m'); }, 'Feet (alt)' : function() { setUnitsAlt(0.3048,'feet'); } }; From 19f7b6a06a408807e6688b4c6a6e28412f1a8e62 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 16:34:07 +1300 Subject: [PATCH 003/149] Max 6 char names --- apps/speedalt/waypoints.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/speedalt/waypoints.json b/apps/speedalt/waypoints.json index 17cd2ca20..d1af258b2 100644 --- a/apps/speedalt/waypoints.json +++ b/apps/speedalt/waypoints.json @@ -8,17 +8,17 @@ "lon":175.7613350 }, { - "name":"DeltW", + "name":"DeltaW", "lat":-38.9438550, "lon":175.7676930 }, { - "name":"DeltE", + "name":"DeltaE", "lat":-38.9395240, "lon":175.7814420 }, { - "name":"BClub", + "name":"BtClub", "lat":-38.9446020, "lon":175.8475720 }, @@ -33,7 +33,7 @@ "lon":175.7839440 }, { - "name":"ChyBy", + "name":"ChryBy", "lat":-38.7975050, "lon":175.7551960 }, @@ -43,17 +43,17 @@ "lon":175.7481520 }, { - "name":"KwaKw", + "name":"KwaKwa", "lat":-38.6632310, "lon":175.8670320 }, { - "name":"Hatep", + "name":"Hatepe", "lat":-38.8547420, "lon":176.0089124 }, { - "name":"Kinlc", + "name":"Kinloc", "lat":-38.6614442, "lon":175.9161607 } From 585119b271616e7bb556099dbec08720c68582d1 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 16:40:12 +1300 Subject: [PATCH 004/149] Add waypoints file and distance to selected waypoint display. --- apps/speedalt/app.js | 147 +++++++++++++++++++++++++++++++++---------- 1 file changed, 113 insertions(+), 34 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7ccb20935..23475b097 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 0.07 +Ver : 0.10 Mike Bennett mike[at]kereru.com */ @@ -11,22 +11,9 @@ var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts require("Font7x11Numeric7Seg").add(Graphics); -/* -var mainmenu = { - "" : { "title" : "-- Units --" }, - "default" : function() { setUnits(0,''); }, - "Kph (spd)" : function() { setUnits(1,'kph'); }, - "Knots (spd)" : function() { setUnits(1.852,'knots'); }, - "Mph (spd)" : function() { setUnits(1.60934,'mph'); }, - "m/s (spd)" : function() { setUnits(3.6,'m/s'); }, - "Meters (alt)" : function() { setUnitsAlt(1,'m'); }, - "Feet (alt)" : function() { setUnitsAlt(0.3048,'feet'); }, - "Exit" : function() { exitMenu(); }, // remove the menu and restore -}; -*/ - var lastFix = {fix:0,satellites:0}; -var showSpeed = 1; // 1 = Speed in primary display. 0 = alt in primary +var primaryDisp = 1; // 1 = Speed in primary display. 0 = alt/dist in primary +var altDisp = 1; // 1 = alt, 0 = dist to wp var showMax = 0; // 1 = display the max values. 0 = display the cur fix var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; @@ -41,6 +28,36 @@ max.alt = 0; var emulator = 0; if (process.env.BOARD=="EMSCRIPTEN") emulator = 1; // 1 = running in emulator. Supplies test values; +var waypoints = require("Storage").readJSON("waypoints.json")||[{name:"NONE"}]; +var wpindex=0; +var wp = {}; // Waypoint to use for distance from cur position. + +function nextwp(inc){ + if (altDisp) return; + wpindex+=inc; + if (wpindex>=waypoints.length) wpindex=0; + if (wpindex<0) wpindex = waypoints.length-1; + wp = waypoints[wpindex]; + onGPS(lastFix); +} + +function radians(a) { + return a*Math.PI/180; +} + +function distance(a,b){ + var x = radians(a.lon-b.lon) * Math.cos(radians((a.lat+b.lat)/2)); + var y = radians(b.lat-a.lat); + + // Distance in selected units + var d = Math.sqrt(x*x + y*y) * 6371000; + d = (d/parseFloat(settings.dist)).toFixed(2); + if ( d >= 100 ) d = parseFloat(d).toFixed(1); + if ( d >= 1000 ) d = parseFloat(d).toFixed(0); + + return d; +} + function drawFix(speed,units,sats,alt,alt_units) { if (!canDraw) return; @@ -51,26 +68,29 @@ function drawFix(speed,units,sats,alt,alt_units) { // Primary Display val = speed.toString(); - if ( !showSpeed ) val = alt.toString(); + if ( !primaryDisp ) val = alt.toString(); // Primary Units u = settings.spd_unit; - if ( !showSpeed ) u = alt_units; + if ( !primaryDisp ) u = alt_units; drawPrimary(val,u); // Secondary Display val = alt.toString(); - if ( !showSpeed ) val = speed.toString(); + if ( !primaryDisp ) val = speed.toString(); // Secondary Units u = alt_units; - if ( !showSpeed ) u = settings.spd_unit; + if ( !primaryDisp ) u = settings.spd_unit; drawSecondary(val,u); // Time drawTime(); + + // Waypoint name + drawWP(); //Sats drawSats(sats); @@ -154,6 +174,7 @@ function drawSecondary(n,u) { } + function drawTime() { var x = 0; var y = 160; @@ -168,6 +189,22 @@ function drawTime() { buf.drawString(time,x,y); } +function drawWP() { + var nm = wp.name; + if ( nm == undefined ) nm = ''; + if ( nm == 'NONE' ) nm = ''; + if ( altDisp ) nm=''; + + + buf.setFontAlign(-12,1); //left, bottom + buf.setColor(2); +// buf.setFont("6x8", 1); + buf.setFontVector(20); + buf.drawString(nm.substring(0,6),77,160); + +} + + function drawSats(sats) { buf.setFontAlign(1,1); //right, bottom buf.setColor(3); @@ -205,22 +242,51 @@ function onGPS(fix) { else { speed = fix.speed; if ( emulator ) speed = '100'; - speed = Math.round(parseFloat(speed)/parseFloat(settings.spd),0); + speed = Math.round(parseFloat(speed)/parseFloat(settings.spd)); } // ==== Altitude ==== alt = fix.alt; if ( emulator ) alt = '360'; - alt = Math.round(parseFloat(alt)/parseFloat(settings.alt),0); + alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); + + // ==== Distance to waypoint ==== + if ( emulator ) { + lastFix.lat = -38.92; + lastFix.lon = 175.7613350; + } + + dist = distance(lastFix,wp); + if (isNaN(dist)) dist = 0; + // Record max values if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); - if ( showMax ) drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit); - else drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit); + if ( showMax ) { + // Speed and alt maximums + drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit); + } + else { + if ( altDisp ) { + // Show speed/altitude + drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit); + } + else { + // Show speed/distance + if ( dist <= 0 ) { + // No WP selected + drawFix(speed,settings.spd_unit,fix.satellites,'',''); + } + else { + drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit); + } + } + } - } else { + } + else { doBuzz(0); drawNoFix(fix.satellites); } @@ -263,28 +329,38 @@ function doBuzz2() { } function toggleDisplay() { - showSpeed = !showSpeed; - onGPS(lastFix); // Back to Speed display + primaryDisp = !primaryDisp; + onGPS(lastFix); // Update display +} + +function toggleAltDist() { + altDisp = !altDisp; + onGPS(lastFix); } function toggleMax() { // if ( inMenu ) return; showMax = !showMax; - onGPS(lastFix); // Back to Speed display + onGPS(lastFix); } function setButtons(){ - - // Show launcher when middle button pressed - setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); // Switch between fix and max display on short press or reset max values on long press setWatch(maxPressed, BTN1,{repeat:true,edge:"rising"}); setWatch(maxReleased, BTN1,{repeat:true,edge:"falling"}); - // Touch screen to toggle display + // Show launcher when middle button pressed + setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); + + // Select a waypoint for dist display + setWatch(nextwp.bind(this,1), BTN3, {repeat:true,edge:"falling"}); + + // Touch left screen to toggle display setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling"}); - setWatch(toggleDisplay, BTN5, {repeat:true,edge:"falling"}); + + // Touch left screen to toggle between alt or dist + setWatch(toggleAltDist, BTN5, {repeat:true,edge:"falling"}); } @@ -341,6 +417,10 @@ settings.spd = settings.spd||0; // Multiplier for speed unit conversions. 0 = u settings.spd_unit = settings.spd_unit||''; // Displayed speed unit settings.alt = settings.alt||0.3048;// Multiplier for altitude unit conversions. settings.alt_unit = settings.alt_unit||'feet'; // Displayed altitude units + +settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. +settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units + settings.colour = settings.colour||0; // Colour scheme. settings.buzz = settings.buzz||0; // Buzz when fix lost or gained. @@ -405,4 +485,3 @@ Bangle.on('GPS', onGPS); setButtons(); setInterval(updateClock, 30000); - From a5be6ac4174edc2dab320ed366fd2374ad3de453 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 16:42:44 +1300 Subject: [PATCH 005/149] Added distance to waypoint. --- apps.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index d5e301251..b5a98ec85 100644 --- a/apps.json +++ b/apps.json @@ -2625,8 +2625,8 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"0.07", - "description": "GPS speed and altitude display. Designed for easy viewing and use during outdoor activities such as para-gliding, hang-gliding, sailing, cycling etc.", + "version":"1.00", + "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.", "tags": "tool,outdoors", "type":"app", "allow_emulator":true, From 693ed73acfde67bd2177853cd8265b569390d769 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 16:46:12 +1300 Subject: [PATCH 006/149] New feature. Added waypoints file and distance to selected waypoint display. --- apps/speedalt/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 258b5051a..ac05ad706 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -5,3 +5,4 @@ 0.05 : Add setting to turn vibrate on/off. 0.06 : Tweaks to vibration settings. 0.07 : Switch to BTN1 for Max toggle and reset function. +1.00 : New feature. Added waypoints file and distance to selected waypoint display. From a68842d418abf0850e8efefd0d9102994ac60a6f Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 17:06:49 +1300 Subject: [PATCH 007/149] Update README.md --- apps/speedalt/README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index e1d00653e..d7a21bef5 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -1,12 +1,20 @@ -Displays the GPS speed and altitude. One is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. +Displays the GPS speed, altitude and distance to selected waypoint. One is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. -Display Tap : Swaps the displays. You can have either speed or altitude on the large primary display. +You can chose between two modes. One showing speed and altitude and one showing speed and distance to waypoint. -BTN1 : Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum values recorded. +The waypoints list is the same as that used with the [GPS Navigation] app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. + +Left Display Tap : Swaps the displays. You can have either speed or altitude/distance on the large primary display. + +Right Display Tap : Swaps the modes between Speed+Altitude or Speed+Distance Note: You cannot swap to Speed+Distance or select waypoints while displaying MAX values. + +BTN1 : Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. BTN1 : Long press > 2 secs resets the recorded maximum values. -App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. +BTN3 : (Only in Speed+Distance mode) Select waypoint. Last fix distance from selected waypoint is displayed. + +App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. ![](screen1.png) ![](screen2.png) @@ -15,4 +23,6 @@ App Settings : Select the desired display units. Speed can be as per the default Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! -( Many thanks to Gordon Williams. Awesome job. ) +Thanks: +Many thanks to Gordon Williams. Awesome job. +Also to @jeffmer, the developer of the 'GPS Navigation' app. From 4808a3aebeaece60e0a8e20f0bf4eff4e120bcaf Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 17:13:49 +1300 Subject: [PATCH 008/149] Update README.md --- apps/speedalt/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index d7a21bef5..6d8018a56 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -16,10 +16,16 @@ BTN3 : (Only in Speed+Distance mode) Select waypoint. Last fix distance from sel App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. -![](screen1.png) -![](screen2.png) -![](screen3.png) -![](screen4.png) +Speed and Altitude:
+![](screen1.png)

+Left tap swaps displays:
+![](screen2.png)

+Distance to waypoint DeltaW:
+![](screen5.png)

+MAX Values instead:
+![](screen3.png)

+Settings:
+![](screen4.png)

Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! From 468b80504f50713ad50a85e338e162b5fbf9129b Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 17:14:21 +1300 Subject: [PATCH 009/149] Add files via upload --- apps/speedalt/screen5.png | Bin 0 -> 4201 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/speedalt/screen5.png diff --git a/apps/speedalt/screen5.png b/apps/speedalt/screen5.png new file mode 100644 index 0000000000000000000000000000000000000000..1d6d51f10be7f654a3d2942bbdf9ec5e26409213 GIT binary patch literal 4201 zcmd^D={wYo_a2`z_Sz0U&lReo|iIH`tQqh9SHibsU7EKJoN69`)*)y^{k9|wZ zGMI`i4Jym1EMpxEW-JpSzMl8LKj3$Lzc0=?FYfC;*LicF`#LAe@)B;(?nAp_FxZ}R zXHBncSKhw?-?^O)tfmuSFr>ygQ=@DC4s#jyuLn*DV>1fLDe}&U$`>~lkGdp1m1md~ zYR#XDcDW&D5X#zHYf-rP^tfQyu2XWowam?l&&lc`L4T4%P%tPA3^rngS)pCv8)h)* zt{_}YA(S2-gPTDb;sannI0EH8GWzT^h)j_QHM|AD?W+BAg$2NWcA+d&V8H%kG6g0u zXjmkx^jI>aCvLC@7{M<+6rA=xPbIr7zH7ov zswkG{`P;k_kNI9X#CY=hb_ZVamL^&~CT_*oYRG0l3&2G)0h@ySRL-vx34{&Te=ZB> zEG=qWX`u>Q3s&7$*E7Zm5!9ym9x^-e~;fT|m9`hH)j|^!?OL#O%$J8f8L^vtbF?0x%6C)zhwl`Uf4`u@M);#GH zrK6SAE@dZG)x(WGrEvCNccDU+Li@vOY~TBh++LWSIN_F2PrkvCSs=H0W#Pm%0ROyf zZqr1R%ihXo#Mw60Z+ZurFGT&F1<;0mDr=tZH}%nsJH=`VHn{|?G9wn4RwovWeXhvz zX-r73Dz%@<*E+WHmy~kuJ0it0>C7cupz91MBRGTmp`I52tvkW!2E zqf%=gxIT`R(r4(C7Md_+V<{hf>lMrXx>K)t9xSu0z> zFav#UJ2pH7J5?U%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XWCxQ|HpYt!fDUF_6q@a&g_zDsWCq6Kd&setpET3 literal 0 HcmV?d00001 From 5907747904c89d564e8ddc1e6196d577c283f157 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 17:22:20 +1300 Subject: [PATCH 010/149] Update README.md --- apps/speedalt/README.md | 71 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 6d8018a56..cbff3cf5d 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -6,7 +6,7 @@ The waypoints list is the same as that used with the [GPS Navigation] app so the Left Display Tap : Swaps the displays. You can have either speed or altitude/distance on the large primary display. -Right Display Tap : Swaps the modes between Speed+Altitude or Speed+Distance Note: You cannot swap to Speed+Distance or select waypoints while displaying MAX values. +Right Display Tap : Swaps the modes between Speed+Altitude or Speed+Distance Note: You cannot swap to Speed+Distance while displaying MAX values. BTN1 : Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. @@ -32,3 +32,72 @@ Developed for my use in sailing, cycling and motorcycling. If you find this soft Thanks: Many thanks to Gordon Williams. Awesome job. Also to @jeffmer, the developer of the 'GPS Navigation' app. + +Waypoints: + +Create a file waypoints.json and write to storage on the Bangle.js using the IDE. + +Sample waypoints.json + +

+[
+  {
+  "name":"NONE"
+  },
+  {
+  "name":"Omori",
+  "lat":-38.9058670,
+  "lon":175.7613350
+  },
+  {
+  "name":"DeltaW",
+  "lat":-38.9438550,
+  "lon":175.7676930
+  },
+  {
+  "name":"DeltaE",
+  "lat":-38.9395240,
+  "lon":175.7814420
+  },
+  {
+  "name":"BtClub",
+  "lat":-38.9446020,
+  "lon":175.8475720
+  },
+  {
+  "name":"Hapua",
+  "lat":-38.8177750,
+  "lon":175.8088720
+  },
+  {
+  "name":"Nook",
+  "lat":-38.7848090,
+  "lon":175.7839440
+  },
+  {
+  "name":"ChryBy",
+  "lat":-38.7975050,
+  "lon":175.7551960
+  },
+  {
+  "name":"Waiha",
+  "lat":-38.7219630,
+  "lon":175.7481520
+  },
+  {
+  "name":"KwaKwa",
+  "lat":-38.6632310,
+  "lon":175.8670320
+  },
+  {
+  "name":"Hatepe",
+  "lat":-38.8547420,
+  "lon":176.0089124
+  },
+  {
+  "name":"Kinloc",
+  "lat":-38.6614442,
+  "lon":175.9161607
+  }
+]
+
From 4a75840802ad108800349d1d845a610e5ab1922d Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 17:33:49 +1300 Subject: [PATCH 011/149] Update app.js --- apps/speedalt/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 23475b097..4432e2d85 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -34,6 +34,8 @@ var wp = {}; // Waypoint to use for distance from cur position. function nextwp(inc){ if (altDisp) return; + if ( showMax ) return; + wpindex+=inc; if (wpindex>=waypoints.length) wpindex=0; if (wpindex<0) wpindex = waypoints.length-1; @@ -194,6 +196,7 @@ function drawWP() { if ( nm == undefined ) nm = ''; if ( nm == 'NONE' ) nm = ''; if ( altDisp ) nm=''; + if ( showMax ) nm=''; buf.setFontAlign(-12,1); //left, bottom From 17cff7315f96f69945093d335a3720239eea2739 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 18:48:29 +1300 Subject: [PATCH 012/149] Update waypoints.json --- apps/speedalt/waypoints.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/speedalt/waypoints.json b/apps/speedalt/waypoints.json index d1af258b2..b117bc5c2 100644 --- a/apps/speedalt/waypoints.json +++ b/apps/speedalt/waypoints.json @@ -28,6 +28,11 @@ "lon":175.8088720 }, { + "name":"MotuTa", + "lat":-38.85454, + "lon":175.94199 + }, + { "name":"Nook", "lat":-38.7848090, "lon":175.7839440 From cb57c9004713a6ab5be41981fcf47bd670c06a23 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 18:59:33 +1300 Subject: [PATCH 013/149] Update app.js --- apps/speedalt/app.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 4432e2d85..f468e0395 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -357,14 +357,13 @@ function setButtons(){ setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); // Select a waypoint for dist display - setWatch(nextwp.bind(this,1), BTN3, {repeat:true,edge:"falling"}); + setWatch(nextwp.bind(this,1), BTN3, {repeat:true,edge:"rising"}); // Touch left screen to toggle display - setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling"}); + setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); // Touch left screen to toggle between alt or dist - setWatch(toggleAltDist, BTN5, {repeat:true,edge:"falling"}); - + setWatch(toggleAltDist, BTN5, {repeat:true,edge:"rising"}); } @@ -420,10 +419,8 @@ settings.spd = settings.spd||0; // Multiplier for speed unit conversions. 0 = u settings.spd_unit = settings.spd_unit||''; // Displayed speed unit settings.alt = settings.alt||0.3048;// Multiplier for altitude unit conversions. settings.alt_unit = settings.alt_unit||'feet'; // Displayed altitude units - settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units - settings.colour = settings.colour||0; // Colour scheme. settings.buzz = settings.buzz||0; // Buzz when fix lost or gained. From 2f2faea7b326a799a05f1c5cd3bfc89b66ac0fe5 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 19:01:57 +1300 Subject: [PATCH 014/149] Add distance units --- apps/speedalt/settings.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index 01de13c27..3f4d6303f 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -19,6 +19,12 @@ writeSettings(); } + function setUnitsDist(d,u) { + settings.dist = d; + settings.dist_unit = u; + writeSettings(); + } + function setColour(c) { settings.colour = c; writeSettings(); @@ -43,9 +49,9 @@ 'Knots (spd)' : function() { setUnits(1.852,'knots'); }, 'Mph (spd)' : function() { setUnits(1.60934,'mph'); }, 'm/s (spd)' : function() { setUnits(3.6,'m/s'); }, - 'Km (dist)' : function() { setUnits(1000,'km'); }, - 'Miles (dist)' : function() { setUnits(1609.344,'miles'); }, - 'Nm (dist)' : function() { setUnits(1852.001,'nm'); }, + 'Km (dist)' : function() { setUnitsDist(1000,'km'); }, + 'Miles (dist)' : function() { setUnitsDist(1609.344,'miles'); }, + 'Nm (dist)' : function() { setUnitsDist(1852.001,'nm'); }, 'Meters (alt)' : function() { setUnitsAlt(1,'m'); }, 'Feet (alt)' : function() { setUnitsAlt(0.3048,'feet'); } }; From 47a86312a2ae62ebf562011f595929ea12a73621 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 21:59:22 +1300 Subject: [PATCH 015/149] LEDs indicate Spd+Alt or Spd+Dist modes Use red/green leds to indicate current mode. Use BTN1 for all tasks. In Spd+Alt mode changes MAX settings. In Spd+Dist mode selects next waypoint. --- apps/speedalt/app.js | 65 ++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index f468e0395..609638191 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 0.10 +Ver : 0.11 Mike Bennett mike[at]kereru.com */ @@ -40,7 +40,6 @@ function nextwp(inc){ if (wpindex>=waypoints.length) wpindex=0; if (wpindex<0) wpindex = waypoints.length-1; wp = waypoints[wpindex]; - onGPS(lastFix); } function radians(a) { @@ -64,10 +63,14 @@ function drawFix(speed,units,sats,alt,alt_units) { if (!canDraw) return; buf.clear(); + + drawLED(0); // Use LED to indicate current mode var val = ''; var u=''; + // LED to distingush current mode + // Primary Display val = speed.toString(); if ( !primaryDisp ) val = alt.toString(); @@ -111,6 +114,8 @@ function drawNoFix(sats) { buf.clear(); + drawLED(1); + buf.setFontAlign(0,0); buf.setColor(3); @@ -175,7 +180,14 @@ function drawSecondary(n,u) { buf.drawString(u,s,135); } +function drawLED(rst) { + LED1.reset(); + LED2.reset(); + if ( rst ) return; + if ( altDisp ) LED2.set(); // green = Speed/Alt mode + else LED1.set(); // red = Speed/Dist mode +} function drawTime() { var x = 0; @@ -225,6 +237,9 @@ function onGPS(fix) { var m; if (fix.fix || emulator) { + + lastFix.fix=1; + doBuzz(1); //==== Speed ==== @@ -290,6 +305,7 @@ function onGPS(fix) { } else { + lastFix.fix=0; doBuzz(0); drawNoFix(fix.satellites); } @@ -320,8 +336,6 @@ function doBuzz(hasFix) { Bangle.buzz(); return; } - - } // Second buzz @@ -337,28 +351,21 @@ function toggleDisplay() { } function toggleAltDist() { + if ( showMax ) return; altDisp = !altDisp; onGPS(lastFix); } -function toggleMax() { -// if ( inMenu ) return; - showMax = !showMax; - onGPS(lastFix); -} - function setButtons(){ - // Switch between fix and max display on short press or reset max values on long press - setWatch(maxPressed, BTN1,{repeat:true,edge:"rising"}); - setWatch(maxReleased, BTN1,{repeat:true,edge:"falling"}); + // Spd+Alt : Switch between fix and max display on short press or reset max values on long press + // Spd+Dist : Select next waypoint + setWatch(btnPressed, BTN1,{repeat:true,edge:"rising"}); + setWatch(btnReleased, BTN1,{repeat:true,edge:"falling"}); // Show launcher when middle button pressed setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); - // Select a waypoint for dist display - setWatch(nextwp.bind(this,1), BTN3, {repeat:true,edge:"rising"}); - // Touch left screen to toggle display setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); @@ -367,19 +374,29 @@ function setButtons(){ } -function maxPressed() { +function btnPressed() { + if ( !lastFix.fix ) return; maxPress = getTime(); } -function maxReleased() { +function btnReleased() { + if ( !lastFix.fix ) return; var dur = getTime()-maxPress; - - if ( dur < 2 ) toggleMax(); // Short press toggle fix/max display - else { - max.spd = 0; // Long press resets max values. - max.alt = 0; - onGPS(lastFix); // redraw display + if ( altDisp ) { + // Spd+Alt mode - Switch between fix and MAX + if ( dur < 2 ) { + showMax = !showMax; // Short press toggle fix/max display + } + else { + max.spd = 0; // Long press resets max values. + max.alt = 0; + } } + else { + // Spd+Dist mode - Select next waypoint + nextwp(1); + } + onGPS(lastFix); } function updateClock() { From ad5169eb98eccc50f06674fcdbce953ab3dcdb8d Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:00:49 +1300 Subject: [PATCH 016/149] Update ChangeLog --- apps/speedalt/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index ac05ad706..51d8cced3 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -5,4 +5,5 @@ 0.05 : Add setting to turn vibrate on/off. 0.06 : Tweaks to vibration settings. 0.07 : Switch to BTN1 for Max toggle and reset function. -1.00 : New feature. Added waypoints file and distance to selected waypoint display. +1.00 : New feature. Added waypoints file and distance to selected waypoint display +1.01 : Use LEDs to indicate mode. Green = Spd+Alt. Red = Spd+Dist. BTN1 for all functions. From 6cc5761b7623701d4dd1757c7d48ff340fa81ed0 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:01:48 +1300 Subject: [PATCH 017/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 609638191..58a3a7e63 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 0.11 +Ver : 1.01 Mike Bennett mike[at]kereru.com */ From 4da33b20c8bfe871282aa20e4a3b1a232dbcf043 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:02:36 +1300 Subject: [PATCH 018/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index b5a98ec85..6329f9e26 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.00", + "version":"1.01", "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.", "tags": "tool,outdoors", "type":"app", From b7b60dc3a61b4715a9dc70d9e586905000251404 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:24:08 +1300 Subject: [PATCH 019/149] Update README.md --- apps/speedalt/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index cbff3cf5d..c198a89b7 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -1,18 +1,18 @@ Displays the GPS speed, altitude and distance to selected waypoint. One is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. -You can chose between two modes. One showing speed and altitude and one showing speed and distance to waypoint. +You can chose between two modes. One showing speed and altitude (green LED) and one showing speed and distance to waypoint (red LED). The waypoints list is the same as that used with the [GPS Navigation] app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. Left Display Tap : Swaps the displays. You can have either speed or altitude/distance on the large primary display. -Right Display Tap : Swaps the modes between Speed+Altitude or Speed+Distance Note: You cannot swap to Speed+Distance while displaying MAX values. +Right Display Tap : Swaps the modes between Speed+Altitude (green LED) or Speed+Distance (red LED). -BTN1 : Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. +BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. -BTN1 : Long press > 2 secs resets the recorded maximum values. +BTN1 : [Speed+Altitude] Long press > 2 secs resets the recorded maximum values. -BTN3 : (Only in Speed+Distance mode) Select waypoint. Last fix distance from selected waypoint is displayed. +BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected waypoint is displayed. App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. From 731303ee71ccc327d59b512653d12911b657a966 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:24:58 +1300 Subject: [PATCH 020/149] Update app.js --- apps/speedalt/app.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 58a3a7e63..01e0373d5 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -34,8 +34,6 @@ var wp = {}; // Waypoint to use for distance from cur position. function nextwp(inc){ if (altDisp) return; - if ( showMax ) return; - wpindex+=inc; if (wpindex>=waypoints.length) wpindex=0; if (wpindex<0) wpindex = waypoints.length-1; @@ -208,7 +206,6 @@ function drawWP() { if ( nm == undefined ) nm = ''; if ( nm == 'NONE' ) nm = ''; if ( altDisp ) nm=''; - if ( showMax ) nm=''; buf.setFontAlign(-12,1); //left, bottom @@ -224,7 +221,7 @@ function drawSats(sats) { buf.setFontAlign(1,1); //right, bottom buf.setColor(3); buf.setFont("6x8", 2); - if ( showMax ) { + if ( showMax && altDisp ) { buf.setColor(2); buf.drawString("MAX",240,160); } @@ -282,27 +279,26 @@ function onGPS(fix) { if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); - if ( showMax ) { - // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit); - } - else { - if ( altDisp ) { + if ( altDisp ) { + if ( showMax ) { + // Speed and alt maximums + drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit); + } + else { // Show speed/altitude drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit); } + } + else { + // Show speed/distance + if ( dist <= 0 ) { + // No WP selected + drawFix(speed,settings.spd_unit,fix.satellites,'',''); + } else { - // Show speed/distance - if ( dist <= 0 ) { - // No WP selected - drawFix(speed,settings.spd_unit,fix.satellites,'',''); - } - else { - drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit); - } + drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit); } } - } else { lastFix.fix=0; @@ -351,7 +347,6 @@ function toggleDisplay() { } function toggleAltDist() { - if ( showMax ) return; altDisp = !altDisp; onGPS(lastFix); } From 1ad16ab585a091b024515bba47069e11be39da94 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:25:44 +1300 Subject: [PATCH 021/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 01e0373d5..a3ff5491b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.01 +Ver : 1.02 Mike Bennett mike[at]kereru.com */ From fde821022af55a56fc87ec92f22a6f637456e995 Mon Sep 17 00:00:00 2001 From: nujw Date: Sun, 31 Jan 2021 22:26:23 +1300 Subject: [PATCH 022/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 6329f9e26..4e804d718 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.01", + "version":"1.02", "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.", "tags": "tool,outdoors", "type":"app", From 677ed52b0188a6ed7ba7d71e1939bf4e2f277122 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 19:40:37 +1300 Subject: [PATCH 023/149] Change screen for no fix. --- apps/speedalt/app.js | 213 ++++++++++++++++--------------------------- 1 file changed, 80 insertions(+), 133 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index a3ff5491b..5c13324f2 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.02 +Ver : 1.03 Mike Bennett mike[at]kereru.com */ @@ -17,9 +17,9 @@ var altDisp = 1; // 1 = alt, 0 = dist to wp var showMax = 0; // 1 = display the max values. 0 = display the cur fix var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; -var lastBuzz = 0; // What sort of buzz was last performed. 0 = no fix, 1 = fix. -var timerBuzz2 = 0; // ID of timer for fix second buzz var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. +var ledID = 0; // ID of interval doing the LED flasher +var ledOn = 0; // LED state flag for flasher var max = {}; max.spd = 0; @@ -57,18 +57,17 @@ function distance(a,b){ return d; } -function drawFix(speed,units,sats,alt,alt_units) { +function drawFix(speed,units,sats,alt,alt_units,age,fix) { if (!canDraw) return; buf.clear(); - drawLED(0); // Use LED to indicate current mode + if ( fix ) drawLED(0); // Use LED to indicate current mode + else drawLEDFlash(0); // Flashing indicate no fix sodisplaying last known var val = ''; var u=''; - // LED to distingush current mode - // Primary Display val = speed.toString(); if ( !primaryDisp ) val = alt.toString(); @@ -96,40 +95,11 @@ function drawFix(speed,units,sats,alt,alt_units) { drawWP(); //Sats - drawSats(sats); + if ( fix ) drawSats('Sats:'+sats); + else drawSats('Age:'+age); g.reset(); g.drawImage(img,0,40); -// g.flip(); - - -} - - -function drawNoFix(sats) { - if (!canDraw) return; - var u; - - buf.clear(); - - drawLED(1); - - buf.setFontAlign(0,0); - buf.setColor(3); - - buf.setFontVector(25); - buf.drawString("Waiting for GPS",120,56); - - // Time - drawTime(); - - //Sats - drawSats(sats); - - g.reset(); - g.drawImage(img,0,40); -// g.flip(); - } @@ -179,14 +149,25 @@ function drawSecondary(n,u) { } function drawLED(rst) { + if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher LED1.reset(); LED2.reset(); if ( rst ) return; - if ( altDisp ) LED2.set(); // green = Speed/Alt mode else LED1.set(); // red = Speed/Dist mode } +function drawLEDFlash(rst) { + if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher + LED1.reset(); + LED2.reset(); + ledOn = 0; + if ( rst ) return; + if ( altDisp ) ledID = setInterval(function() {ledOn=!ledOn;digitalWrite(LED2,ledOn);},500); // green = Speed/Alt mode + else ledID = setInterval(function() {ledOn=!ledOn;digitalWrite(LED1,ledOn);},500); // red = Speed/Dist mode +} + + function drawTime() { var x = 0; var y = 160; @@ -207,7 +188,6 @@ function drawWP() { if ( nm == 'NONE' ) nm = ''; if ( altDisp ) nm=''; - buf.setFontAlign(-12,1); //left, bottom buf.setColor(2); // buf.setFont("6x8", 1); @@ -218,128 +198,98 @@ function drawWP() { function drawSats(sats) { - buf.setFontAlign(1,1); //right, bottom + + if ( showMax && altDisp ) { + buf.setFontVector(20); + buf.setFontAlign(0,1); //centre, bottom + buf.setColor(2); + buf.drawString("MAX",120,160); + } + buf.setColor(3); buf.setFont("6x8", 2); - if ( showMax && altDisp ) { - buf.setColor(2); - buf.drawString("MAX",240,160); - } - else buf.drawString("Sats:"+sats,240,160); + buf.setFontAlign(1,1); //right, bottom + buf.drawString(sats,240,160); } function onGPS(fix) { - lastFix = fix; + +//print ( fix); + + if ( emulator ) { + fix.fix = 1; + fix.speed = 125; + fix.alt = 390; + fix.lat = -38.92; + fix.lon = 175.7613350; + fix.course = 245; + fix.satellites = 12; + fix.time = new Date(); + } + + if (fix.fix) lastFix = fix; + var m; - if (fix.fix || emulator) { + speed = '---'; + alt = '---'; + dist = '---'; + age = '---'; + + if (lastFix.fix == 1 ) { - lastFix.fix=1; - - doBuzz(1); - - //==== Speed ==== - if ( settings.spd == 0 ) { - var strSpeed = require("locale").speed(fix.speed); - m = strSpeed.match(/([0-9,\.]+)(.*)/); // regex splits numbers from units - - if ( emulator ) { - speed = '125'; //testing only - settings.spd_unit = 'kph'; - } - else { + //==== Speed ==== + if ( settings.spd == 0 ) { + m = require("locale").speed(lastFix.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units speed = m[1]; settings.spd_unit = m[2]; } + else { + // Calculate for selected units + speed = lastFix.speed; + if ( emulator ) speed = '100'; + speed = Math.round(parseFloat(speed)/parseFloat(settings.spd)); + } + if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); + + // ==== Altitude ==== + alt = lastFix.alt; + alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); + if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); + + // ==== Distance to waypoint ==== + dist = distance(lastFix,wp); + if (isNaN(dist)) dist = 0; + + // Age of last fix (secs) + age = Math.max(0,Math.round(getTime())-(lastFix.time.getTime()/1000)); //Can be negative if GPS time and watch drift apart. + if ( age > 90 ) age = '>90'; } - // Calculate for selected units - else { - speed = fix.speed; - if ( emulator ) speed = '100'; - speed = Math.round(parseFloat(speed)/parseFloat(settings.spd)); - } - - // ==== Altitude ==== - alt = fix.alt; - if ( emulator ) alt = '360'; - alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); - - // ==== Distance to waypoint ==== - if ( emulator ) { - lastFix.lat = -38.92; - lastFix.lon = 175.7613350; - } - - dist = distance(lastFix,wp); - if (isNaN(dist)) dist = 0; - - - // Record max values - if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); - if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); - + if ( altDisp ) { if ( showMax ) { // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit); + drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit,age,fix.fix); } else { // Show speed/altitude - drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit); + drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit,age,fix.fix); } } else { // Show speed/distance if ( dist <= 0 ) { // No WP selected - drawFix(speed,settings.spd_unit,fix.satellites,'',''); + drawFix(speed,settings.spd_unit,fix.satellites,'','',age,fix.fix); } else { - drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit); + drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit,age,fix.fix); } } - } - else { - lastFix.fix=0; - doBuzz(0); - drawNoFix(fix.satellites); - } } -// Vibrate watch when fix lost or gained. -function doBuzz(hasFix) { - - // nothing to do - if ( lastBuzz === hasFix || !settings.buzz ) { - return; - } - - // fix gained - double buzz - if ( !lastBuzz && hasFix ) { - if ( dbg ) print('Fix'); - lastBuzz = 1; - Bangle.buzz(); - timerBuzz2 = setInterval(doBuzz2, 600); // Trigger a second buzz - return; - } - - // fix lost - single buzz - if ( lastBuzz && !hasFix ) { - if ( dbg ) print('Fix lost'); - lastBuzz = 0; - Bangle.buzz(); - return; - } -} - -// Second buzz -function doBuzz2() { - if ( dbg ) print('Buzz2'); - clearInterval(timerBuzz2); - Bangle.buzz(); - } function toggleDisplay() { primaryDisp = !primaryDisp; @@ -370,12 +320,10 @@ function setButtons(){ } function btnPressed() { - if ( !lastFix.fix ) return; maxPress = getTime(); } function btnReleased() { - if ( !lastFix.fix ) return; var dur = getTime()-maxPress; if ( altDisp ) { // Spd+Alt mode - Switch between fix and MAX @@ -434,7 +382,6 @@ settings.alt_unit = settings.alt_unit||'feet'; // Displayed altitude units settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units settings.colour = settings.colour||0; // Colour scheme. -settings.buzz = settings.buzz||0; // Buzz when fix lost or gained. /* Colour Pallet Idx From fe019eb184ae0798462bb0302af011dee23ee07e Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 19:41:19 +1300 Subject: [PATCH 024/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 4e804d718..bf1e983c7 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.02", + "version":"1.03", "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.", "tags": "tool,outdoors", "type":"app", From 1669f5f910ef9c984fbc237cc9bce3cf68245cfb Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 22:20:48 +1300 Subject: [PATCH 025/149] Update app.js --- apps/speedalt/app.js | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 5c13324f2..9394c9c71 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -6,7 +6,7 @@ Mike Bennett mike[at]kereru.com const dbg = 0; -var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); +var buf = Graphics.createArrayBuffer(240,160,4,{msb:true}); // Load fonts require("Font7x11Numeric7Seg").add(Graphics); @@ -62,8 +62,8 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { buf.clear(); - if ( fix ) drawLED(0); // Use LED to indicate current mode - else drawLEDFlash(0); // Flashing indicate no fix sodisplaying last known + if ( fix ) drawLED(); // Use LED to indicate current mode + else drawLEDFlash(); // Flashing indicate no fix so displaying last known var val = ''; var u=''; @@ -148,25 +148,29 @@ function drawSecondary(n,u) { buf.drawString(u,s,135); } -function drawLED(rst) { +function drawLED() { if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher - LED1.reset(); - LED2.reset(); - if ( rst ) return; - if ( altDisp ) LED2.set(); // green = Speed/Alt mode - else LED1.set(); // red = Speed/Dist mode + drawLEDCircle(0); } -function drawLEDFlash(rst) { +function drawLEDFlash() { if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher - LED1.reset(); - LED2.reset(); ledOn = 0; - if ( rst ) return; - if ( altDisp ) ledID = setInterval(function() {ledOn=!ledOn;digitalWrite(LED2,ledOn);},500); // green = Speed/Alt mode - else ledID = setInterval(function() {ledOn=!ledOn;digitalWrite(LED1,ledOn);},500); // red = Speed/Dist mode + ledID = setInterval(function() {ledOn=!ledOn;drawLEDCircle(ledOn);},500); // Toggle the LED + } +function drawLEDCircle(rst) { + var x=225; + var y=120; + var r=10; + if ( rst ) buf.setColor(0); // background = off + else if ( altDisp ) buf.setColor(5); // blue = Speed/Alt mode + else buf.setColor(4); // red = Speed/Dist mode + buf.fillCircle(x,y,r); + g.reset(); + g.drawImage(img,0,40); +} function drawTime() { var x = 0; @@ -196,7 +200,6 @@ function drawWP() { } - function drawSats(sats) { if ( showMax && altDisp ) { @@ -213,9 +216,6 @@ function drawSats(sats) { } function onGPS(fix) { - -//print ( fix); - if ( emulator ) { fix.fix = 1; @@ -232,14 +232,13 @@ function onGPS(fix) { var m; - speed = '---'; + speed = '---'; alt = '---'; dist = '---'; age = '---'; if (lastFix.fix == 1 ) { - - //==== Speed ==== + // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lastFix.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units speed = m[1]; @@ -253,17 +252,17 @@ function onGPS(fix) { } if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); - // ==== Altitude ==== + // Altitude alt = lastFix.alt; alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); - // ==== Distance to waypoint ==== + // Distance to waypoint dist = distance(lastFix,wp); if (isNaN(dist)) dist = 0; // Age of last fix (secs) - age = Math.max(0,Math.round(getTime())-(lastFix.time.getTime()/1000)); //Can be negative if GPS time and watch drift apart. + age = Math.max(0,Math.round(getTime())-(lastFix.time.getTime()/1000)); if ( age > 90 ) age = '>90'; } @@ -303,7 +302,6 @@ function toggleAltDist() { function setButtons(){ - // Spd+Alt : Switch between fix and max display on short press or reset max values on long press // Spd+Dist : Select next waypoint setWatch(btnPressed, BTN1,{repeat:true,edge:"rising"}); setWatch(btnReleased, BTN1,{repeat:true,edge:"falling"}); @@ -351,7 +349,6 @@ function updateClock() { g.drawImage(img,0,40); // g.flip(); - // Something different to display in the emulator if ( emulator ) { max.spd++; max.alt++; @@ -370,7 +367,7 @@ function stopDraw() { canDraw=false; } -// ===== Main Prog ===== +// =Main Prog // Read settings. let settings = require('Storage').readJSON('speedalt.json',1)||{}; @@ -389,18 +386,21 @@ Colour Pallet Idx 1 : Speed/Alt 2 : Units 3 : Sats +4 : led1 (red) +5 : led2 (blue) */ var img = { width:buf.getWidth(), height:buf.getHeight(), - bpp:2, + bpp:4, buffer:buf.buffer, - palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB]) + palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB,0xF800,0x051F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]) }; -if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF]); -if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800]); - +/* +if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]); +if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]); +*/ // Find speed unit if using locale speed if ( settings.spd == 0 ) { From 6e42bea69e8701c1da394ec1c7829f8a0a95b8ac Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 22:48:30 +1300 Subject: [PATCH 026/149] Update app.js --- apps/speedalt/app.js | 93 ++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 9394c9c71..e6b028767 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,25 +1,23 @@ /* Speed and Altitude [speedalt] -Ver : 1.03 +Ver : 1.04 Mike Bennett mike[at]kereru.com */ const dbg = 0; -var buf = Graphics.createArrayBuffer(240,160,4,{msb:true}); +var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts require("Font7x11Numeric7Seg").add(Graphics); -var lastFix = {fix:0,satellites:0}; +var lf = {fix:0,satellites:0}; var primaryDisp = 1; // 1 = Speed in primary display. 0 = alt/dist in primary var altDisp = 1; // 1 = alt, 0 = dist to wp var showMax = 0; // 1 = display the max values. 0 = display the cur fix var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. -var ledID = 0; // ID of interval doing the LED flasher -var ledOn = 0; // LED state flag for flasher var max = {}; max.spd = 0; @@ -62,9 +60,6 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { buf.clear(); - if ( fix ) drawLED(); // Use LED to indicate current mode - else drawLEDFlash(); // Flashing indicate no fix so displaying last known - var val = ''; var u=''; @@ -148,30 +143,6 @@ function drawSecondary(n,u) { buf.drawString(u,s,135); } -function drawLED() { - if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher - drawLEDCircle(0); -} - -function drawLEDFlash() { - if ( ledID > 0 ) clearInterval(ledID); // Stop the flasher - ledOn = 0; - ledID = setInterval(function() {ledOn=!ledOn;drawLEDCircle(ledOn);},500); // Toggle the LED - -} - -function drawLEDCircle(rst) { - var x=225; - var y=120; - var r=10; - if ( rst ) buf.setColor(0); // background = off - else if ( altDisp ) buf.setColor(5); // blue = Speed/Alt mode - else buf.setColor(4); // red = Speed/Dist mode - buf.fillCircle(x,y,r); - g.reset(); - g.drawImage(img,0,40); -} - function drawTime() { var x = 0; var y = 160; @@ -202,23 +173,29 @@ function drawWP() { function drawSats(sats) { - if ( showMax && altDisp ) { - buf.setFontVector(20); - buf.setFontAlign(0,1); //centre, bottom - buf.setColor(2); - buf.drawString("MAX",120,160); - } - buf.setColor(3); buf.setFont("6x8", 2); buf.setFontAlign(1,1); //right, bottom buf.drawString(sats,240,160); + + buf.setFontVector(20); + buf.setColor(2); + + if ( altDisp ) buf.drawString("A",240,140); + else buf.drawString("D",240,140); + + if ( showMax && altDisp ) { + buf.setFontAlign(0,1); //centre, bottom + buf.drawString("MAX",120,164); + } + + } function onGPS(fix) { if ( emulator ) { - fix.fix = 1; + fix.fix = 0; fix.speed = 125; fix.alt = 390; fix.lat = -38.92; @@ -228,7 +205,7 @@ function onGPS(fix) { fix.time = new Date(); } - if (fix.fix) lastFix = fix; + if (fix.fix) lf = fix; var m; @@ -237,32 +214,32 @@ function onGPS(fix) { dist = '---'; age = '---'; - if (lastFix.fix == 1 ) { + if (lf.fix == 1 ) { // Speed if ( settings.spd == 0 ) { - m = require("locale").speed(lastFix.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units + m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units speed = m[1]; settings.spd_unit = m[2]; } else { // Calculate for selected units - speed = lastFix.speed; + speed = lf.speed; if ( emulator ) speed = '100'; speed = Math.round(parseFloat(speed)/parseFloat(settings.spd)); } if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); // Altitude - alt = lastFix.alt; + alt = lf.alt; alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); // Distance to waypoint - dist = distance(lastFix,wp); + dist = distance(lf,wp); if (isNaN(dist)) dist = 0; // Age of last fix (secs) - age = Math.max(0,Math.round(getTime())-(lastFix.time.getTime()/1000)); + age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); if ( age > 90 ) age = '>90'; } @@ -292,12 +269,12 @@ function onGPS(fix) { function toggleDisplay() { primaryDisp = !primaryDisp; - onGPS(lastFix); // Update display + onGPS(lf); // Update display } function toggleAltDist() { altDisp = !altDisp; - onGPS(lastFix); + onGPS(lf); } function setButtons(){ @@ -337,7 +314,7 @@ function btnReleased() { // Spd+Dist mode - Select next waypoint nextwp(1); } - onGPS(lastFix); + onGPS(lf); } function updateClock() { @@ -360,7 +337,7 @@ function startDraw(){ canDraw=true; g.clear(); Bangle.drawWidgets(); - onGPS(lastFix); // draw app screen + onGPS(lf); // draw app screen } function stopDraw() { @@ -386,21 +363,17 @@ Colour Pallet Idx 1 : Speed/Alt 2 : Units 3 : Sats -4 : led1 (red) -5 : led2 (blue) */ var img = { width:buf.getWidth(), height:buf.getHeight(), - bpp:4, + bpp:2, buffer:buf.buffer, - palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB,0xF800,0x051F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]) + palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB]) }; -/* -if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]); -if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF]); -*/ +if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF]); +if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800]); // Find speed unit if using locale speed if ( settings.spd == 0 ) { @@ -439,7 +412,7 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); Bangle.setGPSPower(1); -onGPS(lastFix); +onGPS(lf); Bangle.on('GPS', onGPS); setButtons(); From 2905f110942819b3bb3d6f5740cd362fd35617cf Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 22:49:44 +1300 Subject: [PATCH 027/149] Update ChangeLog --- apps/speedalt/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 51d8cced3..5470ed1d4 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -6,4 +6,4 @@ 0.06 : Tweaks to vibration settings. 0.07 : Switch to BTN1 for Max toggle and reset function. 1.00 : New feature. Added waypoints file and distance to selected waypoint display -1.01 : Use LEDs to indicate mode. Green = Spd+Alt. Red = Spd+Dist. BTN1 for all functions. +1.04 : Misc tweaks. From d475f56660249b2b113240c7a20cff4cb0bd9ca9 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 1 Feb 2021 22:50:21 +1300 Subject: [PATCH 028/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index bf1e983c7..e8fbc1105 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.03", + "version":"1.04", "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.", "tags": "tool,outdoors", "type":"app", From b7e0be2b4ab10389df9f02ff25bf3d94ea48a148 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 08:16:28 +1300 Subject: [PATCH 029/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index e6b028767..e86bc1e38 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -289,8 +289,8 @@ function setButtons(){ // Touch left screen to toggle display setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); - // Touch left screen to toggle between alt or dist - setWatch(toggleAltDist, BTN5, {repeat:true,edge:"rising"}); + // Toggle between alt or dist + setWatch(toggleAltDist, BTN2, {repeat:true,edge:"rising"}); } From ae58842e729a16fd17a76b97bf5dcd549d00c717 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 08:22:32 +1300 Subject: [PATCH 030/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index e86bc1e38..7364531fd 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -290,7 +290,7 @@ function setButtons(){ setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); // Toggle between alt or dist - setWatch(toggleAltDist, BTN2, {repeat:true,edge:"rising"}); + setWatch(toggleAltDist, BTN2, {repeat:true,edge:"falling"}); } From 10c18757f4ca16cea991f958da9f51e4bbb96397 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 08:27:32 +1300 Subject: [PATCH 031/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7364531fd..97da2f2b4 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -290,7 +290,7 @@ function setButtons(){ setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); // Toggle between alt or dist - setWatch(toggleAltDist, BTN2, {repeat:true,edge:"falling"}); + setWatch(toggleAltDist, BTN3, {repeat:true,edge:"rising"}); } From 2f1f561d43f4012ffe313cdae9d18b63b750ffb8 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 08:32:36 +1300 Subject: [PATCH 032/149] Update app.js --- apps/speedalt/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 97da2f2b4..7f5c76de0 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -286,12 +286,12 @@ function setButtons(){ // Show launcher when middle button pressed setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); - // Touch left screen to toggle display - setWatch(toggleDisplay, BTN4, {repeat:true,edge:"rising"}); - // Toggle between alt or dist - setWatch(toggleAltDist, BTN3, {repeat:true,edge:"rising"}); + setWatch(toggleAltDist, BTN3, {repeat:true,edge:"falling"}); + // Touch left screen to toggle display + setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling"}); + } function btnPressed() { From 23493e946b15d351a505b30b152532ab34f07107 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 08:42:53 +1300 Subject: [PATCH 033/149] Update README.md --- apps/speedalt/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index c198a89b7..41def8b11 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -1,12 +1,10 @@ Displays the GPS speed, altitude and distance to selected waypoint. One is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. -You can chose between two modes. One showing speed and altitude (green LED) and one showing speed and distance to waypoint (red LED). +You can chose between two modes. One showing speed and altitude (A) and one showing speed and distance to waypoint (D). The waypoints list is the same as that used with the [GPS Navigation] app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. -Left Display Tap : Swaps the displays. You can have either speed or altitude/distance on the large primary display. - -Right Display Tap : Swaps the modes between Speed+Altitude (green LED) or Speed+Distance (red LED). +Left Display Tap : Swaps the displays. You can have either speed or [A]ltitude/[D]istance on the large primary display. BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. @@ -14,6 +12,8 @@ BTN1 : [Speed+Altitude] Long press > 2 secs resets the recorded maximum values. BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected waypoint is displayed. +BTN3 : Swaps the modes between Speed+Altitude. + App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. Speed and Altitude:
From 098be8a59a0645a32a59aa2ebdef22dd47dcee0a Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 10:40:27 +1300 Subject: [PATCH 034/149] Memory optimisation Stopped loading entire waypoint list into memory. --- apps/speedalt/app.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7f5c76de0..2b70b84c7 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,7 +1,8 @@ /* Speed and Altitude [speedalt] -Ver : 1.04 +Ver : 1.05 Mike Bennett mike[at]kereru.com +process.memory() */ const dbg = 0; @@ -26,16 +27,20 @@ max.alt = 0; var emulator = 0; if (process.env.BOARD=="EMSCRIPTEN") emulator = 1; // 1 = running in emulator. Supplies test values; -var waypoints = require("Storage").readJSON("waypoints.json")||[{name:"NONE"}]; -var wpindex=0; var wp = {}; // Waypoint to use for distance from cur position. -function nextwp(inc){ +function nxtWp(inc){ if (altDisp) return; - wpindex+=inc; - if (wpindex>=waypoints.length) wpindex=0; - if (wpindex<0) wpindex = waypoints.length-1; - wp = waypoints[wpindex]; + settings.wp+=inc; + loadWp(); +} + +function loadWp() { + var w = require("Storage").readJSON('waypoints.json')||[{name:"NONE"}]; + if (settings.wp>=w.length) settings.wp=0; + if (settings.wp<0) settings.wp = w.length-1; + require("Storage").write('speedalt.json',settings); + wp = w[settings.wp]; } function radians(a) { @@ -312,7 +317,7 @@ function btnReleased() { } else { // Spd+Dist mode - Select next waypoint - nextwp(1); + nxtWp(1); } onGPS(lf); } @@ -355,7 +360,10 @@ settings.alt = settings.alt||0.3048;// Multiplier for altitude unit conversions. settings.alt_unit = settings.alt_unit||'feet'; // Displayed altitude units settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units -settings.colour = settings.colour||0; // Colour scheme. +settings.colour = settings.colour||0; // Colour scheme. +settings.wp = settings.wp||0; // Last selected waypoint for dist + +loadWp(); /* Colour Pallet Idx From 2cda0b0a5445ef35e99a277722c28689efc98615 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 10:41:04 +1300 Subject: [PATCH 035/149] Update ChangeLog --- apps/speedalt/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 5470ed1d4..fa189dd31 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -7,3 +7,4 @@ 0.07 : Switch to BTN1 for Max toggle and reset function. 1.00 : New feature. Added waypoints file and distance to selected waypoint display 1.04 : Misc tweaks. +1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. From 61f4d023a3350a2e2d5f9dbc1790308a7777e8d2 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 10:41:46 +1300 Subject: [PATCH 036/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index e8fbc1105..5a46930c4 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.04", + "version":"1.05", "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.", "tags": "tool,outdoors", "type":"app", From d5e031b21f11b8b97571add61294988869384852 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 10:51:59 +1300 Subject: [PATCH 037/149] Update README.md --- apps/speedalt/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 41def8b11..f9db449f4 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -12,9 +12,11 @@ BTN1 : [Speed+Altitude] Long press > 2 secs resets the recorded maximum values. BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected waypoint is displayed. -BTN3 : Swaps the modes between Speed+Altitude. +BTN3 : Swaps the modes between Speed+[A]ltitude or Speed+[D]istance. -App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Colours, high contrast (all white on black) or night ( all red on black ). Vibration can be used to indicate when a fix is lost or gained. One buzz for a lost fix and a double buzz when a fix is found. +App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default, high contrast (all white on black) or night ( all red on black ). + +Loss of fix : When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats' or 'Age' indicates whether the GPS has a fix or not. Speed and Altitude:
![](screen1.png)

@@ -35,7 +37,7 @@ Also to @jeffmer, the developer of the 'GPS Navigation' app. Waypoints: -Create a file waypoints.json and write to storage on the Bangle.js using the IDE. +Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displyed in Speed+[D]istance mode. Sample waypoints.json From a7b79618e816e026e0cd3cabec758bbb54156626 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 11:09:40 +1300 Subject: [PATCH 038/149] Update app.js --- apps/speedalt/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 2b70b84c7..2dcb78a67 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -200,9 +200,9 @@ function drawSats(sats) { function onGPS(fix) { if ( emulator ) { - fix.fix = 0; - fix.speed = 125; - fix.alt = 390; + fix.fix = 1; + fix.speed = 15; + fix.alt = 354; fix.lat = -38.92; fix.lon = 175.7613350; fix.course = 245; @@ -229,10 +229,11 @@ function onGPS(fix) { else { // Calculate for selected units speed = lf.speed; - if ( emulator ) speed = '100'; - speed = Math.round(parseFloat(speed)/parseFloat(settings.spd)); + speed = parseFloat(speed)/parseFloat(settings.spd); } if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); + if ( speed < 10 ) speed = speed.toFixed(1); + else speed = Math.round(speed); // Altitude alt = lf.alt; From 04b35145f6972939a0f01c8915c52670c06fe609 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 11:20:20 +1300 Subject: [PATCH 039/149] Add files via upload --- apps/speedalt/screen1.png | Bin 4324 -> 3937 bytes apps/speedalt/screen2.png | Bin 4138 -> 4026 bytes apps/speedalt/screen3.png | Bin 4193 -> 4491 bytes apps/speedalt/screen5.png | Bin 4201 -> 4427 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/speedalt/screen1.png b/apps/speedalt/screen1.png index eac5e7e7aa7be41cd9bb0d3d478d3a312f936960..fa477875dbc1e1aa100a8b8ee05d203b935e6e2f 100644 GIT binary patch literal 3937 zcmd^C`8$;D+t=+*GYT_AS+Y$?43*L-`!>X534>AcB&I?}CB}Xyj}Sd%i7Z8>FpPa^ zhWqiPkTF!qHioR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!mQb9&oe7zVcWQLIHG5x2C=!GU_tB_)oTnn0% zDO(J&i24DEL^!lv>9Tt zPO;U<8aE|q)Kv9LH-`rHGH=oSHegDi3s6;_Q#&}FjsroA$jBkJGkK<-?A>i)3!Sv1 z)hHUCv>aO-(xM0|14}g@*6&mO-QE<*ODXZdei#}pnkMo&QE)}D9Yi$(8jx#BkN^_) zJ{iu8lWl_I9I!GGq9x1;V zYb1s(T>nao>zc=tWLvcG=fhpc-In4eq1wQEkR>5w=De}{K^n21l@NXMjQ7*e)!u}; zKj)YDmEktiJ0zo#m>2!6Iar@%S$oY?q9g4GWBY+1TDUP-eHOAccQaKBtD2Zl0OqI}-N%eov8; z1-iD&zqbf1@;aTDI$yR=-FZZRE}&D{|U6)PB{Po diff --git a/apps/speedalt/screen3.png b/apps/speedalt/screen3.png index 9e061958e7e1e60aac01b75f1687c33c70f378af..1c32720197b79278cfc9890a36d8bc3ee7936b3c 100644 GIT binary patch literal 4491 zcmeHL`8V5JyC?nX8&z%4YH6$Hyo#bY$B>w+hPF6Lg4B>#ilRl$#L&3a9vVYwT9icV z9BK$sBIcy65=3%T%|vR5w&p30p}e{Gm;2NG2i|pm*n6-2S@x3!OUnd&B(TAEIC_J02A9 zt_^y097h*d)Fq4HQpFWlKYUV&1S{&o|9|&?F>wM&+WXn1PT%+B{w5be%D=ptd>M!G zOiHxtC>Y+02>)?);$xGO^_-V-VkNU2AE+J%Bmvf(56=c{$H)t(zfRU&WVb1w*D|gl zUEG5eeRcpcQ?ed@L)1=&r}JH=Co4ko^%@p)Y5Ob6Hq*b&!H24wQ>(?e6;jH7v5i~i zTwig{^)BvG@zhf2as&-xbR;_Z$QRkbvcfCj&T;;OlmJ#x2-h^bKxQOjo%o>1iFcFf zky@kCsTU(OiC7CKljoTu@Ftt}dLjm2%h&0|7%3AY%$<(y!z82s%@eT|0QKRF=JYMLgG&SUs4cLeq{JJ!mB6P zKN|G;&OOFCDK*JU==?xY~^@+Ufht61Mk;3CtMB2HLVi3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E!m~-^L+H0?7s-u82h#zY^>qt^w ze`IGZfWWQ$l%y%P`uI&npeXikX3QRGs`?My2qI3XnLh)>pMQh5`#Uue%_B|wy$+_) zFISifG?<3mwus{np1R5Lpj8>M=zET+l#^nsKm+b9o6uL6v%+7>Lznxw8*o1fI4_tZ zS0(E_p+KX6Osk&XJ@fBiul|3;SII=FGTPl=QobvGyrSUZ4FO znq)^T=;JfH;ybuFRH;YXM*QKZ6DOH;J4|6Fozeoom zNnBVXvn1?FOM&0*tZpjUFn_bXV%4*~^-_R@X02~#e7glvM5E(iwt==oWz^>Qu!thZ z6wjY{tH(=66ic1Nl-=%0e=JuhH#&G=qEgMx@&^3n~Gg_vbYYBKlb_cb5x70%kvg?OP z6x%x~)B-o67gf@Dd8Ag1v&%BOW%Gj97R9A^KeT_2Ze3OKp}_Br0AO3N^cw~Y5jy); z(N%qyh#jJFoH-lS_{PzapHRsmbh+77rNMs5wY-cvv*|I=q4!w5AI*xatqv+6zxc5b zZ3CAedQq#kmjJLXWCxQ|HpYt!fDUF_6q@a&g_zDsWCq6Kd&setpET3 From 8eb99f2452c4d2d5009cf22fe5d37f3ad077e606 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 11:21:41 +1300 Subject: [PATCH 040/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 2dcb78a67..77e6ff258 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -201,7 +201,7 @@ function onGPS(fix) { if ( emulator ) { fix.fix = 1; - fix.speed = 15; + fix.speed = 10; fix.alt = 354; fix.lat = -38.92; fix.lon = 175.7613350; @@ -231,9 +231,9 @@ function onGPS(fix) { speed = lf.speed; speed = parseFloat(speed)/parseFloat(settings.spd); } - if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); if ( speed < 10 ) speed = speed.toFixed(1); else speed = Math.round(speed); + if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); // Altitude alt = lf.alt; From fe9133cc24c0da1ca92b91c05070f66baa65215b Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 15:57:41 +1300 Subject: [PATCH 041/149] Update app.js --- apps/speedalt/app.js | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 77e6ff258..2b16ef9da 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.05 +Ver : 1.06 Mike Bennett mike[at]kereru.com process.memory() */ @@ -13,8 +13,6 @@ var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); require("Font7x11Numeric7Seg").add(Graphics); var lf = {fix:0,satellites:0}; -var primaryDisp = 1; // 1 = Speed in primary display. 0 = alt/dist in primary -var altDisp = 1; // 1 = alt, 0 = dist to wp var showMax = 0; // 1 = display the max values. 0 = display the cur fix var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; @@ -30,7 +28,7 @@ if (process.env.BOARD=="EMSCRIPTEN") emulator = 1; // 1 = running in emulator. var wp = {}; // Waypoint to use for distance from cur position. function nxtWp(inc){ - if (altDisp) return; + if (settings.modeA) return; settings.wp+=inc; loadWp(); } @@ -39,7 +37,7 @@ function loadWp() { var w = require("Storage").readJSON('waypoints.json')||[{name:"NONE"}]; if (settings.wp>=w.length) settings.wp=0; if (settings.wp<0) settings.wp = w.length-1; - require("Storage").write('speedalt.json',settings); + savSettings(); wp = w[settings.wp]; } @@ -70,21 +68,21 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { // Primary Display val = speed.toString(); - if ( !primaryDisp ) val = alt.toString(); + if ( !settings.primSpd ) val = alt.toString(); // Primary Units u = settings.spd_unit; - if ( !primaryDisp ) u = alt_units; + if ( !settings.primSpd ) u = alt_units; drawPrimary(val,u); // Secondary Display val = alt.toString(); - if ( !primaryDisp ) val = speed.toString(); + if ( !settings.primSpd ) val = speed.toString(); // Secondary Units u = alt_units; - if ( !primaryDisp ) u = settings.spd_unit; + if ( !settings.primSpd ) u = settings.spd_unit; drawSecondary(val,u); @@ -166,7 +164,7 @@ function drawWP() { var nm = wp.name; if ( nm == undefined ) nm = ''; if ( nm == 'NONE' ) nm = ''; - if ( altDisp ) nm=''; + if ( settings.modeA ) nm=''; buf.setFontAlign(-12,1); //left, bottom buf.setColor(2); @@ -186,10 +184,10 @@ function drawSats(sats) { buf.setFontVector(20); buf.setColor(2); - if ( altDisp ) buf.drawString("A",240,140); + if ( settings.modeA ) buf.drawString("A",240,140); else buf.drawString("D",240,140); - if ( showMax && altDisp ) { + if ( showMax && settings.modeA ) { buf.setFontAlign(0,1); //centre, bottom buf.drawString("MAX",120,164); } @@ -249,7 +247,7 @@ function onGPS(fix) { if ( age > 90 ) age = '>90'; } - if ( altDisp ) { + if ( settings.modeA ) { if ( showMax ) { // Speed and alt maximums drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit,age,fix.fix); @@ -274,12 +272,14 @@ function onGPS(fix) { function toggleDisplay() { - primaryDisp = !primaryDisp; + settings.primSpd = !settings.primSpd; + savSettings(); onGPS(lf); // Update display } function toggleAltDist() { - altDisp = !altDisp; + settings.modeA = !settings.modeA; + savSettings(); onGPS(lf); } @@ -306,7 +306,7 @@ function btnPressed() { function btnReleased() { var dur = getTime()-maxPress; - if ( altDisp ) { + if ( settings.modeA ) { // Spd+Alt mode - Switch between fix and MAX if ( dur < 2 ) { showMax = !showMax; // Short press toggle fix/max display @@ -350,6 +350,10 @@ function stopDraw() { canDraw=false; } +function savSettings() { + require("Storage").write('speedalt.json',settings); +} + // =Main Prog // Read settings. @@ -363,6 +367,9 @@ settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units settings.colour = settings.colour||0; // Colour scheme. settings.wp = settings.wp||0; // Last selected waypoint for dist +settings.modeA = settings.modeA||0; // 0 = [D], 1 = [A] +settings.primSpd = settings.primSpd||0; // 1 = Spd in primary, 0 = Spd in secondary + loadWp(); From a91adfcf2dac2a23bb8ab389219ed66324aa9982 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 15:59:12 +1300 Subject: [PATCH 042/149] Update ChangeLog --- apps/speedalt/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index fa189dd31..265b2e4e1 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -8,3 +8,4 @@ 1.00 : New feature. Added waypoints file and distance to selected waypoint display 1.04 : Misc tweaks. 1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. +1.06 : Save dispay settings and restore when app restarted. From fc7ec82ebf06b5006e9a923bcef830051367cb13 Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 16:00:00 +1300 Subject: [PATCH 043/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 5a46930c4..1d50aa1e6 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.05", + "version":"1.06", "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.", "tags": "tool,outdoors", "type":"app", From 5b07163ecc51ad2b2c31e120ebaabdb9c2198d3d Mon Sep 17 00:00:00 2001 From: nujw Date: Tue, 2 Feb 2021 16:01:29 +1300 Subject: [PATCH 044/149] Update ChangeLog --- apps/speedalt/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 265b2e4e1..405f80f63 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -8,4 +8,4 @@ 1.00 : New feature. Added waypoints file and distance to selected waypoint display 1.04 : Misc tweaks. 1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. -1.06 : Save dispay settings and restore when app restarted. +1.06 : Save display settings and restore when app restarted. From 20a02090ec1699d9378c31ae165fe127927a5c04 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 17:03:44 +1300 Subject: [PATCH 045/149] Update app.js --- apps/speedalt/app.js | 75 ++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 48 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 2b16ef9da..21e472c11 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,12 +1,10 @@ /* Speed and Altitude [speedalt] -Ver : 1.06 +Ver : 1.07 Mike Bennett mike[at]kereru.com process.memory() */ -const dbg = 0; - var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -22,8 +20,7 @@ var max = {}; max.spd = 0; max.alt = 0; -var emulator = 0; -if (process.env.BOARD=="EMSCRIPTEN") emulator = 1; // 1 = running in emulator. Supplies test values; +var emulator = (process.env.BOARD=="EMSCRIPTEN")?1:0; // 1 = running in emulator. Supplies test values; var wp = {}; // Waypoint to use for distance from cur position. @@ -63,28 +60,28 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { buf.clear(); - var val = ''; + var v = ''; var u=''; // Primary Display - val = speed.toString(); - if ( !settings.primSpd ) val = alt.toString(); + v = speed.toString(); + if ( !settings.primSpd ) v = alt.toString(); // Primary Units u = settings.spd_unit; if ( !settings.primSpd ) u = alt_units; - drawPrimary(val,u); + drawPrimary(v,u); // Secondary Display - val = alt.toString(); - if ( !settings.primSpd ) val = speed.toString(); + v = alt.toString(); + if ( !settings.primSpd ) v = speed.toString(); // Secondary Units u = alt_units; if ( !settings.primSpd ) u = settings.spd_unit; - drawSecondary(val,u); + drawSecondary(v,u); // Time drawTime(); @@ -106,15 +103,16 @@ function drawPrimary(n,u) { // Primary Display var s=40; // Font size - if ( n.length <= 7 ) s=48; - if ( n.length <= 6 ) s=55; - if ( n.length <= 5 ) s=68; - if ( n.length <= 4 ) s=85; - if ( n.length <= 3 ) s=110; + var l=n.length; + + if ( l <= 7 ) s=48; + if ( l <= 6 ) s=55; + if ( l <= 5 ) s=68; + if ( l <= 4 ) s=85; + if ( l <= 3 ) s=110; buf.setFontAlign(0,-1); //Centre buf.setColor(1); - buf.setFontVector(s); buf.drawString(n,110,0); @@ -128,11 +126,12 @@ function drawPrimary(n,u) { function drawSecondary(n,u) { var s=180; // units X position - if ( n.length <= 5 ) s=155; - if ( n.length <= 4 ) s=125; - if ( n.length <= 3 ) s=100; - if ( n.length <= 2 ) s=65; - if ( n.length <= 1 ) s=35; + var l=n.length; + if ( l <= 5 ) s=155; + if ( l <= 4 ) s=125; + if ( l <= 3 ) s=100; + if ( l <= 2 ) s=65; + if ( l <= 1 ) s=35; buf.setFontAlign(-1,1); //left, bottom buf.setColor(1); @@ -212,10 +211,10 @@ function onGPS(fix) { var m; - speed = '---'; - alt = '---'; - dist = '---'; - age = '---'; + var speed = '---'; + var alt = '---'; + var dist = '---'; + var age = '---'; if (lf.fix == 1 ) { // Speed @@ -324,19 +323,11 @@ function btnReleased() { } function updateClock() { - if ( dbg ) print('Updating clock'); if (!canDraw) return; - drawTime(); g.reset(); g.drawImage(img,0,40); -// g.flip(); - - if ( emulator ) { - max.spd++; - max.alt++; - } - + if ( emulator ) {max.spd++;max.alt++;} } function startDraw(){ @@ -391,24 +382,15 @@ var img = { if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF]); if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800]); -// Find speed unit if using locale speed -if ( settings.spd == 0 ) { - var strSpeed = require("locale").speed(1); - m = strSpeed.match(/([0-9,\.]+)(.*)/); // regex splits numbers from units - settings.spd_unit = m[2]; -} - var SCREENACCESS = { withApp:true, request:function(){ this.withApp=false; stopDraw(); - clearWatch(); }, release:function(){ this.withApp=true; startDraw(); - setButtons(); } }; @@ -423,13 +405,10 @@ Bangle.on('lcdPower',function(on) { // All set up. Lets go. g.clear(); -Bangle.setLCDBrightness(1); Bangle.loadWidgets(); Bangle.drawWidgets(); Bangle.setGPSPower(1); - onGPS(lf); Bangle.on('GPS', onGPS); - setButtons(); setInterval(updateClock, 30000); From 1944382768ecbdb8b13668ab5fd119dab4d417ad Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 17:05:59 +1300 Subject: [PATCH 046/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 1d50aa1e6..f22a88ee1 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.06", + "version":"1.07", "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.", "tags": "tool,outdoors", "type":"app", From 50f6075d40b9c03430dd80711efa002376b8ae7e Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 17:06:41 +1300 Subject: [PATCH 047/149] Update ChangeLog --- apps/speedalt/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 405f80f63..debc08453 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -8,4 +8,5 @@ 1.00 : New feature. Added waypoints file and distance to selected waypoint display 1.04 : Misc tweaks. 1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. -1.06 : Save display settings and restore when app restarted. +1.06 : Save display settings and restore when app restarted. +1.07 : Memory optimisation. From 65001996639749bd93d576bebe75f79df1c7866b Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 17:39:16 +1300 Subject: [PATCH 048/149] Update app.js --- apps/speedalt/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 21e472c11..41ea06253 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -387,10 +387,12 @@ var SCREENACCESS = { request:function(){ this.withApp=false; stopDraw(); + clearWatch(); }, release:function(){ this.withApp=true; startDraw(); + setButtons(); } }; @@ -412,3 +414,4 @@ onGPS(lf); Bangle.on('GPS', onGPS); setButtons(); setInterval(updateClock, 30000); + From fb3853ce38bd6a7854fd67a70bab2c950f47b20c Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 18:04:48 +1300 Subject: [PATCH 049/149] Update app.js --- apps/speedalt/app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 41ea06253..cd47bf15b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -220,7 +220,7 @@ function onGPS(fix) { // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units - speed = m[1]; + speed = parseFloat(m[1]); settings.spd_unit = m[2]; } else { @@ -387,12 +387,10 @@ var SCREENACCESS = { request:function(){ this.withApp=false; stopDraw(); - clearWatch(); }, release:function(){ this.withApp=true; startDraw(); - setButtons(); } }; @@ -414,4 +412,3 @@ onGPS(lf); Bangle.on('GPS', onGPS); setButtons(); setInterval(updateClock, 30000); - From 6bece4a54cfe42d35e045e8933dae6d1c34d868a Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 18:58:03 +1300 Subject: [PATCH 050/149] Update app.js --- apps/speedalt/app.js | 55 ++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index cd47bf15b..efd653802 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.07 +Ver : 1.07a mem optimise Mike Bennett mike[at]kereru.com process.memory() */ @@ -211,35 +211,35 @@ function onGPS(fix) { var m; - var speed = '---'; - var alt = '---'; - var dist = '---'; + var sp = '---'; + var al = '---'; + var di = '---'; var age = '---'; if (lf.fix == 1 ) { // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units - speed = parseFloat(m[1]); + sp = parseFloat(m[1]); settings.spd_unit = m[2]; } else { // Calculate for selected units - speed = lf.speed; - speed = parseFloat(speed)/parseFloat(settings.spd); + sp = lf.speed; + sp = parseFloat(sp)/parseFloat(settings.spd); } - if ( speed < 10 ) speed = speed.toFixed(1); - else speed = Math.round(speed); - if (parseFloat(speed) > parseFloat(max.spd) ) max.spd = parseFloat(speed); + if ( sp < 10 ) sp = sp.toFixed(1); + else sp = Math.round(sp); + if (parseFloat(sp) > parseFloat(max.spd) ) max.spd = parseFloat(sp); // Altitude - alt = lf.alt; - alt = Math.round(parseFloat(alt)/parseFloat(settings.alt)); - if (parseFloat(alt) > parseFloat(max.alt) ) max.alt = parseFloat(alt); + al = lf.alt; + al = Math.round(parseFloat(al)/parseFloat(settings.alt)); + if (parseFloat(al) > parseFloat(max.alt) ) max.alt = parseFloat(al); // Distance to waypoint - dist = distance(lf,wp); - if (isNaN(dist)) dist = 0; + di = distance(lf,wp); + if (isNaN(di)) di = 0; // Age of last fix (secs) age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); @@ -253,17 +253,17 @@ function onGPS(fix) { } else { // Show speed/altitude - drawFix(speed,settings.spd_unit,fix.satellites,alt,settings.alt_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,fix.satellites,al,settings.alt_unit,age,fix.fix); } } else { // Show speed/distance - if ( dist <= 0 ) { + if ( di <= 0 ) { // No WP selected - drawFix(speed,settings.spd_unit,fix.satellites,'','',age,fix.fix); + drawFix(sp,settings.spd_unit,fix.satellites,'','',age,fix.fix); } else { - drawFix(speed,settings.spd_unit,fix.satellites,dist,settings.dist_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,fix.satellites,di,settings.dist_unit,age,fix.fix); } } @@ -384,23 +384,14 @@ if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF8 var SCREENACCESS = { withApp:true, - request:function(){ - this.withApp=false; - stopDraw(); - }, - release:function(){ - this.withApp=true; - startDraw(); - } + request:function(){this.withApp=false;stopDraw();}, + release:function(){this.withApp=true;startDraw();} }; Bangle.on('lcdPower',function(on) { if (!SCREENACCESS.withApp) return; - if (on) { - startDraw(); - } else { - stopDraw(); - } + if (on) startDraw(); + else stopDraw(); }); // All set up. Lets go. From 69c4519b941b495f26cf4645405e23ff008928d8 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 21:03:05 +1300 Subject: [PATCH 051/149] Update settings.js --- apps/speedalt/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index 3f4d6303f..114664e2c 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -34,11 +34,11 @@ '': {'title': 'GPS Speed Alt'}, '< Back': back, 'Units' : function() { E.showMenu(unitsMenu); }, - 'Colours' : function() { E.showMenu(colMenu); }, + 'Colours' : function() { E.showMenu(colMenu); }/*, 'Vibrate' : { value : settings.buzz, format : v => v?"On":"Off", - onchange : () => { settings.buzz = !settings.buzz; writeSettings(); } + onchange : () => { settings.buzz = !settings.buzz; writeSettings(); }*/ }}; const unitsMenu = { From 80927cfaab767394d305578bad4fb55d31f30269 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:01:55 +1300 Subject: [PATCH 052/149] Update app.js --- apps/speedalt/app.js | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index efd653802..672bada49 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.07a mem optimise +Ver : 1.07b low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ @@ -208,7 +208,12 @@ function onGPS(fix) { } if (fix.fix) lf = fix; + doFix(); + +} +function doFix() { + var m; var sp = '---'; @@ -249,21 +254,21 @@ function onGPS(fix) { if ( settings.modeA ) { if ( showMax ) { // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit,age,fix.fix); + drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); } else { // Show speed/altitude - drawFix(sp,settings.spd_unit,fix.satellites,al,settings.alt_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); } } else { // Show speed/distance if ( di <= 0 ) { // No WP selected - drawFix(sp,settings.spd_unit,fix.satellites,'','',age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); } else { - drawFix(sp,settings.spd_unit,fix.satellites,di,settings.dist_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); } } @@ -332,6 +337,7 @@ function updateClock() { function startDraw(){ canDraw=true; + setLpMode(0); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -339,12 +345,28 @@ function startDraw(){ function stopDraw() { canDraw=false; + setLpMode(1); // on } function savSettings() { require("Storage").write('speedalt.json',settings); } +// Is low power GPS service available to use? +function isLP() { + if (WIDGETS.gpsservice == undefined) return(0); + return(1); +} + +function setLpMode(on) { + if ( !lp ) return; + var settings = WIDGETS.gpsservice.gps_get_settings(); + settings.gpsservice = on; + settings.power_mode = (on)?'PSMOO':'SuperE'; + WIDGETS.gpsservice.gps_set_settings(settings); + WIDGETS.gpsservice.reload(); +} + // =Main Prog // Read settings. @@ -398,6 +420,10 @@ Bangle.on('lcdPower',function(on) { g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); + +var lp = isLP(); // Low power GPS widget installed. + + Bangle.setGPSPower(1); onGPS(lf); Bangle.on('GPS', onGPS); From 2a120cb7694a906be83065d282cb2acd64f52482 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:07:22 +1300 Subject: [PATCH 053/149] Update app.js --- apps/speedalt/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 672bada49..9c083a27d 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -363,6 +363,9 @@ function setLpMode(on) { var settings = WIDGETS.gpsservice.gps_get_settings(); settings.gpsservice = on; settings.power_mode = (on)?'PSMOO':'SuperE'; + + print(settings.power_mode); + WIDGETS.gpsservice.gps_set_settings(settings); WIDGETS.gpsservice.reload(); } From 0698cc31a3bf28daccf4b36cda437123a62310d9 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:14:18 +1300 Subject: [PATCH 054/149] Update app.js --- apps/speedalt/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 9c083a27d..52dace3f3 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -425,9 +425,8 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); var lp = isLP(); // Low power GPS widget installed. - - Bangle.setGPSPower(1); +setLpMode(0); onGPS(lf); Bangle.on('GPS', onGPS); setButtons(); From d20fb4cd53927c222af6c37a8f4f2a9e592b9d03 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:20:49 +1300 Subject: [PATCH 055/149] Update app.js --- apps/speedalt/app.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 52dace3f3..af298d27c 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -354,19 +354,18 @@ function savSettings() { // Is low power GPS service available to use? function isLP() { - if (WIDGETS.gpsservice == undefined) return(0); - return(1); + retrun (WIDGETS.gpsservice==undefined)?0:1; } function setLpMode(on) { if ( !lp ) return; - var settings = WIDGETS.gpsservice.gps_get_settings(); - settings.gpsservice = on; - settings.power_mode = (on)?'PSMOO':'SuperE'; + var s = WIDGETS.gpsservice.gps_get_settings(); + s.gpsservice = on; + s.power_mode = (on)?'PSMOO':'SuperE'; - print(settings.power_mode); + print(s.power_mode+''+s.update); - WIDGETS.gpsservice.gps_set_settings(settings); + WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From cf08ec851de848c210a82ae07074a65590f7f6d8 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:24:30 +1300 Subject: [PATCH 056/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index af298d27c..5c87ac002 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -363,7 +363,7 @@ function setLpMode(on) { s.gpsservice = on; s.power_mode = (on)?'PSMOO':'SuperE'; - print(s.power_mode+''+s.update); + print(s.power_mode+' '+s.update); WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 2ab9a562841f40120c1d50026fd601e6d04a6188 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:26:30 +1300 Subject: [PATCH 057/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 5c87ac002..6c31bc44f 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -363,7 +363,7 @@ function setLpMode(on) { s.gpsservice = on; s.power_mode = (on)?'PSMOO':'SuperE'; - print(s.power_mode+' '+s.update); + print(s.power_mode+' ['+s.update+']'); WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 9f81246989d44d2b71a046461c475d537116e6f4 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:28:29 +1300 Subject: [PATCH 058/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 6c31bc44f..7df9c0ea5 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -354,7 +354,7 @@ function savSettings() { // Is low power GPS service available to use? function isLP() { - retrun (WIDGETS.gpsservice==undefined)?0:1; + return (WIDGETS.gpsservice==undefined)?0:1; } function setLpMode(on) { From 06651b2575c973e45de65f3a4099e5a1f994d469 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:42:05 +1300 Subject: [PATCH 059/149] Update app.js --- apps/speedalt/app.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7df9c0ea5..fde27bec5 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -362,9 +362,6 @@ function setLpMode(on) { var s = WIDGETS.gpsservice.gps_get_settings(); s.gpsservice = on; s.power_mode = (on)?'PSMOO':'SuperE'; - - print(s.power_mode+' ['+s.update+']'); - WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From acaa293abc06c4cecc06d2d27180076dde9a4ec6 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:45:37 +1300 Subject: [PATCH 060/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index fde27bec5..fe080d110 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -360,7 +360,7 @@ function isLP() { function setLpMode(on) { if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); - s.gpsservice = on; + s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 6fd412a25c4b1a5032d16e5deb50ced4bb90a4ff Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:47:18 +1300 Subject: [PATCH 061/149] Update app.js --- apps/speedalt/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index fe080d110..c279a227e 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -362,6 +362,9 @@ function setLpMode(on) { var s = WIDGETS.gpsservice.gps_get_settings(); s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; + +print(s.power_mode+' ['+s.update+']'); + WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From 7d40130b20a6c7e11c2ddfa08a48e95e0f1d7d93 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:48:35 +1300 Subject: [PATCH 062/149] Update settings.js --- apps/speedalt/settings.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index 114664e2c..5f7418dbb 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -38,8 +38,9 @@ 'Vibrate' : { value : settings.buzz, format : v => v?"On":"Off", - onchange : () => { settings.buzz = !settings.buzz; writeSettings(); }*/ - }}; + onchange : () => { settings.buzz = !settings.buzz; writeSettings(); } + }*/ + }; const unitsMenu = { '': {'title': 'Units'}, From e8605338bd398cd71d56a410d1eba3ff5f79e8c8 Mon Sep 17 00:00:00 2001 From: nujw Date: Thu, 4 Feb 2021 22:57:01 +1300 Subject: [PATCH 063/149] Update app.js --- apps/speedalt/app.js | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index c279a227e..b80c923bd 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.07b low power gps widget +Ver : 1.07 Mike Bennett mike[at]kereru.com process.memory() */ @@ -208,12 +208,7 @@ function onGPS(fix) { } if (fix.fix) lf = fix; - doFix(); - -} -function doFix() { - var m; var sp = '---'; @@ -254,21 +249,21 @@ function doFix() { if ( settings.modeA ) { if ( showMax ) { // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); + drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit,age,fix.fix); } else { // Show speed/altitude - drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); + drawFix(sp,settings.spd_unit,fix.satellites,al,settings.alt_unit,age,fix.fix); } } else { // Show speed/distance if ( di <= 0 ) { // No WP selected - drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); + drawFix(sp,settings.spd_unit,fix.satellites,'','',age,fix.fix); } else { - drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); + drawFix(sp,settings.spd_unit,fix.satellites,di,settings.dist_unit,age,fix.fix); } } @@ -337,7 +332,6 @@ function updateClock() { function startDraw(){ canDraw=true; - setLpMode(0); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -345,30 +339,12 @@ function startDraw(){ function stopDraw() { canDraw=false; - setLpMode(1); // on } function savSettings() { require("Storage").write('speedalt.json',settings); } -// Is low power GPS service available to use? -function isLP() { - return (WIDGETS.gpsservice==undefined)?0:1; -} - -function setLpMode(on) { - if ( !lp ) return; - var s = WIDGETS.gpsservice.gps_get_settings(); - s.gpsservice = true; - s.power_mode = (on)?'PSMOO':'SuperE'; - -print(s.power_mode+' ['+s.update+']'); - - WIDGETS.gpsservice.gps_set_settings(s); - WIDGETS.gpsservice.reload(); -} - // =Main Prog // Read settings. @@ -422,10 +398,7 @@ Bangle.on('lcdPower',function(on) { g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); - -var lp = isLP(); // Low power GPS widget installed. Bangle.setGPSPower(1); -setLpMode(0); onGPS(lf); Bangle.on('GPS', onGPS); setButtons(); From 82ffaf63830aae6959f2fbab3c30658a06fd5900 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:02:35 +1300 Subject: [PATCH 064/149] Update ChangeLog --- apps/speedalt/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index debc08453..47f335b6f 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -10,3 +10,4 @@ 1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. 1.06 : Save display settings and restore when app restarted. 1.07 : Memory optimisation. +2.01 : Integrate with Low Power GPS service From ded3b115bd38f54addd6fa9e84a97426e50f4892 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:04:05 +1300 Subject: [PATCH 065/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index f22a88ee1..ea91d4981 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"1.07", + "version":"2.01", "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.", "tags": "tool,outdoors", "type":"app", From d79336d212c0f7518c67b894f57383633d7502ff Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:06:09 +1300 Subject: [PATCH 066/149] Low Power widget branch --- apps/speedalt/app.js | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index b80c923bd..672bada49 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.07 +Ver : 1.07b low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ @@ -208,7 +208,12 @@ function onGPS(fix) { } if (fix.fix) lf = fix; + doFix(); + +} +function doFix() { + var m; var sp = '---'; @@ -249,21 +254,21 @@ function onGPS(fix) { if ( settings.modeA ) { if ( showMax ) { // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,fix.satellites,max.alt,settings.alt_unit,age,fix.fix); + drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); } else { // Show speed/altitude - drawFix(sp,settings.spd_unit,fix.satellites,al,settings.alt_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); } } else { // Show speed/distance if ( di <= 0 ) { // No WP selected - drawFix(sp,settings.spd_unit,fix.satellites,'','',age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); } else { - drawFix(sp,settings.spd_unit,fix.satellites,di,settings.dist_unit,age,fix.fix); + drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); } } @@ -332,6 +337,7 @@ function updateClock() { function startDraw(){ canDraw=true; + setLpMode(0); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -339,12 +345,28 @@ function startDraw(){ function stopDraw() { canDraw=false; + setLpMode(1); // on } function savSettings() { require("Storage").write('speedalt.json',settings); } +// Is low power GPS service available to use? +function isLP() { + if (WIDGETS.gpsservice == undefined) return(0); + return(1); +} + +function setLpMode(on) { + if ( !lp ) return; + var settings = WIDGETS.gpsservice.gps_get_settings(); + settings.gpsservice = on; + settings.power_mode = (on)?'PSMOO':'SuperE'; + WIDGETS.gpsservice.gps_set_settings(settings); + WIDGETS.gpsservice.reload(); +} + // =Main Prog // Read settings. @@ -398,6 +420,10 @@ Bangle.on('lcdPower',function(on) { g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); + +var lp = isLP(); // Low power GPS widget installed. + + Bangle.setGPSPower(1); onGPS(lf); Bangle.on('GPS', onGPS); From f290969ea1708e789f4912dcf580a2be8eec55da Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:06:36 +1300 Subject: [PATCH 067/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 672bada49..4fc027664 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,6 +1,6 @@ /* Speed and Altitude [speedalt] -Ver : 1.07b low power gps widget +Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ From 1afb2e28ddc1391a9f8272669988cc4a6384ef53 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:09:28 +1300 Subject: [PATCH 068/149] Set theme jekyll-theme-leap-day --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index c74188174..b84971359 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-slate \ No newline at end of file +theme: jekyll-theme-leap-day \ No newline at end of file From e803faf71bc7c5693e7e889424f9401286abe801 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:47:59 +1300 Subject: [PATCH 070/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 4fc027664..a55a65659 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -361,7 +361,7 @@ function isLP() { function setLpMode(on) { if ( !lp ) return; var settings = WIDGETS.gpsservice.gps_get_settings(); - settings.gpsservice = on; + settings.gpsservice = true; settings.power_mode = (on)?'PSMOO':'SuperE'; WIDGETS.gpsservice.gps_set_settings(settings); WIDGETS.gpsservice.reload(); From 19186dfae4ac4f99f0f1a8ce8a40bac2075b3848 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 08:48:47 +1300 Subject: [PATCH 071/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index ea91d4981..efae93f7c 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.01", + "version":"2.02", "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.", "tags": "tool,outdoors", "type":"app", From 961c5e47180bc7f55b99724967f69bbe3140c5c4 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:01:14 +1300 Subject: [PATCH 072/149] Update app.js --- apps/speedalt/app.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index a55a65659..6c14972d4 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -221,6 +221,8 @@ function doFix() { var di = '---'; var age = '---'; +print(lf.fix+' '+lf.alt); + if (lf.fix == 1 ) { // Speed if ( settings.spd == 0 ) { @@ -360,9 +362,12 @@ function isLP() { function setLpMode(on) { if ( !lp ) return; - var settings = WIDGETS.gpsservice.gps_get_settings(); - settings.gpsservice = true; - settings.power_mode = (on)?'PSMOO':'SuperE'; + var s = WIDGETS.gpsservice.gps_get_settings(); + s.gpsservice = true; + s.power_mode = (on)?'PSMOO':'SuperE'; + +print( s.power_mode ); + WIDGETS.gpsservice.gps_set_settings(settings); WIDGETS.gpsservice.reload(); } From cc47b51c1ce58029322d09b903d0be4c616c4ce3 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:01:55 +1300 Subject: [PATCH 073/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index efae93f7c..8b26252e1 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.02", + "version":"2.03", "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.", "tags": "tool,outdoors", "type":"app", From 7044a12c6389b78ceaa454d29d0f3f13867fbe14 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:14:47 +1300 Subject: [PATCH 074/149] Update app.js --- apps/speedalt/app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 6c14972d4..d27d441c6 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -360,6 +360,10 @@ function isLP() { return(1); } +function lpGetFix() { + onGPS(WIDGETS.gpsservice.gps_get_fix()); +} + function setLpMode(on) { if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); @@ -431,6 +435,9 @@ var lp = isLP(); // Low power GPS widget installed. Bangle.setGPSPower(1); onGPS(lf); -Bangle.on('GPS', onGPS); + +if ( lp ) setInterval(lpGetFix, 1000); +else Bangle.on('GPS', onGPS); + setButtons(); setInterval(updateClock, 30000); From 2bcfc725363d391abc41929b3985c9fb4689cb35 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:15:33 +1300 Subject: [PATCH 075/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 8b26252e1..f5064fc77 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.03", + "version":"2.04", "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.", "tags": "tool,outdoors", "type":"app", From 0dc34edf3bca8f75fa03ebd15d8e63e2b444576b Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:23:56 +1300 Subject: [PATCH 076/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index d27d441c6..03641a952 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -372,7 +372,7 @@ function setLpMode(on) { print( s.power_mode ); - WIDGETS.gpsservice.gps_set_settings(settings); + WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From d228eb3c2b19fdd90e4425562908d45677b9f72a Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:24:39 +1300 Subject: [PATCH 077/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index f5064fc77..6406ebf7b 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.04", + "version":"2.05", "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.", "tags": "tool,outdoors", "type":"app", From 7fb03ff9003b87ce98cba89fba2ea0568cb5c79f Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:35:29 +1300 Subject: [PATCH 078/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 03641a952..ecf54dde3 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -370,7 +370,7 @@ function setLpMode(on) { s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; -print( s.power_mode ); +print( s ); WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 45e55e48ccfcf7a34155391cbacba12fc59f7812 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:36:02 +1300 Subject: [PATCH 079/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 6406ebf7b..e636cf4bb 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.05", + "version":"2.06", "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.", "tags": "tool,outdoors", "type":"app", From 1116b4400a18153e9036ea7c554e6344296464bb Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:44:48 +1300 Subject: [PATCH 080/149] Update app.js --- apps/speedalt/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index ecf54dde3..625df8447 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -347,7 +347,9 @@ function startDraw(){ function stopDraw() { canDraw=false; - setLpMode(1); // on +// setLpMode(1); // on +setLpMode(0); // off + } function savSettings() { From af83dafee4d956c1ac1ff668e799f92e37be57a4 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 09:45:43 +1300 Subject: [PATCH 081/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index e636cf4bb..fa3ab83c4 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.06", + "version":"2.07", "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.", "tags": "tool,outdoors", "type":"app", From b3357b2efaa1c43a0b6cdcdb62cee29d6849baf5 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 10:19:49 +1300 Subject: [PATCH 082/149] Update app.js --- apps/speedalt/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 625df8447..3ebba0bb0 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -347,9 +347,7 @@ function startDraw(){ function stopDraw() { canDraw=false; -// setLpMode(1); // on -setLpMode(0); // off - + setLpMode(1); // on } function savSettings() { @@ -372,7 +370,7 @@ function setLpMode(on) { s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; -print( s ); +print('[a] '+s.power_mode); WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 569b08200c2cd0cf1b9edd473974cbf9418bd2e4 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 10:31:26 +1300 Subject: [PATCH 083/149] Update app.js --- apps/speedalt/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 3ebba0bb0..7a7cb7ec4 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -207,6 +207,10 @@ function onGPS(fix) { fix.time = new Date(); } + +print(fix.fix+' '+fix.alt); + + if (fix.fix) lf = fix; doFix(); @@ -220,10 +224,8 @@ function doFix() { var al = '---'; var di = '---'; var age = '---'; - -print(lf.fix+' '+lf.alt); - - if (lf.fix == 1 ) { + + if (lf.fix == 1 ) { // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units @@ -370,7 +372,7 @@ function setLpMode(on) { s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; -print('[a] '+s.power_mode); +print('[b] '+s.power_mode); WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From 0520d9a2074fb2840aedb9abfb7f0737435192b4 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 10:43:15 +1300 Subject: [PATCH 084/149] Update app.js --- apps/speedalt/app.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7a7cb7ec4..6398e377f 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -206,10 +206,6 @@ function onGPS(fix) { fix.satellites = 12; fix.time = new Date(); } - - -print(fix.fix+' '+fix.alt); - if (fix.fix) lf = fix; doFix(); @@ -371,9 +367,6 @@ function setLpMode(on) { var s = WIDGETS.gpsservice.gps_get_settings(); s.gpsservice = true; s.power_mode = (on)?'PSMOO':'SuperE'; - -print('[b] '+s.power_mode); - WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From 40346cfb6f094247affa6fd5faa67b76a5b1e7fc Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 10:47:54 +1300 Subject: [PATCH 085/149] Update app.js --- apps/speedalt/app.js | 99 +++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 52 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 6398e377f..530f064b0 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -208,12 +208,7 @@ function onGPS(fix) { } if (fix.fix) lf = fix; - doFix(); - -} -function doFix() { - var m; var sp = '---'; @@ -221,56 +216,56 @@ function doFix() { var di = '---'; var age = '---'; - if (lf.fix == 1 ) { - // Speed - if ( settings.spd == 0 ) { - m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units - sp = parseFloat(m[1]); - settings.spd_unit = m[2]; - } - else { - // Calculate for selected units - sp = lf.speed; - sp = parseFloat(sp)/parseFloat(settings.spd); - } - if ( sp < 10 ) sp = sp.toFixed(1); - else sp = Math.round(sp); - if (parseFloat(sp) > parseFloat(max.spd) ) max.spd = parseFloat(sp); - - // Altitude - al = lf.alt; - al = Math.round(parseFloat(al)/parseFloat(settings.alt)); - if (parseFloat(al) > parseFloat(max.alt) ) max.alt = parseFloat(al); - - // Distance to waypoint - di = distance(lf,wp); - if (isNaN(di)) di = 0; - - // Age of last fix (secs) - age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); - if ( age > 90 ) age = '>90'; - } - - if ( settings.modeA ) { - if ( showMax ) { - // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); - } - else { - // Show speed/altitude - drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); - } +// if (lf.fix == 1 ) { + // Speed + if ( settings.spd == 0 ) { + m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units + sp = parseFloat(m[1]); + settings.spd_unit = m[2]; } else { - // Show speed/distance - if ( di <= 0 ) { - // No WP selected - drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); - } - else { - drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); - } + // Calculate for selected units + sp = lf.speed; + sp = parseFloat(sp)/parseFloat(settings.spd); } + if ( sp < 10 ) sp = sp.toFixed(1); + else sp = Math.round(sp); + if (parseFloat(sp) > parseFloat(max.spd) ) max.spd = parseFloat(sp); + + // Altitude + al = lf.alt; + al = Math.round(parseFloat(al)/parseFloat(settings.alt)); + if (parseFloat(al) > parseFloat(max.alt) ) max.alt = parseFloat(al); + + // Distance to waypoint + di = distance(lf,wp); + if (isNaN(di)) di = 0; + + // Age of last fix (secs) + age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); + if ( age > 90 ) age = '>90'; +// } + + if ( settings.modeA ) { + if ( showMax ) { + // Speed and alt maximums + drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); + } + else { + // Show speed/altitude + drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); + } + } + else { + // Show speed/distance + if ( di <= 0 ) { + // No WP selected + drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); + } + else { + drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); + } + } } From 2e34b4f030e9c364628cab72fcb186bb9d5af2c7 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 11:14:34 +1300 Subject: [PATCH 086/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 530f064b0..97e84548e 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -216,7 +216,7 @@ function onGPS(fix) { var di = '---'; var age = '---'; -// if (lf.fix == 1 ) { + if (lf.fix == 1 ) { // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units @@ -244,7 +244,7 @@ function onGPS(fix) { // Age of last fix (secs) age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); if ( age > 90 ) age = '>90'; -// } + } if ( settings.modeA ) { if ( showMax ) { From fae839f86cf9ddd666bec9d64943a31d9c2e7b5b Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 11:23:12 +1300 Subject: [PATCH 087/149] Update app.js --- apps/speedalt/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 97e84548e..eac8d186c 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -90,9 +90,11 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { drawWP(); //Sats - if ( fix ) drawSats('Sats:'+sats); - else drawSats('Age:'+age); - +// if ( fix ) drawSats('Sats:'+sats); +// else drawSats('Age:'+age); + if ( age > 10 ) drawSats('Age:'+age); + else drawSats('Sats:'+sats); + g.reset(); g.drawImage(img,0,40); @@ -242,7 +244,9 @@ function onGPS(fix) { if (isNaN(di)) di = 0; // Age of last fix (secs) - age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); + //age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); + var time = formatTime(lf.time); + age = timeSince(time); if ( age > 90 ) age = '>90'; } From 0f8af3e8eced769c3d816bec0638fb29fe6269ba Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 11:27:07 +1300 Subject: [PATCH 088/149] Update app.js --- apps/speedalt/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index eac8d186c..398ac5adf 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -244,9 +244,7 @@ function onGPS(fix) { if (isNaN(di)) di = 0; // Age of last fix (secs) - //age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); - var time = formatTime(lf.time); - age = timeSince(time); + age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); if ( age > 90 ) age = '>90'; } From c284a9c999d356390a93a53de9392101c0b69154 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 11:55:25 +1300 Subject: [PATCH 089/149] Update app.js --- apps/speedalt/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 398ac5adf..23d2fa62f 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -209,8 +209,6 @@ function onGPS(fix) { fix.time = new Date(); } - if (fix.fix) lf = fix; - var m; var sp = '---'; @@ -218,7 +216,9 @@ function onGPS(fix) { var di = '---'; var age = '---'; - if (lf.fix == 1 ) { + if (fix.fix) { + lf = fix; + // Speed if ( settings.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units @@ -342,7 +342,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - setLpMode(1); // on + if (lf.fix) setLpMode(1); // on. Keep lp mode off until we have a first fix. } function savSettings() { From 0e2c518efd78a513f834d50be967bdf69f4de291 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 13:22:00 +1300 Subject: [PATCH 090/149] Update app.js --- apps/speedalt/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 23d2fa62f..3e579f7cb 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -15,6 +15,7 @@ var showMax = 0; // 1 = display the max values. 0 = display the cur fix var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. +var tmrLP; // Timer for delay in switching to low power after screen turns off var max = {}; max.spd = 0; @@ -334,6 +335,10 @@ function updateClock() { function startDraw(){ canDraw=true; + if (tmrLP) { + clearInterval(tmrLP); // Stop any scheduled drop to low power + tmrLP = false; + } setLpMode(0); // off g.clear(); Bangle.drawWidgets(); @@ -342,7 +347,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - if (lf.fix) setLpMode(1); // on. Keep lp mode off until we have a first fix. + if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode(1);}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. } function savSettings() { From 40604b93a31b2aecd86b390367c33cc316a80e0b Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 13:27:24 +1300 Subject: [PATCH 091/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 3e579f7cb..7f29dbd79 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ - +var v = '2'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts From c7aec562d96d197341b4101587256d56b330e90c Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 13:54:04 +1300 Subject: [PATCH 092/149] Update app.js --- apps/speedalt/app.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7f29dbd79..dc5aa9f83 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '2'; +var v = '3'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -335,10 +335,6 @@ function updateClock() { function startDraw(){ canDraw=true; - if (tmrLP) { - clearInterval(tmrLP); // Stop any scheduled drop to low power - tmrLP = false; - } setLpMode(0); // off g.clear(); Bangle.drawWidgets(); @@ -365,6 +361,7 @@ function lpGetFix() { } function setLpMode(on) { + if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); s.gpsservice = true; From 92f9a8e1c341441fdc9ad62745a6dc5fd97a160b Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 14:03:07 +1300 Subject: [PATCH 093/149] Update app.js --- apps/speedalt/app.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index dc5aa9f83..0fd924bc5 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '3'; +var v = '4'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -91,9 +91,10 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { drawWP(); //Sats -// if ( fix ) drawSats('Sats:'+sats); -// else drawSats('Age:'+age); - if ( age > 10 ) drawSats('Age:'+age); + if ( age > 10 ) { + if ( age > 90 ) age = '>90'; + drawSats('Age:'+age); + } else drawSats('Sats:'+sats); g.reset(); @@ -164,13 +165,10 @@ function drawTime() { function drawWP() { var nm = wp.name; - if ( nm == undefined ) nm = ''; - if ( nm == 'NONE' ) nm = ''; - if ( settings.modeA ) nm=''; + if ( nm == undefined || nm == 'NONE' || settings.modeA ) nm = ''; - buf.setFontAlign(-12,1); //left, bottom + buf.setFontAlign(-1,1); //left, bottom buf.setColor(2); -// buf.setFont("6x8", 1); buf.setFontVector(20); buf.drawString(nm.substring(0,6),77,160); @@ -246,7 +244,6 @@ function onGPS(fix) { // Age of last fix (secs) age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); - if ( age > 90 ) age = '>90'; } if ( settings.modeA ) { From 6f79080f8c7f840f8c0041f0cb9ad5098018bbff Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 14:31:24 +1300 Subject: [PATCH 094/149] Update app.js --- apps/speedalt/app.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 0fd924bc5..71bf28563 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '4'; +var v = '5'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -65,22 +65,18 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { var u=''; // Primary Display - v = speed.toString(); - if ( !settings.primSpd ) v = alt.toString(); + v = (settings.primSpd)?speed.toString():alt.toString(); // Primary Units - u = settings.spd_unit; - if ( !settings.primSpd ) u = alt_units; + u = (settings.primSpd)?settings.spd_unit:alt_units; drawPrimary(v,u); // Secondary Display - v = alt.toString(); - if ( !settings.primSpd ) v = speed.toString(); + v = (settings.primSpd)?alt.toString():speed.toString(); // Secondary Units - u = alt_units; - if ( !settings.primSpd ) u = settings.spd_unit; + u = (settings.primSpd)?alt_units:settings.spd_unit; drawSecondary(v,u); From acaf6d32b73ce3258fc73256744b137f48529f93 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 14:44:12 +1300 Subject: [PATCH 095/149] Update app.js --- apps/speedalt/app.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 71bf28563..493e9119f 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '5'; +var v = '6'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -328,7 +328,7 @@ function updateClock() { function startDraw(){ canDraw=true; - setLpMode(0); // off + setLpMode('SuperE'); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -336,7 +336,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode(1);}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. + if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO');}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. } function savSettings() { @@ -353,14 +353,16 @@ function lpGetFix() { onGPS(WIDGETS.gpsservice.gps_get_fix()); } -function setLpMode(on) { +function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); - s.gpsservice = true; - s.power_mode = (on)?'PSMOO':'SuperE'; - WIDGETS.gpsservice.gps_set_settings(s); - WIDGETS.gpsservice.reload(); + if ( m <> s.power_mode ) { + s.gpsservice = true; + s.power_mode = (on)?'PSMOO':'SuperE'; + WIDGETS.gpsservice.gps_set_settings(s); + WIDGETS.gpsservice.reload(); + } } // =Main Prog From f4815c5ff8a5855245aed020a285d45d5d8b9d60 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 14:46:26 +1300 Subject: [PATCH 096/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 493e9119f..426d35f3a 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -359,7 +359,7 @@ function setLpMode(m) { var s = WIDGETS.gpsservice.gps_get_settings(); if ( m <> s.power_mode ) { s.gpsservice = true; - s.power_mode = (on)?'PSMOO':'SuperE'; + s.power_mode = m; WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } From 2c4f83d0504035c57e57463c410369a799b812d9 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 14:51:49 +1300 Subject: [PATCH 097/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 426d35f3a..f974d75a2 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '6'; +var v = '7'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -357,7 +357,7 @@ function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); - if ( m <> s.power_mode ) { + if ( m !== s.power_mode ) { s.gpsservice = true; s.power_mode = m; WIDGETS.gpsservice.gps_set_settings(s); From cae0222b94df682620ed42e9ce2ee739871afe55 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 15:20:17 +1300 Subject: [PATCH 098/149] Update app.js --- apps/speedalt/app.js | 45 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index f974d75a2..7d2cf5795 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -4,7 +4,7 @@ Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com process.memory() */ -var v = '7'; +var v = '8'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -220,11 +220,8 @@ function onGPS(fix) { sp = parseFloat(m[1]); settings.spd_unit = m[2]; } - else { - // Calculate for selected units - sp = lf.speed; - sp = parseFloat(sp)/parseFloat(settings.spd); - } + else sp = parseFloat(lf.speed)/parseFloat(settings.spd); // Calculate for selected units + if ( sp < 10 ) sp = sp.toFixed(1); else sp = Math.round(sp); if (parseFloat(sp) > parseFloat(max.spd) ) max.spd = parseFloat(sp); @@ -243,24 +240,13 @@ function onGPS(fix) { } if ( settings.modeA ) { - if ( showMax ) { - // Speed and alt maximums - drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); - } - else { - // Show speed/altitude - drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); - } - } + if ( showMax ) drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); // Speed and alt maximums + else drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); // Show speed/altitude + } else { // Show speed/distance - if ( di <= 0 ) { - // No WP selected - drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); - } - else { - drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); - } + if ( di <= 0 ) drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); // No WP selected + else drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); } } @@ -303,18 +289,11 @@ function btnReleased() { var dur = getTime()-maxPress; if ( settings.modeA ) { // Spd+Alt mode - Switch between fix and MAX - if ( dur < 2 ) { - showMax = !showMax; // Short press toggle fix/max display - } - else { - max.spd = 0; // Long press resets max values. - max.alt = 0; - } - } - else { - // Spd+Dist mode - Select next waypoint - nxtWp(1); + if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display + else { max.spd = 0; max.alt = 0; } // Long press resets max values. } + else nxtWp(1); // Spd+Dist mode - Select next waypoint + onGPS(lf); } From 2d935f77f80f3169fd76f429d87128264df6f994 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 17:23:33 +1300 Subject: [PATCH 099/149] Update ChangeLog --- apps/speedalt/ChangeLog | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 47f335b6f..2c77ccafa 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -5,9 +5,4 @@ 0.05 : Add setting to turn vibrate on/off. 0.06 : Tweaks to vibration settings. 0.07 : Switch to BTN1 for Max toggle and reset function. -1.00 : New feature. Added waypoints file and distance to selected waypoint display -1.04 : Misc tweaks. -1.05 : Memory optimisation. Stopped loading entire waypoint list into memory. -1.06 : Save display settings and restore when app restarted. -1.07 : Memory optimisation. -2.01 : Integrate with Low Power GPS service +1.00 : New features. Added waypoints file and distance to selected waypoint display. Added integration with Low Power GPS service. Save display settings and restore when app restarted. From b019b7e6f822c5c8f7251376905dfdca182942f9 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 17:24:51 +1300 Subject: [PATCH 100/149] Update app.js --- apps/speedalt/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7d2cf5795..3de66926b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,10 +1,8 @@ /* Speed and Altitude [speedalt] -Ver : 2.01 low power gps widget Mike Bennett mike[at]kereru.com -process.memory() */ -var v = '8'; +var v = '1.00'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts From 3e5fcbfdf076fb5a5c999caa790062df6e496a66 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 17:45:03 +1300 Subject: [PATCH 101/149] Update README.md --- apps/speedalt/README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index f9db449f4..2c8d5917a 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -31,9 +31,13 @@ Settings:
Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! -Thanks: -Many thanks to Gordon Williams. Awesome job. -Also to @jeffmer, the developer of the 'GPS Navigation' app. +Low Power GPS Service : + +This app will work quite happily without this service but will use the Low power GPS Service if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significant longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. + +When using the Low Power GPS Service this app switches the GPS to SuperE ( default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off. This delay gives an opportunity to restore the display before the power mode is switched. + +There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. Waypoints: @@ -103,3 +107,11 @@ Sample waypoints.json } ] + +Thanks: + +Many thanks to Gordon Williams. Awesome job. + +Special thanks also to @jeffmer, for the 'GPS Navigation' app and @hughbarney for the 'Low power GPS Service' work. + + From c618ebfdccc3e42d05db4ce842a93ed2b6bca629 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 17:56:37 +1300 Subject: [PATCH 102/149] Update README.md --- apps/speedalt/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 2c8d5917a..c5f8883a5 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -33,17 +33,19 @@ Developed for my use in sailing, cycling and motorcycling. If you find this soft Low Power GPS Service : -This app will work quite happily without this service but will use the Low power GPS Service if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significant longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. +This app will work quite happily without this service but will use the Low power GPS Service if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. -When using the Low Power GPS Service this app switches the GPS to SuperE ( default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off. This delay gives an opportunity to restore the display before the power mode is switched. +When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off. This delay gives an opportunity to restore the display before the power mode is switched. -There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. +There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. Waypoints: -Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displyed in Speed+[D]istance mode. +Waypoints are used in [D]istance mode. Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displayed in Speed+[D]istance mode. -Sample waypoints.json +The GPS Navigation app in the App Loader has a really nice waypoints file editor. + +Sample waypoints.json (My sailing waypoints)

 [

From f610ce521cab3748b1df25569cff75b82fbf5184 Mon Sep 17 00:00:00 2001
From: nujw 
Date: Fri, 5 Feb 2021 18:08:33 +1300
Subject: [PATCH 103/149] Update README.md

---
 apps/speedalt/README.md | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md
index c5f8883a5..cdffa483d 100644
--- a/apps/speedalt/README.md
+++ b/apps/speedalt/README.md
@@ -1,10 +1,12 @@
-Displays the GPS speed, altitude and distance to selected waypoint. One is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. 
+# GPS Speed, Altimeter and Distance to Waypoint
 
-You can chose between two modes. One showing speed and altitude (A) and one showing speed and distance to waypoint (D). 
+You can switch between two display modes. One showing speed and altitude (A) and one showing speed and distance to waypoint (D). 
+
+Within each display mode one figure is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. 
 
 The waypoints list is the same as that used with the [GPS Navigation] app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information.
 
-Left Display Tap : Swaps the displays. You can have either speed or [A]ltitude/[D]istance on the large primary display.
+Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display.
 
 BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded.
 
@@ -14,9 +16,9 @@ BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected wa
 
 BTN3 : Swaps the modes between Speed+[A]ltitude or Speed+[D]istance.
 
-App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance caqn be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default, high contrast (all white on black) or night ( all red on black ). 
+App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance can be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default (three colours), high contrast (all white on black) or night ( all red on black ). 
 
-Loss of fix : When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats'  or 'Age' indicates whether the GPS has a fix or not.  
+Loss of fix : When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats'  or 'Age' indicates whether the GPS has a current fix or not.  
 
 Speed and Altitude:
![](screen1.png)

@@ -31,7 +33,7 @@ Settings:
Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! -Low Power GPS Service : +## Low Power GPS Service This app will work quite happily without this service but will use the Low power GPS Service if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. @@ -39,7 +41,7 @@ When using the Low Power GPS Service this app switches the GPS to SuperE (defaul There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. -Waypoints: +## Waypoints Waypoints are used in [D]istance mode. Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displayed in Speed+[D]istance mode. @@ -110,7 +112,7 @@ Sample waypoints.json (My sailing waypoints) ]

-Thanks: +## Thanks Many thanks to Gordon Williams. Awesome job. From de21b9b57013346c7f045e9278bf6e8048c74dc5 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 18:09:32 +1300 Subject: [PATCH 104/149] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index fa3ab83c4..b5a98ec85 100644 --- a/apps.json +++ b/apps.json @@ -2625,7 +2625,7 @@ "name": "GPS Speedo and Altimeter", "shortName":"GPS Speed Alt", "icon": "app.png", - "version":"2.07", + "version":"1.00", "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.", "tags": "tool,outdoors", "type":"app", From fd17073693f5309a704acae47291309ebbce9416 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 18:22:25 +1300 Subject: [PATCH 105/149] Update README.md --- apps/speedalt/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index cdffa483d..13e840bfb 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -4,7 +4,7 @@ You can switch between two display modes. One showing speed and altitude (A) and Within each display mode one figure is displayed on the watch face using the largest possible characters depending on the number of digits. The other is in a smaller characters below that. Both are always visible. You can display the current or maximum observed speed/altitude values. Current time is always displayed. -The waypoints list is the same as that used with the [GPS Navigation] app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. +The waypoints list is the same as that used with the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. @@ -35,9 +35,9 @@ Developed for my use in sailing, cycling and motorcycling. If you find this soft ## Low Power GPS Service -This app will work quite happily without this service but will use the Low power GPS Service if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. +This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. -When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off. This delay gives an opportunity to restore the display before the power mode is switched. +When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. @@ -45,7 +45,7 @@ There are a couple of things to consider when using the Low Power GPS Service. T Waypoints are used in [D]istance mode. Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displayed in Speed+[D]istance mode. -The GPS Navigation app in the App Loader has a really nice waypoints file editor. +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) @@ -116,6 +116,6 @@ Sample waypoints.json (My sailing waypoints) Many thanks to Gordon Williams. Awesome job. -Special thanks also to @jeffmer, for the 'GPS Navigation' app and @hughbarney for the 'Low power GPS Service' work. +Special thanks also to @jeffmer, for the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app and @hughbarney for the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) work. From 256cb4f6c32200e9991ad3b1cf238ced5c5f660b Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 21:48:15 +1300 Subject: [PATCH 106/149] Update app.js --- apps/speedalt/app.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 3de66926b..09b8d69e0 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.00'; +var v = '1.01'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -10,6 +10,7 @@ require("Font7x11Numeric7Seg").add(Graphics); var lf = {fix:0,satellites:0}; var showMax = 0; // 1 = display the max values. 0 = display the cur fix +var pwrSav = 1; // 1 = default power saving with watch screen off and GPS to PMOO mode. 0 = screen kept on. var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. @@ -262,6 +263,19 @@ function toggleAltDist() { onGPS(lf); } +function togglePwrSav() { + pwrSav=!pwrSav; + if ( pwrSav ) { + var s = require('Storage').readJSON('setting.json',1)||{}; + var t = s.timeout||10; + Bangle.setLCDTimeout(t); + } + else { + Bangle.setLCDTimeout(0); + Bangle.setLCDPower(1); + } +} + function setButtons(){ // Spd+Dist : Select next waypoint @@ -277,6 +291,9 @@ function setButtons(){ // Touch left screen to toggle display setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling"}); + // Touch right screen to toggle pwrSav + setWatch(togglePwrSav, BTN5, {repeat:true,edge:"falling"}); + } function btnPressed() { From 91935f4ebe6c9b12a0f96ee66802e7828c0400b3 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 21:58:14 +1300 Subject: [PATCH 107/149] Update app.js --- apps/speedalt/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 09b8d69e0..eb81d417b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.01'; +var v = '1.02'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -266,6 +266,7 @@ function toggleAltDist() { function togglePwrSav() { pwrSav=!pwrSav; if ( pwrSav ) { + LED1.reset(); var s = require('Storage').readJSON('setting.json',1)||{}; var t = s.timeout||10; Bangle.setLCDTimeout(t); @@ -273,6 +274,7 @@ function togglePwrSav() { else { Bangle.setLCDTimeout(0); Bangle.setLCDPower(1); + LED1.set(); } } From 10539c251629fa998ebc647106c433928e83af6d Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 22:07:31 +1300 Subject: [PATCH 108/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index eb81d417b..40712b061 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.02'; +var v = '1.00'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts From c8dfac215d044ab5585641c485256f7a7a6f8c08 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 5 Feb 2021 22:11:02 +1300 Subject: [PATCH 109/149] Update README.md --- apps/speedalt/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 13e840bfb..00062269d 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -6,7 +6,9 @@ Within each display mode one figure is displayed on the watch face using the lar The waypoints list is the same as that used with the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. -Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. +BTN4 : Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. + +BTN5 : Right Display Tap : Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. From 24afa000bdb4efc841048562cebee6b8b3faddc4 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 09:17:33 +1300 Subject: [PATCH 110/149] Update app.js --- apps/speedalt/app.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 40712b061..24838ccf1 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.00'; +var v = '1.01'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -345,9 +345,11 @@ function isLP() { return(1); } +/* function lpGetFix() { onGPS(WIDGETS.gpsservice.gps_get_fix()); } +*/ function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power @@ -414,15 +416,15 @@ Bangle.on('lcdPower',function(on) { g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); - var lp = isLP(); // Low power GPS widget installed. - - -Bangle.setGPSPower(1); onGPS(lf); - -if ( lp ) setInterval(lpGetFix, 1000); -else Bangle.on('GPS', onGPS); - +if ( lp ) { + setLpMode('SuperE'); + setInterval(onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); +} +else { + Bangle.setGPSPower(1); + Bangle.on('GPS', onGPS); +} setButtons(); setInterval(updateClock, 30000); From d6afa194a944f5093046cbd6bbf157e71ad8e5b6 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 09:26:41 +1300 Subject: [PATCH 111/149] Update app.js --- apps/speedalt/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 24838ccf1..630a69a84 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -416,15 +416,17 @@ Bangle.on('lcdPower',function(on) { g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); -var lp = isLP(); // Low power GPS widget installed. onGPS(lf); + +var lp = isLP(); // Low power GPS widget installed? if ( lp ) { setLpMode('SuperE'); - setInterval(onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); + setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); } else { Bangle.setGPSPower(1); Bangle.on('GPS', onGPS); } + setButtons(); setInterval(updateClock, 30000); From 7bd7f371066fd3a94c48dcbb5eb2a9d3c481e334 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 10:28:20 +1300 Subject: [PATCH 112/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 630a69a84..0cc435544 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.01'; +var v = '1.02'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -355,7 +355,7 @@ function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); - if ( m !== s.power_mode ) { + if ( m !== s.power_mode || !s.gpsservice ) { s.gpsservice = true; s.power_mode = m; WIDGETS.gpsservice.gps_set_settings(s); From 3b3c1da0ea400f14a637a32eaa06abe022ed87fb Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 10:31:39 +1300 Subject: [PATCH 113/149] Update app.js --- apps/speedalt/app.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 0cc435544..8041dc095 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.02'; +var v = '1.03'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -345,12 +345,6 @@ function isLP() { return(1); } -/* -function lpGetFix() { - onGPS(WIDGETS.gpsservice.gps_get_fix()); -} -*/ - function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; From 0bfe32eec2884ea0afbd8a45b688a47ad281dce5 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 10:57:38 +1300 Subject: [PATCH 114/149] Update app-icon.js --- apps/speedalt/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app-icon.js b/apps/speedalt/app-icon.js index 6c03df55b..f4f24a18b 100644 --- a/apps/speedalt/app-icon.js +++ b/apps/speedalt/app-icon.js @@ -1 +1 @@ -require("heatshrink").decompress(atob("m02xH+AH4AJlgAMGWQ4lEw1Wq2BAAgHBG8QhFq+C1nXABGswQ4GGjhkBGJIAHOQI2ZDIcyGaQ3EmQ3WNAiaKABusNyoUDNCxuGGySdDNDBuGUoY0e2etAAWzGzoOCGheJxNlAA2J1o2LGprTNGRAAFbZw0LqwZI1pkGAAgJDUxdWGxTULFAmJFJGzURjaET6Q0DGZKYIrqjRT5Q0EGZwpEUZZqPaYaRMGg6LINhBJKNK40JAAI1Iq6fJGjDrIUQoVCwRqJDhA0OXYQRGwRsEAgWsNTCeIDYTwG1g1GqygJNROsq0ymVWq7TI2ZRJUQg1JUARkMAAg0FDhY1GDAxOKQwgAEKI6IKKAQ1KeAQ1IJ4VXAog1gC4Q1ImQVBAwYFBmQ1K1o1fMoQ1ORIQ1Ua5ahD1uzrqnEULo1L1gVBAAusGrDxHC4NlEY4aDAAZQGDhiHCGpZOJNodWmUyqxpIRBY1GQw7wCURAAPKIWtXhI1EwSFJNhIAMNQSgHwQ1EGwVXKBJsWDJSgENgjyKGyg0CNQ/XNQo1DwIRGbIS+HABYWLwI1GGwVWKhZtQChigGNhg2TCRhqIGwcy1g2YCBmsmQ0INgajIYgY1PdRKfCGpCjMG4ShNBxSfKGwyjIADOsGho1DbRI0YagQ1MG0Y0RGwjbLACLTDGh42FqxuY1lWGig2FmRuWwKdDGiZuHG6WBNC42JHAWCVBWswQyEGjQ3IHAJyBAAgHBCAwzbG5QAMGb44SGUgAkA")) +require("heatshrink").decompress(atob("mEwxH+AH4A/AE+sFtoABF12swItsF9QuFR4IwmFwwvnFw4vCGEYuIF4JgjFxIvkFxQvCGBfOAAQvqFwYwRFxYvDGBIvUFxgv/F6IuNF4n+0nB4TvXFxwvF4XBAALlPF7ZfBGC4uPF4rABGAYAGTQwvad4YwKFzYvIGBQvfFwgAE3Qvt4IvEFzgvCLxO7Lx7vULzIzTFwIvgGZheFRAiNRGSQvpGYouesYAGmQAKq3CE4PIC4wviq2eFwPCroveCRSGEC6Qv0DAwRLcoouWC4VdVYQXkr1eAgVdAoIABroNEB4gHHC5QvHwQSDAAOCA74vH1uICQIABxGtA74vIAEwv/F/4vXAH4A/AHY")) From 870092b340939fb15e9035db5ca61b5421d9daee Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 10:58:22 +1300 Subject: [PATCH 115/149] Add files via upload --- apps/speedalt/app.png | Bin 3356 -> 1639 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/speedalt/app.png b/apps/speedalt/app.png index 41849d3072b2e9625782fb0ae0d61b931b312373..93d8e57dcbfaf905321fffcf06df042aa49d7dc8 100644 GIT binary patch literal 1639 zcmV-t2AKJYP)@pC8}P=li+m^Env72)@5?yIePa+S>ZbmYsjOa=2m` z!{OB3)^@Gi>3mz!4w$0Hsk)+sbUjipG!&a5|mi z0)`wD_))?j-{$=p(Hmdb{pQ4>#*6Vi6tc_Zs;~=3feFd%R;{|DPtl#K#zRAi7Y`X1 z;B-32+0egXk^BI1gjay&Ter42GL0Dz85MB$^y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natXaBd9^3?;o zi>*UXUWA9RgCE@HoWMzNERlaV&_8_N^&cs#7zxQX9w+8mT5<*`L(9p1V1 zE6c{c(El_!K{-PDpI=gvr?B$n7ryo_QGfXgtJb{3`Pz&6>f;_IGVk!NEuWjUGef^4 zYV!*VVLMa+EYHtlMd4CnV;%ivZHV^v4mQ8PgOXhpy^rA?%B`61S604f z5g<3mz*A)xE&nk>{3qa#3fk>4I2Y%T_h`1|qiQ&4X>FsdqLN(|m3j{kpj%4$lLHmo zf6MJ1T#{n@z8g)Wa)`XAi> z{Ahpq*6M-EKFI0vg^vr#zk{4%L}0hakT7m6iQ~rNh;{gr9Xh+ZaCNw7XlkahvAOq5 z>v2ZF>s}AsNGH> zMW*+OI?VTDT7W}Ba!`1BN{wE12MgcmpQdti3*)*KnF4Z>B8f!^EvPMJhg3wnl+;D3 mqNYDt-$NL}5QZ>>e&BBr{h5vNHZoHH0000 Date: Sat, 6 Feb 2021 10:59:36 +1300 Subject: [PATCH 116/149] Update app-icon.js --- apps/speedalt/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app-icon.js b/apps/speedalt/app-icon.js index 6c03df55b..f4f24a18b 100644 --- a/apps/speedalt/app-icon.js +++ b/apps/speedalt/app-icon.js @@ -1 +1 @@ -require("heatshrink").decompress(atob("m02xH+AH4AJlgAMGWQ4lEw1Wq2BAAgHBG8QhFq+C1nXABGswQ4GGjhkBGJIAHOQI2ZDIcyGaQ3EmQ3WNAiaKABusNyoUDNCxuGGySdDNDBuGUoY0e2etAAWzGzoOCGheJxNlAA2J1o2LGprTNGRAAFbZw0LqwZI1pkGAAgJDUxdWGxTULFAmJFJGzURjaET6Q0DGZKYIrqjRT5Q0EGZwpEUZZqPaYaRMGg6LINhBJKNK40JAAI1Iq6fJGjDrIUQoVCwRqJDhA0OXYQRGwRsEAgWsNTCeIDYTwG1g1GqygJNROsq0ymVWq7TI2ZRJUQg1JUARkMAAg0FDhY1GDAxOKQwgAEKI6IKKAQ1KeAQ1IJ4VXAog1gC4Q1ImQVBAwYFBmQ1K1o1fMoQ1ORIQ1Ua5ahD1uzrqnEULo1L1gVBAAusGrDxHC4NlEY4aDAAZQGDhiHCGpZOJNodWmUyqxpIRBY1GQw7wCURAAPKIWtXhI1EwSFJNhIAMNQSgHwQ1EGwVXKBJsWDJSgENgjyKGyg0CNQ/XNQo1DwIRGbIS+HABYWLwI1GGwVWKhZtQChigGNhg2TCRhqIGwcy1g2YCBmsmQ0INgajIYgY1PdRKfCGpCjMG4ShNBxSfKGwyjIADOsGho1DbRI0YagQ1MG0Y0RGwjbLACLTDGh42FqxuY1lWGig2FmRuWwKdDGiZuHG6WBNC42JHAWCVBWswQyEGjQ3IHAJyBAAgHBCAwzbG5QAMGb44SGUgAkA")) +require("heatshrink").decompress(atob("mEwxH+AH4A/AE+sFtoABF12swItsF9QuFR4IwmFwwvnFw4vCGEYuIF4JgjFxIvkFxQvCGBfOAAQvqFwYwRFxYvDGBIvUFxgv/F6IuNF4n+0nB4TvXFxwvF4XBAALlPF7ZfBGC4uPF4rABGAYAGTQwvad4YwKFzYvIGBQvfFwgAE3Qvt4IvEFzgvCLxO7Lx7vULzIzTFwIvgGZheFRAiNRGSQvpGYouesYAGmQAKq3CE4PIC4wviq2eFwPCroveCRSGEC6Qv0DAwRLcoouWC4VdVYQXkr1eAgVdAoIABroNEB4gHHC5QvHwQSDAAOCA74vH1uICQIABxGtA74vIAEwv/F/4vXAH4A/AHY")) From 464317aecbe50674d02d102d3e1c058e48fc91e5 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 11:00:09 +1300 Subject: [PATCH 117/149] Add files via upload --- apps/speedalt/app.png | Bin 3356 -> 1639 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/speedalt/app.png b/apps/speedalt/app.png index 41849d3072b2e9625782fb0ae0d61b931b312373..93d8e57dcbfaf905321fffcf06df042aa49d7dc8 100644 GIT binary patch literal 1639 zcmV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-S7TBKO&kv2O}2Ks zH^09_Z~f2gE8k|i{2_z_ii(OEA8;^IjdfbvGJVN z)`yv+;Q5)_{x?JYv06ZQKtJbXbzq}YBN`a@RX<>1n zVI0Vz5TR(io}O+!culr(S%B&u*!T{JM)(AsQov`m zHEs7!o!$v#15}@{W%Q_#Owrx$jNpibq~U!ZJZQJPq~RKmP$=KCpWnatXaBd9^3?;o zi>*UXUWA9RgCE@HoWMzNERlaV&_8_N^&cs#7zxQX9w+8mT5<*`L(9p1V1 zE6c{c(El_!K{-PDpI=gvr?B$n7ryo_QGfXgtJb{3`Pz&6>f;_IGVk!NEuWjUGef^4 zYV!*VVLMa+EYHtlMd4CnV;%ivZHV^v4mQ8PgOXhpy^rA?%B`61S604f z5g<3mz*A)xE&nk>{3qa#3fk>4I2Y%T_h`1|qiQ&4X>FsdqLN(|m3j{kpj%4$lLHmo zf6MJ1T#{n@z8g)Wa)`XAi> z{Ahpq*6M-EKFI0vg^vr#zk{4%L}0hakT7m6iQ~rNh;{gr9Xh+ZaCNw7XlkahvAOq5 z>v2ZF>s}AsNGH> zMW*+OI?VTDT7W}Ba!`1BN{wE12MgcmpQdti3*)*KnF4Z>B8f!^EvPMJhg3wnl+;D3 mqNYDt-$NL}5QZ>>e&BBr{h5vNHZoHH0000 Date: Sat, 6 Feb 2021 11:00:47 +1300 Subject: [PATCH 118/149] Update app.js --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 8041dc095..c6421df98 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.03'; +var v = '1.04'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts From 3a63458834daffe3b7879ed23a00ddb0f46e34ed Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 11:07:50 +1300 Subject: [PATCH 119/149] Major functionality update to speedalt. Renamed to GPS Adventure Sports. Added distance to waypoint. Added Low Power GPS Service. Many minor tweaks. --- apps.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index b5a98ec85..c85bf25d4 100644 --- a/apps.json +++ b/apps.json @@ -2622,8 +2622,8 @@ ] }, { "id": "speedalt", - "name": "GPS Speedo and Altimeter", - "shortName":"GPS Speed Alt", + "name": "GPS Adventure Sports", + "shortName":"GPS Adv", "icon": "app.png", "version":"1.00", "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.", From 083ce365deafe7504b2fed40aa54d084e91252f6 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 11:17:07 +1300 Subject: [PATCH 120/149] Update README.md --- apps/speedalt/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 00062269d..03c4a0f17 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -37,7 +37,7 @@ Developed for my use in sailing, cycling and motorcycling. If you find this soft ## Low Power GPS Service -This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. In this case the GPS Service must be On for this app to obtain a fix. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. +This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. From 417ebad08cc547872759a33dd99d3cdf61ab6033 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 12:09:14 +1300 Subject: [PATCH 121/149] Update app.js --- apps/speedalt/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index c6421df98..6c9f4aa3e 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.04'; +var v = '1.05'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -391,8 +391,8 @@ var img = { palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB]) }; -if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFFF,0xFFFF]); -if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xF800,0xF800]); +if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFF6,0xDFFF]); +if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xFAE0,0xF813]); var SCREENACCESS = { withApp:true, From f5dcf7b0e66fe67286a35d39a2dcb4cdce66643f Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 17:10:17 +1300 Subject: [PATCH 122/149] Update app.js --- apps/speedalt/app.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 6c9f4aa3e..f9d69f64e 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.05'; +var v = '1.06'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -11,7 +11,7 @@ require("Font7x11Numeric7Seg").add(Graphics); var lf = {fix:0,satellites:0}; var showMax = 0; // 1 = display the max values. 0 = display the cur fix var pwrSav = 1; // 1 = default power saving with watch screen off and GPS to PMOO mode. 0 = screen kept on. -var maxPress = 0; // Time max button pressed. Used to calculate short or long press. +// var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. var tmrLP; // Timer for delay in switching to low power after screen turns off @@ -281,9 +281,20 @@ function togglePwrSav() { function setButtons(){ // Spd+Dist : Select next waypoint - setWatch(btnPressed, BTN1,{repeat:true,edge:"rising"}); - setWatch(btnReleased, BTN1,{repeat:true,edge:"falling"}); - +// setWatch(btnPressed, BTN1,{repeat:true,edge:"rising"}); +// setWatch(btnReleased, BTN1,{repeat:true,edge:"falling"}); + setWatch(function(e) { + var dur = e.time - e.lastTime; + if ( settings.modeA ) { + // Spd+Alt mode - Switch between fix and MAX + if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display + else { max.spd = 0; max.alt = 0; } // Long press resets max values. + } + else nxtWp(1); // Spd+Dist mode - Select next waypoint + onGPS(lf); + }, BTN1, { edge:"falling",repeat:true}); + + // Show launcher when middle button pressed setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); @@ -298,10 +309,12 @@ function setButtons(){ } +/* function btnPressed() { maxPress = getTime(); } + function btnReleased() { var dur = getTime()-maxPress; if ( settings.modeA ) { @@ -313,6 +326,7 @@ function btnReleased() { onGPS(lf); } +*/ function updateClock() { if (!canDraw) return; From 7ae823f6391806c49864480bd1bc1bb46abcaae4 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 17:15:13 +1300 Subject: [PATCH 123/149] Update app.js --- apps/speedalt/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index f9d69f64e..17d55e516 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.06'; +var v = '1.07'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -292,20 +292,20 @@ function setButtons(){ } else nxtWp(1); // Spd+Dist mode - Select next waypoint onGPS(lf); - }, BTN1, { edge:"falling",repeat:true}); + }, BTN1, { edge:"falling",repeat:true,debounce:50}); // Show launcher when middle button pressed setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); // Toggle between alt or dist - setWatch(toggleAltDist, BTN3, {repeat:true,edge:"falling"}); + setWatch(toggleAltDist, BTN3, {repeat:true,edge:"falling",debounce:50}); // Touch left screen to toggle display - setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling"}); + setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling",debounce:50}); // Touch right screen to toggle pwrSav - setWatch(togglePwrSav, BTN5, {repeat:true,edge:"falling"}); + setWatch(togglePwrSav, BTN5, {repeat:true,edge:"falling",debounce:50}); } From 39accb63b393d8d91ae64e97f731c6d5053a1da6 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 17:23:17 +1300 Subject: [PATCH 124/149] Update app.js --- apps/speedalt/app.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 17d55e516..76091f20b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -11,7 +11,6 @@ require("Font7x11Numeric7Seg").add(Graphics); var lf = {fix:0,satellites:0}; var showMax = 0; // 1 = display the max values. 0 = display the cur fix var pwrSav = 1; // 1 = default power saving with watch screen off and GPS to PMOO mode. 0 = screen kept on. -// var maxPress = 0; // Time max button pressed. Used to calculate short or long press. var canDraw = 1; var time = ''; // Last time string displayed. Re displayed in background colour to remove before drawing new time. var tmrLP; // Timer for delay in switching to low power after screen turns off @@ -281,8 +280,6 @@ function togglePwrSav() { function setButtons(){ // Spd+Dist : Select next waypoint -// setWatch(btnPressed, BTN1,{repeat:true,edge:"rising"}); -// setWatch(btnReleased, BTN1,{repeat:true,edge:"falling"}); setWatch(function(e) { var dur = e.time - e.lastTime; if ( settings.modeA ) { @@ -309,25 +306,6 @@ function setButtons(){ } -/* -function btnPressed() { - maxPress = getTime(); -} - - -function btnReleased() { - var dur = getTime()-maxPress; - if ( settings.modeA ) { - // Spd+Alt mode - Switch between fix and MAX - if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display - else { max.spd = 0; max.alt = 0; } // Long press resets max values. - } - else nxtWp(1); // Spd+Dist mode - Select next waypoint - - onGPS(lf); -} -*/ - function updateClock() { if (!canDraw) return; drawTime(); From 3f5552170d0b081ccdd47e0cf45c9197490a6111 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 20:31:31 +1300 Subject: [PATCH 125/149] Update app.js --- apps/speedalt/app.js | 63 ++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 76091f20b..1603d5548 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.07'; +var v = '1.08'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -249,34 +249,6 @@ function onGPS(fix) { } - -function toggleDisplay() { - settings.primSpd = !settings.primSpd; - savSettings(); - onGPS(lf); // Update display -} - -function toggleAltDist() { - settings.modeA = !settings.modeA; - savSettings(); - onGPS(lf); -} - -function togglePwrSav() { - pwrSav=!pwrSav; - if ( pwrSav ) { - LED1.reset(); - var s = require('Storage').readJSON('setting.json',1)||{}; - var t = s.timeout||10; - Bangle.setLCDTimeout(t); - } - else { - Bangle.setLCDTimeout(0); - Bangle.setLCDPower(1); - LED1.set(); - } -} - function setButtons(){ // Spd+Dist : Select next waypoint @@ -293,17 +265,38 @@ function setButtons(){ // Show launcher when middle button pressed - setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); + // setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); + // Power saving on/off + setWatch(function(e){ + pwrSav=!pwrSav; + if ( pwrSav ) { + LED1.reset(); + var s = require('Storage').readJSON('setting.json',1)||{}; + var t = s.timeout||10; + Bangle.setLCDTimeout(t); + } + else { + Bangle.setLCDTimeout(0); + Bangle.setLCDPower(1); + LED1.set(); + } + }, BTN2, {repeat:true,edge:"falling",debounce:50}); + // Toggle between alt or dist - setWatch(toggleAltDist, BTN3, {repeat:true,edge:"falling",debounce:50}); + setWatch(function(e){ + settings.modeA = !settings.modeA; + savSettings(); + onGPS(lf); + }, BTN3, {repeat:true,edge:"falling",debounce:50}); // Touch left screen to toggle display - setWatch(toggleDisplay, BTN4, {repeat:true,edge:"falling",debounce:50}); + setWatch(function(e){ + settings.primSpd = !settings.primSpd; + savSettings(); + onGPS(lf); // Update display + }, BTN4, {repeat:true,edge:"falling",debounce:50}); - // Touch right screen to toggle pwrSav - setWatch(togglePwrSav, BTN5, {repeat:true,edge:"falling",debounce:50}); - } function updateClock() { From 64c1adeaf6db3aaa71b9e5bff548cc0bc4637f6b Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 20:33:57 +1300 Subject: [PATCH 126/149] Update README.md --- apps/speedalt/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 03c4a0f17..54d7f0f94 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -8,16 +8,18 @@ The waypoints list is the same as that used with the [GPS Navigation](https://ba BTN4 : Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. -BTN5 : Right Display Tap : Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. - BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. BTN1 : [Speed+Altitude] Long press > 2 secs resets the recorded maximum values. BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected waypoint is displayed. +BTN2 : Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but uses maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. + BTN3 : Swaps the modes between Speed+[A]ltitude or Speed+[D]istance. +BTN3 : Long press exit and return to watch. + App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance can be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default (three colours), high contrast (all white on black) or night ( all red on black ). Loss of fix : When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats' or 'Age' indicates whether the GPS has a current fix or not. From 90ae9f0f8c2198599e67112c906e31c400ec5245 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 20:42:01 +1300 Subject: [PATCH 127/149] Update app.js --- apps/speedalt/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 1603d5548..d25d95f64 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.08'; +var v = '1.09'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -261,7 +261,7 @@ function setButtons(){ } else nxtWp(1); // Spd+Dist mode - Select next waypoint onGPS(lf); - }, BTN1, { edge:"falling",repeat:true,debounce:50}); + }, BTN1, { edge:"falling",repeat:true}); // Show launcher when middle button pressed @@ -281,21 +281,21 @@ function setButtons(){ Bangle.setLCDPower(1); LED1.set(); } - }, BTN2, {repeat:true,edge:"falling",debounce:50}); + }, BTN2, {repeat:true,edge:"falling"}); // Toggle between alt or dist setWatch(function(e){ settings.modeA = !settings.modeA; savSettings(); onGPS(lf); - }, BTN3, {repeat:true,edge:"falling",debounce:50}); + }, BTN3, {repeat:true,edge:"falling"}); // Touch left screen to toggle display setWatch(function(e){ settings.primSpd = !settings.primSpd; savSettings(); onGPS(lf); // Update display - }, BTN4, {repeat:true,edge:"falling",debounce:50}); + }, BTN4, {repeat:true,edge:"falling"}); } From 48a6d29d608ab529e991b8a6f8334c9585e395b8 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 21:08:13 +1300 Subject: [PATCH 128/149] Update app.js --- apps/speedalt/app.js | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index d25d95f64..85ed5e75b 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.09'; +var v = '1.10'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -269,17 +269,21 @@ function setButtons(){ // Power saving on/off setWatch(function(e){ - pwrSav=!pwrSav; - if ( pwrSav ) { - LED1.reset(); - var s = require('Storage').readJSON('setting.json',1)||{}; - var t = s.timeout||10; - Bangle.setLCDTimeout(t); - } - else { - Bangle.setLCDTimeout(0); - Bangle.setLCDPower(1); - LED1.set(); + var dur = e.time - e.lastTime; + if ( dur < 2 ) { // Short press. + pwrSav=!pwrSav; + if ( pwrSav ) { + LED1.reset(); + var s = require('Storage').readJSON('setting.json',1)||{}; + var t = s.timeout||10; + Bangle.setLCDTimeout(t); + } + else { + Bangle.setLCDTimeout(0); + Bangle.setLCDPower(1); + LED1.set(); + } + else setLpMode('SuperE',false); // long press, power off LP GPS } }, BTN2, {repeat:true,edge:"falling"}); @@ -309,7 +313,7 @@ function updateClock() { function startDraw(){ canDraw=true; - setLpMode('SuperE'); // off + setLpMode('SuperE',true); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -317,7 +321,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO');}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. + if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO',true);}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. } function savSettings() { @@ -330,12 +334,12 @@ function isLP() { return(1); } -function setLpMode(m) { +function setLpMode(m,p) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); if ( m !== s.power_mode || !s.gpsservice ) { - s.gpsservice = true; + s.gpsservice = p; s.power_mode = m; WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); @@ -399,7 +403,7 @@ onGPS(lf); var lp = isLP(); // Low power GPS widget installed? if ( lp ) { - setLpMode('SuperE'); + setLpMode('SuperE',true); setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); } else { From 0e2e17229a0eee4125a0a27a6531858be4708f4b Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 21:24:13 +1300 Subject: [PATCH 129/149] Update README.md --- apps/speedalt/README.md | 50 +++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 54d7f0f94..f4a679574 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -6,23 +6,39 @@ Within each display mode one figure is displayed on the watch face using the lar The waypoints list is the same as that used with the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app so the same set of waypoints can be used across both apps. Refer to that app for waypoint file information. -BTN4 : Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. - -BTN1 : [Speed+Altitude] Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. - -BTN1 : [Speed+Altitude] Long press > 2 secs resets the recorded maximum values. - -BTN1 : [Speed+Distance] Select next waypoint. Last fix distance from selected waypoint is displayed. - -BTN2 : Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but uses maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. +## Buttons and Controls BTN3 : Swaps the modes between Speed+[A]ltitude or Speed+[D]istance. +### [A]ltitude mode + +BTN1 : Short press < 2 secs toggles the displays between showing the current speed/alt values or the maximum speed/alt values recorded. + +BTN1 : Long press > 2 secs resets the recorded maximum values. + +### [D]istance mode + +BTN1 : Select next waypoint. Last fix distance from selected waypoint is displayed. + +### Both modes + +BTN2 : Short press < 2 secs Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but uses maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. + +BTN2 : Long press > 2 secs turns off the low power GPS service and GPS. Exit and restart the app to turn back on. If you are using the low power gps service it will keep the GPS powered on after exiting the app. This is a convenient way to turn it off. + BTN3 : Long press exit and return to watch. -App Settings : Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance can be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default (three colours), high contrast (all white on black) or night ( all red on black ). +BTN4 : Left Display Tap : Swaps which figure is in the large display. You can have either speed or [A]ltitude/[D]istance on the large primary display. -Loss of fix : When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats' or 'Age' indicates whether the GPS has a current fix or not. +## App Settings + +Select the desired display units. Speed can be as per the default locale, kph, knots, mph or m/s. Distance can be km, miles or nautical miles. Altitude can be feet or metres. Select one of three colour schemes. Default (three colours), high contrast (all white on black) or night ( all red on black ). + +## Loss of fix + +When the GPS obtains a fix the number of satellites is displayed as 'Sats:nn'. When unable to obtain a fix then the last known fix is used and the age of that fix in seconds is displayed as 'Age:nn'. Seeing 'Sats' or 'Age' indicates whether the GPS has a current fix or not. + +## Screens Speed and Altitude:
![](screen1.png)

@@ -35,15 +51,17 @@ MAX Values instead:
Settings:
![](screen4.png)

-Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! - ## Low Power GPS Service This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. -There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. +There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. + +The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. + +When exiting this app the Low Power GPS Service will keep the GPS powered on, using battery. It can be manually turned off using the gps service settings menu. As a convenience, long press BTN2 for 2 seconds will turn it off while using this GPS Adv app. ## Waypoints @@ -116,6 +134,10 @@ Sample waypoints.json (My sailing waypoints) ] +## Comments and Feedback + +Developed for my use in sailing, cycling and motorcycling. If you find this software useful or have feedback drop me a line mike[at]kereru.com. Enjoy! + ## Thanks Many thanks to Gordon Williams. Awesome job. From 9ee180cf4121f46597a829307d372243b1a24222 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 21:29:54 +1300 Subject: [PATCH 130/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 85ed5e75b..bd123173a 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.10'; +var v = '1.11'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -283,8 +283,8 @@ function setButtons(){ Bangle.setLCDPower(1); LED1.set(); } - else setLpMode('SuperE',false); // long press, power off LP GPS } + else setLpMode('SuperE',false); // long press, power off LP GPS }, BTN2, {repeat:true,edge:"falling"}); // Toggle between alt or dist From bafc1b5b48b10c358be08b2781d8c71ebcca8575 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 21:45:54 +1300 Subject: [PATCH 131/149] Update app.js --- apps/speedalt/app.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index bd123173a..62464f34c 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.11'; +var v = '1.12'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -284,7 +284,7 @@ function setButtons(){ LED1.set(); } } - else setLpMode('SuperE',false); // long press, power off LP GPS + else gpsOff(); // long press, power off LP GPS }, BTN2, {repeat:true,edge:"falling"}); // Toggle between alt or dist @@ -313,7 +313,7 @@ function updateClock() { function startDraw(){ canDraw=true; - setLpMode('SuperE',true); // off + setLpMode('SuperE'); // off g.clear(); Bangle.drawWidgets(); onGPS(lf); // draw app screen @@ -321,7 +321,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO',true);}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. + if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO');}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. } function savSettings() { @@ -334,18 +334,27 @@ function isLP() { return(1); } -function setLpMode(m,p) { +function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); if ( m !== s.power_mode || !s.gpsservice ) { - s.gpsservice = p; + s.gpsservice = true; s.power_mode = m; WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); } } +function gpsOff() { + if ( !lp ) return; + var s = WIDGETS.gpsservice.gps_get_settings(); + s.gpsservice = true; + s.power_mode = 'SuperE'; + WIDGETS.gpsservice.gps_set_settings(s); + WIDGETS.gpsservice.reload(); +} + // =Main Prog // Read settings. @@ -403,7 +412,7 @@ onGPS(lf); var lp = isLP(); // Low power GPS widget installed? if ( lp ) { - setLpMode('SuperE',true); + setLpMode('SuperE'); setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); } else { From e033a7bcab08d1a9ef2f33ed88586942ed7718c5 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 6 Feb 2021 21:52:57 +1300 Subject: [PATCH 132/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 62464f34c..b533b1fbe 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.12'; +var v = '1.13'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -349,7 +349,7 @@ function setLpMode(m) { function gpsOff() { if ( !lp ) return; var s = WIDGETS.gpsservice.gps_get_settings(); - s.gpsservice = true; + s.gpsservice = false; s.power_mode = 'SuperE'; WIDGETS.gpsservice.gps_set_settings(s); WIDGETS.gpsservice.reload(); From a167a17d3e224c4f4ed99149eb43f32b2f886269 Mon Sep 17 00:00:00 2001 From: nujw Date: Wed, 10 Feb 2021 08:10:06 +1300 Subject: [PATCH 133/149] Update app.js --- apps/speedalt/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index b533b1fbe..9b1886cd2 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.13'; +var v = '1.14'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -321,7 +321,7 @@ function startDraw(){ function stopDraw() { canDraw=false; - if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO');}, 30000); //Drop to low power in 30 secs. Keep lp mode off until we have a first fix. + if (!tmrLP) tmrLP=setInterval(function () {if (lf.fix) setLpMode('PSMOO');}, 10000); //Drop to low power in 10 secs. Keep lp mode off until we have a first fix. } function savSettings() { From ba01cdb0bc28f6f53c9935683b75d8167c44c5b8 Mon Sep 17 00:00:00 2001 From: nujw Date: Wed, 10 Feb 2021 08:34:14 +1300 Subject: [PATCH 134/149] Update README.md --- apps/speedalt/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index f4a679574..538575ae9 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -55,7 +55,7 @@ Settings:
This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. -When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 30 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. +When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 10 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. From 0784361e438544c6370d8372b15921e94df11a55 Mon Sep 17 00:00:00 2001 From: nujw Date: Wed, 10 Feb 2021 17:32:11 +1300 Subject: [PATCH 135/149] Bumped inter ver --- apps/speedalt/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 9b1886cd2..f87290155 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -2,7 +2,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com */ -var v = '1.14'; +var v = '1.15'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts From c3a45287d07dd4994aad6eb7c9aed0324a286065 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 13:53:08 +1300 Subject: [PATCH 136/149] Use new GPS settings module --- apps/speedalt/app.js | 72 +++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 44 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index f87290155..1b2c6cd65 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -1,8 +1,9 @@ /* Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com +1.16 : Use new GPS settings module */ -var v = '1.15'; +var v = '1.16'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -269,22 +270,18 @@ function setButtons(){ // Power saving on/off setWatch(function(e){ - var dur = e.time - e.lastTime; - if ( dur < 2 ) { // Short press. - pwrSav=!pwrSav; - if ( pwrSav ) { - LED1.reset(); - var s = require('Storage').readJSON('setting.json',1)||{}; - var t = s.timeout||10; - Bangle.setLCDTimeout(t); - } - else { - Bangle.setLCDTimeout(0); - Bangle.setLCDPower(1); - LED1.set(); - } + pwrSav=!pwrSav; + if ( pwrSav ) { + LED1.reset(); + var s = require('Storage').readJSON('setting.json',1)||{}; + var t = s.timeout||10; + Bangle.setLCDTimeout(t); + } + else { + Bangle.setLCDTimeout(0); + Bangle.setLCDPower(1); + LED1.set(); } - else gpsOff(); // long press, power off LP GPS }, BTN2, {repeat:true,edge:"falling"}); // Toggle between alt or dist @@ -328,31 +325,10 @@ function savSettings() { require("Storage").write('speedalt.json',settings); } -// Is low power GPS service available to use? -function isLP() { - if (WIDGETS.gpsservice == undefined) return(0); - return(1); -} - function setLpMode(m) { if (tmrLP) {clearInterval(tmrLP);tmrLP = false;} // Stop any scheduled drop to low power - if ( !lp ) return; - var s = WIDGETS.gpsservice.gps_get_settings(); - if ( m !== s.power_mode || !s.gpsservice ) { - s.gpsservice = true; - s.power_mode = m; - WIDGETS.gpsservice.gps_set_settings(s); - WIDGETS.gpsservice.reload(); - } -} - -function gpsOff() { - if ( !lp ) return; - var s = WIDGETS.gpsservice.gps_get_settings(); - s.gpsservice = false; - s.power_mode = 'SuperE'; - WIDGETS.gpsservice.gps_set_settings(s); - WIDGETS.gpsservice.reload(); + if ( !gpssetup ) return; + gpssetup.setPowerMode({power_mode:m}) } // =Main Prog @@ -404,21 +380,29 @@ Bangle.on('lcdPower',function(on) { else stopDraw(); }); +var gpssetup; +try { + gpssetup = require("gpssetup") +} catch(e) { + gpssetup = false; +} + // All set up. Lets go. g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets(); onGPS(lf); +Bangle.setGPSPower(1); -var lp = isLP(); // Low power GPS widget installed? -if ( lp ) { - setLpMode('SuperE'); - setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); +if ( gpssetup ) { + gpssetup.setPowerMode({power_mode:"SuperE"}).then(function() { Bangle.setGPSPower(1); }); +// setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); } else { Bangle.setGPSPower(1); - Bangle.on('GPS', onGPS); } +Bangle.on('GPS', onGPS); + setButtons(); setInterval(updateClock, 30000); From 8fcebaa7f880eba4016c2114e13d3c88656ee9a7 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 14:09:11 +1300 Subject: [PATCH 137/149] Rename var settings to cfg --- apps/speedalt/app.js | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 1b2c6cd65..ae840fd47 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -3,7 +3,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com 1.16 : Use new GPS settings module */ -var v = '1.16'; +var v = '1.17'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -25,17 +25,17 @@ var emulator = (process.env.BOARD=="EMSCRIPTEN")?1:0; // 1 = running in emulato var wp = {}; // Waypoint to use for distance from cur position. function nxtWp(inc){ - if (settings.modeA) return; - settings.wp+=inc; + if (cfg.modeA) return; + cfg.wp+=inc; loadWp(); } function loadWp() { var w = require("Storage").readJSON('waypoints.json')||[{name:"NONE"}]; - if (settings.wp>=w.length) settings.wp=0; - if (settings.wp<0) settings.wp = w.length-1; + if (cfg.wp>=w.length) cfg.wp=0; + if (cfg.wp<0) cfg.wp = w.length-1; savSettings(); - wp = w[settings.wp]; + wp = w[cfg.wp]; } function radians(a) { @@ -48,7 +48,7 @@ function distance(a,b){ // Distance in selected units var d = Math.sqrt(x*x + y*y) * 6371000; - d = (d/parseFloat(settings.dist)).toFixed(2); + d = (d/parseFloat(cfg.dist)).toFixed(2); if ( d >= 100 ) d = parseFloat(d).toFixed(1); if ( d >= 1000 ) d = parseFloat(d).toFixed(0); @@ -64,18 +64,18 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { var u=''; // Primary Display - v = (settings.primSpd)?speed.toString():alt.toString(); + v = (cfg.primSpd)?speed.toString():alt.toString(); // Primary Units - u = (settings.primSpd)?settings.spd_unit:alt_units; + u = (cfg.primSpd)?cfg.spd_unit:alt_units; drawPrimary(v,u); // Secondary Display - v = (settings.primSpd)?alt.toString():speed.toString(); + v = (cfg.primSpd)?alt.toString():speed.toString(); // Secondary Units - u = (settings.primSpd)?alt_units:settings.spd_unit; + u = (cfg.primSpd)?alt_units:cfg.spd_unit; drawSecondary(v,u); @@ -160,7 +160,7 @@ function drawTime() { function drawWP() { var nm = wp.name; - if ( nm == undefined || nm == 'NONE' || settings.modeA ) nm = ''; + if ( nm == undefined || nm == 'NONE' || cfg.modeA ) nm = ''; buf.setFontAlign(-1,1); //left, bottom buf.setColor(2); @@ -179,10 +179,10 @@ function drawSats(sats) { buf.setFontVector(20); buf.setColor(2); - if ( settings.modeA ) buf.drawString("A",240,140); + if ( cfg.modeA ) buf.drawString("A",240,140); else buf.drawString("D",240,140); - if ( showMax && settings.modeA ) { + if ( showMax && cfg.modeA ) { buf.setFontAlign(0,1); //centre, bottom buf.drawString("MAX",120,164); } @@ -214,12 +214,12 @@ function onGPS(fix) { lf = fix; // Speed - if ( settings.spd == 0 ) { + if ( cfg.spd == 0 ) { m = require("locale").speed(lf.speed).match(/([0-9,\.]+)(.*)/); // regex splits numbers from units sp = parseFloat(m[1]); - settings.spd_unit = m[2]; + cfg.spd_unit = m[2]; } - else sp = parseFloat(lf.speed)/parseFloat(settings.spd); // Calculate for selected units + else sp = parseFloat(lf.speed)/parseFloat(cfg.spd); // Calculate for selected units if ( sp < 10 ) sp = sp.toFixed(1); else sp = Math.round(sp); @@ -227,7 +227,7 @@ function onGPS(fix) { // Altitude al = lf.alt; - al = Math.round(parseFloat(al)/parseFloat(settings.alt)); + al = Math.round(parseFloat(al)/parseFloat(cfg.alt)); if (parseFloat(al) > parseFloat(max.alt) ) max.alt = parseFloat(al); // Distance to waypoint @@ -238,14 +238,14 @@ function onGPS(fix) { age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); } - if ( settings.modeA ) { - if ( showMax ) drawFix(max.spd,settings.spd_unit,lf.satellites,max.alt,settings.alt_unit,age,lf.fix); // Speed and alt maximums - else drawFix(sp,settings.spd_unit,lf.satellites,al,settings.alt_unit,age,lf.fix); // Show speed/altitude + if ( cfg.modeA ) { + if ( showMax ) drawFix(max.spd,cfg.spd_unit,lf.satellites,max.alt,cfg.alt_unit,age,lf.fix); // Speed and alt maximums + else drawFix(sp,cfg.spd_unit,lf.satellites,al,cfg.alt_unit,age,lf.fix); // Show speed/altitude } else { // Show speed/distance - if ( di <= 0 ) drawFix(sp,settings.spd_unit,lf.satellites,'','',age,lf.fix); // No WP selected - else drawFix(sp,settings.spd_unit,lf.satellites,di,settings.dist_unit,age,lf.fix); + if ( di <= 0 ) drawFix(sp,cfg.spd_unit,lf.satellites,'','',age,lf.fix); // No WP selected + else drawFix(sp,cfg.spd_unit,lf.satellites,di,cfg.dist_unit,age,lf.fix); } } @@ -255,7 +255,7 @@ function setButtons(){ // Spd+Dist : Select next waypoint setWatch(function(e) { var dur = e.time - e.lastTime; - if ( settings.modeA ) { + if ( cfg.modeA ) { // Spd+Alt mode - Switch between fix and MAX if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display else { max.spd = 0; max.alt = 0; } // Long press resets max values. @@ -286,14 +286,14 @@ function setButtons(){ // Toggle between alt or dist setWatch(function(e){ - settings.modeA = !settings.modeA; + cfg.modeA = !cfg.modeA; savSettings(); onGPS(lf); }, BTN3, {repeat:true,edge:"falling"}); // Touch left screen to toggle display setWatch(function(e){ - settings.primSpd = !settings.primSpd; + cfg.primSpd = !cfg.primSpd; savSettings(); onGPS(lf); // Update display }, BTN4, {repeat:true,edge:"falling"}); @@ -322,7 +322,7 @@ function stopDraw() { } function savSettings() { - require("Storage").write('speedalt.json',settings); + require("Storage").write('speedalt.json',cfg); } function setLpMode(m) { @@ -334,18 +334,18 @@ function setLpMode(m) { // =Main Prog // Read settings. -let settings = require('Storage').readJSON('speedalt.json',1)||{}; +let cfg = require('Storage').readJSON('speedalt.json',1)||{}; -settings.spd = settings.spd||0; // Multiplier for speed unit conversions. 0 = use the locale values for speed -settings.spd_unit = settings.spd_unit||''; // Displayed speed unit -settings.alt = settings.alt||0.3048;// Multiplier for altitude unit conversions. -settings.alt_unit = settings.alt_unit||'feet'; // Displayed altitude units -settings.dist = settings.dist||1000;// Multiplier for distnce unit conversions. -settings.dist_unit = settings.dist_unit||'km'; // Displayed altitude units -settings.colour = settings.colour||0; // Colour scheme. -settings.wp = settings.wp||0; // Last selected waypoint for dist -settings.modeA = settings.modeA||0; // 0 = [D], 1 = [A] -settings.primSpd = settings.primSpd||0; // 1 = Spd in primary, 0 = Spd in secondary +cfg.spd = cfg.spd||0; // Multiplier for speed unit conversions. 0 = use the locale values for speed +cfg.spd_unit = cfg.spd_unit||''; // Displayed speed unit +cfg.alt = cfg.alt||0.3048;// Multiplier for altitude unit conversions. +cfg.alt_unit = cfg.alt_unit||'feet'; // Displayed altitude units +cfg.dist = cfg.dist||1000;// Multiplier for distnce unit conversions. +cfg.dist_unit = cfg.dist_unit||'km'; // Displayed altitude units +cfg.colour = cfg.colour||0; // Colour scheme. +cfg.wp = cfg.wp||0; // Last selected waypoint for dist +cfg.modeA = cfg.modeA||0; // 0 = [D], 1 = [A] +cfg.primSpd = cfg.primSpd||0; // 1 = Spd in primary, 0 = Spd in secondary loadWp(); @@ -365,8 +365,8 @@ var img = { palette:new Uint16Array([0,0x4FE0,0xEFE0,0x07DB]) }; -if ( settings.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFF6,0xDFFF]); -if ( settings.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xFAE0,0xF813]); +if ( cfg.colour == 1 ) img.palette = new Uint16Array([0,0xFFFF,0xFFF6,0xDFFF]); +if ( cfg.colour == 2 ) img.palette = new Uint16Array([0,0xFF800,0xFAE0,0xF813]); var SCREENACCESS = { withApp:true, From 8e4cc30b3f59a607342201171181babd2705ee64 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 14:41:37 +1300 Subject: [PATCH 138/149] Display only actual fixes. If not a fix, then last fix --- apps/speedalt/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index ae840fd47..1b25b1b7d 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -3,7 +3,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com 1.16 : Use new GPS settings module */ -var v = '1.17'; +var v = '1.18'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -210,8 +210,8 @@ function onGPS(fix) { var di = '---'; var age = '---'; - if (fix.fix) { - lf = fix; + if (fix.fix) lf = fix; + if (lf.fix) { // Speed if ( cfg.spd == 0 ) { From 925fff2181cbbc487990685ba3cf05246d8933aa Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 14:59:15 +1300 Subject: [PATCH 139/149] Exit settings directly into app --- apps/speedalt/app.js | 2 +- apps/speedalt/settings.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 1b25b1b7d..7d599c15f 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -3,7 +3,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com 1.16 : Use new GPS settings module */ -var v = '1.18'; +var v = '1.19'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index 5f7418dbb..b04395fb9 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -45,6 +45,7 @@ const unitsMenu = { '': {'title': 'Units'}, '< Back': function() { E.showMenu(appMenu); }, + '< Load GPS Adv': ()=>{load('speedalt.app.js');}, 'default (spd)' : function() { setUnits(0,''); }, 'Kph (spd)' : function() { setUnits(1,'kph'); }, 'Knots (spd)' : function() { setUnits(1.852,'knots'); }, From 3585c468cf4e0d501d1ee92cf4423c6e0ed84b50 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 15:14:19 +1300 Subject: [PATCH 140/149] Tweak settings --- apps.json | 2 +- apps/speedalt/settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index c85bf25d4..1c14740b3 100644 --- a/apps.json +++ b/apps.json @@ -2623,7 +2623,7 @@ }, { "id": "speedalt", "name": "GPS Adventure Sports", - "shortName":"GPS Adv", + "shortName":"GPS Adv Sport", "icon": "app.png", "version":"1.00", "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.", diff --git a/apps/speedalt/settings.js b/apps/speedalt/settings.js index b04395fb9..aeec76c98 100644 --- a/apps/speedalt/settings.js +++ b/apps/speedalt/settings.js @@ -33,6 +33,7 @@ const appMenu = { '': {'title': 'GPS Speed Alt'}, '< Back': back, + '< Load GPS Adv Sport': ()=>{load('speedalt.app.js');}, 'Units' : function() { E.showMenu(unitsMenu); }, 'Colours' : function() { E.showMenu(colMenu); }/*, 'Vibrate' : { @@ -45,7 +46,6 @@ const unitsMenu = { '': {'title': 'Units'}, '< Back': function() { E.showMenu(appMenu); }, - '< Load GPS Adv': ()=>{load('speedalt.app.js');}, 'default (spd)' : function() { setUnits(0,''); }, 'Kph (spd)' : function() { setUnits(1,'kph'); }, 'Knots (spd)' : function() { setUnits(1.852,'knots'); }, From c1b076f0c68221640bec1a4afdf1109b6bcbe708 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 16:04:11 +1300 Subject: [PATCH 141/149] Changed multiple function arguments into a single object arg. --- apps/speedalt/app.js | 65 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 7d599c15f..064551182 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -3,7 +3,7 @@ Speed and Altitude [speedalt] Mike Bennett mike[at]kereru.com 1.16 : Use new GPS settings module */ -var v = '1.19'; +var v = '1.20'; var buf = Graphics.createArrayBuffer(240,160,2,{msb:true}); // Load fonts @@ -55,7 +55,9 @@ function distance(a,b){ return d; } -function drawFix(speed,units,sats,alt,alt_units,age,fix) { +//function drawFix(speed,sats,alt,alt_units,age,fix) { +function drawFix(dat) { + if (!canDraw) return; buf.clear(); @@ -64,18 +66,18 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { var u=''; // Primary Display - v = (cfg.primSpd)?speed.toString():alt.toString(); + v = (cfg.primSpd)?dat.speed.toString():dat.alt.toString(); // Primary Units - u = (cfg.primSpd)?cfg.spd_unit:alt_units; + u = (cfg.primSpd)?cfg.spd_unit:dat.alt_units; drawPrimary(v,u); // Secondary Display - v = (cfg.primSpd)?alt.toString():speed.toString(); + v = (cfg.primSpd)?dat.alt.toString():dat.speed.toString(); // Secondary Units - u = (cfg.primSpd)?alt_units:cfg.spd_unit; + u = (cfg.primSpd)?dat.alt_units:cfg.spd_unit; drawSecondary(v,u); @@ -86,11 +88,11 @@ function drawFix(speed,units,sats,alt,alt_units,age,fix) { drawWP(); //Sats - if ( age > 10 ) { - if ( age > 90 ) age = '>90'; - drawSats('Age:'+age); + if ( dat.age > 10 ) { + if ( dat.age > 90 ) dat.age = '>90'; + drawSats('Age:'+dat.age); } - else drawSats('Sats:'+sats); + else drawSats('Sats:'+dat.sats); g.reset(); g.drawImage(img,0,40); @@ -238,14 +240,48 @@ function onGPS(fix) { age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); } + + // {speed:,sats:,alt:,alt_units:,age:,fix:} if ( cfg.modeA ) { - if ( showMax ) drawFix(max.spd,cfg.spd_unit,lf.satellites,max.alt,cfg.alt_unit,age,lf.fix); // Speed and alt maximums - else drawFix(sp,cfg.spd_unit,lf.satellites,al,cfg.alt_unit,age,lf.fix); // Show speed/altitude + if ( showMax ) + drawFix({ + speed:max.spd, + sats:lf.satellites, + alt:max.alt, + alt_units:cfg.alt_unit, + age:age, + fix:lf.fix + }); // Speed and alt maximums + else + drawFix({ + speed:sp, + sats:lf.satellites, + alt:al, + alt_units:cfg.alt_unit, + age:age, + fix:lf.fix + }); // Show speed/altitude } else { // Show speed/distance - if ( di <= 0 ) drawFix(sp,cfg.spd_unit,lf.satellites,'','',age,lf.fix); // No WP selected - else drawFix(sp,cfg.spd_unit,lf.satellites,di,cfg.dist_unit,age,lf.fix); + if ( di <= 0 ) + drawFix({ + speed:sp, + sats:lf.satellites, + alt:'', + alt_units:'', + age:age, + fix:lf.fix + }); // No WP selected + else + drawFix({ + speed:sp, + sats:lf.satellites, + alt:di, + alt_units:cfg.dist_unit, + age:age, + fix:lf.fix + }); } } @@ -396,7 +432,6 @@ Bangle.setGPSPower(1); if ( gpssetup ) { gpssetup.setPowerMode({power_mode:"SuperE"}).then(function() { Bangle.setGPSPower(1); }); -// setInterval(()=>onGPS(WIDGETS.gpsservice.gps_get_fix()), 1000); } else { Bangle.setGPSPower(1); From bce5b9f6d493e7f2b8bdb827f69a3a2b57a49be4 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 16:25:33 +1300 Subject: [PATCH 142/149] Update README.md --- apps/speedalt/README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 538575ae9..4dd564339 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -22,9 +22,7 @@ BTN1 : Select next waypoint. Last fix distance from selected waypoint is display ### Both modes -BTN2 : Short press < 2 secs Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but uses maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Tap again to restore power saving timeouts. - -BTN2 : Long press > 2 secs turns off the low power GPS service and GPS. Exit and restart the app to turn back on. If you are using the low power gps service it will keep the GPS powered on after exiting the app. This is a convenient way to turn it off. +BTN2 : Disables/Restores power saving timeout. Locks the screen on to enable reading for longer periods but uses maximum battery drain. Red LED (dot) at top of screen when screen is locked on. Press again to restore power saving timeouts. BTN3 : Long press exit and return to watch. @@ -51,18 +49,18 @@ MAX Values instead:
Settings:
![](screen4.png)

-## Low Power GPS Service +## Power Saving -This app will work quite happily without this service but will use the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) if it is installed. You may choose to use the Low Power GPS Service to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Service Readme to understand what this does. +The The GPS Adv Sport app obeys the watch screen off timeouts as a power saving measure. Restore the screen as per any of the colck/watch apps. Use BTN2 to lock the screen on but doing this will use more battery. -When using the Low Power GPS Service this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 10 seconds after the display is blanked by the watch this app will switch the GPS to PMOO mode and will only attempt to get a fix every minute or two. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. +This app will work quite happily on its own but will use the [GPS Setup App](https://banglejs.com/apps/#gps setup) if it is installed. You may choose to use the GPS Setup App to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Setup App Readme to understand what this does. -There are a couple of things to consider when using the Low Power GPS Service. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. +When using the GPS Setup App this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 10 seconds after the display is blanked by the watch this app will switch the GPS to PSMOO mode and will only attempt to get a fix every two minutes. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. + +There are a couple of things to consider when using the GPS Setup App. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. -When exiting this app the Low Power GPS Service will keep the GPS powered on, using battery. It can be manually turned off using the gps service settings menu. As a convenience, long press BTN2 for 2 seconds will turn it off while using this GPS Adv app. - ## Waypoints Waypoints are used in [D]istance mode. Create a file waypoints.json and write to storage on the Bangle.js using the IDE. The first 6 characters of the name are displayed in Speed+[D]istance mode. @@ -142,6 +140,6 @@ Developed for my use in sailing, cycling and motorcycling. If you find this soft Many thanks to Gordon Williams. Awesome job. -Special thanks also to @jeffmer, for the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app and @hughbarney for the [Low power GPS Service](https://banglejs.com/apps/#low%20power%20gps%20service) work. +Special thanks also to @jeffmer, for the [GPS Navigation](https://banglejs.com/apps/#gps%20navigation) app and @hughbarney for the Low power GPS code development. From 2b08a4b0c3f1a98e05dc4520d820aade8ece7351 Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 16:27:45 +1300 Subject: [PATCH 143/149] Update README.md --- apps/speedalt/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 4dd564339..3eaefa283 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -53,7 +53,7 @@ Settings:
The The GPS Adv Sport app obeys the watch screen off timeouts as a power saving measure. Restore the screen as per any of the colck/watch apps. Use BTN2 to lock the screen on but doing this will use more battery. -This app will work quite happily on its own but will use the [GPS Setup App](https://banglejs.com/apps/#gps setup) if it is installed. You may choose to use the GPS Setup App to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Setup App Readme to understand what this does. +This app will work quite happily on its own but will use the [GPS Setup App](https://banglejs.com/apps/#gps%20setup) if it is installed. You may choose to use the GPS Setup App to gain significantly longer battery life while the GPS is on. Please read the Low Power GPS Setup App Readme to understand what this does. When using the GPS Setup App this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 10 seconds after the display is blanked by the watch this app will switch the GPS to PSMOO mode and will only attempt to get a fix every two minutes. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. From 6a18185ef80d24cadd97bc012c66d3970cf1babc Mon Sep 17 00:00:00 2001 From: nujw Date: Fri, 12 Feb 2021 16:29:39 +1300 Subject: [PATCH 144/149] Update README.md --- apps/speedalt/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/speedalt/README.md b/apps/speedalt/README.md index 3eaefa283..50ffce70c 100644 --- a/apps/speedalt/README.md +++ b/apps/speedalt/README.md @@ -57,8 +57,6 @@ This app will work quite happily on its own but will use the [GPS Setup App](htt When using the GPS Setup App this app switches the GPS to SuperE (default) mode while the display is lit and showing fix information. This ensures that that fixes are updated every second or so. 10 seconds after the display is blanked by the watch this app will switch the GPS to PSMOO mode and will only attempt to get a fix every two minutes. This improves power saving while the display is off and the delay gives an opportunity to restore the display before the GPS power mode is switched. -There are a couple of things to consider when using the GPS Setup App. This app plus the LP GPS service together use a considerable chunk of the Bangle.JS memory. A large waypoints file will also contribute to this. - The MAX values continue to be collected with the display off so may appear a little odd after the intermittent fixes of the low power mode. ## Waypoints From a766807607fdcb0750b59ad7578ef8c2b4791b93 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 13 Feb 2021 08:50:57 +1300 Subject: [PATCH 145/149] Final check and tidy --- apps/speedalt/app.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/speedalt/app.js b/apps/speedalt/app.js index 064551182..9e95737c4 100644 --- a/apps/speedalt/app.js +++ b/apps/speedalt/app.js @@ -55,7 +55,6 @@ function distance(a,b){ return d; } -//function drawFix(speed,sats,alt,alt_units,age,fix) { function drawFix(dat) { if (!canDraw) return; @@ -240,8 +239,6 @@ function onGPS(fix) { age = Math.max(0,Math.round(getTime())-(lf.time.getTime()/1000)); } - - // {speed:,sats:,alt:,alt_units:,age:,fix:} if ( cfg.modeA ) { if ( showMax ) drawFix({ @@ -300,10 +297,6 @@ function setButtons(){ onGPS(lf); }, BTN1, { edge:"falling",repeat:true}); - - // Show launcher when middle button pressed - // setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); - // Power saving on/off setWatch(function(e){ pwrSav=!pwrSav; @@ -418,7 +411,7 @@ Bangle.on('lcdPower',function(on) { var gpssetup; try { - gpssetup = require("gpssetup") + gpssetup = require("gpssetup"); } catch(e) { gpssetup = false; } From 56500622ee7e1cd37af70223bbb7a3be17d1108d Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 13 Feb 2021 09:07:07 +1300 Subject: [PATCH 146/149] Delete waypoints.json --- apps/speedalt/waypoints.json | 66 ------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 apps/speedalt/waypoints.json diff --git a/apps/speedalt/waypoints.json b/apps/speedalt/waypoints.json deleted file mode 100644 index b117bc5c2..000000000 --- a/apps/speedalt/waypoints.json +++ /dev/null @@ -1,66 +0,0 @@ -[ - { - "name":"NONE" - }, - { - "name":"Omori", - "lat":-38.9058670, - "lon":175.7613350 - }, - { - "name":"DeltaW", - "lat":-38.9438550, - "lon":175.7676930 - }, - { - "name":"DeltaE", - "lat":-38.9395240, - "lon":175.7814420 - }, - { - "name":"BtClub", - "lat":-38.9446020, - "lon":175.8475720 - }, - { - "name":"Hapua", - "lat":-38.8177750, - "lon":175.8088720 - }, - { - "name":"MotuTa", - "lat":-38.85454, - "lon":175.94199 - }, - { - "name":"Nook", - "lat":-38.7848090, - "lon":175.7839440 - }, - { - "name":"ChryBy", - "lat":-38.7975050, - "lon":175.7551960 - }, - { - "name":"Waiha", - "lat":-38.7219630, - "lon":175.7481520 - }, - { - "name":"KwaKwa", - "lat":-38.6632310, - "lon":175.8670320 - }, - { - "name":"Hatepe", - "lat":-38.8547420, - "lon":176.0089124 - }, - { - "name":"Kinloc", - "lat":-38.6614442, - "lon":175.9161607 - } - -] From 5a98eda2d090d6060b94091a0cb1afd15367154e Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 13 Feb 2021 09:17:55 +1300 Subject: [PATCH 147/149] Delete _config.yml --- _config.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _config.yml diff --git a/_config.yml b/_config.yml deleted file mode 100644 index b84971359..000000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-leap-day \ No newline at end of file From 97b47087f482cbbcccbd20e0cfe8b102c649ac40 Mon Sep 17 00:00:00 2001 From: nujw Date: Sat, 13 Feb 2021 09:24:00 +1300 Subject: [PATCH 148/149] Update ChangeLog --- apps/speedalt/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 2c77ccafa..1020a8eec 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -5,4 +5,4 @@ 0.05 : Add setting to turn vibrate on/off. 0.06 : Tweaks to vibration settings. 0.07 : Switch to BTN1 for Max toggle and reset function. -1.00 : New features. Added waypoints file and distance to selected waypoint display. Added integration with Low Power GPS service. Save display settings and restore when app restarted. +1.00 : New features. Added waypoints file and distance to selected waypoint display. Added integration with GPS Setup module to switch GPS to low power mode when screen off. Save display settings and restore when app restarted. From 1ab10da07b3df8c23fd84891feb60c771bc23a49 Mon Sep 17 00:00:00 2001 From: nujw Date: Mon, 15 Feb 2021 08:27:40 +1300 Subject: [PATCH 149/149] Update ChangeLog --- apps/speedalt/ChangeLog | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/speedalt/ChangeLog b/apps/speedalt/ChangeLog index 1020a8eec..e87c903bb 100644 --- a/apps/speedalt/ChangeLog +++ b/apps/speedalt/ChangeLog @@ -1,8 +1,8 @@ -0.01 : Initial import. -0.02 : Misc development. -0.03 : Enable screen off. -0.04 : Vibrate once on no fix, twice on fix. -0.05 : Add setting to turn vibrate on/off. -0.06 : Tweaks to vibration settings. -0.07 : Switch to BTN1 for Max toggle and reset function. -1.00 : New features. Added waypoints file and distance to selected waypoint display. Added integration with GPS Setup module to switch GPS to low power mode when screen off. Save display settings and restore when app restarted. +0.01: Initial import. +0.02: Misc development. +0.03: Enable screen off. +0.04: Vibrate once on no fix, twice on fix. +0.05: Add setting to turn vibrate on/off. +0.06: Tweaks to vibration settings. +0.07: Switch to BTN1 for Max toggle and reset function. +1.00: New features. Added waypoints file and distance to selected waypoint display. Added integration with GPS Setup module to switch GPS to low power mode when screen off. Save display settings and restore when app restarted.