pull/1545/head
Salim Blume 2022-03-05 03:28:23 -06:00
parent e823ae8496
commit 8a7b30cf6c
3 changed files with 11 additions and 19 deletions

View File

@ -25,15 +25,15 @@ let settings = Object.assign({
notify: {
dist: {
value: 0,
notification: [],
notifications: [],
},
step: {
value: 0,
notification: [],
notifications: [],
},
time: {
value: 0,
notification: [],
notifications: [],
},
},
}, require("Storage").readJSON("run.json", 1) || {});

View File

@ -20,15 +20,15 @@
notify: {
dist: {
increment: 0,
notification: [],
notifications: [],
},
step: {
increment: 0,
notification: [],
notifications: [],
},
time: {
increment: 0,
notification: [],
notifications: [],
},
},
}, storage.readJSON(SETTINGS_FILE, 1) || {});
@ -48,10 +48,10 @@
}
}
function sampleBuzz(buzzTimes) {
buzzTimes.reduce(function (promise, buzzTime) {
function sampleBuzz(buzzPatterns) {
buzzPatterns.reduce(function (promise, buzzPattern) {
return promise.then(function () {
return Bangle.buzz(buzzTime);
return Bangle.buzz(buzzPattern[0], buzzPattern[1]);
});
}, Promise.resolve());
}
@ -74,7 +74,8 @@
var vibTimes = [
[],
[[100, 1]],
[[500, 1]],[[500, 1], [100, 0], [500, 1]],
[[500, 1]],
[[500, 1], [100, 0], [500, 1]],
[[500, 1],[100, 0], [100, 1], [100, 0], [500, 1]],
[[500, 1],[100, 0],[500, 1],[100, 0],[500, 1]],
];

View File

@ -67,17 +67,14 @@ var state = {
notify: {
dist: {
increment: 0,
notification: [],
next: 0,
},
steps: {
increment: 0,
notification: [],
next: 0,
},
time: {
increment: 0,
notification: [],
next: 0,
},
},
@ -277,8 +274,6 @@ exports.getStats = function(statIDs, options) {
state.BPM = 0;
if (stats["bpm"]) stats["bpm"].emit("changed",stats["bpm"]);
}
console.log(now);
console.log(state.notify.time.next);
if (state.notify.time.increment > 0 && state.notify.time.next < now) {
stats["time"].emit("notify",stats["time"]);
state.notify.time.next = now + state.notify.time.increment;
@ -296,8 +291,6 @@ exports.getStats = function(statIDs, options) {
state.BPM = 0;
state.BPMage = 0;
state.notify = options.notify;
console.log("options:");
console.log(JSON.stringify(options));
if (options.notify.dist.increment > 0) {
state.notify.dist.next = state.distance + options.notify.dist.increment;
}
@ -307,8 +300,6 @@ exports.getStats = function(statIDs, options) {
if (options.notify.time.increment > 0) {
state.notify.time.next = state.startTime + options.notify.time.increment;
}
console.log("state:");
console.log(JSON.stringify(state));
}
reset();
return {