jeti-log 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jeti/log/entry.rb +27 -2
- data/lib/jeti/log/file.rb +37 -11
- data/lib/jeti/log/version.rb +1 -1
- data/spec/data/gps-crash.log +7047 -0
- data/spec/file_spec.rb +79 -0
- metadata +5 -3
data/spec/file_spec.rb
CHANGED
@@ -50,6 +50,85 @@ describe Jeti::Log::File do
|
|
50
50
|
expect(subject.signal_qualities[90]).to eql([1120425, 100])
|
51
51
|
end
|
52
52
|
|
53
|
+
its(:mgps_locations?) { should be_false }
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
context 'with data file gps-crash.log' do
|
58
|
+
|
59
|
+
before(:all) { @file = Jeti::Log::File.new(data_file('gps-crash.log')) }
|
60
|
+
|
61
|
+
subject { @file }
|
62
|
+
|
63
|
+
its(:duration) { should be_within(0.1).of(286.2) }
|
64
|
+
|
65
|
+
its(:antenna1_signals?) { should be_true }
|
66
|
+
|
67
|
+
it { should have(553).antenna1_signals }
|
68
|
+
|
69
|
+
it 'should have some select antenna1 signals' do
|
70
|
+
expect(subject.antenna1_signals[0]).to eql([219714, 9])
|
71
|
+
expect(subject.antenna1_signals[50]).to eql([244741, 9])
|
72
|
+
expect(subject.antenna1_signals[100]).to eql([270738, 9])
|
73
|
+
end
|
74
|
+
|
75
|
+
its(:antenna2_signals?) { should be_true }
|
76
|
+
|
77
|
+
it { should have(553).antenna2_signals }
|
78
|
+
|
79
|
+
it 'should have some select antenna2 signals' do
|
80
|
+
expect(subject.antenna1_signals[10]).to eql([223938, 9])
|
81
|
+
expect(subject.antenna1_signals[60]).to eql([249938, 9])
|
82
|
+
expect(subject.antenna1_signals[90]).to eql([265538, 9])
|
83
|
+
end
|
84
|
+
|
85
|
+
its(:rx_voltages?) { should be_true }
|
86
|
+
|
87
|
+
it { should have(553).rx_voltages }
|
88
|
+
|
89
|
+
it 'should have some select rx voltages' do
|
90
|
+
expect(subject.rx_voltages[10]).to eql([223938, 4.69])
|
91
|
+
expect(subject.rx_voltages[60]).to eql([249938, 4.69])
|
92
|
+
expect(subject.rx_voltages[90]).to eql([265538, 4.69])
|
93
|
+
end
|
94
|
+
|
95
|
+
its(:signal_qualities?) { should be_true }
|
96
|
+
|
97
|
+
it { should have(553).signal_qualities }
|
98
|
+
|
99
|
+
it 'should have some select signal qualities' do
|
100
|
+
expect(subject.signal_qualities[10]).to eql([223938, 100])
|
101
|
+
expect(subject.signal_qualities[60]).to eql([249938, 100])
|
102
|
+
expect(subject.signal_qualities[90]).to eql([265538, 100])
|
103
|
+
end
|
104
|
+
|
105
|
+
its(:mgps_locations?) { should be_true }
|
106
|
+
|
107
|
+
it { should have(539).mgps_locations }
|
108
|
+
|
109
|
+
it 'should have some select gps locations' do
|
110
|
+
loc = subject.mgps_locations[0]
|
111
|
+
expect(loc[0]).to eql(219552)
|
112
|
+
expect(loc[1][:latitude]).to be_within(0.0001).of(41.1856)
|
113
|
+
expect(loc[1][:longitude]).to be_within(0.0001).of(-96.0103)
|
114
|
+
expect(loc[1][:altitude]).to eql(309)
|
115
|
+
expect(loc[1][:course]).to eql(0)
|
116
|
+
|
117
|
+
loc = subject.mgps_locations[250]
|
118
|
+
expect(loc[0]).to eql(347038)
|
119
|
+
expect(loc[1][:latitude]).to be_within(0.0001).of(41.1868)
|
120
|
+
expect(loc[1][:longitude]).to be_within(0.0001).of(-96.0094)
|
121
|
+
expect(loc[1][:altitude]).to eql(352)
|
122
|
+
expect(loc[1][:course]).to eql(294)
|
123
|
+
|
124
|
+
loc = subject.mgps_locations[450]
|
125
|
+
expect(loc[0]).to eql(456409)
|
126
|
+
expect(loc[1][:latitude]).to be_within(0.0001).of(41.1871)
|
127
|
+
expect(loc[1][:longitude]).to be_within(0.0001).of(-96.0091)
|
128
|
+
expect(loc[1][:altitude]).to eql(333)
|
129
|
+
expect(loc[1][:course]).to eql(0)
|
130
|
+
end
|
131
|
+
|
53
132
|
end
|
54
133
|
|
55
134
|
it 'should raise for invalid or missing files' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeti-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Veys
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/jeti/log/header.rb
|
157
157
|
- lib/jeti/log/version.rb
|
158
158
|
- spec/data/1min-tx-rx.log
|
159
|
+
- spec/data/gps-crash.log
|
159
160
|
- spec/data/invalid/castle/long-flight.csv
|
160
161
|
- spec/data/invalid/eagle_tree/multi-session-2.fdr
|
161
162
|
- spec/data/invalid/empty.file
|
@@ -185,12 +186,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
version: '0'
|
186
187
|
requirements: []
|
187
188
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.0.
|
189
|
+
rubygems_version: 2.0.6
|
189
190
|
signing_key:
|
190
191
|
specification_version: 4
|
191
192
|
summary: Jeti telemetry log file reader
|
192
193
|
test_files:
|
193
194
|
- spec/data/1min-tx-rx.log
|
195
|
+
- spec/data/gps-crash.log
|
194
196
|
- spec/data/invalid/castle/long-flight.csv
|
195
197
|
- spec/data/invalid/eagle_tree/multi-session-2.fdr
|
196
198
|
- spec/data/invalid/empty.file
|