aixm 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +4 -0
- data/CHANGELOG.md +15 -0
- data/README.md +7 -7
- data/aixm.gemspec +1 -0
- data/{Gemfile → gems.rb} +0 -0
- data/lib/aixm.rb +4 -0
- data/lib/aixm/component/fato.rb +255 -0
- data/lib/aixm/component/helipad.rb +59 -4
- data/lib/aixm/component/layer.rb +2 -2
- data/lib/aixm/component/lighting.rb +133 -0
- data/lib/aixm/component/runway.rb +31 -6
- data/lib/aixm/component/surface.rb +45 -2
- data/lib/aixm/d.rb +3 -3
- data/lib/aixm/document.rb +3 -1
- data/lib/aixm/feature/airport.rb +39 -5
- data/lib/aixm/feature/airspace.rb +7 -1
- data/lib/aixm/feature/unit.rb +3 -1
- data/lib/aixm/p.rb +88 -0
- data/lib/aixm/refinements.rb +15 -15
- data/lib/aixm/shortcuts.rb +4 -0
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/w.rb +86 -0
- data/lib/aixm/xy.rb +6 -0
- data/{Rakefile → rakefile.rb} +10 -0
- data/spec/factory.rb +64 -6
- data/spec/lib/aixm/component/fato_spec.rb +260 -0
- data/spec/lib/aixm/component/helipad_spec.rb +68 -3
- data/spec/lib/aixm/component/lighting_spec.rb +88 -0
- data/spec/lib/aixm/component/runway_spec.rb +63 -3
- data/spec/lib/aixm/component/surface_spec.rb +36 -0
- data/spec/lib/aixm/d_spec.rb +2 -2
- data/spec/lib/aixm/document_spec.rb +280 -2
- data/spec/lib/aixm/feature/airport_spec.rb +161 -8
- data/spec/lib/aixm/p_spec.rb +189 -0
- data/spec/lib/aixm/refinements_spec.rb +16 -16
- data/spec/lib/aixm/w_spec.rb +150 -0
- data/spec/lib/aixm/xy_spec.rb +11 -0
- data/spec/macros/marking.rb +12 -0
- metadata +32 -4
@@ -0,0 +1,260 @@
|
|
1
|
+
require_relative '../../../spec_helper'
|
2
|
+
|
3
|
+
describe AIXM::Component::FATO do
|
4
|
+
subject do
|
5
|
+
AIXM::Factory.airport.fatos.first
|
6
|
+
end
|
7
|
+
|
8
|
+
describe :name= do
|
9
|
+
it "fails on invalid values" do
|
10
|
+
[nil, :foobar, 123].wont_be_written_to subject, :name
|
11
|
+
end
|
12
|
+
|
13
|
+
it "upcases and transcodes valid values" do
|
14
|
+
subject.tap { |s| s.name = 'h1' }.name.must_equal 'H1'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe :length= do
|
19
|
+
it "fails on invalid values" do
|
20
|
+
[:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :length
|
21
|
+
end
|
22
|
+
|
23
|
+
it "accepts nil value" do
|
24
|
+
[nil].must_be_written_to subject, :length
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe :width= do
|
29
|
+
it "fails on invalid values" do
|
30
|
+
[:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :width
|
31
|
+
end
|
32
|
+
|
33
|
+
it "accepts nil value" do
|
34
|
+
[nil].must_be_written_to subject, :width
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe :marking= do
|
39
|
+
macro :marking
|
40
|
+
end
|
41
|
+
|
42
|
+
describe :profile= do
|
43
|
+
it "accepts nil value" do
|
44
|
+
[nil].must_be_written_to subject, :profile
|
45
|
+
end
|
46
|
+
|
47
|
+
it "stringifies valid values" do
|
48
|
+
subject.tap { |s| s.profile = 'foobar' }.profile.must_equal 'foobar'
|
49
|
+
subject.tap { |s| s.profile = 123 }.profile.must_equal '123'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe :status= do
|
54
|
+
it "fails on invalid values" do
|
55
|
+
[:foobar, 123].wont_be_written_to subject, :status
|
56
|
+
end
|
57
|
+
|
58
|
+
it "accepts nil value" do
|
59
|
+
[nil].must_be_written_to subject, :status
|
60
|
+
end
|
61
|
+
|
62
|
+
it "looks up valid values" do
|
63
|
+
subject.tap { |s| s.status = :closed }.status.must_equal :closed
|
64
|
+
subject.tap { |s| s.status = :SPOWER }.status.must_equal :secondary_power
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe :remarks= do
|
69
|
+
macro :remarks
|
70
|
+
end
|
71
|
+
|
72
|
+
describe :xml= do
|
73
|
+
it "builds correct complete OFMX" do
|
74
|
+
AIXM.ofmx!
|
75
|
+
subject.to_xml.must_equal <<~END
|
76
|
+
<Fto>
|
77
|
+
<FtoUid>
|
78
|
+
<AhpUid>
|
79
|
+
<codeId>LFNT</codeId>
|
80
|
+
</AhpUid>
|
81
|
+
<txtDesig>H1</txtDesig>
|
82
|
+
</FtoUid>
|
83
|
+
<valLen>35</valLen>
|
84
|
+
<valWid>35</valWid>
|
85
|
+
<uomDim>M</uomDim>
|
86
|
+
<codeComposition>CONC</codeComposition>
|
87
|
+
<codePreparation>PAVED</codePreparation>
|
88
|
+
<codeCondSfc>FAIR</codeCondSfc>
|
89
|
+
<valPcnClass>30</valPcnClass>
|
90
|
+
<codePcnPavementType>F</codePcnPavementType>
|
91
|
+
<codePcnPavementSubgrade>A</codePcnPavementSubgrade>
|
92
|
+
<codePcnMaxTirePressure>W</codePcnMaxTirePressure>
|
93
|
+
<codePcnEvalMethod>U</codePcnEvalMethod>
|
94
|
+
<txtPcnNote>Cracks near the center</txtPcnNote>
|
95
|
+
<valSiwlWeight>1500</valSiwlWeight>
|
96
|
+
<uomSiwlWeight>KG</uomSiwlWeight>
|
97
|
+
<valSiwlTirePressure>0.5</valSiwlTirePressure>
|
98
|
+
<uomSiwlTirePressure>MPA</uomSiwlTirePressure>
|
99
|
+
<valAuwWeight>8</valAuwWeight>
|
100
|
+
<uomAuwWeight>T</uomAuwWeight>
|
101
|
+
<txtProfile>Northwest from RWY 12/30</txtProfile>
|
102
|
+
<txtMarking>Dashed white lines</txtMarking>
|
103
|
+
<codeSts>OTHER</codeSts>
|
104
|
+
<txtRmk>Authorizaton by AD operator required</txtRmk>
|
105
|
+
</Fto>
|
106
|
+
<Fdn>
|
107
|
+
<FdnUid>
|
108
|
+
<FtoUid>
|
109
|
+
<AhpUid>
|
110
|
+
<codeId>LFNT</codeId>
|
111
|
+
</AhpUid>
|
112
|
+
<txtDesig>H1</txtDesig>
|
113
|
+
</FtoUid>
|
114
|
+
<txtDesig>35</txtDesig>
|
115
|
+
</FdnUid>
|
116
|
+
<valTrueBrg>355</valTrueBrg>
|
117
|
+
<valMagBrg>356</valMagBrg>
|
118
|
+
<txtRmk>Avoid flight over residental area</txtRmk>
|
119
|
+
</Fdn>
|
120
|
+
<Fls>
|
121
|
+
<FlsUid>
|
122
|
+
<FdnUid>
|
123
|
+
<FtoUid>
|
124
|
+
<AhpUid>
|
125
|
+
<codeId>LFNT</codeId>
|
126
|
+
</AhpUid>
|
127
|
+
<txtDesig>H1</txtDesig>
|
128
|
+
</FtoUid>
|
129
|
+
<txtDesig>35</txtDesig>
|
130
|
+
</FdnUid>
|
131
|
+
<codePsn>AIM</codePsn>
|
132
|
+
</FlsUid>
|
133
|
+
<txtDescr>omnidirectional</txtDescr>
|
134
|
+
<codeIntst>LIM</codeIntst>
|
135
|
+
<codeColour>GRN</codeColour>
|
136
|
+
<txtRmk>lighting remarks</txtRmk>
|
137
|
+
</Fls>
|
138
|
+
END
|
139
|
+
end
|
140
|
+
|
141
|
+
it "builds correct minimal OFMX" do
|
142
|
+
AIXM.ofmx!
|
143
|
+
%i(length width profile marking status remarks).each { |a| subject.send(:"#{a}=", nil) }
|
144
|
+
%i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
|
145
|
+
subject.directions['35'].instance_eval { @lightings.clear }
|
146
|
+
subject.to_xml.must_equal <<~END
|
147
|
+
<Fto>
|
148
|
+
<FtoUid>
|
149
|
+
<AhpUid>
|
150
|
+
<codeId>LFNT</codeId>
|
151
|
+
</AhpUid>
|
152
|
+
<txtDesig>H1</txtDesig>
|
153
|
+
</FtoUid>
|
154
|
+
</Fto>
|
155
|
+
<Fdn>
|
156
|
+
<FdnUid>
|
157
|
+
<FtoUid>
|
158
|
+
<AhpUid>
|
159
|
+
<codeId>LFNT</codeId>
|
160
|
+
</AhpUid>
|
161
|
+
<txtDesig>H1</txtDesig>
|
162
|
+
</FtoUid>
|
163
|
+
<txtDesig>35</txtDesig>
|
164
|
+
</FdnUid>
|
165
|
+
<valTrueBrg>355</valTrueBrg>
|
166
|
+
<valMagBrg>356</valMagBrg>
|
167
|
+
<txtRmk>Avoid flight over residental area</txtRmk>
|
168
|
+
</Fdn>
|
169
|
+
END
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
describe AIXM::Component::FATO::Direction do
|
175
|
+
subject do
|
176
|
+
AIXM::Factory.airport.fatos.first.directions['35']
|
177
|
+
end
|
178
|
+
|
179
|
+
describe :name= do
|
180
|
+
it "fails on invalid values" do
|
181
|
+
[nil, :foobar, 'OGGY'].wont_be_written_to subject, :name
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
describe :geographic_orientation= do
|
186
|
+
it "fails on invalid values" do
|
187
|
+
[:foobar, -1, 10].wont_be_written_to subject, :geographic_orientation
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
describe :remarks= do
|
192
|
+
macro :remarks
|
193
|
+
end
|
194
|
+
|
195
|
+
describe :magnetic_orientation do
|
196
|
+
it "is calculated correctly" do
|
197
|
+
subject.geographic_orientation = AIXM.a(16)
|
198
|
+
subject.magnetic_orientation.must_equal AIXM.a(17)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
describe :xml= do
|
203
|
+
it "builds correct complete OFMX" do
|
204
|
+
AIXM.ofmx!
|
205
|
+
subject.to_xml.must_equal <<~END
|
206
|
+
<Fdn>
|
207
|
+
<FdnUid>
|
208
|
+
<FtoUid>
|
209
|
+
<AhpUid>
|
210
|
+
<codeId>LFNT</codeId>
|
211
|
+
</AhpUid>
|
212
|
+
<txtDesig>H1</txtDesig>
|
213
|
+
</FtoUid>
|
214
|
+
<txtDesig>35</txtDesig>
|
215
|
+
</FdnUid>
|
216
|
+
<valTrueBrg>355</valTrueBrg>
|
217
|
+
<valMagBrg>356</valMagBrg>
|
218
|
+
<txtRmk>Avoid flight over residental area</txtRmk>
|
219
|
+
</Fdn>
|
220
|
+
<Fls>
|
221
|
+
<FlsUid>
|
222
|
+
<FdnUid>
|
223
|
+
<FtoUid>
|
224
|
+
<AhpUid>
|
225
|
+
<codeId>LFNT</codeId>
|
226
|
+
</AhpUid>
|
227
|
+
<txtDesig>H1</txtDesig>
|
228
|
+
</FtoUid>
|
229
|
+
<txtDesig>35</txtDesig>
|
230
|
+
</FdnUid>
|
231
|
+
<codePsn>AIM</codePsn>
|
232
|
+
</FlsUid>
|
233
|
+
<txtDescr>omnidirectional</txtDescr>
|
234
|
+
<codeIntst>LIM</codeIntst>
|
235
|
+
<codeColour>GRN</codeColour>
|
236
|
+
<txtRmk>lighting remarks</txtRmk>
|
237
|
+
</Fls>
|
238
|
+
END
|
239
|
+
end
|
240
|
+
|
241
|
+
it "builds correct minimal OFMX" do
|
242
|
+
AIXM.ofmx!
|
243
|
+
%i(geographic_orientation remarks).each { |a| subject.send(:"#{a}=", nil) }
|
244
|
+
subject.instance_eval { @lightings.clear }
|
245
|
+
subject.to_xml.must_equal <<~END
|
246
|
+
<Fdn>
|
247
|
+
<FdnUid>
|
248
|
+
<FtoUid>
|
249
|
+
<AhpUid>
|
250
|
+
<codeId>LFNT</codeId>
|
251
|
+
</AhpUid>
|
252
|
+
<txtDesig>H1</txtDesig>
|
253
|
+
</FtoUid>
|
254
|
+
<txtDesig>35</txtDesig>
|
255
|
+
</FdnUid>
|
256
|
+
</Fdn>
|
257
|
+
END
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
@@ -47,6 +47,35 @@ describe AIXM::Component::Helipad do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
describe :marking= do
|
51
|
+
macro :marking
|
52
|
+
end
|
53
|
+
|
54
|
+
describe :fato= do
|
55
|
+
it "fails on invalid values" do
|
56
|
+
[:foobar, 0].wont_be_written_to subject, :fato
|
57
|
+
end
|
58
|
+
|
59
|
+
it "accepts valid values" do
|
60
|
+
[nil, AIXM::Factory.fato].must_be_written_to subject, :fato
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe :helicopter_class= do
|
65
|
+
it "fails on invalid values" do
|
66
|
+
[:foobar, 123].wont_be_written_to subject, :helicopter_class
|
67
|
+
end
|
68
|
+
|
69
|
+
it "accepts nil value" do
|
70
|
+
[nil].must_be_written_to subject, :helicopter_class
|
71
|
+
end
|
72
|
+
|
73
|
+
it "looks up valid values" do
|
74
|
+
subject.tap { |s| s.helicopter_class = 1 }.helicopter_class.must_equal :'1'
|
75
|
+
subject.tap { |s| s.helicopter_class = :OTHER }.helicopter_class.must_equal :other
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
50
79
|
describe :status= do
|
51
80
|
it "fails on invalid values" do
|
52
81
|
[:foobar, 123].wont_be_written_to subject, :status
|
@@ -77,6 +106,12 @@ describe AIXM::Component::Helipad do
|
|
77
106
|
</AhpUid>
|
78
107
|
<txtDesig>H1</txtDesig>
|
79
108
|
</TlaUid>
|
109
|
+
<FtoUid>
|
110
|
+
<AhpUid>
|
111
|
+
<codeId>LFNT</codeId>
|
112
|
+
</AhpUid>
|
113
|
+
<txtDesig>H1</txtDesig>
|
114
|
+
</FtoUid>
|
80
115
|
<geoLat>43.99915000N</geoLat>
|
81
116
|
<geoLong>004.75154444E</geoLong>
|
82
117
|
<codeDatum>WGE</codeDatum>
|
@@ -93,17 +128,41 @@ describe AIXM::Component::Helipad do
|
|
93
128
|
<codePcnPavementSubgrade>A</codePcnPavementSubgrade>
|
94
129
|
<codePcnMaxTirePressure>W</codePcnMaxTirePressure>
|
95
130
|
<codePcnEvalMethod>U</codePcnEvalMethod>
|
96
|
-
<txtPcnNote>Cracks near the center
|
131
|
+
<txtPcnNote>Cracks near the center</txtPcnNote>
|
132
|
+
<valSiwlWeight>1500</valSiwlWeight>
|
133
|
+
<uomSiwlWeight>KG</uomSiwlWeight>
|
134
|
+
<valSiwlTirePressure>0.5</valSiwlTirePressure>
|
135
|
+
<uomSiwlTirePressure>MPA</uomSiwlTirePressure>
|
136
|
+
<valAuwWeight>8</valAuwWeight>
|
137
|
+
<uomAuwWeight>T</uomAuwWeight>
|
138
|
+
<codeClassHel>1</codeClassHel>
|
139
|
+
<txtMarking>Continuous white lines</txtMarking>
|
97
140
|
<codeSts>OTHER</codeSts>
|
98
141
|
<txtRmk>Authorizaton by AD operator required</txtRmk>
|
99
142
|
</Tla>
|
143
|
+
<Tls>
|
144
|
+
<TlsUid>
|
145
|
+
<TlaUid>
|
146
|
+
<AhpUid>
|
147
|
+
<codeId>LFNT</codeId>
|
148
|
+
</AhpUid>
|
149
|
+
<txtDesig>H1</txtDesig>
|
150
|
+
</TlaUid>
|
151
|
+
<codePsn>AIM</codePsn>
|
152
|
+
</TlsUid>
|
153
|
+
<txtDescr>omnidirectional</txtDescr>
|
154
|
+
<codeIntst>LIM</codeIntst>
|
155
|
+
<codeColour>GRN</codeColour>
|
156
|
+
<txtRmk>lighting remarks</txtRmk>
|
157
|
+
</Tls>
|
100
158
|
END
|
101
159
|
end
|
102
160
|
|
103
161
|
it "builds correct minimal OFMX" do
|
104
162
|
AIXM.ofmx!
|
105
|
-
%i(z length width status remarks).each { |a| subject.send(:"#{a}=", nil) }
|
106
|
-
%i(composition preparation condition pcn remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
|
163
|
+
%i(z length width helicopter_class marking status remarks).each { |a| subject.send(:"#{a}=", nil) }
|
164
|
+
%i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
|
165
|
+
subject.instance_eval { @lightings.clear }
|
107
166
|
subject.to_xml.must_equal <<~END
|
108
167
|
<Tla>
|
109
168
|
<TlaUid>
|
@@ -112,6 +171,12 @@ describe AIXM::Component::Helipad do
|
|
112
171
|
</AhpUid>
|
113
172
|
<txtDesig>H1</txtDesig>
|
114
173
|
</TlaUid>
|
174
|
+
<FtoUid>
|
175
|
+
<AhpUid>
|
176
|
+
<codeId>LFNT</codeId>
|
177
|
+
</AhpUid>
|
178
|
+
<txtDesig>H1</txtDesig>
|
179
|
+
</FtoUid>
|
115
180
|
<geoLat>43.99915000N</geoLat>
|
116
181
|
<geoLong>004.75154444E</geoLong>
|
117
182
|
<codeDatum>WGE</codeDatum>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require_relative '../../../spec_helper'
|
2
|
+
|
3
|
+
describe AIXM::Component::Lighting do
|
4
|
+
subject do
|
5
|
+
AIXM::Factory.airport.runways.first.forth.lightings.first
|
6
|
+
end
|
7
|
+
|
8
|
+
describe :position= do
|
9
|
+
it "fails on invalid values" do
|
10
|
+
[:foobar, 123, nil].wont_be_written_to subject, :position
|
11
|
+
end
|
12
|
+
|
13
|
+
it "looks up valid values" do
|
14
|
+
subject.tap { |s| s.position = :edge }.position.must_equal :edge
|
15
|
+
subject.tap { |s| s.position = :SWYEND }.position.must_equal :stopway_end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe :description= do
|
20
|
+
it "accepts nil value" do
|
21
|
+
[nil].must_be_written_to subject, :description
|
22
|
+
end
|
23
|
+
|
24
|
+
it "stringifies valid values" do
|
25
|
+
subject.tap { |s| s.description = 'foobar' }.description.must_equal 'foobar'
|
26
|
+
subject.tap { |s| s.description = 123 }.description.must_equal '123'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe :intensity= do
|
31
|
+
it "fails on invalid values" do
|
32
|
+
[:foobar, 123].wont_be_written_to subject, :intensity
|
33
|
+
end
|
34
|
+
|
35
|
+
it "accepts nil value" do
|
36
|
+
[nil].must_be_written_to subject, :intensity
|
37
|
+
end
|
38
|
+
|
39
|
+
it "looks up valid values" do
|
40
|
+
subject.tap { |s| s.intensity = :low }.intensity.must_equal :low
|
41
|
+
subject.tap { |s| s.intensity = 'LIM' }.intensity.must_equal :medium
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe :color= do
|
46
|
+
it "fails on invalid values" do
|
47
|
+
[:foobar, 123].wont_be_written_to subject, :color
|
48
|
+
end
|
49
|
+
|
50
|
+
it "accepts nil value" do
|
51
|
+
[nil].must_be_written_to subject, :color
|
52
|
+
end
|
53
|
+
|
54
|
+
it "looks up valid values" do
|
55
|
+
subject.tap { |s| s.color = :blue }.color.must_equal :blue
|
56
|
+
subject.tap { |s| s.color = 'GRN' }.color.must_equal :green
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe :remarks= do
|
61
|
+
macro :remarks
|
62
|
+
end
|
63
|
+
|
64
|
+
describe :to_xml do
|
65
|
+
it "builds correct complete AIXM/OFMX" do
|
66
|
+
subject.to_xml(as: :Rls).must_equal <<~END
|
67
|
+
<Rls>
|
68
|
+
<RlsUid>
|
69
|
+
<RdnUid>
|
70
|
+
<RwyUid>
|
71
|
+
<AhpUid>
|
72
|
+
<codeId>LFNT</codeId>
|
73
|
+
</AhpUid>
|
74
|
+
<txtDesig>16L/34R</txtDesig>
|
75
|
+
</RwyUid>
|
76
|
+
<txtDesig>16L</txtDesig>
|
77
|
+
</RdnUid>
|
78
|
+
<codePsn>AIM</codePsn>
|
79
|
+
</RlsUid>
|
80
|
+
<txtDescr>omnidirectional</txtDescr>
|
81
|
+
<codeIntst>LIM</codeIntst>
|
82
|
+
<codeColour>GRN</codeColour>
|
83
|
+
<txtRmk>lighting remarks</txtRmk>
|
84
|
+
</Rls>
|
85
|
+
END
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|