fixes to draw correctly and in a timely manner when swiping to the karvonnen ui depending on if we have hrm data or not
parent
0e08d37d3e
commit
60a631d84f
|
|
@ -41,12 +41,12 @@ let settings = Object.assign({
|
|||
time: {
|
||||
value: 0,
|
||||
notifications: [],
|
||||
}
|
||||
},
|
||||
},
|
||||
HRM: {
|
||||
min: 65,
|
||||
max: 170,
|
||||
}
|
||||
},
|
||||
}, require("Storage").readJSON("runplus.json", 1) || {});
|
||||
let statIDs = [settings.B1,settings.B2,settings.B3,settings.B4,settings.B5,settings.B6].filter(s=>s!=="");
|
||||
let exs = ExStats.getStats(statIDs, settings);
|
||||
|
|
@ -100,7 +100,7 @@ function onStartStop() {
|
|||
let lc = [];
|
||||
// Load stats in pair by pair
|
||||
for (let i=0;i<statIDs.length;i+=2) {
|
||||
let sa = exs.stats[statIDs[i+0]]
|
||||
let sa = exs.stats[statIDs[i+0]];
|
||||
let sb = exs.stats[statIDs[i+1]];
|
||||
lc.push({ type:"h", filly:1, c:[
|
||||
sa?{type:"txt", font:fontHeading, label:sa.title.toUpperCase(), fillx:1, col:headingCol }:{},
|
||||
|
|
|
|||
|
|
@ -188,15 +188,14 @@
|
|||
|
||||
function initDraw() {
|
||||
drawArrows();
|
||||
drawWaitHR();
|
||||
drawBgArc();
|
||||
if (hr!=0) updateUI(true); else {drawWaitHR(); drawBgArc();}
|
||||
//drawZones();
|
||||
}
|
||||
|
||||
let hrLast;
|
||||
//h = 0; // Used to force hr update to trigger draws, together with `if (h!=0) hr = h;` below.
|
||||
function updateUI() { // Update UI, only draw if warranted by change in HR.
|
||||
hrLast = hr;
|
||||
//h = 0; // Used to force hr update via web ui console field to trigger draws, together with `if (h!=0) hr = h;` below.
|
||||
function updateUI(resetHrLast) { // Update UI, only draw if warranted by change in HR.
|
||||
hrLast = resetHrLast?0:hr; // Handles correct updating on init depending on if we've got HRM readings yet or not.
|
||||
hr = exsHrmStats.getValue();
|
||||
//if (h!=0) hr = h;
|
||||
if (hr!=hrLast) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue