Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was hoping to include the pace (inverse of speed) with not these many lines of codes, but to do so I should have refactored many pieces of the existing infrastructure which has a fair bit of repetition. Instead, I opted for keeping the same infrastructure (and repetitions) as is, and duplicate it for the pace.
Moreover, the pace is a time over a fixed distance, and is usually shown as
minute:seconds
. To do so, I would have to change many things, including how the labels for the y axis are created in the plotting library, using strings instead of number. Instead, I choose to give the user the option to select either minutes or seconds (per either km or miles) and keeping them numbers instead of having to mess up with strings.Last, but not least, being pace the inverse of speed, it diverges when one is not moving, which is exactly what one wants (how long would it take to cover a mile if you are standing still? It would take forever, or infinity -- how long if you are going slower than ant's step? Again almost forever or a very large number). Therefore, like in all systems that use pace, I set a threshold in
globals.h
, above which pace is not computed/plotted.In the end, it seems to be working well.