Move functionality to the Finite State Machine

On hindsight, the approach of letting the FSM handle all state transitions explicitly is much clearer
This commit is contained in:
Jaap van Ekris 2023-01-16 12:18:39 +01:00 committed by GitHub
parent 675c85cb59
commit 36953315bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ stateDiagram-v2
Stopped --> [*] Stopped --> [*]
``` ```
Please note: the 'Stopped' state in the `handleRotationImpulse`'s state machine is a direct consequence of either `rower.js` indicating the flywheel is in a freespin or reaching the end of an interval without any subsequent interval being present in the workout. The later is tested in the function `handleIntervalEnd()`, which determines this. Although this distinction could be handled by the state machine as part of `handleRotationImpulse`, we felt it would make the state machine less readable as it would add another three new states. Please note: `handleRotationImpulse` implements all these state transitions, where the state transitions for the end of an interval and the end of a session are handled individually as the metrics updates differ slightly.
#### metrics maintained in RowingStatistics.js #### metrics maintained in RowingStatistics.js