File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11'use strict'
22/**
33 * @copyright [OpenRowingMonitor]{@link https://github.com/JaapvanEkris/openrowingmonitor}
4- *
4+ *
55 * @file This models the flywheel with all of its attributes, which we can also test for being powered
66 *
77 * All times and distances are defined as being before the beginning of the flank, as RowingEngine's metrics
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export function createFITRecorder (config) {
160160 ...( ! isNaN ( heartRate ) && heartRate > 0 ? { heartrate : heartRate } : { heartrate : undefined } )
161161 } )
162162 sessionData . totalMovingTime = metrics . workout . timeSpent . moving
163- VO2max . push ( metrics )
163+ VO2max . push ( metrics , heartRate )
164164 fitfileContentIsCurrent = false
165165 allDataHasBeenWritten = false
166166 }
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export function createRowingDataRecorder (config) {
117117 strokes [ strokeNumber ] . driveHandleForceCurve = metrics . driveHandleForceCurve
118118 strokes [ strokeNumber ] . driveHandleVelocityCurve = metrics . driveHandleVelocityCurve
119119 strokes [ strokeNumber ] . driveHandlePowerCurve = metrics . driveHandlePowerCurve
120- VO2max . push ( metrics )
120+ VO2max . push ( metrics , heartRate )
121121 if ( ! isNaN ( metrics . dragFactor ) && metrics . dragFactor > 0 ) { drag . push ( metrics . dragFactor ) }
122122 allDataHasBeenWritten = false
123123 rowingDataFileContentIsCurrent = false
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export function createTCXRecorder (config) {
111111 } else {
112112 sessionData . lap [ lapnumber ] . strokes [ strokenumber ] . heartrate = undefined
113113 }
114- VO2max . push ( metrics )
114+ VO2max . push ( metrics , heartRate )
115115 tcxfileContentIsCurrent = false
116116 allDataHasBeenWritten = false
117117 }
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ export function createVO2max (config) {
2727 /**
2828 * @param {Metrics } metrics
2929 */
30- function push ( metrics ) {
30+ function push ( metrics , HRData ) {
3131 VO2MaxResultIsCurrent = false
32- if ( metrics . totalMovingTime > offset && ! ! metrics . heartrate && ! isNaN ( metrics . heartrate ) && metrics . heartrate >= config . userSettings . restingHR && metrics . heartrate < config . userSettings . maxHR && ! isNaN ( metrics . cyclePower ) && metrics . cyclePower > 0 && metrics . cyclePower <= config . userSettings . maxPower ) {
32+ if ( metrics . totalMovingTime > offset && ! ! HRData && ! isNaN ( HRData ) && HRData >= config . userSettings . restingHR && HRData < config . userSettings . maxHR && ! isNaN ( metrics . cyclePower ) && metrics . cyclePower > 0 && metrics . cyclePower <= config . userSettings . maxPower ) {
3333 // We are outside the startup noise and have numeric fields
3434 metricsArray . push ( {
3535 totalMovingTime : metrics . totalMovingTime ,
3636 totalLinearDistance : metrics . totalLinearDistance ,
3737 cyclePower : metrics . cyclePower ,
38- heartrate : metrics . heartrate
38+ heartrate : HRData
3939 } )
4040 }
4141 }
You can’t perform that action at this time.
0 commit comments