forked from espruino/BangleApps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# My Profile | ||
|
||
Configure your personal profile. All settings are optional and are only stored on the watch. | ||
|
||
## Available settings | ||
|
||
| Setting | Description | Displayed in | Stored in | Default value | How to measure | | ||
| ------------- | ----------------------------- | ------------------- | --------- | ------------- | ----------------------------------------------------------------- | | ||
| HR max | maximum heart rate | BPM | BPM | 60 | Use maximum value when exercising.<br/> If unsure set to 220-age. | | ||
| HR min | minimum heart rate | BPM | BPM | 200 | Measure your heart rate after waking up | | ||
| Stride length | distance travel with one step | local length unit | meter | 0 (=not set) | Walk 10 steps and divide the travelled distance by 10 | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ "id": "myprofile", | ||
"name": "My Profile", | ||
"shortName":"My Profile", | ||
"icon": "app.png", | ||
"type": "settings", | ||
"version":"0.01", | ||
"description": "Configure your personal profile. All settings are optional and only stored on the watch.", | ||
"readme": "README.md", | ||
"tags": "tool,utility", | ||
"supports": ["BANGLEJS", "BANGLEJS2"], | ||
"storage": [ | ||
{"name":"myprofile.settings.js","url":"settings.js"} | ||
], | ||
"data": [ | ||
{"name":"myprofile.json"} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(function(back) { | ||
const FILE = "myprofile.json"; | ||
|
||
const myprofile = Object.assign({ | ||
minHrm: 60, | ||
maxHrm: 200, | ||
strideLength: 0, // 0 = not set | ||
}, require('Storage').readJSON(FILE, true) || {}); | ||
|
||
function writeProfile() { | ||
require('Storage').writeJSON(FILE, myprofile); | ||
} | ||
|
||
// Show the menu | ||
E.showMenu({ | ||
"" : { "title" : /*LANG*/"My Profile" }, | ||
|
||
"< Back" : () => back(), | ||
|
||
/*LANG*/'HR max': { | ||
format: v => /*LANG*/`${v} BPM`, | ||
value: myprofile.maxHrm, | ||
min: 30, max: 220, | ||
onchange: v => { | ||
myprofile.maxHrm = v; | ||
writeProfile(); | ||
} | ||
}, | ||
|
||
/*LANG*/'HR min': { | ||
format: v => /*LANG*/`${v} BPM`, | ||
value: myprofile.minHrm, | ||
min: 30, max: 220, | ||
onchange: v => { | ||
myprofile.minHrm = v; | ||
writeProfile(); | ||
} | ||
}, | ||
|
||
/*LANG*/"Stride length": { | ||
value: myprofile.strideLength, | ||
min:0.00, | ||
step:0.01, | ||
format: v => v ? require("locale").distance(v, 2) : '-', | ||
onchange: v => { | ||
console.log(v); | ||
myprofile.strideLength=v; | ||
writeProfile(); | ||
}, | ||
}, | ||
}); | ||
}) |