fit4ruby 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fit4ruby.gemspec +1 -1
- data/lib/fit4ruby/Activity.rb +1 -1
- data/lib/fit4ruby/GlobalFitMessage.rb +1 -1
- data/lib/fit4ruby/GlobalFitMessages.rb +112 -2
- data/lib/fit4ruby/Record.rb +4 -4
- data/lib/fit4ruby/version.rb +1 -1
- data/spec/FitFile_spec.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76d1a2e0091c4aa84e7e26a381630def4b5e5b0
|
4
|
+
data.tar.gz: 21814b487808a93810dfedf2fe4908d7f9ecf246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb6bf23b5adadb57b114444de5d067b13273bb73537e76b6a8b6436e61a5fea69af8f619625369ac5c6c9fd13018a31514e3e1662d8437f33ba71b8a52b949e
|
7
|
+
data.tar.gz: 5404ca45effe3b389041a036711c55006c95f304f4afa91a888c2dfda4f38ad2fc55faf450e23791cfd571c6b0c9373865161b881e87e53e268af36e93f130a3
|
data/fit4ruby.gemspec
CHANGED
@@ -25,7 +25,7 @@ EOT
|
|
25
25
|
spec.required_ruby_version = '>=2.0'
|
26
26
|
|
27
27
|
spec.add_dependency('bindata', '=2.3.0')
|
28
|
-
spec.add_development_dependency('yard', '~>0.9.
|
28
|
+
spec.add_development_dependency('yard', '~>0.9.20')
|
29
29
|
spec.add_development_dependency('rake', '~>0.9.6')
|
30
30
|
spec.add_development_dependency('bundler', '>=1.6.4')
|
31
31
|
end
|
data/lib/fit4ruby/Activity.rb
CHANGED
@@ -216,7 +216,7 @@ module Fit4Ruby
|
|
216
216
|
# Convenience method that averages the speed over all sessions.
|
217
217
|
def avg_speed
|
218
218
|
speed = 0.0
|
219
|
-
@sessions.each { |s| speed += s.avg_speed }
|
219
|
+
@sessions.each { |s| speed += s.avg_speed if s.avg_speed }
|
220
220
|
speed / @sessions.length
|
221
221
|
end
|
222
222
|
|
@@ -126,7 +126,7 @@ module Fit4Ruby
|
|
126
126
|
when 'date_time'
|
127
127
|
value = time_to_fit_time(value)
|
128
128
|
end
|
129
|
-
if value.is_a?(Float) && @opts[:scale].nil?
|
129
|
+
if @type != 'float32' && value.is_a?(Float) && @opts[:scale].nil?
|
130
130
|
Log.error "Field #{@name} must not be a Float value"
|
131
131
|
end
|
132
132
|
|
@@ -43,13 +43,18 @@ module Fit4Ruby
|
|
43
43
|
field 13, 'uint8', 'undocumented_field_13'
|
44
44
|
field 14, 'uint8', 'undocumented_field_14'
|
45
45
|
field 15, 'uint8', 'undocumented_field_15'
|
46
|
+
field 16, 'enum', 'undocumented_field_16'
|
47
|
+
field 17, 'enum', 'undocumented_field_17'
|
48
|
+
field 18, 'enum', 'undocumented_field_18'
|
46
49
|
field 22, 'enum', 'undocumented_field_22'
|
47
50
|
field 23, 'enum', 'undocumented_field_23'
|
48
51
|
field 25, 'enum', 'undocumented_field_25'
|
49
52
|
field 26, 'enum', 'undocumented_field_26'
|
50
53
|
field 28, 'enum', 'undocumented_field_28'
|
54
|
+
field 29, 'enum', 'undocumented_field_29'
|
51
55
|
field 30, 'enum', 'undocumented_field_30'
|
52
56
|
field 31, 'enum', 'undocumented_field_31'
|
57
|
+
field 33, 'uint8', 'undocumented_field_33'
|
53
58
|
field 34, 'enum', 'undocumented_field_34'
|
54
59
|
field 35, 'enum', 'undocumented_field_35'
|
55
60
|
field 36, 'enum', 'activity_tracker_enabled'
|
@@ -90,11 +95,14 @@ module Fit4Ruby
|
|
90
95
|
field 85, 'enum', 'undocumented_field_85'
|
91
96
|
field 87, 'enum', 'undocumented_field_87'
|
92
97
|
field 90, 'uint32', 'auto_activity_detect'
|
98
|
+
field 91, 'uint8z', 'undocumented_field_91'
|
93
99
|
field 94, 'uint8', 'number_of_screens'
|
94
100
|
field 96, 'enum', 'undocumented_field_96'
|
95
101
|
field 97, 'uint8z', 'undocumented_field_97'
|
102
|
+
field 98, 'enum', 'undocumented_field_98'
|
96
103
|
field 101, 'enum', 'undocumented_field_101'
|
97
104
|
field 104, 'enum', 'undocumented_field_104'
|
105
|
+
field 106, 'enum', 'undocumented_field_106'
|
98
106
|
field 107, 'enum', 'undocumented_field_107'
|
99
107
|
field 108, 'enum', 'undocumented_field_108'
|
100
108
|
field 109, 'enum', 'undocumented_field_109'
|
@@ -103,6 +111,7 @@ module Fit4Ruby
|
|
103
111
|
field 112, 'enum', 'undocumented_field_112'
|
104
112
|
field 116, 'enum', 'undocumented_field_116'
|
105
113
|
field 117, 'enum', 'undocumented_field_117'
|
114
|
+
field 121, 'enum', 'undocumented_field_121'
|
106
115
|
field 124, 'uint8', 'undocumented_field_124'
|
107
116
|
field 125, 'uint8', 'undocumented_field_125'
|
108
117
|
field 126, 'enum', 'undocumented_field_126'
|
@@ -133,9 +142,12 @@ module Fit4Ruby
|
|
133
142
|
field 6, 'enum', 'elev_setting'
|
134
143
|
field 7, 'enum', 'weight_setting'
|
135
144
|
field 8, 'uint8', 'resting_heart_rate', :unit => 'bpm'
|
145
|
+
field 10, 'uint8', 'default_max_biking_heart_rate', :dict => 'display_heart'
|
146
|
+
field 11, 'uint8', 'default_max_heart_rate', :dict => 'display_heart'
|
136
147
|
field 12, 'enum', 'hr_setting', :dict => 'display_heart'
|
137
148
|
field 13, 'enum', 'speed_setting', :dict => 'display_measure'
|
138
149
|
field 14, 'enum', 'dist_setting', :dict => 'display_measure'
|
150
|
+
field 16, 'enum', 'power_setting'
|
139
151
|
field 17, 'enum', 'activity_class', :scale => 10
|
140
152
|
field 18, 'enum', 'position_setting', :dict => 'display_position'
|
141
153
|
field 21, 'enum', 'temperature_setting', :dict => 'display_measure'
|
@@ -212,6 +224,7 @@ module Fit4Ruby
|
|
212
224
|
field 10, 'enum', 'undocumented_field_10'
|
213
225
|
field 11, 'enum', 'undocumented_field_11'
|
214
226
|
field 12, 'enum', 'undocumented_field_12'
|
227
|
+
field 13, 'enum', 'undocumented_field_13'
|
215
228
|
field 254, 'uint16', 'message_index'
|
216
229
|
|
217
230
|
message 12, 'sport'
|
@@ -221,12 +234,16 @@ module Fit4Ruby
|
|
221
234
|
field 4, 'uint16', 'undocumented_field_4'
|
222
235
|
field 5, 'enum', 'undocumented_field_5'
|
223
236
|
field 6, 'enum', 'undocumented_field_6'
|
237
|
+
field 7, 'uint8', 'undocumented_field_7'
|
238
|
+
field 8, 'uint8', 'undocumented_field_8'
|
224
239
|
field 9, 'uint8', 'undocumented_field_9'
|
225
240
|
field 10, 'uint8', 'undocumented_field_10', :array => true
|
226
241
|
field 11, 'enum', 'undocumented_field_11'
|
227
242
|
field 12, 'uint8', 'undocumented_field_12', :array => true
|
228
243
|
field 13, 'enum', 'undocumented_field_13'
|
229
244
|
field 15, 'enum', 'undocumented_field_15'
|
245
|
+
field 17, 'enum', 'undocumented_field_17'
|
246
|
+
field 18, 'enum', 'undocumented_field_18'
|
230
247
|
field 19, 'enum', 'undocumented_field_19', :array => true
|
231
248
|
|
232
249
|
# Not part of the official ANT SDK doc.
|
@@ -239,16 +256,21 @@ module Fit4Ruby
|
|
239
256
|
field 6, 'sint32', 'undocumented_field_6'
|
240
257
|
field 7, 'enum', 'undocumented_field_7'
|
241
258
|
field 8, 'uint16', 'undocumented_field_8'
|
259
|
+
field 9, 'enum', 'undocumented_field_9'
|
260
|
+
field 10, 'uint16', 'undocumented_field_10'
|
242
261
|
field 11, 'uint8', 'undocumented_field_11'
|
243
262
|
field 12, 'enum', 'undocumented_field_12'
|
244
263
|
field 13, 'enum', 'undocumented_field_13'
|
245
264
|
field 14, 'enum', 'undocumented_field_14'
|
246
265
|
field 15, 'enum', 'undocumented_field_15'
|
247
266
|
field 16, 'enum', 'undocumented_field_16'
|
267
|
+
field 18, 'enum', 'undocumented_field_18'
|
268
|
+
field 19, 'uint16', 'undocumented_field_19'
|
248
269
|
field 21, 'enum', 'undocumented_field_21'
|
249
270
|
field 22, 'uint16', 'undocumented_field_22'
|
250
271
|
field 23, 'enum', 'undocumented_field_23'
|
251
272
|
field 24, 'enum', 'undocumented_field_24'
|
273
|
+
field 25, 'enum', 'undocumented_field_25'
|
252
274
|
field 27, 'enum', 'undocumented_field_27'
|
253
275
|
field 28, 'enum', 'undocumented_field_28'
|
254
276
|
field 29, 'enum', 'undocumented_field_29'
|
@@ -271,16 +293,27 @@ module Fit4Ruby
|
|
271
293
|
field 46, 'enum', 'undocumented_field_46'
|
272
294
|
field 47, 'enum', 'undocumented_field_47'
|
273
295
|
field 48, 'enum', 'undocumented_field_48'
|
296
|
+
field 50, 'enum', 'undocumented_field_50'
|
297
|
+
field 51, 'enum', 'undocumented_field_51'
|
298
|
+
field 52, 'uint16', 'undocumented_field_52'
|
274
299
|
field 53, 'enum', 'undocumented_field_53'
|
275
300
|
field 54, 'uint32', 'undocumented_field_54'
|
276
301
|
field 55, 'enum', 'undocumented_field_55'
|
277
302
|
field 57, 'enum', 'undocumented_field_57'
|
303
|
+
field 58, 'enum', 'undocumented_field_58'
|
278
304
|
field 60, 'enum', 'undocumented_field_60'
|
305
|
+
field 61, 'enum', 'undocumented_field_61'
|
279
306
|
field 62, 'enum', 'undocumented_field_62'
|
280
307
|
field 63, 'enum', 'undocumented_field_63'
|
281
308
|
field 64, 'uint16', 'undocumented_field_64'
|
282
309
|
field 65, 'enum', 'undocumented_field_65'
|
283
310
|
field 66, 'enum', 'undocumented_field_66'
|
311
|
+
field 67, 'enum', 'undocumented_field_67'
|
312
|
+
field 69, 'uint16', 'undocumented_field_69'
|
313
|
+
field 70, 'enum', 'undocumented_field_70'
|
314
|
+
field 73, 'sint32', 'undocumented_field_73'
|
315
|
+
field 74, 'sint32', 'undocumented_field_74'
|
316
|
+
field 75, 'enum', 'undocumented_field_75'
|
284
317
|
field 76, 'enum', 'undocumented_field_76'
|
285
318
|
field 254, 'uint16', 'message_index'
|
286
319
|
|
@@ -368,6 +401,7 @@ module Fit4Ruby
|
|
368
401
|
field 108, 'uint16', 'undefined_value_108'
|
369
402
|
field 109, 'uint8', 'undefined_value_109'
|
370
403
|
field 110, 'string', 'undefined_value_110'
|
404
|
+
field 111, 'uint8', 'undefined_value_111'
|
371
405
|
field 112, 'uint32', 'time_standing', :scale => 1000, :unit => 's'
|
372
406
|
field 113, 'uint16', 'stand_count'
|
373
407
|
field 114, 'sint8', 'avg_left_pco', :unit => 'mm'
|
@@ -390,6 +424,7 @@ module Fit4Ruby
|
|
390
424
|
field 134, 'uint16', 'avg_step_length', :scale => 10, :unit => 'mm'
|
391
425
|
field 137, 'uint8', 'total_anaerobic_training_effect', :scale => 10
|
392
426
|
field 138, 'uint8', 'undocumented_field_138'
|
427
|
+
field 139, 'uint16', 'avg_vam', :scale => 1000, :unit => 'm/s'
|
393
428
|
field 150, 'sint8', 'min_temperature', :unit => 'C' # guessed
|
394
429
|
field 151, 'uint16', 'undocumented_field_151'
|
395
430
|
field 152, 'uint32', 'undocumented_field_152'
|
@@ -397,7 +432,19 @@ module Fit4Ruby
|
|
397
432
|
field 158, 'uint16', 'undocumented_field_158'
|
398
433
|
field 153, 'enum', 'undocumented_field_153'
|
399
434
|
field 154, 'enum', 'undocumented_field_154'
|
435
|
+
field 168, 'sint32', 'undocumented_field_168'
|
436
|
+
field 169, 'uint16', 'undocumented_field_169'
|
437
|
+
field 170, 'uint16', 'undocumented_field_170'
|
438
|
+
field 177, 'uint16', 'undocumented_field_177'
|
439
|
+
field 178, 'uint16', 'undocumented_field_178'
|
440
|
+
field 179, 'uint16', 'undocumented_field_179'
|
441
|
+
field 180, 'uint16', 'undocumented_field_180'
|
442
|
+
field 181, 'float32', 'undocumented_field_181'
|
443
|
+
field 183, 'uint16', 'undocumented_field_183'
|
400
444
|
field 184, 'enum', 'undocumented_field_184'
|
445
|
+
field 185, 'uint8', 'undocumented_field_185'
|
446
|
+
field 187, 'float32', 'undocumented_field_187'
|
447
|
+
field 188, 'enum', 'undocumented_field_188'
|
401
448
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
402
449
|
field 254, 'uint16', 'message_index'
|
403
450
|
|
@@ -493,9 +540,18 @@ module Fit4Ruby
|
|
493
540
|
field 118, 'uint16', 'avg_vertical_ratio', :scale => 100, :unit => '%'
|
494
541
|
field 119, 'uint16', 'avg_stance_time_balance', :scale => 100, :unit => '%'
|
495
542
|
field 120, 'uint16', 'avg_step_length', :scale => 10000, :unit => 'm'
|
543
|
+
field 121, 'uint16', 'avg_vam', :scale => 1000, :unit => 'm/s'
|
496
544
|
field 124, 'sint8', 'min_temperature', :unit => 'C' # guessed
|
497
545
|
field 125, 'uint16', 'undocumented_field_125'
|
498
546
|
field 126, 'uint16', 'undocumented_field_126'
|
547
|
+
field 136, 'uint16', 'undocumented_field_136'
|
548
|
+
field 137, 'uint16', 'undocumented_field_137'
|
549
|
+
field 143, 'uint16', 'undocumented_field_143'
|
550
|
+
field 145, 'uint16', 'undocumented_field_145'
|
551
|
+
field 149, 'float32', 'undocumented_field_149'
|
552
|
+
field 151, 'uint16', 'undocumented_field_151'
|
553
|
+
field 152, 'uint8', 'undocumented_field_152'
|
554
|
+
field 154, 'float32', 'undocumented_field_154'
|
499
555
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
500
556
|
field 254, 'uint16', 'message_index'
|
501
557
|
|
@@ -541,6 +597,8 @@ module Fit4Ruby
|
|
541
597
|
field 70, 'uint8', 'left_power_phase_peak', :scale => 0.7111111, :unit => 'degrees', :array => true
|
542
598
|
field 71, 'uint8', 'right_power_phase', :scale => 0.7111111, :unit => 'degrees', :array => true
|
543
599
|
field 72, 'uint8', 'right_power_phase_peak', :scale => 0.7111111, :unit => 'degrees', :array => true
|
600
|
+
field 73, 'uint32', 'enhanced_speed', :scale => 1000, :unit => 'm/s'
|
601
|
+
field 78, 'uint32', 'enhanced_elevation', :scale => 5, :offset => 500, :unit => 'm'
|
544
602
|
field 83, 'uint16', 'vertical_ratio', :scale => 100, :unit => '%' # guessed
|
545
603
|
field 84, 'uint16', 'gct_balance', :scale => 100, :unit => '%' # guessed
|
546
604
|
field 85, 'uint16', 'stride_length', :scale => 10000, :unit => 'm' # guessed
|
@@ -583,6 +641,8 @@ module Fit4Ruby
|
|
583
641
|
field 14, 'enum', 'undocumented_field_14'
|
584
642
|
field 15, 'uint32', 'undocumented_field_15'
|
585
643
|
field 16, 'enum', 'undocumented_field_16'
|
644
|
+
field 17, 'uint16', 'undocumented_field_17'
|
645
|
+
field 18, 'uint16', 'undocumented_field_18'
|
586
646
|
field 19, 'uint8', 'undocumented_field_19'
|
587
647
|
field 20, 'uint8', 'undocumented_field_20'
|
588
648
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
@@ -597,6 +657,9 @@ module Fit4Ruby
|
|
597
657
|
field 4, 'uint8', 'heart_rate'
|
598
658
|
field 5, 'enum', 'mode' # 0 or 3 seen, unknown meaning
|
599
659
|
field 6, 'uint8', 'power' # First found in FR920XT
|
660
|
+
field 7, 'uint8', 'undocumented_field_7'
|
661
|
+
field 8, 'uint8', 'undocumented_field_8'
|
662
|
+
field 9, 'uint8', 'undocumented_field_9'
|
600
663
|
field 14, 'uint8', 'calories' # First found in FR920XT
|
601
664
|
field 15, 'uint8', 'undocumented_field_15'
|
602
665
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
@@ -748,6 +811,11 @@ module Fit4Ruby
|
|
748
811
|
field 13, 'uint16', 'undocumented_field_13'
|
749
812
|
field 14, 'uint8', 'undocumented_field_14'
|
750
813
|
field 15, 'uint8', 'undocumented_field_15'
|
814
|
+
field 16, 'uint32', 'undocumented_field_16'
|
815
|
+
field 17, 'sint32', 'undocumented_field_17'
|
816
|
+
field 18, 'sint32', 'undocumented_field_18'
|
817
|
+
field 19, 'sint32', 'undocumented_field_19'
|
818
|
+
field 20, 'uint16', 'undocumented_field_20'
|
751
819
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
752
820
|
|
753
821
|
message 101, 'length'
|
@@ -833,7 +901,7 @@ module Fit4Ruby
|
|
833
901
|
field 12, 'enum', 'undocumented_field_12'
|
834
902
|
field 13, 'uint8', 'undocumented_field_13'
|
835
903
|
field 14, 'uint16', 'running_lactate_threshold_heart_rate', :unit => 'bpm'
|
836
|
-
field 15, 'uint16', 'running_lactate_threshold_speed', :scale =>
|
904
|
+
field 15, 'uint16', 'running_lactate_threshold_speed', :scale => 1000, :unit => 'm/s'
|
837
905
|
field 16, 'uint16', 'undocumented_field_16' # very correlated to 14 and 15
|
838
906
|
field 17, 'sint8', 'performance_condition'
|
839
907
|
field 18, 'uint8', 'undocumented_field_18'
|
@@ -845,10 +913,21 @@ module Fit4Ruby
|
|
845
913
|
field 24, 'sint32', 'undocumented_field_24'
|
846
914
|
field 25, 'uint8', 'undocumented_field_25'
|
847
915
|
field 26, 'sint32', 'undocumented_field_26'
|
916
|
+
field 27, 'sint32', 'undocumented_field_27'
|
917
|
+
field 28, 'sint32', 'undocumented_field_28'
|
848
918
|
field 29, 'sint32', 'metmax_running', :scale => 65536, :unit => 'MET'
|
919
|
+
field 30, 'sint8', 'undocumented_field_30'
|
920
|
+
field 31, 'sint8', 'undocumented_field_31'
|
921
|
+
field 32, 'sint32', 'undocumented_field_32'
|
922
|
+
field 33, 'uint8', 'undocumented_field_33'
|
849
923
|
field 34, 'enum', 'undocumented_field_34'
|
850
924
|
field 35, 'uint32', 'undocumented_field_35'
|
851
925
|
field 36, 'uint32', 'undocumented_field_36'
|
926
|
+
field 37, 'sint32', 'undocumented_field_37'
|
927
|
+
field 38, 'sint32', 'undocumented_field_38'
|
928
|
+
field 39, 'sint32', 'undocumented_field_39'
|
929
|
+
field 40, 'sint32', 'undocumented_field_40'
|
930
|
+
field 41, 'enum', 'undocumented_field_41'
|
852
931
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
853
932
|
|
854
933
|
# Not part of the official ANT SDK doc. The message name is guessed and
|
@@ -872,7 +951,7 @@ module Fit4Ruby
|
|
872
951
|
field 5, 'enum', 'undocumented_field_5'
|
873
952
|
field 6, 'enum', 'undocumented_field_6'
|
874
953
|
field 7, 'enum', 'undocumented_field_7'
|
875
|
-
field 8, '
|
954
|
+
field 8, 'enum', 'undocumented_field_8'
|
876
955
|
field 9, 'uint8', 'undocumented_field_9'
|
877
956
|
field 10, 'uint16', 'undocumented_field_10'
|
878
957
|
field 11, 'uint16', 'calibration_factor', :scale => 10
|
@@ -886,6 +965,12 @@ module Fit4Ruby
|
|
886
965
|
field 19, 'uint8z', 'undocumented_field_19'
|
887
966
|
field 20, 'uint8z', 'undocumented_field_20'
|
888
967
|
field 21, 'uint16', 'undocumented_field_21'
|
968
|
+
field 25, 'uint16', 'undocumented_field_25'
|
969
|
+
field 26, 'uint16', 'undocumented_field_26'
|
970
|
+
field 27, 'uint8', 'undocumented_field_27'
|
971
|
+
field 28, 'uint8', 'undocumented_field_28'
|
972
|
+
field 29, 'uint8', 'undocumented_field_29'
|
973
|
+
field 30, 'uint8', 'undocumented_field_30'
|
889
974
|
field 24, 'enum', 'undocumented_field_24'
|
890
975
|
field 31, 'uint8', 'undocumented_field_31'
|
891
976
|
field 32, 'uint16', 'undocumented_field_32'
|
@@ -909,15 +994,20 @@ module Fit4Ruby
|
|
909
994
|
field 51, 'enum', 'undocumented_field_51'
|
910
995
|
field 52, 'uint8', 'undocumented_field_52'
|
911
996
|
field 53, 'uint8', 'undocumented_field_53'
|
997
|
+
field 54, 'enum', 'undocumented_field_54'
|
912
998
|
field 55, 'uint16', 'undocumented_field_55'
|
913
999
|
field 56, 'uint16', 'undocumented_field_56'
|
914
1000
|
field 57, 'uint16', 'undocumented_field_57'
|
915
1001
|
field 58, 'enum', 'undocumented_field_58'
|
916
1002
|
field 59, 'uint8', 'undocumented_field_59'
|
1003
|
+
field 60, 'enum', 'undocumented_field_60'
|
1004
|
+
field 61, 'enum', 'undocumented_field_61'
|
917
1005
|
field 62, 'uint8', 'undocumented_field_62'
|
918
1006
|
field 63, 'enum', 'undocumented_field_63'
|
919
1007
|
field 64, 'uint32', 'undocumented_field_64'
|
920
1008
|
field 65, 'uint32', 'undocumented_field_65'
|
1009
|
+
field 70, 'uint32', 'undocumented_field_70'
|
1010
|
+
field 71, 'enum', 'undocumented_field_71'
|
921
1011
|
field 254, 'uint16', 'message_index'
|
922
1012
|
|
923
1013
|
# Not part of the official ANT SDK doc.
|
@@ -1032,6 +1122,17 @@ module Fit4Ruby
|
|
1032
1122
|
field 1, 'uint8', 'undocumented_field_1'
|
1033
1123
|
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
1034
1124
|
|
1125
|
+
# Not part of the official ANT SDK doc.
|
1126
|
+
message 261, 'undocumented_261'
|
1127
|
+
field 0, 'enum', 'undocumented_field_0'
|
1128
|
+
field 1, 'sint32', 'undocumented_field_1'
|
1129
|
+
field 2, 'sint32', 'undocumented_field_2'
|
1130
|
+
field 3, 'uint32', 'undocumented_field_3'
|
1131
|
+
field 7, 'uint8', 'undocumented_field_7'
|
1132
|
+
field 8, 'uint8', 'undocumented_field_8'
|
1133
|
+
field 9, 'uint8', 'undocumented_field_9'
|
1134
|
+
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
1135
|
+
|
1035
1136
|
# Not part of the official ANT SDK doc.
|
1036
1137
|
message 279, 'undocumented_279'
|
1037
1138
|
field 0, 'uint32', 'undocumented_field_0'
|
@@ -1042,6 +1143,15 @@ module Fit4Ruby
|
|
1042
1143
|
field 0, 'uint16', 'load'
|
1043
1144
|
field 1, 'uint32', 'timestamp', :type => 'date_time'
|
1044
1145
|
|
1146
|
+
# Not part of the official ANT SDK doc.
|
1147
|
+
message 288, 'undocumented_288'
|
1148
|
+
field 0, 'sint8', 'undocumented_field_0'
|
1149
|
+
field 1, 'sint8', 'undocumented_field_1'
|
1150
|
+
field 2, 'uint16', 'undocumented_field_2'
|
1151
|
+
field 251, 'byte', 'undocumented_field_251'
|
1152
|
+
field 252, 'uint8', 'undocumented_field_252'
|
1153
|
+
field 253, 'uint32', 'timestamp', :type => 'date_time'
|
1154
|
+
|
1045
1155
|
# Not part of the official ANT SDK doc.
|
1046
1156
|
message 1024, 'undocumented_1024'
|
1047
1157
|
field 0, 'enum', 'undocumented_field_0'
|
data/lib/fit4ruby/Record.rb
CHANGED
@@ -38,14 +38,14 @@ module Fit4Ruby
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
# Convert the 'speed' field into a running pace. The
|
42
|
-
# minutes per Kilometer.
|
41
|
+
# Convert the 'speed' or 'enhanced_speed' field into a running pace. The
|
42
|
+
# pace is measured in minutes per Kilometer.
|
43
43
|
# @return [Float or nil] pace for this Record in m/s or nil if not
|
44
44
|
# available.
|
45
45
|
def pace
|
46
|
-
return nil unless @speed
|
46
|
+
return nil unless @speed || @enhanced_speed
|
47
47
|
|
48
|
-
1000.0 / (@speed * 60.0)
|
48
|
+
1000.0 / ((@speed || @enhanced_speed) * 60.0)
|
49
49
|
end
|
50
50
|
|
51
51
|
end
|
data/lib/fit4ruby/version.rb
CHANGED
data/spec/FitFile_spec.rb
CHANGED
@@ -14,6 +14,8 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
14
14
|
|
15
15
|
require 'fit4ruby'
|
16
16
|
|
17
|
+
ENV['TZ'] = 'UTC'
|
18
|
+
|
17
19
|
describe Fit4Ruby do
|
18
20
|
|
19
21
|
before(:each) do
|
@@ -109,7 +111,7 @@ describe Fit4Ruby do
|
|
109
111
|
expect(File.exists?(fit_file)).to be true
|
110
112
|
|
111
113
|
b = Fit4Ruby.read(fit_file)
|
112
|
-
expect(b).to eq(@activity)
|
114
|
+
expect(b.inspect).to eq(@activity.inspect)
|
113
115
|
File.delete(fit_file)
|
114
116
|
end
|
115
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fit4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schlaeger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9.
|
33
|
+
version: 0.9.20
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.9.
|
40
|
+
version: 0.9.20
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|