aixm 0.3.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +72 -6
  4. data/README.md +191 -53
  5. data/exe/ckmid +11 -0
  6. data/exe/mkmid +11 -0
  7. data/lib/aixm/association.rb +367 -0
  8. data/lib/aixm/classes.rb +44 -0
  9. data/lib/aixm/component/fato.rb +44 -52
  10. data/lib/aixm/component/frequency.rb +13 -14
  11. data/lib/aixm/component/geometry/arc.rb +2 -2
  12. data/lib/aixm/component/geometry/border.rb +14 -5
  13. data/lib/aixm/component/geometry/circle.rb +8 -2
  14. data/lib/aixm/component/geometry/point.rb +10 -3
  15. data/lib/aixm/component/geometry/rhumb_line.rb +54 -0
  16. data/lib/aixm/component/geometry.rb +38 -38
  17. data/lib/aixm/component/helipad.rb +29 -37
  18. data/lib/aixm/component/layer.rb +28 -19
  19. data/lib/aixm/component/lighting.rb +11 -12
  20. data/lib/aixm/component/runway.rb +46 -53
  21. data/lib/aixm/{feature → component}/service.rb +36 -35
  22. data/lib/aixm/component/surface.rb +3 -3
  23. data/lib/aixm/component/timetable.rb +5 -3
  24. data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
  25. data/lib/aixm/config.rb +6 -3
  26. data/lib/aixm/document.rb +31 -49
  27. data/lib/aixm/executables.rb +85 -0
  28. data/lib/aixm/f.rb +28 -0
  29. data/lib/aixm/feature/address.rb +20 -15
  30. data/lib/aixm/feature/airport.rb +113 -129
  31. data/lib/aixm/feature/airspace.rb +54 -23
  32. data/lib/aixm/feature/navigational_aid/designated_point.rb +12 -14
  33. data/lib/aixm/feature/navigational_aid/dme.rb +10 -11
  34. data/lib/aixm/feature/navigational_aid/marker.rb +6 -2
  35. data/lib/aixm/feature/navigational_aid/ndb.rb +6 -2
  36. data/lib/aixm/feature/navigational_aid/tacan.rb +6 -2
  37. data/lib/aixm/feature/navigational_aid/vor.rb +22 -14
  38. data/lib/aixm/feature/navigational_aid.rb +7 -9
  39. data/lib/aixm/feature/obstacle.rb +22 -20
  40. data/lib/aixm/feature/obstacle_group.rb +30 -30
  41. data/lib/aixm/feature/organisation.rb +20 -4
  42. data/lib/aixm/feature/unit.rb +35 -45
  43. data/lib/aixm/feature.rb +13 -3
  44. data/lib/aixm/memoize.rb +89 -0
  45. data/lib/aixm/object.rb +9 -0
  46. data/lib/aixm/payload_hash.rb +114 -0
  47. data/lib/aixm/refinements.rb +34 -50
  48. data/lib/aixm/shortcuts.rb +6 -43
  49. data/lib/aixm/version.rb +1 -1
  50. data/lib/aixm/xy.rb +9 -1
  51. data/lib/aixm.rb +18 -7
  52. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV-Obstacle.json +0 -0
  53. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV.json +0 -0
  54. data/schemas/ofmx/{0 → 0.1}/OFMX-DataTypes.xsd +52 -2
  55. data/schemas/ofmx/{0 → 0.1}/OFMX-Features.xsd +225 -14
  56. data/schemas/ofmx/{0 → 0.1}/OFMX-Snapshot.xsd +0 -5
  57. data.tar.gz.sig +0 -0
  58. metadata +116 -164
  59. metadata.gz.sig +0 -0
  60. data/.gitignore +0 -6
  61. data/.ruby-version +0 -1
  62. data/.travis.yml +0 -8
  63. data/.yardopts +0 -3
  64. data/Guardfile +0 -8
  65. data/aixm.gemspec +0 -35
  66. data/gems.rb +0 -3
  67. data/lib/aixm/component.rb +0 -6
  68. data/rakefile.rb +0 -22
  69. data/spec/factory.rb +0 -559
  70. data/spec/lib/aixm/a_spec.rb +0 -203
  71. data/spec/lib/aixm/component/fato_spec.rb +0 -260
  72. data/spec/lib/aixm/component/frequency_spec.rb +0 -75
  73. data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -75
  74. data/spec/lib/aixm/component/geometry/border_spec.rb +0 -33
  75. data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -70
  76. data/spec/lib/aixm/component/geometry/point_spec.rb +0 -39
  77. data/spec/lib/aixm/component/geometry_spec.rb +0 -321
  78. data/spec/lib/aixm/component/helipad_spec.rb +0 -187
  79. data/spec/lib/aixm/component/layer_spec.rb +0 -137
  80. data/spec/lib/aixm/component/lighting_spec.rb +0 -88
  81. data/spec/lib/aixm/component/runway_spec.rb +0 -472
  82. data/spec/lib/aixm/component/surface_spec.rb +0 -124
  83. data/spec/lib/aixm/component/timetable_spec.rb +0 -49
  84. data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -97
  85. data/spec/lib/aixm/config_spec.rb +0 -41
  86. data/spec/lib/aixm/d_spec.rb +0 -150
  87. data/spec/lib/aixm/document_spec.rb +0 -1875
  88. data/spec/lib/aixm/errors_spec.rb +0 -14
  89. data/spec/lib/aixm/f_spec.rb +0 -85
  90. data/spec/lib/aixm/feature/address_spec.rb +0 -55
  91. data/spec/lib/aixm/feature/airport_spec.rb +0 -770
  92. data/spec/lib/aixm/feature/airspace_spec.rb +0 -390
  93. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -98
  94. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -92
  95. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -79
  96. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -89
  97. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -88
  98. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -245
  99. data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
  100. data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -326
  101. data/spec/lib/aixm/feature/obstacle_spec.rb +0 -279
  102. data/spec/lib/aixm/feature/organisation_spec.rb +0 -77
  103. data/spec/lib/aixm/feature/service_spec.rb +0 -59
  104. data/spec/lib/aixm/feature/unit_spec.rb +0 -230
  105. data/spec/lib/aixm/feature_spec.rb +0 -38
  106. data/spec/lib/aixm/p_spec.rb +0 -189
  107. data/spec/lib/aixm/refinements_spec.rb +0 -381
  108. data/spec/lib/aixm/version_spec.rb +0 -7
  109. data/spec/lib/aixm/w_spec.rb +0 -150
  110. data/spec/lib/aixm/xy_spec.rb +0 -180
  111. data/spec/lib/aixm/z_spec.rb +0 -94
  112. data/spec/macros/marking.rb +0 -12
  113. data/spec/macros/organisation.rb +0 -11
  114. data/spec/macros/remarks.rb +0 -12
  115. data/spec/macros/timetable.rb +0 -11
  116. data/spec/macros/xy.rb +0 -11
  117. data/spec/macros/z_qnh.rb +0 -11
  118. data/spec/sounds/failure.mp3 +0 -0
  119. data/spec/sounds/success.mp3 +0 -0
  120. data/spec/spec_helper.rb +0 -55
