fix hrm max setting

master
thyttan 2023-02-19 12:28:33 +01:00
parent b8eca27831
commit ef3794cfad
3 changed files with 5 additions and 5 deletions

View File

@ -178,7 +178,7 @@ function stopRunUI() {
// Define the function to go back and foth between the different UI's
function swipeHandler(LR,_) {
if (LR==-1 && karvonnenActive && !isMenuDisplayed) run();
if (LR==1 && !karvonnenActive && !isMenuDisplayed) {stopRunUI(); require("run_karvonnen").show();}
if (LR==1 && !karvonnenActive && !isMenuDisplayed) {stopRunUI(); require("run_karvonnen").show(settings.HRM);}
}
// Listen for swipes with the swipeHandler

View File

@ -1,5 +1,5 @@
// Korvonnen pasted inside a function
exports.show = function karvonnen() {
exports.show = function karvonnen(hrmSettings) {
//This app is an extra feature implementation for the Run.app of the bangle.js. It's called run+
//The calculation of the Heart Rate Zones is based on the Karvonnen method. It requires to know maximum and minimum heart rates. More precise calculation methods require a lab.
//Other methods are even more approximative.
@ -18,8 +18,8 @@ exports.show = function karvonnen() {
// HRR = maximum HR - Minimum HR. minhr is minimum hr, maxhr is maximum hr.
//get the hrr (heart rate reserve).
// I put random data here, but this has to come as a menu in the settings section so that users can change it.
let minhr = 48;
let maxhr = 187;
let minhr = hrmSettings.min;
let maxhr = hrmSettings.max;
function calculatehrr(minhr, maxhr) {
return maxhr - minhr;}

View File

@ -146,7 +146,7 @@
}
hrmMenu[/*LANG*/"max"] = {
min: 120, max: 190,
value: settings.HRM.min|165,
value: settings.HRM.max|165,
format: v => v,
onchange: v => {
settings[HRM][max] = v;