summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/postrunner/ChartView.rb13
-rw-r--r--postrunner.gemspec4
2 files changed, 14 insertions, 3 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
diff --git a/postrunner.gemspec b/postrunner.gemspec
index 08cd48b..d60c074 100644
--- a/postrunner.gemspec
+++ b/postrunner.gemspec
@@ -28,12 +28,12 @@ operating systems as well.}
spec.require_paths = ["lib"]
spec.required_ruby_version = '>=2.4'
- spec.add_dependency 'fit4ruby', '~> 3.2.0'
+ spec.add_dependency 'fit4ruby', '~> 3.3.0'
spec.add_dependency 'perobs', '~> 4.1.0'
spec.add_dependency 'nokogiri', '~> 1.6'
spec.add_development_dependency 'bundler', '~> 1.6'
spec.add_development_dependency 'rake', '~> 0.9.6'
spec.add_development_dependency 'rspec', '~> 3.6.0'
- spec.add_development_dependency 'yard', '~> 0.9.12'
+ spec.add_development_dependency 'yard', '~> 0.9.20'
end