summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2016-06-18 14:08:09 +0200
committerChris Schlaeger <chris@linux.com>2016-06-18 14:08:09 +0200
commitb2f7ea6b10f89414519eebf47abe3945f3581761 (patch)
tree590f2cc2c8e235ee364637a70326fd3112ef009b /lib
parente1771fb3537aaa0fef243943baa16e69399826a3 (diff)
downloadpostrunner-b2f7ea6b10f89414519eebf47abe3945f3581761.zip
New: Show Lactate Threshold values in Events section
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/EventList.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/postrunner/EventList.rb b/lib/postrunner/EventList.rb
index 7679b6f..a096e1b 100644
--- a/lib/postrunner/EventList.rb
+++ b/lib/postrunner/EventList.rb
@@ -96,10 +96,10 @@ module PostRunner
value = event.speed_low_alert
when 'cad_high_alert'
name = 'Cadence high alert'
- value = "#{event.cad_high_alert} spm"
+ value = "#{2 * event.cad_high_alert} spm"
when 'cad_low_alert'
name = 'Cadence low alert'
- value = "#{event.cad_low_alert} spm"
+ value = "#{2 * event.cad_low_alert} spm"
when 'power_high_alert'
name = 'Power high alert'
value = event.power_high_alert
@@ -134,6 +134,12 @@ module PostRunner
when 'vo2max'
name = 'VO2Max'
value = event.vo2max
+ when 'lactate_threshold_heart_rate'
+ name = 'Lactate Threshold Heart Rate'
+ value = "#{event.lactate_threshold_heart_rate} bpm"
+ when 'lactate_threshold_speed'
+ name = 'Lactate Threshold Pace'
+ value = pace(event, 'lactate_threshold_speed')
else
name = event.event
value = event.data
@@ -143,6 +149,18 @@ module PostRunner
table.cell(value)
end
+ def pace(fdr, field, show_unit = true)
+ speed = fdr.get(field)
+ case @unit_system
+ when :metric
+ "#{speedToPace(speed)}#{show_unit ? ' min/km' : ''}"
+ when :statute
+ "#{speedToPace(speed, 1609.34)}#{show_unit ? ' min/mi' : ''}"
+ else
+ Log.fatal "Unknown unit system #{@unit_system}"
+ end
+ end
+
end
end