summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-07-25 22:08:11 +0200
committerChris Schlaeger <chris@linux.com>2015-07-25 22:08:11 +0200
commit2c0a56d4f1689c9df5939bb8f5004983b9eb9694 (patch)
treef1e34a1dc6f4ab899f331776b42745a5d4d2a255 /lib
parentda80d813e85fcb05c7eb9971178f7da51ac23f3c (diff)
downloadpostrunner-2c0a56d4f1689c9df5939bb8f5004983b9eb9694.zip
New: Adding support for temperature graph
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/ChartView.rb2
-rw-r--r--lib/postrunner/DeviceList.rb12
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/postrunner/ChartView.rb b/lib/postrunner/ChartView.rb
index a9b408c..5c33974 100644
--- a/lib/postrunner/ChartView.rb
+++ b/lib/postrunner/ChartView.rb
@@ -45,6 +45,7 @@ module PostRunner
chart_div(doc, 'vertical_oscillation',
"Vertical Oscillation (#{select_unit('cm')})")
chart_div(doc, 'stance_time', 'Ground Contact Time (ms)')
+ chart_div(doc, 'temperature', 'Temperature (°C)')
end
private
@@ -121,6 +122,7 @@ EOT
[ '#A0D488', 273 ],
[ '#F79666', 305 ],
[ '#EE3F2D', nil ] ])
+ s << line_graph('temperature', 'Temperature', 'C', '#444444')
s << "\n});\n"
diff --git a/lib/postrunner/DeviceList.rb b/lib/postrunner/DeviceList.rb
index 4b1a12e..51a3502 100644
--- a/lib/postrunner/DeviceList.rb
+++ b/lib/postrunner/DeviceList.rb
@@ -48,15 +48,17 @@ module PostRunner
t.body
t.cell('Manufacturer:', { :width => '40%' })
- t.cell(device.manufacturer, { :width => '60%' })
+ t.cell(device.manufacturer.upcase, { :width => '60%' })
t.new_row
- if (product = device.product)
+ if (product = %w( garmin dynastream dynastream_oem ).include?(
+ device.manufacturer) ?
+ device.garmin_product : device.product)
t.cell('Product:')
- rename = { 'fr620' => 'FR620', 'sdm4' => 'SDM4',
- 'hrm_run_single_byte_product_id' => 'HRM Run',
+ # Beautify some product names. The others will just be upcased.
+ rename = { 'hrm_run_single_byte_product_id' => 'HRM Run',
'hrm_run' => 'HRM Run' }
- product = rename[product] if rename.include?(product)
+ product = rename.include?(product) ? rename[product] : product.upcase
t.cell(product)
t.new_row
end