@@ -1,770 +0,0 @@
1
- require_relative '../../../spec_helper'
2
-
3
- describe AIXM::Feature::Airport do
4
- subject do
5
- AIXM::Factory.airport
6
- end
7
-
8
- describe :initialize do
9
- it "sets defaults" do
10
- subject = AIXM::Feature::Airport.new(
11
- organisation: AIXM::Factory.organisation,
12
- id: 'LFNT',
13
- name: 'Avignon-Pujaut',
14
- xy: AIXM.xy(lat: %q(43°59'46"N), long: %q(004°45'16"E))
15
- )
16
- subject.addresses.must_equal []
17
- subject.runways.must_equal []
18
- subject.helipads.must_equal []
19
- subject.usage_limitations.must_equal []
20
- end
21
- end
22
-
23
- describe :organisation= do
24
- it "fails on invalid values" do
25
- [nil, :foobar].wont_be_written_to subject, :organisation
26
- end
27
- end
28
-
29
- describe :id= do
30
- it "fails on invalid values" do
31
- [nil, 'A', 'ABCDE', 'AB 1234'].wont_be_written_to subject, :id
32
- end
33
-
34
- it "combines 2 character region with an 8 characters digest from name" do
35
- subject.tap { |s| s.id = 'lf' }.id.must_equal 'LFD18754F5'
36
- subject.tap { |s| s.name = 'OTHER'; s.id = 'lf' }.id.must_equal 'LFD646E0F9'
37
- end
38
-
39
- it "upcases valid values" do
40
- subject.tap { |s| s.id = 'lfnt' }.id.must_equal 'LFNT'
41
- end
42
- end
43
-
44
- describe :name= do
45
- it "fails on invalid values" do
46
- [nil, 123].wont_be_written_to subject, :name
47
- end
48
-
49
- it "upcases and transcodes valid values" do
50
- subject.tap { |s| s.name = 'Nîmes-Alès' }.name.must_equal 'NIMES-ALES'
51
- end
52
- end
53
-
54
- describe :gps= do
55
- it "fails on invalid values" do
56
- [:foobar, 123].wont_be_written_to subject, :gps
57
- end
58
-
59
- it "accepts nil value" do
60
- [nil].must_be_written_to subject, :gps
61
- end
62
-
63
- it "upcases valid values" do
64
- subject.tap { |s| s.gps = 'Ebdeurne' }.gps.must_equal 'EBDEURNE'
65
- end
66
- end
67
-
68
- describe :type= do
69
- it "fails on invalid values" do
70
- [nil, :foobar].wont_be_written_to subject, :type
71
- end
72
-
73
- it "fails on values derived from runways and helipads" do
74
- [:aerodrome, :heliport, :aerodrome_and_heliport].wont_be_written_to subject, :type
75
- end
76
-
77
- it "looks up valid values" do
78
- subject.tap { |s| s.type = :landing_site }.type.must_equal :landing_site
79
- subject.tap { |s| s.type = :LS }.type.must_equal :landing_site
80
- end
81
-
82
- it "derives values from runways and helipads" do
83
- subject.type.must_equal :aerodrome_and_heliport
84
- end
85
- end
86
-
87
- describe :xy= do
88
- macro :xy
89
-
90
- it "fails on nil values" do
91
- [nil].wont_be_written_to subject, :xy
92
- end
93
- end
94
-
95
- describe :z= do
96
- macro :z_qnh
97
-
98
- it "accepts nil value" do
99
- [nil].must_be_written_to subject, :z
100
- end
101
- end
102
-
103
- describe :declination= do
104
- it "fails on invalid values" do
105
- [:foobar, false].wont_be_written_to subject, :declination
106
- end
107
-
108
- it "accepts nil value" do
109
- [nil].must_be_written_to subject, :declination
110
- end
111
-
112
- it "converts valid values to Float" do
113
- subject.tap { |s| s.declination = 10 }.declination.must_equal 10.0
114
- subject.tap { |s| s.declination = 20.0 }.declination.must_equal 20.0
115
- end
116
- end
117
-
118
- describe :transition_z= do
119
- it "fails on invalid values" do
120
- [123, AIXM.z(123, :qfe)].wont_be_written_to subject, :transition_z
121
- end
122
-
123
- it "accepts valid values" do
124
- [nil, AIXM.z(123, :qnh)].must_be_written_to subject, :transition_z
125
- end
126
- end
127
-
128
- describe :timetable= do
129
- macro :timetable
130
- end
131
-
132
- describe :operator= do
133
- it "fails on invalid values" do
134
- [123].wont_be_written_to subject, :operator
135
- end
136
-
137
- it "accepts nil value" do
138
- [nil].must_be_written_to subject, :operator
139
- end
140
-
141
- it "upcases and transcodes valid values" do
142
- subject.tap { |s| s.operator = 'Municipality of Nîmes-Alès' }.operator.must_equal 'MUNICIPALITY OF NIMES-ALES'
143
- end
144
- end
145
-
146
- describe :remarks= do
147
- macro :remarks
148
- end
149
-
150
- describe :add_address do
151
- it "fails on invalid arguments" do
152
- -> { subject.add_address nil }.must_raise ArgumentError
153
- end
154
-
155
- it "adds address to the array" do
156
- count = subject.addresses.count
157
- subject.add_address(AIXM::Factory.address)
158
- subject.addresses.count.must_equal count + 1
159
- end
160
- end
161
-
162
- describe :add_runway do
163
- it "fails on invalid arguments" do
164
- -> { subject.add_runway nil }.must_raise ArgumentError
165
- end
166
-
167
- it "adds runway to the array" do
168
- count = subject.runways.count
169
- subject.add_runway(AIXM.runway(name: '10'))
170
- subject.runways.count.must_equal count + 1
171
- end
172
- end
173
-
174
- describe :add_helipad do
175
- it "fails on invalid arguments" do
176
- -> { subject.add_helipad nil }.must_raise ArgumentError
177
- end
178
-
179
- it "adds helipad to the array" do
180
- count = subject.helipads.count
181
- subject.add_helipad(AIXM.helipad(name: 'H2', xy: AIXM::Factory.xy))
182
- subject.helipads.count.must_equal count + 1
183
- end
184
- end
185
-
186
- describe :add_usage_limitation do
187
- it "fails on invalid arguments" do
188
- -> { subject.add_usage_limitation(:foobar) }.must_raise ArgumentError
189
- end
190
-
191
- context "without block" do
192
- it "accepts simple limitation" do
193
- count = subject.usage_limitations.count
194
- subject.add_usage_limitation(:permitted)
195
- subject.usage_limitations.count.must_equal count + 1
196
- subject.usage_limitations.last.type.must_equal :permitted
197
- end
198
- end
199
-
200
- context "with block" do
201
- it "accepts complex limitation" do
202
- count = subject.usage_limitations.count
203
- subject.add_usage_limitation(:permitted) do |permitted|
204
- permitted.add_condition { |c| c.aircraft = :glider }
205
- permitted.add_condition { |c| c.rule = :ifr }
206
- end
207
- subject.usage_limitations.count.must_equal count + 1
208
- subject.usage_limitations.last.conditions.count.must_equal 2
209
- end
210
- end
211
- end
212
-
213
- describe :to_xml do
214
- it "builds correct complete OFMX" do
215
- AIXM.ofmx!
216
- subject.add_address(AIXM.address(source: "LF|GEN|0.0 FACTORY|0|0", type: :url, address: 'https://lfnt.tower.zone'))
217
- subject.add_address(AIXM.address(source: "LF|GEN|0.0 FACTORY|0|0", type: :url, address: 'https://planeur-avignon-pujaut.fr'))
218
- subject.to_xml.must_equal <<~END
219
- <!-- Airport: LFNT AVIGNON-PUJAUT -->
220
- <Ahp source="LF|GEN|0.0 FACTORY|0|0">
221
- <AhpUid>
222
- <codeId>LFNT</codeId>
223
- </AhpUid>
224
- <OrgUid>
225
- <txtName>FRANCE</txtName>
226
- </OrgUid>
227
- <txtName>AVIGNON-PUJAUT</txtName>
228
- <codeIcao>LFNT</codeIcao>
229
- <codeGps>LFPUJAUT</codeGps>
230
- <codeType>AH</codeType>
231
- <geoLat>43.99611111N</geoLat>
232
- <geoLong>004.75444444E</geoLong>
233
- <codeDatum>WGE</codeDatum>
234
- <valElev>146</valElev>
235
- <uomDistVer>FT</uomDistVer>
236
- <valMagVar>1.08</valMagVar>
237
- <txtNameAdmin>MUNICIPALITY OF PUJAUT</txtNameAdmin>
238
- <valTransitionAlt>10000</valTransitionAlt>
239
- <uomTransitionAlt>FT</uomTransitionAlt>
240
- <txtRmk>Restricted access</txtRmk>
241
- </Ahp>
242
- <Rwy>
243
- <RwyUid>
244
- <AhpUid>
245
- <codeId>LFNT</codeId>
246
- </AhpUid>
247
- <txtDesig>16L/34R</txtDesig>
248
- </RwyUid>
249
- <valLen>650</valLen>
250
- <valWid>80</valWid>
251
- <uomDimRwy>M</uomDimRwy>
252
- <codeComposition>ASPH</codeComposition>
253
- <codePreparation>PAVED</codePreparation>
254
- <codeCondSfc>GOOD</codeCondSfc>
255
- <valPcnClass>59</valPcnClass>
256
- <codePcnPavementType>F</codePcnPavementType>
257
- <codePcnPavementSubgrade>A</codePcnPavementSubgrade>
258
- <codePcnMaxTirePressure>W</codePcnMaxTirePressure>
259
- <codePcnEvalMethod>T</codePcnEvalMethod>
260
- <txtPcnNote>Paved shoulder on 2.5m on each side of the RWY.</txtPcnNote>
261
- <valSiwlWeight>1500</valSiwlWeight>
262
- <uomSiwlWeight>KG</uomSiwlWeight>
263
- <valSiwlTirePressure>0.5</valSiwlTirePressure>
264
- <uomSiwlTirePressure>MPA</uomSiwlTirePressure>
265
- <valAuwWeight>30</valAuwWeight>
266
- <uomAuwWeight>T</uomAuwWeight>
267
- <codeSts>CLSD</codeSts>
268
- <txtRmk>Markings eroded</txtRmk>
269
- </Rwy>
270
- <Rdn>
271
- <RdnUid>
272
- <RwyUid>
273
- <AhpUid>
274
- <codeId>LFNT</codeId>
275
- </AhpUid>
276
- <txtDesig>16L/34R</txtDesig>
277
- </RwyUid>
278
- <txtDesig>16L</txtDesig>
279
- </RdnUid>
280
- <geoLat>44.00211944N</geoLat>
281
- <geoLong>004.75216944E</geoLong>
282
- <valTrueBrg>165</valTrueBrg>
283
- <valMagBrg>166</valMagBrg>
284
- <valElevTdz>145</valElevTdz>
285
- <uomElevTdz>FT</uomElevTdz>
286
- <codeVfrPattern>E</codeVfrPattern>
287
- <txtRmk>forth remarks</txtRmk>
288
- </Rdn>
289
- <Rdd>
290
- <RddUid>
291
- <RdnUid>
292
- <RwyUid>
293
- <AhpUid>
294
- <codeId>LFNT</codeId>
295
- </AhpUid>
296
- <txtDesig>16L/34R</txtDesig>
297
- </RwyUid>
298
- <txtDesig>16L</txtDesig>
299
- </RdnUid>
300
- <codeType>DPLM</codeType>
301
- <codeDayPeriod>A</codeDayPeriod>
302
- </RddUid>
303
- <valDist>131</valDist>
304
- <uomDist>M</uomDist>
305
- <txtRmk>forth remarks</txtRmk>
306
- </Rdd>
307
- <Rls>
308
- <RlsUid>
309
- <RdnUid>
310
- <RwyUid>
311
- <AhpUid>
312
- <codeId>LFNT</codeId>
313
- </AhpUid>
314
- <txtDesig>16L/34R</txtDesig>
315
- </RwyUid>
316
- <txtDesig>16L</txtDesig>
317
- </RdnUid>
318
- <codePsn>AIM</codePsn>
319
- </RlsUid>
320
- <txtDescr>omnidirectional</txtDescr>
321
- <codeIntst>LIM</codeIntst>
322
- <codeColour>GRN</codeColour>
323
- <txtRmk>lighting remarks</txtRmk>
324
- </Rls>
325
- <Rdn>
326
- <RdnUid>
327
- <RwyUid>
328
- <AhpUid>
329
- <codeId>LFNT</codeId>
330
- </AhpUid>
331
- <txtDesig>16L/34R</txtDesig>
332
- </RwyUid>
333
- <txtDesig>34R</txtDesig>
334
- </RdnUid>
335
- <geoLat>43.99036389N</geoLat>
336
- <geoLong>004.75645556E</geoLong>
337
- <valTrueBrg>345</valTrueBrg>
338
- <valMagBrg>346</valMagBrg>
339
- <valElevTdz>147</valElevTdz>
340
- <uomElevTdz>FT</uomElevTdz>
341
- <codeVfrPattern>L</codeVfrPattern>
342
- <txtRmk>back remarks</txtRmk>
343
- </Rdn>
344
- <Rdd>
345
- <RddUid>
346
- <RdnUid>
347
- <RwyUid>
348
- <AhpUid>
349
- <codeId>LFNT</codeId>
350
- </AhpUid>
351
- <txtDesig>16L/34R</txtDesig>
352
- </RwyUid>
353
- <txtDesig>34R</txtDesig>
354
- </RdnUid>
355
- <codeType>DPLM</codeType>
356
- <codeDayPeriod>A</codeDayPeriod>
357
- </RddUid>
358
- <valDist>209</valDist>
359
- <uomDist>M</uomDist>
360
- <txtRmk>back remarks</txtRmk>
361
- </Rdd>
362
- <Rls>
363
- <RlsUid>
364
- <RdnUid>
365
- <RwyUid>
366
- <AhpUid>
367
- <codeId>LFNT</codeId>
368
- </AhpUid>
369
- <txtDesig>16L/34R</txtDesig>
370
- </RwyUid>
371
- <txtDesig>34R</txtDesig>
372
- </RdnUid>
373
- <codePsn>AIM</codePsn>
374
- </RlsUid>
375
- <txtDescr>omnidirectional</txtDescr>
376
- <codeIntst>LIM</codeIntst>
377
- <codeColour>GRN</codeColour>
378
- <txtRmk>lighting remarks</txtRmk>
379
- </Rls>
380
- <Fto>
381
- <FtoUid>
382
- <AhpUid>
383
- <codeId>LFNT</codeId>
384
- </AhpUid>
385
- <txtDesig>H1</txtDesig>
386
- </FtoUid>
387
- <valLen>35</valLen>
388
- <valWid>35</valWid>
389
- <uomDim>M</uomDim>
390
- <codeComposition>CONC</codeComposition>
391
- <codePreparation>PAVED</codePreparation>
392
- <codeCondSfc>FAIR</codeCondSfc>
393
- <valPcnClass>30</valPcnClass>
394
- <codePcnPavementType>F</codePcnPavementType>
395
- <codePcnPavementSubgrade>A</codePcnPavementSubgrade>
396
- <codePcnMaxTirePressure>W</codePcnMaxTirePressure>
397
- <codePcnEvalMethod>U</codePcnEvalMethod>
398
- <txtPcnNote>Cracks near the center</txtPcnNote>
399
- <valSiwlWeight>1500</valSiwlWeight>
400
- <uomSiwlWeight>KG</uomSiwlWeight>
401
- <valSiwlTirePressure>0.5</valSiwlTirePressure>
402
- <uomSiwlTirePressure>MPA</uomSiwlTirePressure>
403
- <valAuwWeight>8</valAuwWeight>
404
- <uomAuwWeight>T</uomAuwWeight>
405
- <txtProfile>Northwest from RWY 12/30</txtProfile>
406
- <txtMarking>Dashed white lines</txtMarking>
407
- <codeSts>OTHER</codeSts>
408
- <txtRmk>Authorizaton by AD operator required</txtRmk>
409
- </Fto>
410
- <Fdn>
411
- <FdnUid>
412
- <FtoUid>
413
- <AhpUid>
414
- <codeId>LFNT</codeId>
415
- </AhpUid>
416
- <txtDesig>H1</txtDesig>
417
- </FtoUid>
418
- <txtDesig>35</txtDesig>
419
- </FdnUid>
420
- <valTrueBrg>355</valTrueBrg>
421
- <valMagBrg>356</valMagBrg>
422
- <txtRmk>Avoid flight over residental area</txtRmk>
423
- </Fdn>
424
- <Fls>
425
- <FlsUid>
426
- <FdnUid>
427
- <FtoUid>
428
- <AhpUid>
429
- <codeId>LFNT</codeId>
430
- </AhpUid>
431
- <txtDesig>H1</txtDesig>
432
- </FtoUid>
433
- <txtDesig>35</txtDesig>
434
- </FdnUid>
435
- <codePsn>AIM</codePsn>
436
- </FlsUid>
437
- <txtDescr>omnidirectional</txtDescr>
438
- <codeIntst>LIM</codeIntst>
439
- <codeColour>GRN</codeColour>
440
- <txtRmk>lighting remarks</txtRmk>
441
- </Fls>
442
- <Tla>
443
- <TlaUid>
444
- <AhpUid>
445
- <codeId>LFNT</codeId>
446
- </AhpUid>
447
- <txtDesig>H1</txtDesig>
448
- </TlaUid>
449
- <FtoUid>
450
- <AhpUid>
451
- <codeId>LFNT</codeId>
452
- </AhpUid>
453
- <txtDesig>H1</txtDesig>
454
- </FtoUid>
455
- <geoLat>43.99915000N</geoLat>
456
- <geoLong>004.75154444E</geoLong>
457
- <codeDatum>WGE</codeDatum>
458
- <valElev>141</valElev>
459
- <uomDistVer>FT</uomDistVer>
460
- <valLen>20</valLen>
461
- <valWid>20</valWid>
462
- <uomDim>M</uomDim>
463
- <codeComposition>CONC</codeComposition>
464
- <codePreparation>PAVED</codePreparation>
465
- <codeCondSfc>FAIR</codeCondSfc>
466
- <valPcnClass>30</valPcnClass>
467
- <codePcnPavementType>F</codePcnPavementType>
468
- <codePcnPavementSubgrade>A</codePcnPavementSubgrade>
469
- <codePcnMaxTirePressure>W</codePcnMaxTirePressure>
470
- <codePcnEvalMethod>U</codePcnEvalMethod>
471
- <txtPcnNote>Cracks near the center</txtPcnNote>
472
- <valSiwlWeight>1500</valSiwlWeight>
473
- <uomSiwlWeight>KG</uomSiwlWeight>
474
- <valSiwlTirePressure>0.5</valSiwlTirePressure>
475
- <uomSiwlTirePressure>MPA</uomSiwlTirePressure>
476
- <valAuwWeight>8</valAuwWeight>
477
- <uomAuwWeight>T</uomAuwWeight>
478
- <codeClassHel>1</codeClassHel>
479
- <txtMarking>Continuous white lines</txtMarking>
480
- <codeSts>OTHER</codeSts>
481
- <txtRmk>Authorizaton by AD operator required</txtRmk>
482
- </Tla>
483
- <Tls>
484
- <TlsUid>
485
- <TlaUid>
486
- <AhpUid>
487
- <codeId>LFNT</codeId>
488
- </AhpUid>
489
- <txtDesig>H1</txtDesig>
490
- </TlaUid>
491
- <codePsn>AIM</codePsn>
492
- </TlsUid>
493
- <txtDescr>omnidirectional</txtDescr>
494
- <codeIntst>LIM</codeIntst>
495
- <codeColour>GRN</codeColour>
496
- <txtRmk>lighting remarks</txtRmk>
497
- </Tls>
498
- <Ahu>
499
- <AhuUid>
500
- <AhpUid>
501
- <codeId>LFNT</codeId>
502
- </AhpUid>
503
- </AhuUid>
504
- <UsageLimitation>
505
- <codeUsageLimitation>PERMIT</codeUsageLimitation>
506
- </UsageLimitation>
507
- <UsageLimitation>
508
- <codeUsageLimitation>RESERV</codeUsageLimitation>
509
- <UsageCondition>
510
- <AircraftClass>
511
- <codeType>E</codeType>
512
- </AircraftClass>
513
- </UsageCondition>
514
- <UsageCondition>
515
- <FlightClass>
516
- <codeOrigin>INTL</codeOrigin>
517
- </FlightClass>
518
- </UsageCondition>
519
- <Timetable>
520
- <codeWorkHr>H24</codeWorkHr>
521
- </Timetable>
522
- <txtRmk>reservation remarks</txtRmk>
523
- </UsageLimitation>
524
- </Ahu>
525
- <!-- Address: RADIO for LFNT -->
526
- <Aha source="LF|GEN|0.0 FACTORY|0|0">
527
- <AhaUid>
528
- <AhpUid>
529
- <codeId>LFNT</codeId>
530
- </AhpUid>
531
- <codeType>RADIO</codeType>
532
- <noSeq>1</noSeq>
533
- </AhaUid>
534
- <txtAddress>123.35</txtAddress>
535
- <txtRmk>A/A (callsign PUJAUT)</txtRmk>
536
- </Aha>
537
- <!-- Address: URL for LFNT -->
538
- <Aha source="LF|GEN|0.0 FACTORY|0|0">
539
- <AhaUid>
540
- <AhpUid>
541
- <codeId>LFNT</codeId>
542
- </AhpUid>
543
- <codeType>URL</codeType>
544
- <noSeq>1</noSeq>
545
- </AhaUid>
546
- <txtAddress>https://lfnt.tower.zone</txtAddress>
547
- </Aha>
548
- <!-- Address: URL for LFNT -->
549
- <Aha source="LF|GEN|0.0 FACTORY|0|0">
550
- <AhaUid>
551
- <AhpUid>
552
- <codeId>LFNT</codeId>
553
- </AhpUid>
554
- <codeType>URL</codeType>
555
- <noSeq>2</noSeq>
556
- </AhaUid>
557
- <txtAddress>https://planeur-avignon-pujaut.fr</txtAddress>
558
- </Aha>
559
- END
560
- end
561
-
562
- it "builds correct minimal OFMX" do
563
- AIXM.ofmx!
564
- %i(z declination transition_z operator remarks).each { |a| subject.send(:"#{a}=", nil) }
565
- subject.instance_eval { @addresses.clear }
566
- subject.instance_eval { @runways.clear }
567
- subject.instance_eval { @fatos.clear }
568
- subject.instance_eval { @helipads.clear }
569
- subject.instance_eval { @usage_limitations.clear }
570
- subject.to_xml.must_equal <<~END
571
- <!-- Airport: LFNT AVIGNON-PUJAUT -->
572
- <Ahp source="LF|GEN|0.0 FACTORY|0|0">
573
- <AhpUid>
574
- <codeId>LFNT</codeId>
575
- </AhpUid>
576
- <OrgUid>
577
- <txtName>FRANCE</txtName>
578
- </OrgUid>
579
- <txtName>AVIGNON-PUJAUT</txtName>
580
- <codeIcao>LFNT</codeIcao>
581
- <codeGps>LFPUJAUT</codeGps>
582
- <geoLat>43.99611111N</geoLat>
583
- <geoLong>004.75444444E</geoLong>
584
- <codeDatum>WGE</codeDatum>
585
- </Ahp>
586
- END
587
- end
588
- end
589
- end
590
-
591
- describe AIXM::Feature::Airport::UsageLimitation do
592
- subject do
593
- AIXM::Factory.airport.usage_limitations.first
594
- end
595
-
596
- describe :initialize do
597
- it "sets defaults" do
598
- subject.conditions.must_equal []
599
- end
600
- end
601
-
602
- describe :type= do
603
- it "fails on invalid values" do
604
- [nil, :foobar].wont_be_written_to subject, :type
605
- end
606
-
607
- it "looks up valid values" do
608
- subject.tap { |s| s.type = :permitted }.type.must_equal :permitted
609
- subject.tap { |s| s.type = :RESERV }.type.must_equal :reservation_required
610
- end
611
- end
612
-
613
- describe :timetable= do
614
- macro :timetable
615
- end
616
-
617
- describe :remarks= do
618
- macro :remarks
619
- end
620
-
621
- describe :xml= do
622
- it "builds correct complete OFMX" do
623
- AIXM.ofmx!
624
- subject = AIXM::Factory.airport.usage_limitations.last
625
- subject.to_xml.must_equal <<~END
626
- <UsageLimitation>
627
- <codeUsageLimitation>RESERV</codeUsageLimitation>
628
- <UsageCondition>
629
- <AircraftClass>
630
- <codeType>E</codeType>
631
- </AircraftClass>
632
- </UsageCondition>
633
- <UsageCondition>
634
- <FlightClass>
635
- <codeOrigin>INTL</codeOrigin>
636
- </FlightClass>
637
- </UsageCondition>
638
- <Timetable>
639
- <codeWorkHr>H24</codeWorkHr>
640
- </Timetable>
641
- <txtRmk>reservation remarks</txtRmk>
642
- </UsageLimitation>
643
- END
644
- end
645
-
646
- it "builds correct minimal OFMX" do
647
- AIXM.ofmx!
648
- subject.to_xml.must_equal <<~END
649
- <UsageLimitation>
650
- <codeUsageLimitation>PERMIT</codeUsageLimitation>
651
- </UsageLimitation>
652
- END
653
- end
654
- end
655
- end
656
-
657
- describe AIXM::Feature::Airport::UsageLimitation::Condition do
658
- subject do
659
- AIXM::Factory.airport.usage_limitations.last.conditions.first
660
- end
661
-
662
- describe :aircraft= do
663
- it "fails on invalid values" do
664
- [:foobar, 123].wont_be_written_to subject, :aircraft
665
- end
666
-
667
- it "accepts nil value" do
668
- [nil].must_be_written_to subject, :aircraft
669
- end
670
-
671
- it "looks up valid values" do
672
- subject.tap { |s| s.aircraft = :glider }.aircraft.must_equal :glider
673
- subject.tap { |s| s.aircraft = :H }.aircraft.must_equal :helicopter
674
- end
675
- end
676
-
677
- describe :rule= do
678
- it "fails on invalid values" do
679
- [:foobar, 123].wont_be_written_to subject, :rule
680
- end
681
-
682
- it "accepts nil value" do
683
- [nil].must_be_written_to subject, :rule
684
- end
685
-
686
- it "looks up valid values" do
687
- subject.tap { |s| s.rule = :ifr }.rule.must_equal :ifr
688
- subject.tap { |s| s.rule = :IV }.rule.must_equal :ifr_and_vfr
689
- end
690
- end
691
-
692
- describe :realm= do
693
- it "fails on invalid values" do
694
- [:foobar, 123].wont_be_written_to subject, :realm
695
- end
696
-
697
- it "accepts nil value" do
698
- [nil].must_be_written_to subject, :realm
699
- end
700
-
701
- it "looks up valid values" do
702
- subject.tap { |s| s.realm = :civilian }.realm.must_equal :civilian
703
- subject.tap { |s| s.realm = :MIL }.realm.must_equal :military
704
- end
705
- end
706
-
707
- describe :origin= do
708
- it "fails on invalid values" do
709
- [:foobar, 123].wont_be_written_to subject, :origin
710
- end
711
-
712
- it "accepts nil value" do
713
- [nil].must_be_written_to subject, :origin
714
- end
715
-
716
- it "looks up valid values" do
717
- subject.tap { |s| s.origin = :international }.origin.must_equal :international
718
- subject.tap { |s| s.origin = :NTL }.origin.must_equal :national
719
- end
720
- end
721
-
722
- describe :purpose= do
723
- it "fails on invalid values" do
724
- [:foobar, 123].wont_be_written_to subject, :purpose
725
- end
726
-
727
- it "accepts nil value" do
728
- [nil].must_be_written_to subject, :purpose
729
- end
730
-
731
- it "looks up valid values" do
732
- subject.tap { |s| s.purpose = :private }.purpose.must_equal :private
733
- subject.tap { |s| s.purpose = :TRG }.purpose.must_equal :school_or_training
734
- end
735
- end
736
-
737
- describe :xml= do
738
- it "builds correct complete OFMX" do
739
- subject.rule = :vfr
740
- subject.realm = :military
741
- subject.origin = :international
742
- subject.purpose = :school_or_training
743
- AIXM.ofmx!
744
- subject.to_xml.must_equal <<~END
745
- <UsageCondition>
746
- <AircraftClass>
747
- <codeType>E</codeType>
748
- </AircraftClass>
749
- <FlightClass>
750
- <codeRule>V</codeRule>
751
- <codeMil>MIL</codeMil>
752
- <codeOrigin>INTL</codeOrigin>
753
- <codePurpose>TRG</codePurpose>
754
- </FlightClass>
755
- </UsageCondition>
756
- END
757
- end
758
-
759
- it "builds correct minimal OFMX" do
760
- AIXM.ofmx!
761
- subject.to_xml.must_equal <<~END
762
- <UsageCondition>
763
- <AircraftClass>
764
- <codeType>E</codeType>
765
- </AircraftClass>
766
- </UsageCondition>
767
- END
768
- end
769
- end
770
- end