aixm 0.3.8 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +0 -0
  4. data/CHANGELOG.md +33 -3
  5. data/README.md +166 -56
  6. data/exe/ckmid +14 -0
  7. data/exe/mkmid +14 -0
  8. data/lib/aixm.rb +16 -6
  9. data/lib/aixm/association.rb +369 -0
  10. data/lib/aixm/classes.rb +43 -0
  11. data/lib/aixm/component/fato.rb +45 -53
  12. data/lib/aixm/component/frequency.rb +11 -12
  13. data/lib/aixm/component/geometry.rb +36 -38
  14. data/lib/aixm/component/geometry/arc.rb +2 -2
  15. data/lib/aixm/component/geometry/border.rb +6 -3
  16. data/lib/aixm/component/geometry/circle.rb +8 -2
  17. data/lib/aixm/component/geometry/point.rb +8 -2
  18. data/lib/aixm/component/helipad.rb +30 -38
  19. data/lib/aixm/component/layer.rb +28 -19
  20. data/lib/aixm/component/lighting.rb +12 -13
  21. data/lib/aixm/component/runway.rb +44 -48
  22. data/lib/aixm/{feature → component}/service.rb +37 -36
  23. data/lib/aixm/component/surface.rb +3 -3
  24. data/lib/aixm/component/timetable.rb +2 -2
  25. data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
  26. data/lib/aixm/config.rb +2 -1
  27. data/lib/aixm/document.rb +27 -50
  28. data/lib/aixm/executables.rb +85 -0
  29. data/lib/aixm/feature.rb +13 -3
  30. data/lib/aixm/feature/address.rb +12 -13
  31. data/lib/aixm/feature/airport.rb +103 -128
  32. data/lib/aixm/feature/airspace.rb +44 -17
  33. data/lib/aixm/feature/navigational_aid.rb +7 -9
  34. data/lib/aixm/feature/navigational_aid/designated_point.rb +13 -15
  35. data/lib/aixm/feature/navigational_aid/dme.rb +11 -12
  36. data/lib/aixm/feature/navigational_aid/marker.rb +7 -3
  37. data/lib/aixm/feature/navigational_aid/ndb.rb +7 -3
  38. data/lib/aixm/feature/navigational_aid/tacan.rb +7 -3
  39. data/lib/aixm/feature/navigational_aid/vor.rb +23 -15
  40. data/lib/aixm/feature/obstacle.rb +29 -43
  41. data/lib/aixm/feature/obstacle_group.rb +37 -34
  42. data/lib/aixm/feature/organisation.rb +21 -5
  43. data/lib/aixm/feature/unit.rb +36 -46
  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 +29 -76
  48. data/lib/aixm/shortcuts.rb +5 -42
  49. data/lib/aixm/version.rb +1 -1
  50. data/lib/aixm/xy.rb +1 -1
  51. data/schemas/ofmx/0/OFMX-Features.xsd +152 -20
  52. data/schemas/ofmx/0/OFMX-Snapshot.xsd +0 -5
  53. metadata +107 -156
  54. metadata.gz.sig +2 -0
  55. data/.github/workflows/test.yml +0 -26
  56. data/.gitignore +0 -6
  57. data/.ruby-version +0 -1
  58. data/.yardopts +0 -3
  59. data/Guardfile +0 -8
  60. data/aixm.gemspec +0 -35
  61. data/gems.rb +0 -3
  62. data/lib/aixm/component.rb +0 -6
  63. data/rakefile.rb +0 -36
  64. data/spec/factory.rb +0 -559
  65. data/spec/lib/aixm/a_spec.rb +0 -203
  66. data/spec/lib/aixm/component/fato_spec.rb +0 -267
  67. data/spec/lib/aixm/component/frequency_spec.rb +0 -74
  68. data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -73
  69. data/spec/lib/aixm/component/geometry/border_spec.rb +0 -38
  70. data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -68
  71. data/spec/lib/aixm/component/geometry/point_spec.rb +0 -37
  72. data/spec/lib/aixm/component/geometry_spec.rb +0 -316
  73. data/spec/lib/aixm/component/helipad_spec.rb +0 -193
  74. data/spec/lib/aixm/component/layer_spec.rb +0 -135
  75. data/spec/lib/aixm/component/lighting_spec.rb +0 -94
  76. data/spec/lib/aixm/component/runway_spec.rb +0 -479
  77. data/spec/lib/aixm/component/surface_spec.rb +0 -124
  78. data/spec/lib/aixm/component/timetable_spec.rb +0 -47
  79. data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -94
  80. data/spec/lib/aixm/config_spec.rb +0 -41
  81. data/spec/lib/aixm/d_spec.rb +0 -150
  82. data/spec/lib/aixm/document_spec.rb +0 -1884
  83. data/spec/lib/aixm/errors_spec.rb +0 -14
  84. data/spec/lib/aixm/f_spec.rb +0 -85
  85. data/spec/lib/aixm/feature/address_spec.rb +0 -60
  86. data/spec/lib/aixm/feature/airport_spec.rb +0 -776
  87. data/spec/lib/aixm/feature/airspace_spec.rb +0 -394
  88. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -103
  89. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -98
  90. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -85
  91. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -95
  92. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -94
  93. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -251
  94. data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
  95. data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -330
  96. data/spec/lib/aixm/feature/obstacle_spec.rb +0 -284
  97. data/spec/lib/aixm/feature/organisation_spec.rb +0 -83
  98. data/spec/lib/aixm/feature/service_spec.rb +0 -59
  99. data/spec/lib/aixm/feature/unit_spec.rb +0 -238
  100. data/spec/lib/aixm/feature_spec.rb +0 -38
  101. data/spec/lib/aixm/p_spec.rb +0 -189
  102. data/spec/lib/aixm/refinements_spec.rb +0 -430
  103. data/spec/lib/aixm/version_spec.rb +0 -7
  104. data/spec/lib/aixm/w_spec.rb +0 -150
  105. data/spec/lib/aixm/xy_spec.rb +0 -180
  106. data/spec/lib/aixm/z_spec.rb +0 -94
  107. data/spec/macros/marking.rb +0 -12
  108. data/spec/macros/organisation.rb +0 -11
  109. data/spec/macros/remarks.rb +0 -12
  110. data/spec/macros/timetable.rb +0 -11
  111. data/spec/macros/xy.rb +0 -11
  112. data/spec/macros/z_qnh.rb +0 -11
  113. data/spec/sounds/failure.mp3 +0 -0
  114. data/spec/sounds/success.mp3 +0 -0
  115. data/spec/spec_helper.rb +0 -62
