exstats: make time stat duration-based (rather than elapsed time)
parent
7987766ebe
commit
ad30913080
|
|
@ -1,3 +1,4 @@
|
|||
0.01: New app!
|
||||
0.02: Show elapsed time on pause screen
|
||||
0.03: Avoid initial GPS skew and allow reset of time/splits
|
||||
0.04: Bump exstats module - show active time, not elapsed
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "pace",
|
||||
"name": "Pace",
|
||||
"version": "0.03",
|
||||
"version": "0.04",
|
||||
"description": "Show pace and time running splits",
|
||||
"icon": "app.png",
|
||||
"tags": "run,running,fitness,outdoors",
|
||||
|
|
|
|||
|
|
@ -18,3 +18,4 @@
|
|||
0.17: Ensure screen redraws after "Resume run?" menu (#3044)
|
||||
0.18: Minor code improvements
|
||||
0.19: Fix step count bug when runs are resumed after a long time
|
||||
0.20: Bump exstats module - show active time, not elapsed
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "run",
|
||||
"name": "Run",
|
||||
"version": "0.19",
|
||||
"version": "0.20",
|
||||
"description": "Displays distance, time, steps, cadence, pace and more for runners. The **Run+** app for Bangle.js 2 provides additional features.",
|
||||
"icon": "app.png",
|
||||
"tags": "run,running,fitness,outdoors,gps",
|
||||
|
|
|
|||
|
|
@ -28,3 +28,5 @@ Write to correct settings file, fixing settings not working.
|
|||
0.25: Fix step count bug when runs are resumed after a long time
|
||||
0.26: Add ability to zoom in on a single stat by tapping it
|
||||
0.27: Allow setting to alway resume an activity
|
||||
0.28: Change the "time" stat to show active time (duration) rather than
|
||||
elapsed time (fix #3802)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "runplus",
|
||||
"name": "Run+",
|
||||
"version": "0.27",
|
||||
"version": "0.28",
|
||||
"description": "Displays distance, time, steps, cadence, pace and more for runners. Based on the Run app, but extended with additional screens for heart rate interval training and individual stat focus.",
|
||||
"icon": "app.png",
|
||||
"tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen",
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ exports.getStats = function(statIDs, options) {
|
|||
if (statIDs.includes("time")) {
|
||||
stats["time"]={
|
||||
title : "Time",
|
||||
getValue : function() { return Date.now()-state.startTime; },
|
||||
getValue : function() { return state.duration; },
|
||||
getString : function() { return formatTime(this.getValue()) },
|
||||
};
|
||||
}
|
||||
|
|
@ -317,12 +317,12 @@ exports.getStats = function(statIDs, options) {
|
|||
if (needHRM) Bangle.setHRMPower(true,"exs");
|
||||
if (needBaro) Bangle.setBarometerPower(true,"exs");
|
||||
setInterval(function() { // run once a second....
|
||||
if (stats["time"]) stats["time"].emit("changed",stats["time"]);
|
||||
if (!state.active) return;
|
||||
// called once a second
|
||||
var now = Date.now();
|
||||
state.duration += now - state.lastTime; // in ms
|
||||
state.lastTime = now;
|
||||
if (stats["time"]) stats["time"].emit("changed",stats["time"]);
|
||||
// set cadence -> steps over last minute
|
||||
state.stepsPerMin = Math.round(60000 * E.sum(state.stepHistory) / Math.min(state.duration,60000));
|
||||
if (stats["caden"]) stats["caden"].emit("changed",stats["caden"]);
|
||||
|
|
@ -335,7 +335,7 @@ exports.getStats = function(statIDs, options) {
|
|||
state.BPM = 0;
|
||||
if (stats["bpm"]) stats["bpm"].emit("changed",stats["bpm"]);
|
||||
}
|
||||
if (state.notify.time.increment > 0 && state.notify.time.next <= now) {
|
||||
if (state.notify.time.increment > 0 && state.notify.time.next <= state.duration) {
|
||||
state.notify.time.next = state.notify.time.next + state.notify.time.increment;
|
||||
stats["time"].emit("notify",stats["time"]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue