ryanbinns / ttwatch

Linux TomTom GPS Watch Utilities
MIT License
205 stars 66 forks source link

Use cumulative distance to calculate interval/lap distance #162

Closed typhoon2099 closed 4 years ago

typhoon2099 commented 5 years ago

Reported distances are unreliable, this commit changes the code to calculate the interval distance based on the start/end cumulative distances.

Fixes #159

ryanbinns commented 5 years ago

I would prefer not to fix this in the ttbin reading code. The reason is that I would like the code to be able to read a ttbin file, then write to a new ttbin file and have it binary identical to the original. The best place to fix this would be in the file conversion routines.

typhoon2099 commented 5 years ago

Righto, I'll make some changes shortly. I'm still unsure why the interval total distance is going wrong, I'd love to fix the root cause of the issue, but I can't seem to track it down. Unless of course that's what the watch is storing. This pull request is a bit of a plaster over the real issue.

typhoon2099 commented 4 years ago

I've tracked down the issue to the data type used for FILE_INTERVAL_FINISH_RECORD.type. Changing this corrects the interval summaries in tcx files.

ryanbinns commented 4 years ago

Sorry for the delay, but thanks for tracking this down.