eagletree-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/lib/eagletree/log/session.rb +45 -17
- data/lib/eagletree/log/version.rb +1 -1
- data/spec/session_spec.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bf17c20d3371b09be089d25b730067975f46589
|
4
|
+
data.tar.gz: f84f0635e5a0e230d2bab9e01a7df4aca87e1a1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e86520b274b9d27f3f2efbabd3159bada74aa64cb27b616ca73823e760f6eacc23ecc86fd0bcd25dbedc4e1ad82c662cbeb3246b6af8c2d27afa03528e93052
|
7
|
+
data.tar.gz: 49884fa65981a4db1ea2001d96ded0f566170ec24a87c8add4a1da795a600e1dceff38ce3cdcdca0fe38b580798002158a0dd3aa9d1a7b76245185213b94f578
|
@@ -32,11 +32,11 @@ module EagleTree
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def milliseconds
|
35
|
-
@
|
35
|
+
@milliseconds ||= int_fields('Milliseconds')
|
36
36
|
end
|
37
37
|
|
38
38
|
def milliseconds?
|
39
|
-
nonzero?(
|
39
|
+
nonzero?(milliseconds)
|
40
40
|
end
|
41
41
|
|
42
42
|
def altitudes
|
@@ -44,7 +44,7 @@ module EagleTree
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def altitudes?
|
47
|
-
nonzero?(
|
47
|
+
nonzero?(altitudes)
|
48
48
|
end
|
49
49
|
|
50
50
|
def airspeeds
|
@@ -52,7 +52,7 @@ module EagleTree
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def airspeeds?
|
55
|
-
nonzero?(
|
55
|
+
nonzero?(airspeeds)
|
56
56
|
end
|
57
57
|
|
58
58
|
def servo_currents
|
@@ -60,7 +60,7 @@ module EagleTree
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def servo_currents?
|
63
|
-
nonzero?(
|
63
|
+
nonzero?(servo_currents)
|
64
64
|
end
|
65
65
|
|
66
66
|
def throttles
|
@@ -68,7 +68,7 @@ module EagleTree
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def throttles?
|
71
|
-
nonzero?(
|
71
|
+
nonzero?(throttles)
|
72
72
|
end
|
73
73
|
|
74
74
|
def pack_voltages
|
@@ -76,7 +76,7 @@ module EagleTree
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def pack_voltages?
|
79
|
-
nonzero?(
|
79
|
+
nonzero?(pack_voltages)
|
80
80
|
end
|
81
81
|
|
82
82
|
def amps
|
@@ -84,7 +84,7 @@ module EagleTree
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def amps?
|
87
|
-
nonzero?(
|
87
|
+
nonzero?(amps)
|
88
88
|
end
|
89
89
|
|
90
90
|
def temps1
|
@@ -92,7 +92,7 @@ module EagleTree
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def temps1?
|
95
|
-
nonzero?(
|
95
|
+
nonzero?(temps1)
|
96
96
|
end
|
97
97
|
|
98
98
|
def temps2
|
@@ -100,7 +100,7 @@ module EagleTree
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def temps2?
|
103
|
-
nonzero?(
|
103
|
+
nonzero?(temps2)
|
104
104
|
end
|
105
105
|
|
106
106
|
def temps3
|
@@ -108,7 +108,7 @@ module EagleTree
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def temps3?
|
111
|
-
nonzero?(
|
111
|
+
nonzero?(temps3)
|
112
112
|
end
|
113
113
|
|
114
114
|
def rpms
|
@@ -116,7 +116,7 @@ module EagleTree
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def rpms?
|
119
|
-
nonzero?(
|
119
|
+
nonzero?(rpms)
|
120
120
|
end
|
121
121
|
|
122
122
|
def rpms2
|
@@ -124,7 +124,7 @@ module EagleTree
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def rpms2?
|
127
|
-
nonzero?(
|
127
|
+
nonzero?(rpms2)
|
128
128
|
end
|
129
129
|
|
130
130
|
def latitudes
|
@@ -132,7 +132,7 @@ module EagleTree
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def latitudes?
|
135
|
-
nonzero?(
|
135
|
+
nonzero?(latitudes)
|
136
136
|
end
|
137
137
|
|
138
138
|
def longitudes
|
@@ -140,7 +140,7 @@ module EagleTree
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def longitudes?
|
143
|
-
nonzero?(
|
143
|
+
nonzero?(longitudes)
|
144
144
|
end
|
145
145
|
|
146
146
|
def gps_altitudes
|
@@ -148,7 +148,35 @@ module EagleTree
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def gps_altitudes?
|
151
|
-
nonzero?(
|
151
|
+
nonzero?(gps_altitudes)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Gets the speed, in desired unit.
|
155
|
+
#
|
156
|
+
# @param unit one of :knots, :mph, :kph to define desired unit
|
157
|
+
# @return [Float] speed in the desired unit
|
158
|
+
def gps_speeds(unit = :mph)
|
159
|
+
@gps_speeds ||= float_fields('GPSSpeed')
|
160
|
+
end
|
161
|
+
|
162
|
+
def gps_speeds?
|
163
|
+
nonzero?(gps_speeds)
|
164
|
+
end
|
165
|
+
|
166
|
+
def gps_courses
|
167
|
+
@gps_courses ||= float_fields('GPSCourse')
|
168
|
+
end
|
169
|
+
|
170
|
+
def gps_courses?
|
171
|
+
nonzero?(gps_courses)
|
172
|
+
end
|
173
|
+
|
174
|
+
def gps_satellites
|
175
|
+
@gps_satellites ||= int_fields('NumSats')
|
176
|
+
end
|
177
|
+
|
178
|
+
def gps_satellites?
|
179
|
+
nonzero?(gps_satellites)
|
152
180
|
end
|
153
181
|
|
154
182
|
def coords
|
@@ -156,7 +184,7 @@ module EagleTree
|
|
156
184
|
end
|
157
185
|
|
158
186
|
def coords?
|
159
|
-
|
187
|
+
longitudes? || latitudes? || gps_altitudes?
|
160
188
|
end
|
161
189
|
|
162
190
|
# Determines if KML methods can be called for this session.
|
data/spec/session_spec.rb
CHANGED
@@ -71,6 +71,36 @@ describe EagleTree::Log::Session do
|
|
71
71
|
subject.coords[2500][2].should be_within(0.1).of(89.0)
|
72
72
|
end
|
73
73
|
|
74
|
+
its(:gps_speeds?) { should be_true }
|
75
|
+
|
76
|
+
it 'should have a few select speeds' do
|
77
|
+
subject.gps_speeds[0].should be_within(0.1).of(0.0)
|
78
|
+
subject.gps_speeds[864].should be_within(0.1).of(0.7)
|
79
|
+
subject.gps_speeds[1566].should be_within(0.1).of(194.6)
|
80
|
+
subject.gps_speeds[1879].should be_within(0.1).of(180.6)
|
81
|
+
subject.gps_speeds[2317].should be_within(0.1).of(126.7)
|
82
|
+
end
|
83
|
+
|
84
|
+
its(:gps_courses?) { should be_true }
|
85
|
+
|
86
|
+
it 'should have a few select courses' do
|
87
|
+
subject.gps_courses[0].should be_within(0.1).of(0.0)
|
88
|
+
subject.gps_courses[864].should be_within(0.1).of(291.6)
|
89
|
+
subject.gps_courses[1566].should be_within(0.1).of(197.6)
|
90
|
+
subject.gps_courses[1879].should be_within(0.1).of(189.1)
|
91
|
+
subject.gps_courses[2317].should be_within(0.1).of(266.1)
|
92
|
+
end
|
93
|
+
|
94
|
+
its(:gps_satellites?) { should be_true }
|
95
|
+
|
96
|
+
it 'should have a few select satellites' do
|
97
|
+
subject.gps_satellites[0].should eql(0)
|
98
|
+
subject.gps_satellites[864].should eql(8)
|
99
|
+
subject.gps_satellites[1566].should eql(7)
|
100
|
+
subject.gps_satellites[1879].should eql(7)
|
101
|
+
subject.gps_satellites[2317].should eql(8)
|
102
|
+
end
|
103
|
+
|
74
104
|
its(:to_kml?) { should be_true }
|
75
105
|
|
76
106
|
its(:to_kml) { should_not be_nil }
|
@@ -110,6 +140,12 @@ describe EagleTree::Log::Session do
|
|
110
140
|
|
111
141
|
its(:gps_altitudes?) { should be_false }
|
112
142
|
|
143
|
+
its(:gps_speeds?) { should be_false }
|
144
|
+
|
145
|
+
its(:gps_courses?) { should be_false }
|
146
|
+
|
147
|
+
its(:gps_satellites?) { should be_false }
|
148
|
+
|
113
149
|
specify { expect { subject.to_kml }.to raise_error(RuntimeError) }
|
114
150
|
|
115
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eagletree-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
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|