OpenTracksApp/OpenTracks

Speed and cadence sensors display values >0 when idle detection detected a stop

lsuhrbier opened this issue · 3 comments

After having stopped the idle detection, non-zero values are displayed from speed and cadence sensors. It appears, the last measured values are shown and not reset to zero or not read again from the sensor after idle detection detected a stop.

Code looks like this is a valid complaint.
Relevant code:

  • TrackPointCreator.reset() [called by idle]
  • SensorDataSet.reset()

Later on used by:

  • TrackRecordingManager.getDataForUI()

Culprit may be children of Aggregator and the implementation of Aggregator.reset().
If I understood the code (I wrote), only accumulated values (like distance) are reset, but not the actual measurements (like speed, cadence, power).
So, the problem seems to be happening during the idle situation.

PS/ you may be idle while a cadence sensor reports values - HR will do this as well :D