diff options
author | Chris Schlaeger <chris@linux.com> | 2016-01-30 20:40:19 +0100 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2016-01-30 20:40:19 +0100 |
commit | 6c2e9624364af2713a54b2e8655e954206271ec9 (patch) | |
tree | aeefa67e219deb607dce54639033cc0db4f0f7c9 | |
parent | 678cf8a5cb8ec0903871b32507407ebf918087a2 (diff) | |
download | postrunner-6c2e9624364af2713a54b2e8655e954206271ec9.zip |
NEW: Activities can now have an attached note.
Use this to capture any additional information about the activity as
free text. It will be shown in the summary report.
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | lib/postrunner/ActivitySummary.rb | 13 | ||||
-rw-r--r-- | lib/postrunner/FFS_Activity.rb | 7 | ||||
-rw-r--r-- | lib/postrunner/Main.rb | 1 |
4 files changed, 22 insertions, 6 deletions
@@ -32,12 +32,13 @@ full path to the directory that contains your FIT files. You can then import all files on the device. ``` -$ postrunner import /var/run/media/user/GARMIN/GARMIN/ACTIVITY/ +$ postrunner import /run/media/$USER/GARMIN/GARMIN/ACTIVITY/ ``` The above command assumes that your device is mounted as -/var/run/media/user. Please replace this with the path to your device. -Files that have been imported previously will not be imported again. +/run/media/$USER. Please replace $USER with your login name and the +path with the path to your device. Files that have been imported +previously will not be imported again. ### Viewing FIT file data on the console diff --git a/lib/postrunner/ActivitySummary.rb b/lib/postrunner/ActivitySummary.rb index 89778ea..9caa9dd 100644 --- a/lib/postrunner/ActivitySummary.rb +++ b/lib/postrunner/ActivitySummary.rb @@ -33,17 +33,28 @@ module PostRunner end def to_s - summary.to_s + "\n" + laps.to_s + summary.to_s + "\n" + + (@activity.note ? note.to_s + "\n" : '') + + laps.to_s end def to_html(doc) width = 600 ViewFrame.new("Activity: #{@name}", width, summary).to_html(doc) + ViewFrame.new('Note', width, note).to_html(doc) if @activity.note ViewFrame.new('Laps', width, laps).to_html(doc) end private + def note + t = FlexiTable.new + t.enable_frame(false) + t.body + t.row([ @activity.note ]) + t + end + def summary session = @fit_activity.sessions[0] diff --git a/lib/postrunner/FFS_Activity.rb b/lib/postrunner/FFS_Activity.rb index 3921301..27efea0 100644 --- a/lib/postrunner/FFS_Activity.rb +++ b/lib/postrunner/FFS_Activity.rb @@ -96,8 +96,9 @@ module PostRunner 'all' => 'All' } - po_attr :device, :fit_file_name, :norecord, :name, :sport, :sub_sport, - :timestamp, :total_distance, :total_timer_time, :avg_speed + po_attr :device, :fit_file_name, :norecord, :name, :note, :sport, + :sub_sport, :timestamp, :total_distance, :total_timer_time, + :avg_speed attr_reader :fit_activity # Create a new FFS_Activity object. @@ -209,6 +210,8 @@ module PostRunner case attribute when 'name' self.name = value + when 'note' + self.note = value when 'type' load_fit_file unless ActivityTypes.values.include?(value) diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb index 1bb067a..baf6a3e 100644 --- a/lib/postrunner/Main.rb +++ b/lib/postrunner/Main.rb @@ -178,6 +178,7 @@ set <attribute> <value> <ref> name: The activity name (defaults to FIT file name) norecord: Ignore all records from this activity (value must true or false) + note: A comment or summary of the activity type: The type of the activity subtype: The subtype of the activity |