mirror of https://github.com/espruino/BangleApps
parent
4d1cf766ef
commit
02fca7a4c8
|
@ -135,7 +135,7 @@ Bangle.on("GPS", function(fix) {
|
||||||
if (stats["dist"]) stats["dist"].emit("changed",stats["dist"]);
|
if (stats["dist"]) stats["dist"].emit("changed",stats["dist"]);
|
||||||
var duration = Date.now() - state.startTime; // in ms
|
var duration = Date.now() - state.startTime; // in ms
|
||||||
state.avrSpeed = state.distance * 1000 / duration; // meters/sec
|
state.avrSpeed = state.distance * 1000 / duration; // meters/sec
|
||||||
state.curSpeed = state.curSpeed*0.8 + fix.speed*0.2/3.6; // meters/sec
|
if (!isNaN(fix.speed)) state.curSpeed = state.curSpeed*0.8 + fix.speed*0.2/3.6; // meters/sec
|
||||||
if (stats["pacea"]) stats["pacea"].emit("changed",stats["pacea"]);
|
if (stats["pacea"]) stats["pacea"].emit("changed",stats["pacea"]);
|
||||||
if (stats["pacec"]) stats["pacec"].emit("changed",stats["pacec"]);
|
if (stats["pacec"]) stats["pacec"].emit("changed",stats["pacec"]);
|
||||||
if (stats["speed"]) stats["speed"].emit("changed",stats["speed"]);
|
if (stats["speed"]) stats["speed"].emit("changed",stats["speed"]);
|
||||||
|
|
Loading…
Reference in New Issue