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