jeti-log 0.1.1 → 0.2.0
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/.rspec +1 -0
- data/lib/jeti/log.rb +1 -0
- data/lib/jeti/log/coordinate.rb +30 -0
- data/lib/jeti/log/file.rb +59 -24
- data/lib/jeti/log/version.rb +1 -1
- data/spec/coordinate_spec.rb +7 -0
- data/spec/data/mezon-1.log +476 -0
- data/spec/data/mezon-2.log +1624 -0
- data/spec/file_spec.rb +119 -15
- metadata +11 -3
data/spec/file_spec.rb
CHANGED
@@ -116,25 +116,25 @@ describe Jeti::Log::File do
|
|
116
116
|
|
117
117
|
it 'should have some select gps locations' do
|
118
118
|
loc = subject.mgps_locations[0]
|
119
|
-
expect(loc
|
120
|
-
expect(loc
|
121
|
-
expect(loc
|
122
|
-
expect(loc
|
123
|
-
expect(loc
|
119
|
+
expect(loc.time).to eql(219552)
|
120
|
+
expect(loc.latitude).to be_within(0.0001).of(41.1856)
|
121
|
+
expect(loc.longitude).to be_within(0.0001).of(-96.0103)
|
122
|
+
expect(loc.altitude(:meters)).to eql(309)
|
123
|
+
expect(loc.course).to eql(0)
|
124
124
|
|
125
125
|
loc = subject.mgps_locations[250]
|
126
|
-
expect(loc
|
127
|
-
expect(loc
|
128
|
-
expect(loc
|
129
|
-
expect(loc
|
130
|
-
expect(loc
|
126
|
+
expect(loc.time).to eql(347038)
|
127
|
+
expect(loc.latitude).to be_within(0.0001).of(41.1868)
|
128
|
+
expect(loc.longitude).to be_within(0.0001).of(-96.0094)
|
129
|
+
expect(loc.altitude(:meters)).to eql(352)
|
130
|
+
expect(loc.course).to eql(294)
|
131
131
|
|
132
132
|
loc = subject.mgps_locations[450]
|
133
|
-
expect(loc
|
134
|
-
expect(loc
|
135
|
-
expect(loc
|
136
|
-
expect(loc
|
137
|
-
expect(loc
|
133
|
+
expect(loc.time).to eql(456409)
|
134
|
+
expect(loc.latitude).to be_within(0.0001).of(41.1871)
|
135
|
+
expect(loc.longitude).to be_within(0.0001).of(-96.0091)
|
136
|
+
expect(loc.altitude(:meters)).to eql(333)
|
137
|
+
expect(loc.course).to eql(0)
|
138
138
|
end
|
139
139
|
|
140
140
|
its(:to_kml?) { should be_true }
|
@@ -153,6 +153,110 @@ describe Jeti::Log::File do
|
|
153
153
|
|
154
154
|
end
|
155
155
|
|
156
|
+
context 'with data file mezon-1.log' do
|
157
|
+
|
158
|
+
before(:all) { @file = Jeti::Log::File.new(data_file('mezon-1.log')) }
|
159
|
+
|
160
|
+
subject { @file }
|
161
|
+
|
162
|
+
its(:duration) { should be_within(0.1).of(9.2) }
|
163
|
+
|
164
|
+
its(:antenna1_signals?) { should be_true }
|
165
|
+
|
166
|
+
its(:antenna2_signals?) { should be_true }
|
167
|
+
|
168
|
+
its(:bec_voltages?) { should be_true }
|
169
|
+
|
170
|
+
it 'should have some select bec voltages' do
|
171
|
+
expect(subject.bec_voltages[0]).to eql([1009713, 5.5])
|
172
|
+
expect(subject.bec_voltages[10]).to eql([1012219, 5.5])
|
173
|
+
expect(subject.bec_voltages[35]).to eql([1018579, 5.5])
|
174
|
+
end
|
175
|
+
|
176
|
+
its(:esc_voltages?) { should be_true }
|
177
|
+
|
178
|
+
it 'should have some select esc voltages' do
|
179
|
+
expect(subject.esc_voltages[0]).to eql([1009713, 22.9])
|
180
|
+
expect(subject.esc_voltages[10]).to eql([1011179, 22.9])
|
181
|
+
expect(subject.esc_voltages[50]).to eql([1016099, 22.9])
|
182
|
+
expect(subject.esc_voltages[60]).to eql([1017179, 22.9])
|
183
|
+
end
|
184
|
+
|
185
|
+
its(:esc_temperatures?) { should be_true }
|
186
|
+
|
187
|
+
its(:rx_voltages?) { should be_true }
|
188
|
+
|
189
|
+
its(:signal_qualities?) { should be_true }
|
190
|
+
|
191
|
+
its(:mgps_locations?) { should be_false }
|
192
|
+
|
193
|
+
its(:to_kml?) { should be_false }
|
194
|
+
|
195
|
+
specify { expect { subject.to_kml }.to raise_error }
|
196
|
+
|
197
|
+
specify { expect { subject.to_kml_file }.to raise_error }
|
198
|
+
|
199
|
+
specify { expect { subject.to_kml_placemark }.to raise_error }
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
context 'with data file mezon-2.log' do
|
204
|
+
|
205
|
+
before(:all) { @file = Jeti::Log::File.new(data_file('mezon-2.log')) }
|
206
|
+
|
207
|
+
subject { @file }
|
208
|
+
|
209
|
+
its(:duration) { should be_within(0.1).of(43.6) }
|
210
|
+
|
211
|
+
its(:antenna1_signals?) { should be_true }
|
212
|
+
|
213
|
+
its(:antenna2_signals?) { should be_true }
|
214
|
+
|
215
|
+
its(:bec_voltages?) { should be_true }
|
216
|
+
|
217
|
+
it 'should have some select bec voltages' do
|
218
|
+
expect(subject.bec_voltages[0]).to eql([304210, 5.5])
|
219
|
+
expect(subject.bec_voltages[10]).to eql([306719, 5.5])
|
220
|
+
expect(subject.bec_voltages[50]).to eql([316519, 5.5])
|
221
|
+
expect(subject.bec_voltages[120]).to eql([333722, 5.5])
|
222
|
+
end
|
223
|
+
|
224
|
+
its(:esc_voltages?) { should be_true }
|
225
|
+
|
226
|
+
it 'should have some select esc voltages' do
|
227
|
+
expect(subject.esc_voltages[0]).to eql([304210, 46.2])
|
228
|
+
expect(subject.esc_voltages[10]).to eql([305578, 46.2])
|
229
|
+
expect(subject.esc_voltages[50]).to eql([310319, 46.2])
|
230
|
+
expect(subject.esc_voltages[160]).to eql([323800, 46.2])
|
231
|
+
end
|
232
|
+
|
233
|
+
its(:esc_temperatures?) { should be_true }
|
234
|
+
|
235
|
+
it 'should have some select esc temperatures' do
|
236
|
+
expect(subject.esc_temperatures(:c)[0]).to eql([304210, 17])
|
237
|
+
expect(subject.esc_temperatures(:f)[0]).to eql([304210, 62.6])
|
238
|
+
expect(subject.esc_temperatures(:c)[10]).to eql([310018, 17])
|
239
|
+
expect(subject.esc_temperatures(:f)[10]).to eql([310018, 62.6])
|
240
|
+
expect(subject.esc_temperatures(:c)[50]).to eql([334623, 16])
|
241
|
+
expect(subject.esc_temperatures(:f)[50]).to eql([334623, 60.8])
|
242
|
+
end
|
243
|
+
|
244
|
+
its(:rx_voltages?) { should be_true }
|
245
|
+
|
246
|
+
its(:signal_qualities?) { should be_true }
|
247
|
+
|
248
|
+
its(:mgps_locations?) { should be_false }
|
249
|
+
|
250
|
+
its(:to_kml?) { should be_false }
|
251
|
+
|
252
|
+
specify { expect { subject.to_kml }.to raise_error }
|
253
|
+
|
254
|
+
specify { expect { subject.to_kml_file }.to raise_error }
|
255
|
+
|
256
|
+
specify { expect { subject.to_kml_placemark }.to raise_error }
|
257
|
+
|
258
|
+
end
|
259
|
+
|
156
260
|
it 'should raise for invalid or missing files' do
|
157
261
|
files = invalid_data_files
|
158
262
|
files.should have(9).files
|
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.
|
4
|
+
version: 0.2.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-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -144,6 +144,7 @@ extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
146
|
- .gitignore
|
147
|
+
- .rspec
|
147
148
|
- .travis.yml
|
148
149
|
- Gemfile
|
149
150
|
- LICENSE.txt
|
@@ -151,10 +152,12 @@ files:
|
|
151
152
|
- Rakefile
|
152
153
|
- jeti-log.gemspec
|
153
154
|
- lib/jeti/log.rb
|
155
|
+
- lib/jeti/log/coordinate.rb
|
154
156
|
- lib/jeti/log/entry.rb
|
155
157
|
- lib/jeti/log/file.rb
|
156
158
|
- lib/jeti/log/header.rb
|
157
159
|
- lib/jeti/log/version.rb
|
160
|
+
- spec/coordinate_spec.rb
|
158
161
|
- spec/data/1min-tx-rx.log
|
159
162
|
- spec/data/gps-crash.log
|
160
163
|
- spec/data/invalid/castle/long-flight.csv
|
@@ -164,6 +167,8 @@ files:
|
|
164
167
|
- spec/data/invalid/mavlink/2013-10-13 18-31-24.tlog
|
165
168
|
- spec/data/invalid/mavlink/2013-10-13 18-50-10.tlog
|
166
169
|
- spec/data/invalid/spektrum/1.TLM
|
170
|
+
- spec/data/mezon-1.log
|
171
|
+
- spec/data/mezon-2.log
|
167
172
|
- spec/file_spec.rb
|
168
173
|
- spec/spec_helper.rb
|
169
174
|
homepage: ''
|
@@ -186,11 +191,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
191
|
version: '0'
|
187
192
|
requirements: []
|
188
193
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.0.
|
194
|
+
rubygems_version: 2.0.3
|
190
195
|
signing_key:
|
191
196
|
specification_version: 4
|
192
197
|
summary: Jeti telemetry log file reader
|
193
198
|
test_files:
|
199
|
+
- spec/coordinate_spec.rb
|
194
200
|
- spec/data/1min-tx-rx.log
|
195
201
|
- spec/data/gps-crash.log
|
196
202
|
- spec/data/invalid/castle/long-flight.csv
|
@@ -200,5 +206,7 @@ test_files:
|
|
200
206
|
- spec/data/invalid/mavlink/2013-10-13 18-31-24.tlog
|
201
207
|
- spec/data/invalid/mavlink/2013-10-13 18-50-10.tlog
|
202
208
|
- spec/data/invalid/spektrum/1.TLM
|
209
|
+
- spec/data/mezon-1.log
|
210
|
+
- spec/data/mezon-2.log
|
203
211
|
- spec/file_spec.rb
|
204
212
|
- spec/spec_helper.rb
|