adds simulated heart rate
This commit is contained in:
parent
1ce1a2136a
commit
f358d06247
|
|
@ -117,13 +117,7 @@ function createRowingStatistics () {
|
|||
|
||||
// clear the displayed metrics in case the user pauses rowing
|
||||
function pauseRowing () {
|
||||
emitter.emit('rowingPaused', {
|
||||
durationTotal,
|
||||
durationTotalFormatted: secondsToTimeString(durationTotal),
|
||||
strokesTotal: strokesTotal,
|
||||
distanceTotal: Math.round(distanceTotal),
|
||||
caloriesTotal: Math.round(caloriesTotal)
|
||||
})
|
||||
emitter.emit('rowingPaused', getMetrics())
|
||||
}
|
||||
|
||||
function startDurationTimer () {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,8 @@ rowingStatistics.on('strokeFinished', (data) => {
|
|||
split: data.split,
|
||||
strokesPerMinute: data.strokesPerMinute,
|
||||
speed: data.speed,
|
||||
heartRate: 0,
|
||||
// todo: no real measurement of heartRate yet
|
||||
heartRate: Math.max(data.caloriesPerMinute * 7, 50),
|
||||
strokeState: data.strokeState
|
||||
}
|
||||
webServer.notifyClients(metrics)
|
||||
|
|
@ -108,7 +109,8 @@ rowingStatistics.on('rowingPaused', (data) => {
|
|||
splitFormatted: '∞',
|
||||
split: Infinity,
|
||||
speed: 0,
|
||||
heartRate: 0,
|
||||
// todo: no real measurement of heartRate yet
|
||||
heartRate: Math.max(data.caloriesPerMinute * 7, 50),
|
||||
strokeState: 'RECOVERY'
|
||||
}
|
||||
webServer.notifyClients(metrics)
|
||||
|
|
|
|||
Loading…
Reference in New Issue