@@ -1,14 +0,0 @@
1
- require_relative '../../spec_helper'
2
-
3
- describe AIXM::GeometryError do
4
- it "must be defined" do
5
- _(AIXM::GeometryError).wont_be_nil
6
- end
7
- end
8
-
9
-
10
- describe AIXM::LayerError do
11
- it "must be defined" do
12
- _(AIXM::LayerError).wont_be_nil
13
- end
14
- end
@@ -1,85 +0,0 @@
1
- require_relative '../../spec_helper'
2
-
3
- describe AIXM::F do
4
- subject do
5
- AIXM::Factory.f
6
- end
7
-
8
- describe :freq= do
9
- it "fails on invalid values" do
10
- _([:foobar]).wont_be_written_to subject, :freq
11
- end
12
-
13
- it "converts Numeric to Float" do
14
- _(subject.tap { |s| s.freq = 5 }.freq).must_equal 5.0
15
- end
16
- end
17
-
18
- describe :unit= do
19
- it "fails on invalid values" do
20
- _([:foobar, 123]).wont_be_written_to subject, :unit
21
- end
22
-
23
- it "symbolizes and downcases values" do
24
- _(subject.tap { |s| s.unit = "MHz" }.unit).must_equal :mhz
25
- end
26
- end
27
-
28
- describe :between? do
29
- subject do
30
- AIXM.f(100, :mhz)
31
- end
32
-
33
- it "detect frequencies within a frequency band" do
34
- _(subject.between?(90, 110, :mhz)).must_equal true
35
- _(subject.between?(90, 100, :mhz)).must_equal true
36
- _(subject.between?(100.0, 100.1, :mhz)).must_equal true
37
- end
38
-
39
- it "detect frequencies outside of a frequency band" do
40
- _(subject.between?(90, 110, :khz)).must_equal false
41
- _(subject.between?(90, 95, :mhz)).must_equal false
42
- end
43
- end
44
-
45
- describe :== do
46
- it "recognizes objects with identical frequency and unit as equal" do
47
- a = AIXM.f(123.0, :mhz)
48
- b = AIXM.f(123, 'MHZ')
49
- _(a).must_equal b
50
- end
51
-
52
- it "recognizes objects with different frequency or unit as unequal" do
53
- a = AIXM.f(123.35, :mhz)
54
- b = AIXM.f(123.35, :khz)
55
- _(a).wont_equal b
56
- end
57
-
58
- it "recognizes objects of different class as unequal" do
59
- a = AIXM.f(123.35, :mhz)
60
- b = :oggy
61
- _(a).wont_equal b
62
- end
63
- end
64
-
65
- describe :hash do
66
- it "returns an integer" do
67
- _(subject.hash).must_be_instance_of Integer
68
- end
69
-
70
- it "allows for the use of instances as hash keys" do
71
- dupe = subject.dup
72
- _({ subject => true }[dupe]).must_equal true
73
- end
74
- end
75
-
76
- describe :zero? do
77
- it "returns true for zero frequency" do
78
- _(subject.tap { |s| s.freq = 0 }).must_be :zero?
79
- end
80
-
81
- it "returns false for non-zero frequency" do
82
- _(subject.tap { |s| s.freq = 1 }).wont_be :zero?
83
- end
84
- end
85
- end
@@ -1,60 +0,0 @@
1
- require_relative '../../../spec_helper'
2
-
3
- describe AIXM::Feature::Address do
4
- subject do
5
- AIXM::Factory.address
6
- end
7
-
8
- describe :type= do
9
- it "fails on invalid values" do
10
- _{ subject.type = :foobar }.must_raise ArgumentError
11
- _{ subject.type = nil }.must_raise ArgumentError
12
- end
13
-
14
- it "looks up valid values" do
15
- _(subject.tap { |s| s.type = :phone }.type).must_equal :phone
16
- _(subject.tap { |s| s.type = :RADIO }.type).must_equal :radio_frequency
17
- end
18
- end
19
-
20
- describe :remarks= do
21
- macro :remarks
22
- end
23
-
24
- describe :xml= do
25
- it "builds correct OFMX" do
26
- AIXM.ofmx!
27
- _(subject.to_xml(as: :Xxx, sequence: 1)).must_equal <<~END
28
- <!-- Address: RADIO -->
29
- <Xxx source="LF|GEN|0.0 FACTORY|0|0">
30
- <XxxUid>
31
- <codeType>RADIO</codeType>
32
- <noSeq>1</noSeq>
33
- </XxxUid>
34
- <txtAddress>123.35</txtAddress>
35
- <txtRmk>A/A (callsign PUJAUT)</txtRmk>
36
- </Xxx>
37
- END
38
- end
39
-
40
- it "builds OFMX with mid" do
41
- AIXM.ofmx!
42
- AIXM.config.mid_region = 'LF'
43
- _(subject.to_xml(as: :Xxx, sequence: 1)).must_match /<XxxUid mid="126bee70-4d4e-0032-ada9-81d3318fe6b7">/
44
- end
45
-
46
- it "builds correct AIXM" do
47
- subject = AIXM.address(type: :weather_url, address: 'https://www.foo.bar')
48
- _(subject.to_xml(as: :Xxx, sequence: 1)).must_equal <<~END
49
- <!-- Address: URL-MET -->
50
- <Xxx>
51
- <XxxUid>
52
- <codeType>URL</codeType>
53
- <noSeq>1</noSeq>
54
- </XxxUid>
55
- <txtAddress>https://www.foo.bar</txtAddress>
56
- </Xxx>
57
- END
58
- end
59
- end
60
- end
@@ -1,776 +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>164</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>344</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>354</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
-
590
- it "builds OFMX with mid" do
591
- AIXM.ofmx!
592
- AIXM.config.mid_region = 'LF'
593
- _(subject.to_xml).must_match /<AhpUid mid="c63504f4-c1d9-1b88-f2ca-2c35a25d8bf3">/
594
- end
595
- end
596
-
597
- describe AIXM::Feature::Airport::UsageLimitation do
598
- subject do
599
- AIXM::Factory.airport.usage_limitations.first
600
- end
601
-
602
- describe :initialize do
603
- it "sets defaults" do
604
- _(subject.conditions).must_equal []
605
- end
606
- end
607
-
608
- describe :type= do
609
- it "fails on invalid values" do
610
- _([nil, :foobar]).wont_be_written_to subject, :type
611
- end
612
-
613
- it "looks up valid values" do
614
- _(subject.tap { |s| s.type = :permitted }.type).must_equal :permitted
615
- _(subject.tap { |s| s.type = :RESERV }.type).must_equal :reservation_required
616
- end
617
- end
618
-
619
- describe :timetable= do
620
- macro :timetable
621
- end
622
-
623
- describe :remarks= do
624
- macro :remarks
625
- end
626
-
627
- describe :xml= do
628
- it "builds correct complete OFMX" do
629
- AIXM.ofmx!
630
- subject = AIXM::Factory.airport.usage_limitations.last
631
- _(subject.to_xml).must_equal <<~END
632
- <UsageLimitation>
633
- <codeUsageLimitation>RESERV</codeUsageLimitation>
634
- <UsageCondition>
635
- <AircraftClass>
636
- <codeType>E</codeType>
637
- </AircraftClass>
638
- </UsageCondition>
639
- <UsageCondition>
640
- <FlightClass>
641
- <codeOrigin>INTL</codeOrigin>
642
- </FlightClass>
643
- </UsageCondition>
644
- <Timetable>
645
- <codeWorkHr>H24</codeWorkHr>
646
- </Timetable>
647
- <txtRmk>reservation remarks</txtRmk>
648
- </UsageLimitation>
649
- END
650
- end
651
-
652
- it "builds correct minimal OFMX" do
653
- AIXM.ofmx!
654
- _(subject.to_xml).must_equal <<~END
655
- <UsageLimitation>
656
- <codeUsageLimitation>PERMIT</codeUsageLimitation>
657
- </UsageLimitation>
658
- END
659
- end
660
- end
661
- end
662
-
663
- describe AIXM::Feature::Airport::UsageLimitation::Condition do
664
- subject do
665
- AIXM::Factory.airport.usage_limitations.last.conditions.first
666
- end
667
-
668
- describe :aircraft= do
669
- it "fails on invalid values" do
670
- _([:foobar, 123]).wont_be_written_to subject, :aircraft
671
- end
672
-
673
- it "accepts nil value" do
674
- _([nil]).must_be_written_to subject, :aircraft
675
- end
676
-
677
- it "looks up valid values" do
678
- _(subject.tap { |s| s.aircraft = :glider }.aircraft).must_equal :glider
679
- _(subject.tap { |s| s.aircraft = :H }.aircraft).must_equal :helicopter
680
- end
681
- end
682
-
683
- describe :rule= do
684
- it "fails on invalid values" do
685
- _([:foobar, 123]).wont_be_written_to subject, :rule
686
- end
687
-
688
- it "accepts nil value" do
689
- _([nil]).must_be_written_to subject, :rule
690
- end
691
-
692
- it "looks up valid values" do
693
- _(subject.tap { |s| s.rule = :ifr }.rule).must_equal :ifr
694
- _(subject.tap { |s| s.rule = :IV }.rule).must_equal :ifr_and_vfr
695
- end
696
- end
697
-
698
- describe :realm= do
699
- it "fails on invalid values" do
700
- _([:foobar, 123]).wont_be_written_to subject, :realm
701
- end
702
-
703
- it "accepts nil value" do
704
- _([nil]).must_be_written_to subject, :realm
705
- end
706
-
707
- it "looks up valid values" do
708
- _(subject.tap { |s| s.realm = :civilian }.realm).must_equal :civilian
709
- _(subject.tap { |s| s.realm = :MIL }.realm).must_equal :military
710
- end
711
- end
712
-
713
- describe :origin= do
714
- it "fails on invalid values" do
715
- _([:foobar, 123]).wont_be_written_to subject, :origin
716
- end
717
-
718
- it "accepts nil value" do
719
- _([nil]).must_be_written_to subject, :origin
720
- end
721
-
722
- it "looks up valid values" do
723
- _(subject.tap { |s| s.origin = :international }.origin).must_equal :international
724
- _(subject.tap { |s| s.origin = :NTL }.origin).must_equal :national
725
- end
726
- end
727
-
728
- describe :purpose= do
729
- it "fails on invalid values" do
730
- _([:foobar, 123]).wont_be_written_to subject, :purpose
731
- end
732
-
733
- it "accepts nil value" do
734
- _([nil]).must_be_written_to subject, :purpose
735
- end
736
-
737
- it "looks up valid values" do
738
- _(subject.tap { |s| s.purpose = :private }.purpose).must_equal :private
739
- _(subject.tap { |s| s.purpose = :TRG }.purpose).must_equal :school_or_training
740
- end
741
- end
742
-
743
- describe :xml= do
744
- it "builds correct complete OFMX" do
745
- subject.rule = :vfr
746
- subject.realm = :military
747
- subject.origin = :international
748
- subject.purpose = :school_or_training
749
- AIXM.ofmx!
750
- _(subject.to_xml).must_equal <<~END
751
- <UsageCondition>
752
- <AircraftClass>
753
- <codeType>E</codeType>
754
- </AircraftClass>
755
- <FlightClass>
756
- <codeRule>V</codeRule>
757
- <codeMil>MIL</codeMil>
758
- <codeOrigin>INTL</codeOrigin>
759
- <codePurpose>TRG</codePurpose>
760
- </FlightClass>
761
- </UsageCondition>
762
- END
763
- end
764
-
765
- it "builds correct minimal OFMX" do
766
- AIXM.ofmx!
767
- _(subject.to_xml).must_equal <<~END
768
- <UsageCondition>
769
- <AircraftClass>
770
- <codeType>E</codeType>
771
- </AircraftClass>
772
- </UsageCondition>
773
- END
774
- end
775
- end
776
- end