diff options
author | Chris Schlaeger <chris@linux.com> | 2019-09-03 21:17:17 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2019-09-03 21:17:17 +0200 |
commit | e926d21e282668b97fcc2689af0c2c8d3eab6b02 (patch) | |
tree | 83d8f59b36c22052e21d1fce515dace99207fe91 /lib | |
parent | b01b8b0c8cb440ba01b58d9980470621717638cd (diff) | |
download | postrunner-e926d21e282668b97fcc2689af0c2c8d3eab6b02.zip |
New: Add support for Garmin Fenix5X Plus FW 8.40
Diffstat (limited to 'lib')
-rw-r--r-- | lib/postrunner/ChartView.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/postrunner/ChartView.rb b/lib/postrunner/ChartView.rb index 9274d9e..e73d978 100644 --- a/lib/postrunner/ChartView.rb +++ b/lib/postrunner/ChartView.rb @@ -295,7 +295,18 @@ EOT # finish the line and start a new one later. data_set << [ (last_timestamp - start_time + 1).to_i * 1000, nil ] end - if (value = r.get_as(chart[:id], chart[:unit] || '')) + value = r.get_as(chart[:id], chart[:unit] || '') + if value.nil? && chart[:id] == 'speed' + # If speed field doesn't exist the value might be in the + # enhanced_speed field. + value = r.get_as('enhanced_speed', chart[:unit] || '') + end + if value.nil? && chart[:id] == 'altitude' + # If altitude field doesn't exist the value might be in the + # enhanced_elevation field. + value = r.get_as('enhanced_elevation', chart[:unit] || '') + end + if value if chart[:id] == 'pace' # Slow speeds lead to very large pace values that make the graph # hard to read. We cap the pace at 20.0 min/km to keep it |