spektrum-log 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/GPS2.TLM +0 -0
- data/lib/spektrum/log/records.rb +4 -3
- data/lib/spektrum/log/version.rb +1 -1
- data/spec/flight_spec.rb +34 -0
- data/spec/gps_record1_spec.rb +18 -0
- data/spec/reader_spec.rb +10 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e09913bbcf8a10fdf8ca401cdd3d8560eb76e5
|
4
|
+
data.tar.gz: 996e2b67693ebbf1a22dc68bafb074647c592cc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a4d6d4f016ce368b756cee96afcfe45df6dce84fdd49dd9a0a0ada5ecbc1452f3af1fb74db5bab44d0f419eee8e0c676d1376a6cddb61290586a46abc3f099
|
7
|
+
data.tar.gz: f2d43b65a285a547c89cbf4c2f60cfe4047f499b65144afc5f1fe25c96e7f8d40f223f83d747bf1a66ffedaa09fea2789993c8ee43517451024e172207e986ff
|
data/data/GPS2.TLM
ADDED
Binary file
|
data/lib/spektrum/log/records.rb
CHANGED
@@ -185,9 +185,10 @@ module Spektrum
|
|
185
185
|
def longitude
|
186
186
|
elements = 10.downto(7).map { |i| hex_byte_field(i) }
|
187
187
|
|
188
|
-
#
|
189
|
-
#
|
190
|
-
|
188
|
+
# 100+ longitude indicator guesses
|
189
|
+
# - upper nybble of 13th byte seemed right, nope...
|
190
|
+
# - current guess: 2nd bit of 14th byte...
|
191
|
+
elements = [((byte_field(14) & 0x04) == 0x04) ? 1 : 0, elements].flatten
|
191
192
|
|
192
193
|
@longitude ||= convert_latlon(elements)
|
193
194
|
end
|
data/lib/spektrum/log/version.rb
CHANGED
data/spec/flight_spec.rb
CHANGED
@@ -342,4 +342,38 @@ describe Spektrum::Log::Flight do
|
|
342
342
|
|
343
343
|
end
|
344
344
|
|
345
|
+
context 'data file GPS2.TLM' do
|
346
|
+
|
347
|
+
let(:reader) { Spektrum::Log::Reader.new(data_file('GPS2.TLM')) }
|
348
|
+
|
349
|
+
context 'flight 1' do
|
350
|
+
|
351
|
+
subject { reader.flights[0] }
|
352
|
+
|
353
|
+
its(:duration) { should be_within(1).of(129) }
|
354
|
+
|
355
|
+
its(:gps1_records?) { should be_true }
|
356
|
+
|
357
|
+
its(:gps2_records?) { should be_true }
|
358
|
+
|
359
|
+
its(:to_kml?) { should be_true }
|
360
|
+
|
361
|
+
end
|
362
|
+
|
363
|
+
context 'flight 2' do
|
364
|
+
|
365
|
+
subject { reader.flights[1] }
|
366
|
+
|
367
|
+
its(:duration) { should be_within(1).of(89) }
|
368
|
+
|
369
|
+
its(:gps1_records?) { should be_true }
|
370
|
+
|
371
|
+
its(:gps2_records?) { should be_true }
|
372
|
+
|
373
|
+
its(:to_kml?) { should be_true }
|
374
|
+
|
375
|
+
end
|
376
|
+
|
377
|
+
end
|
378
|
+
|
345
379
|
end
|
data/spec/gps_record1_spec.rb
CHANGED
@@ -76,4 +76,22 @@ describe Spektrum::Log::GPSRecord1 do
|
|
76
76
|
|
77
77
|
end
|
78
78
|
|
79
|
+
context 'data set 5' do
|
80
|
+
|
81
|
+
let(:raw_data) { ["00142125250249434045084625183B"].pack('H*') }
|
82
|
+
|
83
|
+
its(:altitude) { should be_within(0.1).of(693.6) }
|
84
|
+
|
85
|
+
it 'should allow altitude in meters' do
|
86
|
+
subject.altitude(:meters).should be_within(0.1).of(211.4)
|
87
|
+
end
|
88
|
+
|
89
|
+
its(:heading) { should be_within(0.1).of(254.6)}
|
90
|
+
|
91
|
+
its(:latitude) { should be_within(0.000001).of(49.037542) }
|
92
|
+
|
93
|
+
its(:longitude) { should be_within(0.000001).of(8.756738) }
|
94
|
+
|
95
|
+
end
|
96
|
+
|
79
97
|
end
|
data/spec/reader_spec.rb
CHANGED
@@ -52,6 +52,16 @@ describe Spektrum::Log::Reader do
|
|
52
52
|
|
53
53
|
end
|
54
54
|
|
55
|
+
context 'data file GPS2.TLM' do
|
56
|
+
|
57
|
+
subject { Spektrum::Log::Reader.new(data_file('GPS2.TLM')) }
|
58
|
+
|
59
|
+
it { should have(2).flights }
|
60
|
+
|
61
|
+
its(:duration) { should be_within(0.1).of(217.8) }
|
62
|
+
|
63
|
+
end
|
64
|
+
|
55
65
|
it 'should raise on bad input' do
|
56
66
|
expect { Spektrum::Log::Reader.new(__FILE__) }.to raise_error
|
57
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spektrum-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Veys
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- data/3.TLM
|
156
156
|
- data/4.TLM
|
157
157
|
- data/GPS.TLM
|
158
|
+
- data/GPS2.TLM
|
158
159
|
- lib/spektrum/log.rb
|
159
160
|
- lib/spektrum/log/flight.rb
|
160
161
|
- lib/spektrum/log/headers.rb
|