Merge pull request #3956 from RKBoss6/BangleExerciseUpdates
[BanglExercise] Grammar changes, add language translationsmaster
commit
bc10e7e6bc
|
|
@ -5,3 +5,4 @@
|
||||||
0.03: Add software back button on main menu
|
0.03: Add software back button on main menu
|
||||||
0.04: Minor code improvements
|
0.04: Minor code improvements
|
||||||
0.05: Minor code improvements
|
0.05: Minor code improvements
|
||||||
|
0.06: Fix grammar, add international language support
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ let exerciseType = {
|
||||||
// add new exercises here:
|
// add new exercises here:
|
||||||
const exerciseTypes = [{
|
const exerciseTypes = [{
|
||||||
"id": "pushup",
|
"id": "pushup",
|
||||||
"name": "push ups",
|
"name": /*LANG*/"Push-ups",
|
||||||
"useYaxis": true,
|
"useYaxis": true,
|
||||||
"useZaxis": false,
|
"useZaxis": false,
|
||||||
"threshold": 2500,
|
"threshold": 2500,
|
||||||
|
|
@ -34,7 +34,7 @@ const exerciseTypes = [{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "curl",
|
"id": "curl",
|
||||||
"name": "curls",
|
"name": /*LANG*/"Curls",
|
||||||
"useYaxis": true,
|
"useYaxis": true,
|
||||||
"useZaxis": false,
|
"useZaxis": false,
|
||||||
"threshold": 2500,
|
"threshold": 2500,
|
||||||
|
|
@ -44,7 +44,7 @@ const exerciseTypes = [{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "situp",
|
"id": "situp",
|
||||||
"name": "sit ups",
|
"name": /*LANG*/"Sit-ups",
|
||||||
"useYaxis": false,
|
"useYaxis": false,
|
||||||
"useZaxis": true,
|
"useZaxis": true,
|
||||||
"threshold": 3500,
|
"threshold": 3500,
|
||||||
|
|
@ -88,7 +88,7 @@ function showMainMenu() {
|
||||||
menu["--------"] = {
|
menu["--------"] = {
|
||||||
value: ""
|
value: ""
|
||||||
};
|
};
|
||||||
menu["Last:"] = {
|
menu[/*LANG*/"Last:"] = {
|
||||||
value: exerciseCounter + " " + exerciseType.name
|
value: exerciseCounter + " " + exerciseType.name
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -189,10 +189,10 @@ function isValidExercise(slope, t) {
|
||||||
if (p1 > 0 && p2 < 0) {
|
if (p1 > 0 && p2 < 0) {
|
||||||
if (lastZeroPassCameFromPositive == false) {
|
if (lastZeroPassCameFromPositive == false) {
|
||||||
lastExerciseHalfCompletionTime = t;
|
lastExerciseHalfCompletionTime = t;
|
||||||
console.log(t, exerciseName + " half complete...");
|
console.log(t, exerciseName + /*LANG*/" half complete...");
|
||||||
|
|
||||||
layout.progress.label = "½";
|
layout.progress.label = "½";
|
||||||
layout.recording.label = "TRAINING";
|
layout.recording.label = /*LANG*/"TRAINING";
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
layout.render();
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +204,7 @@ function isValidExercise(slope, t) {
|
||||||
if (lastZeroPassCameFromPositive == true) {
|
if (lastZeroPassCameFromPositive == true) {
|
||||||
const tDiffLastExercise = t - lastExerciseCompletionTime;
|
const tDiffLastExercise = t - lastExerciseCompletionTime;
|
||||||
const tDiffStart = t - tStart;
|
const tDiffStart = t - tStart;
|
||||||
console.log(t, exerciseName + " maybe complete?", Math.round(tDiffLastExercise), Math.round(tDiffStart));
|
console.log(t, exerciseName + /*LANG*/" maybe complete?", Math.round(tDiffLastExercise), Math.round(tDiffStart));
|
||||||
|
|
||||||
// check minimal time between exercises:
|
// check minimal time between exercises:
|
||||||
if ((lastExerciseCompletionTime <= 0 && tDiffStart >= thresholdMinTime) || tDiffLastExercise >= thresholdMinTime) {
|
if ((lastExerciseCompletionTime <= 0 && tDiffStart >= thresholdMinTime) || tDiffLastExercise >= thresholdMinTime) {
|
||||||
|
|
@ -222,7 +222,7 @@ function isValidExercise(slope, t) {
|
||||||
|
|
||||||
layout.count.label = exerciseCounter;
|
layout.count.label = exerciseCounter;
|
||||||
layout.progress.label = "";
|
layout.progress.label = "";
|
||||||
layout.recording.label = "Good!";
|
layout.recording.label =/*LANG*/"Good!";
|
||||||
|
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
layout.render();
|
||||||
|
|
@ -230,26 +230,26 @@ function isValidExercise(slope, t) {
|
||||||
if (settings.buzz)
|
if (settings.buzz)
|
||||||
Bangle.buzz(200, 0.5);
|
Bangle.buzz(200, 0.5);
|
||||||
} else {
|
} else {
|
||||||
console.log(t, exerciseName + " too quick for duration time threshold!"); // thresholdMinDurationTime
|
console.log(t, exerciseName + /*LANG*/" too quick for duration time threshold!"); // thresholdMinDurationTime
|
||||||
lastExerciseCompletionTime = t;
|
lastExerciseCompletionTime = t;
|
||||||
|
|
||||||
layout.recording.label = "Go slower!";
|
layout.recording.label = /*LANG*/"Go slower!";
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
layout.render();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(t, exerciseName + " top slow for time threshold!"); // thresholdMaxTime
|
console.log(t, exerciseName + /*LANG*/" top slow for time threshold!"); // thresholdMaxTime
|
||||||
lastExerciseCompletionTime = t;
|
lastExerciseCompletionTime = t;
|
||||||
|
|
||||||
layout.recording.label = "Go faster!";
|
layout.recording.label = /*LANG*/"Go faster!";
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
layout.render();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(t, exerciseName + " too quick for time threshold!"); // thresholdMinTime
|
console.log(t, exerciseName + /*LANG*/" too quick for time threshold!"); // thresholdMinTime
|
||||||
lastExerciseCompletionTime = t;
|
lastExerciseCompletionTime = t;
|
||||||
|
|
||||||
layout.recording.label = "Go slower!";
|
layout.recording.label = /*LANG*/"Go slower!";
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
layout.render();
|
||||||
}
|
}
|
||||||
|
|
@ -337,7 +337,7 @@ function startTraining() {
|
||||||
type: "txt",
|
type: "txt",
|
||||||
id: "recording",
|
id: "recording",
|
||||||
font: "6x8:2",
|
font: "6x8:2",
|
||||||
label: "TRAINING",
|
label: /*LANG*/"TRAINING",
|
||||||
bgCol: "#f00",
|
bgCol: "#f00",
|
||||||
pad: 5,
|
pad: 5,
|
||||||
fillx: 1
|
fillx: 1
|
||||||
|
|
@ -345,7 +345,7 @@ function startTraining() {
|
||||||
]
|
]
|
||||||
}, {
|
}, {
|
||||||
btns: [{
|
btns: [{
|
||||||
label: "STOP",
|
label: /*LANG*/"STOP",
|
||||||
cb: () => {
|
cb: () => {
|
||||||
stopTraining();
|
stopTraining();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{ "id": "banglexercise",
|
{ "id": "banglexercise",
|
||||||
"name": "BanglExercise",
|
"name": "BanglExercise",
|
||||||
"shortName":"BanglExercise",
|
"shortName":"BanglExercise",
|
||||||
"version": "0.05",
|
"version": "0.06",
|
||||||
"description": "Can automatically track exercises while wearing the Bangle.js watch.",
|
"description": "Automatically tracks exercises while wearing the Bangle.js watch.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
"type": "app",
|
"type": "app",
|
||||||
"tags": "sport",
|
"tags": "health",
|
||||||
"supports" : ["BANGLEJS2"],
|
"supports" : ["BANGLEJS2"],
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue