diff --git a/app/engine/RowingStatistics.js b/app/engine/RowingStatistics.js index 1be31d2..9b7ead0 100644 --- a/app/engine/RowingStatistics.js +++ b/app/engine/RowingStatistics.js @@ -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 () { diff --git a/app/server.js b/app/server.js index 5a18a15..b5cf102 100644 --- a/app/server.js +++ b/app/server.js @@ -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)