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,390 +0,0 @@
1
- require_relative '../../../spec_helper'
2
-
3
- describe AIXM::Feature::Airspace do
4
-
5
- context "only required attributes set" do
6
- subject do
7
- AIXM.airspace(type: "TMA", name: "Test TMA")
8
- end
9
-
10
- describe :initialize do
11
- it "sets defaults" do
12
- subject.id.must_equal 'C55466EC'
13
- subject.layers.must_equal []
14
- subject.geometry.must_be_instance_of AIXM::Component::Geometry
15
- end
16
- end
17
-
18
- describe :id= do
19
- it "fails on invalid values" do
20
- [:foobar, 123].wont_be_written_to subject, :id
21
- end
22
-
23
- it "falls back to id derived from digest of type, local_type and name" do
24
- subject.tap { |s| s.id = nil }.id.must_equal 'C55466EC'
25
- end
26
-
27
- it "upcases value" do
28
- subject.tap { |s| s.id = 'löl' }.id.must_equal 'LOEL'
29
- end
30
- end
31
-
32
- describe :type= do
33
- it "fails on invalid values" do
34
- [nil, :foobar, 123].wont_be_written_to subject, :type
35
- end
36
-
37
- it "looks up valid values" do
38
- subject.tap { |s| s.type = :danger_area }.type.must_equal :danger_area
39
- subject.tap { |s| s.type = :P }.type.must_equal :prohibited_area
40
- end
41
- end
42
-
43
- describe :local_type= do
44
- it "fails on invalid values" do
45
- [:foobar, 123].wont_be_written_to subject, :local_type
46
- end
47
-
48
- it "accepts nil value" do
49
- [nil].must_be_written_to subject, :local_type
50
- end
51
-
52
- it "upcases value" do
53
- subject.tap { |s| s.local_type = 'löl' }.local_type.must_equal 'LOEL'
54
- end
55
- end
56
-
57
- describe :name= do
58
- it "fails on invalid values" do
59
- [:foobar, 123].wont_be_written_to subject, :name
60
- end
61
-
62
- it "accepts nil value" do
63
- [nil].must_be_written_to subject, :name
64
- end
65
-
66
- it "upcases value" do
67
- subject.tap { |s| s.name = 'löl' }.name.must_equal 'LOEL'
68
- end
69
- end
70
-
71
- describe :to_uid do
72
- it "builds with arbitrary tag" do
73
- subject.to_uid.must_match(/<AseUid>/)
74
- subject.to_uid(as: :FooBar).must_match(/<FooBar>/)
75
- end
76
- end
77
-
78
- describe :to_xml do
79
- it "fails to build AIXM since geometry is not closed" do
80
- subject.layers << AIXM::Factory.layer
81
- -> { subject.to_xml }.must_raise AIXM::GeometryError
82
- end
83
-
84
- it "fails to build AIXM since layers are not defined" do
85
- subject.geometry = AIXM::Factory.circle_geometry
86
- -> { subject.to_xml }.must_raise AIXM::LayerError
87
- end
88
- end
89
- end
90
-
91
- context "only required attributes, geometry and layers set" do
92
- subject do
93
- AIXM.airspace(type: "TMA", name: "Test TMA").tap do |airspace|
94
- airspace.geometry = AIXM::Factory.circle_geometry
95
- airspace.layers << AIXM::Factory.layer
96
- end
97
- end
98
-
99
- describe :to_xml do
100
- it "builds correct AIXM without id" do
101
- AIXM.aixm!
102
- subject.to_xml.must_match(%r{<codeId>C55466EC</codeId>})
103
- end
104
-
105
- it "builds correct AIXM without short name" do
106
- AIXM.aixm!
107
- subject.to_xml.wont_match(/<txtLocalType>/)
108
- end
109
-
110
- it "builds correct AIXM with identical name and short name" do
111
- AIXM.aixm!
112
- subject.to_xml.wont_match(/<txtLocalType>/)
113
- end
114
- end
115
- end
116
-
117
- context "with one layer" do
118
- subject do
119
- AIXM::Factory.polygon_airspace
120
- end
121
-
122
- describe :to_xml do
123
- it "builds correct complete OFMX" do
124
- AIXM.ofmx!
125
- subject.to_xml.must_equal <<~"END"
126
- <!-- Airspace: [D] POLYGON AIRSPACE -->
127
- <Ase source="LF|GEN|0.0 FACTORY|0|0">
128
- <AseUid>
129
- <codeType>D</codeType>
130
- <codeId>PA</codeId>
131
- </AseUid>
132
- <txtLocalType>POLYGON</txtLocalType>
133
- <txtName>POLYGON AIRSPACE</txtName>
134
- <codeClass>C</codeClass>
135
- <codeLocInd>XXXX</codeLocInd>
136
- <codeActivity>TFC-AD</codeActivity>
137
- <codeDistVerUpper>STD</codeDistVerUpper>
138
- <valDistVerUpper>65</valDistVerUpper>
139
- <uomDistVerUpper>FL</uomDistVerUpper>
140
- <codeDistVerLower>STD</codeDistVerLower>
141
- <valDistVerLower>45</valDistVerLower>
142
- <uomDistVerLower>FL</uomDistVerLower>
143
- <codeDistVerMax>ALT</codeDistVerMax>
144
- <valDistVerMax>6000</valDistVerMax>
145
- <uomDistVerMax>FT</uomDistVerMax>
146
- <codeDistVerMnm>HEI</codeDistVerMnm>
147
- <valDistVerMnm>3000</valDistVerMnm>
148
- <uomDistVerMnm>FT</uomDistVerMnm>
149
- <Att>
150
- <codeWorkHr>H24</codeWorkHr>
151
- </Att>
152
- <codeSelAvbl>Y</codeSelAvbl>
153
- <txtRmk>airspace layer</txtRmk>
154
- </Ase>
155
- <Abd>
156
- <AbdUid>
157
- <AseUid>
158
- <codeType>D</codeType>
159
- <codeId>PA</codeId>
160
- </AseUid>
161
- </AbdUid>
162
- <Avx>
163
- <codeType>CWA</codeType>
164
- <geoLat>47.85916667N</geoLat>
165
- <geoLong>007.56000000E</geoLong>
166
- <codeDatum>WGE</codeDatum>
167
- <geoLatArc>47.90416667N</geoLatArc>
168
- <geoLongArc>007.56333333E</geoLongArc>
169
- </Avx>
170
- <Avx>
171
- <GbrUid>
172
- <txtName>FRANCE_GERMANY</txtName>
173
- </GbrUid>
174
- <codeType>FNT</codeType>
175
- <geoLat>47.94361111N</geoLat>
176
- <geoLong>007.59583333E</geoLong>
177
- <codeDatum>WGE</codeDatum>
178
- </Avx>
179
- <Avx>
180
- <codeType>GRC</codeType>
181
- <geoLat>47.85916667N</geoLat>
182
- <geoLong>007.56000000E</geoLong>
183
- <codeDatum>WGE</codeDatum>
184
- </Avx>
185
- </Abd>
186
- END
187
- end
188
-
189
- it "builds correct minimal OFMX" do
190
- AIXM.ofmx!
191
- subject.local_type = subject.name = nil
192
- subject.to_xml.must_equal <<~"END"
193
- <!-- Airspace: [D] UNNAMED -->
194
- <Ase source="LF|GEN|0.0 FACTORY|0|0">
195
- <AseUid>
196
- <codeType>D</codeType>
197
- <codeId>PA</codeId>
198
- </AseUid>
199
- <codeClass>C</codeClass>
200
- <codeLocInd>XXXX</codeLocInd>
201
- <codeActivity>TFC-AD</codeActivity>
202
- <codeDistVerUpper>STD</codeDistVerUpper>
203
- <valDistVerUpper>65</valDistVerUpper>
204
- <uomDistVerUpper>FL</uomDistVerUpper>
205
- <codeDistVerLower>STD</codeDistVerLower>
206
- <valDistVerLower>45</valDistVerLower>
207
- <uomDistVerLower>FL</uomDistVerLower>
208
- <codeDistVerMax>ALT</codeDistVerMax>
209
- <valDistVerMax>6000</valDistVerMax>
210
- <uomDistVerMax>FT</uomDistVerMax>
211
- <codeDistVerMnm>HEI</codeDistVerMnm>
212
- <valDistVerMnm>3000</valDistVerMnm>
213
- <uomDistVerMnm>FT</uomDistVerMnm>
214
- <Att>
215
- <codeWorkHr>H24</codeWorkHr>
216
- </Att>
217
- <codeSelAvbl>Y</codeSelAvbl>
218
- <txtRmk>airspace layer</txtRmk>
219
- </Ase>
220
- <Abd>
221
- <AbdUid>
222
- <AseUid>
223
- <codeType>D</codeType>
224
- <codeId>PA</codeId>
225
- </AseUid>
226
- </AbdUid>
227
- <Avx>
228
- <codeType>CWA</codeType>
229
- <geoLat>47.85916667N</geoLat>
230
- <geoLong>007.56000000E</geoLong>
231
- <codeDatum>WGE</codeDatum>
232
- <geoLatArc>47.90416667N</geoLatArc>
233
- <geoLongArc>007.56333333E</geoLongArc>
234
- </Avx>
235
- <Avx>
236
- <GbrUid>
237
- <txtName>FRANCE_GERMANY</txtName>
238
- </GbrUid>
239
- <codeType>FNT</codeType>
240
- <geoLat>47.94361111N</geoLat>
241
- <geoLong>007.59583333E</geoLong>
242
- <codeDatum>WGE</codeDatum>
243
- </Avx>
244
- <Avx>
245
- <codeType>GRC</codeType>
246
- <geoLat>47.85916667N</geoLat>
247
- <geoLong>007.56000000E</geoLong>
248
- <codeDatum>WGE</codeDatum>
249
- </Avx>
250
- </Abd>
251
- END
252
- end
253
- end
254
- end
255
-
256
- context "with two layers" do
257
- subject do
258
- AIXM::Factory.polygon_airspace.tap do |airspace|
259
- airspace.layers << AIXM::Factory.layer
260
- end
261
- end
262
-
263
- describe :to_xml do
264
- it "builds correct OFMX" do
265
- AIXM.ofmx!
266
- subject.to_xml.must_equal <<~"END"
267
- <!-- Airspace: [D] POLYGON AIRSPACE -->
268
- <Ase source="LF|GEN|0.0 FACTORY|0|0">
269
- <AseUid>
270
- <codeType>D</codeType>
271
- <codeId>PA</codeId>
272
- </AseUid>
273
- <txtLocalType>POLYGON</txtLocalType>
274
- <txtName>POLYGON AIRSPACE</txtName>
275
- </Ase>
276
- <Abd>
277
- <AbdUid>
278
- <AseUid>
279
- <codeType>D</codeType>
280
- <codeId>PA</codeId>
281
- </AseUid>
282
- </AbdUid>
283
- <Avx>
284
- <codeType>CWA</codeType>
285
- <geoLat>47.85916667N</geoLat>
286
- <geoLong>007.56000000E</geoLong>
287
- <codeDatum>WGE</codeDatum>
288
- <geoLatArc>47.90416667N</geoLatArc>
289
- <geoLongArc>007.56333333E</geoLongArc>
290
- </Avx>
291
- <Avx>
292
- <GbrUid>
293
- <txtName>FRANCE_GERMANY</txtName>
294
- </GbrUid>
295
- <codeType>FNT</codeType>
296
- <geoLat>47.94361111N</geoLat>
297
- <geoLong>007.59583333E</geoLong>
298
- <codeDatum>WGE</codeDatum>
299
- </Avx>
300
- <Avx>
301
- <codeType>GRC</codeType>
302
- <geoLat>47.85916667N</geoLat>
303
- <geoLong>007.56000000E</geoLong>
304
- <codeDatum>WGE</codeDatum>
305
- </Avx>
306
- </Abd>
307
- <Ase>
308
- <AseUid>
309
- <codeType>CLASS</codeType>
310
- <codeId>B794588D</codeId>
311
- </AseUid>
312
- <txtName>POLYGON AIRSPACE LAYER 1</txtName>
313
- <codeClass>C</codeClass>
314
- <codeLocInd>XXXX</codeLocInd>
315
- <codeActivity>TFC-AD</codeActivity>
316
- <codeDistVerUpper>STD</codeDistVerUpper>
317
- <valDistVerUpper>65</valDistVerUpper>
318
- <uomDistVerUpper>FL</uomDistVerUpper>
319
- <codeDistVerLower>STD</codeDistVerLower>
320
- <valDistVerLower>45</valDistVerLower>
321
- <uomDistVerLower>FL</uomDistVerLower>
322
- <codeDistVerMax>ALT</codeDistVerMax>
323
- <valDistVerMax>6000</valDistVerMax>
324
- <uomDistVerMax>FT</uomDistVerMax>
325
- <codeDistVerMnm>HEI</codeDistVerMnm>
326
- <valDistVerMnm>3000</valDistVerMnm>
327
- <uomDistVerMnm>FT</uomDistVerMnm>
328
- <Att>
329
- <codeWorkHr>H24</codeWorkHr>
330
- </Att>
331
- <codeSelAvbl>Y</codeSelAvbl>
332
- <txtRmk>airspace layer</txtRmk>
333
- </Ase>
334
- <Adg>
335
- <AdgUid>
336
- <AseUid>
337
- <codeType>CLASS</codeType>
338
- <codeId>B794588D</codeId>
339
- </AseUid>
340
- </AdgUid>
341
- <AseUidSameExtent>
342
- <codeType>D</codeType>
343
- <codeId>PA</codeId>
344
- </AseUidSameExtent>
345
- </Adg>
346
- <Ase>
347
- <AseUid>
348
- <codeType>CLASS</codeType>
349
- <codeId>64589EAF</codeId>
350
- </AseUid>
351
- <txtName>POLYGON AIRSPACE LAYER 2</txtName>
352
- <codeClass>C</codeClass>
353
- <codeLocInd>XXXX</codeLocInd>
354
- <codeActivity>TFC-AD</codeActivity>
355
- <codeDistVerUpper>STD</codeDistVerUpper>
356
- <valDistVerUpper>65</valDistVerUpper>
357
- <uomDistVerUpper>FL</uomDistVerUpper>
358
- <codeDistVerLower>STD</codeDistVerLower>
359
- <valDistVerLower>45</valDistVerLower>
360
- <uomDistVerLower>FL</uomDistVerLower>
361
- <codeDistVerMax>ALT</codeDistVerMax>
362
- <valDistVerMax>6000</valDistVerMax>
363
- <uomDistVerMax>FT</uomDistVerMax>
364
- <codeDistVerMnm>HEI</codeDistVerMnm>
365
- <valDistVerMnm>3000</valDistVerMnm>
366
- <uomDistVerMnm>FT</uomDistVerMnm>
367
- <Att>
368
- <codeWorkHr>H24</codeWorkHr>
369
- </Att>
370
- <codeSelAvbl>Y</codeSelAvbl>
371
- <txtRmk>airspace layer</txtRmk>
372
- </Ase>
373
- <Adg>
374
- <AdgUid>
375
- <AseUid>
376
- <codeType>CLASS</codeType>
377
- <codeId>64589EAF</codeId>
378
- </AseUid>
379
- </AdgUid>
380
- <AseUidSameExtent>
381
- <codeType>D</codeType>
382
- <codeId>PA</codeId>
383
- </AseUidSameExtent>
384
- </Adg>
385
- END
386
- end
387
- end
388
- end
389
-
390
- end
@@ -1,98 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::DesignatedPoint do
4
- subject do
5
- AIXM::Factory.designated_point
6
- end
7
-
8
- describe :type= do
9
- it "fails on invalid values" do
10
- [nil, :foobar, 123].wont_be_written_to subject, :type
11
- end
12
-
13
- it "looks up valid values" do
14
- subject.tap { |s| s.type = :icao }.type.must_equal :icao
15
- subject.tap { |s| s.type = :'VFR-RP' }.type.must_equal :vfr_reporting_point
16
- end
17
- end
18
-
19
- describe :airport= do
20
- it "fails on invalid values" do
21
- [:foobar, 123].wont_be_written_to subject, :airport
22
- end
23
-
24
- it "accepts valid values" do
25
- [nil, AIXM::Factory.airport].must_be_written_to subject, :airport
26
- end
27
- end
28
-
29
- describe :kind do
30
- it "must return class/type combo" do
31
- subject.kind.must_equal "DesignatedPoint:VFR-RP"
32
- end
33
- end
34
-
35
- describe :to_xml do
36
- it "builds correct complete OFMX" do
37
- AIXM.ofmx!
38
- subject.to_xml.must_equal <<~END
39
- <!-- NavigationalAid: [DesignatedPoint:VFR-RP] DDD / DESIGNATED POINT NAVAID -->
40
- <Dpn source="LF|GEN|0.0 FACTORY|0|0">
41
- <DpnUid>
42
- <codeId>DDD</codeId>
43
- <geoLat>47.85916667N</geoLat>
44
- <geoLong>007.56000000E</geoLong>
45
- </DpnUid>
46
- <AhpUidAssoc>
47
- <codeId>LFNT</codeId>
48
- </AhpUidAssoc>
49
- <codeDatum>WGE</codeDatum>
50
- <codeType>VFR-RP</codeType>
51
- <txtName>DESIGNATED POINT NAVAID</txtName>
52
- <txtRmk>designated point navaid</txtRmk>
53
- </Dpn>
54
- END
55
- end
56
-
57
- it "builds correct minimal OFMX" do
58
- AIXM.ofmx!
59
- subject.name = subject.remarks = nil
60
- subject.to_xml.must_equal <<~END
61
- <!-- NavigationalAid: [DesignatedPoint:VFR-RP] DDD -->
62
- <Dpn source="LF|GEN|0.0 FACTORY|0|0">
63
- <DpnUid>
64
- <codeId>DDD</codeId>
65
- <geoLat>47.85916667N</geoLat>
66
- <geoLong>007.56000000E</geoLong>
67
- </DpnUid>
68
- <AhpUidAssoc>
69
- <codeId>LFNT</codeId>
70
- </AhpUidAssoc>
71
- <codeDatum>WGE</codeDatum>
72
- <codeType>VFR-RP</codeType>
73
- </Dpn>
74
- END
75
- end
76
-
77
- it "builds correct complete OFMX" do
78
- AIXM.aixm!
79
- subject.to_xml.must_equal <<~END
80
- <!-- NavigationalAid: [DesignatedPoint:VFR-RP] DDD / DESIGNATED POINT NAVAID -->
81
- <Dpn>
82
- <DpnUid>
83
- <codeId>DDD</codeId>
84
- <geoLat>475133.00N</geoLat>
85
- <geoLong>0073336.00E</geoLong>
86
- </DpnUid>
87
- <AhpUidAssoc>
88
- <codeId>LFNT</codeId>
89
- </AhpUidAssoc>
90
- <codeDatum>WGE</codeDatum>
91
- <codeType>OTHER</codeType>
92
- <txtName>DESIGNATED POINT NAVAID</txtName>
93
- <txtRmk>designated point navaid</txtRmk>
94
- </Dpn>
95
- END
96
- end
97
- end
98
- end
@@ -1,92 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::DME do
4
- subject do
5
- AIXM::Factory.dme
6
- end
7
-
8
- describe :organisation= do
9
- macro :organisation
10
- end
11
-
12
- describe :channel= do
13
- it "fails on invalid values" do
14
- [nil, :foobar, 123, '0X', '127Y', '12Z'].wont_be_written_to subject, :channel
15
- end
16
- end
17
-
18
- describe :ghost_f do
19
- it "must be derived from the channel" do
20
- subject.tap { |s| s.channel = '1X' }.ghost_f.freq.must_equal 134.4
21
- subject.tap { |s| s.channel = '12Y' }.ghost_f.freq.must_equal 135.55
22
- subject.tap { |s| s.channel = '16Y' }.ghost_f.freq.must_equal 135.95
23
- subject.tap { |s| s.channel = '17X' }.ghost_f.freq.must_equal 108
24
- subject.tap { |s| s.channel = '30X' }.ghost_f.freq.must_equal 109.3
25
- subject.tap { |s| s.channel = '59Y' }.ghost_f.freq.must_equal 112.25
26
- subject.tap { |s| s.channel = '60X' }.ghost_f.freq.must_equal 133.3
27
- subject.tap { |s| s.channel = '64Y' }.ghost_f.freq.must_equal 133.75
28
- subject.tap { |s| s.channel = '69Y' }.ghost_f.freq.must_equal 134.25
29
- subject.tap { |s| s.channel = '70X' }.ghost_f.freq.must_equal 112.30
30
- subject.tap { |s| s.channel = '100X' }.ghost_f.freq.must_equal 115.3
31
- subject.tap { |s| s.channel = '126Y' }.ghost_f.freq.must_equal 117.95
32
- end
33
- end
34
-
35
- describe :kind do
36
- it "must return class/type combo" do
37
- subject.kind.must_equal "DME"
38
- end
39
- end
40
-
41
- describe :to_xml do
42
- it "builds correct complete OFMX" do
43
- AIXM.ofmx!
44
- subject.to_xml.must_equal <<~END
45
- <!-- NavigationalAid: [DME] MMM / DME NAVAID -->
46
- <Dme source="LF|GEN|0.0 FACTORY|0|0">
47
- <DmeUid>
48
- <codeId>MMM</codeId>
49
- <geoLat>47.85916667N</geoLat>
50
- <geoLong>007.56000000E</geoLong>
51
- </DmeUid>
52
- <OrgUid>
53
- <txtName>FRANCE</txtName>
54
- </OrgUid>
55
- <txtName>DME NAVAID</txtName>
56
- <codeChannel>95X</codeChannel>
57
- <valGhostFreq>114.8</valGhostFreq>
58
- <uomGhostFreq>MHZ</uomGhostFreq>
59
- <codeDatum>WGE</codeDatum>
60
- <valElev>500</valElev>
61
- <uomDistVer>FT</uomDistVer>
62
- <Dtt>
63
- <codeWorkHr>H24</codeWorkHr>
64
- </Dtt>
65
- <txtRmk>dme navaid</txtRmk>
66
- </Dme>
67
- END
68
- end
69
-
70
- it "builds correct minimal OFMX" do
71
- AIXM.ofmx!
72
- subject.name = subject.z = subject.timetable = subject.remarks = nil
73
- subject.to_xml.must_equal <<~END
74
- <!-- NavigationalAid: [DME] MMM -->
75
- <Dme source="LF|GEN|0.0 FACTORY|0|0">
76
- <DmeUid>
77
- <codeId>MMM</codeId>
78
- <geoLat>47.85916667N</geoLat>
79
- <geoLong>007.56000000E</geoLong>
80
- </DmeUid>
81
- <OrgUid>
82
- <txtName>FRANCE</txtName>
83
- </OrgUid>
84
- <codeChannel>95X</codeChannel>
85
- <valGhostFreq>114.8</valGhostFreq>
86
- <uomGhostFreq>MHZ</uomGhostFreq>
87
- <codeDatum>WGE</codeDatum>
88
- </Dme>
89
- END
90
- end
91
- end
92
- end
@@ -1,79 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::Marker do
4
- subject do
5
- AIXM::Factory.marker
6
- end
7
-
8
- describe :type= do
9
- it "fails on invalid values" do
10
- [:foobar, 123].wont_be_written_to subject, :type
11
- end
12
-
13
- it "accepts nil value" do
14
- [nil].must_be_written_to subject, :name
15
- end
16
-
17
- it "looks up valid values" do
18
- subject.tap { |s| s.type = :middle }.type.must_equal :middle
19
- subject.tap { |s| s.type = :O }.type.must_equal :outer
20
- end
21
- end
22
-
23
- describe :kind do
24
- it "must return class/type combo" do
25
- subject.kind.must_equal "Marker:O"
26
- end
27
- end
28
-
29
- describe :to_xml do
30
- it "builds correct complete OFMX" do
31
- AIXM.ofmx!
32
- subject.to_xml.must_equal <<~END
33
- <!-- NavigationalAid: [Marker:O] --- / MARKER NAVAID -->
34
- <Mkr source="LF|GEN|0.0 FACTORY|0|0">
35
- <MkrUid>
36
- <codeId>---</codeId>
37
- <geoLat>47.85916667N</geoLat>
38
- <geoLong>007.56000000E</geoLong>
39
- </MkrUid>
40
- <OrgUid>
41
- <txtName>FRANCE</txtName>
42
- </OrgUid>
43
- <codePsnIls>O</codePsnIls>
44
- <valFreq>75</valFreq>
45
- <uomFreq>MHZ</uomFreq>
46
- <txtName>MARKER NAVAID</txtName>
47
- <codeDatum>WGE</codeDatum>
48
- <valElev>500</valElev>
49
- <uomDistVer>FT</uomDistVer>
50
- <Mtt>
51
- <codeWorkHr>H24</codeWorkHr>
52
- </Mtt>
53
- <txtRmk>marker navaid</txtRmk>
54
- </Mkr>
55
- END
56
- end
57
-
58
- it "builds correct minimal OFMX" do
59
- AIXM.ofmx!
60
- subject.type = subject.name = subject.z = subject.timetable = subject.remarks = nil
61
- subject.to_xml.must_equal <<~END
62
- <!-- NavigationalAid: [Marker] --- -->
63
- <Mkr source="LF|GEN|0.0 FACTORY|0|0">
64
- <MkrUid>
65
- <codeId>---</codeId>
66
- <geoLat>47.85916667N</geoLat>
67
- <geoLong>007.56000000E</geoLong>
68
- </MkrUid>
69
- <OrgUid>
70
- <txtName>FRANCE</txtName>
71
- </OrgUid>
72
- <valFreq>75</valFreq>
73
- <uomFreq>MHZ</uomFreq>
74
- <codeDatum>WGE</codeDatum>
75
- </Mkr>
76
- END
77
- end
78
- end
79
- end