Fix a state machine bug
Fixed a bug where allowMovement() would be called at the start of the first drive, which would force it back to a paused state, causing all kind of weird metrics.
This commit is contained in:
parent
e1701f8038
commit
43d7e45aee
|
|
@ -299,8 +299,11 @@ function createRower (rowerSettings) {
|
|||
}
|
||||
|
||||
function allowMovement () {
|
||||
log.debug(`*** ALLOW MOVEMENT command by RowingEngine recieved at time: ${flywheel.spinningTime().toFixed(4)} sec`)
|
||||
_strokeState = 'WaitingForDrive'
|
||||
if (_strokeState === 'Stopped') {
|
||||
// We have to check whether there actually was a stop/pause, in order to prevent weird behaviour from the state machine
|
||||
log.debug(`*** ALLOW MOVEMENT command by RowingEngine recieved at time: ${flywheel.spinningTime().toFixed(4)} sec`)
|
||||
_strokeState = 'WaitingForDrive'
|
||||
}
|
||||
}
|
||||
|
||||
function pauseMoving () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue