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,98 +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
-
92
- it "builds OFMX with mid" do
93
- AIXM.ofmx!
94
- AIXM.config.mid_region = 'LF'
95
- _(subject.to_xml).must_match /<DmeUid mid="b3ecd57d-529d-4941-97b8-af5ffa089051">/
96
- end
97
- end
98
- end
@@ -1,85 +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
-
79
- it "builds OFMX with mid" do
80
- AIXM.ofmx!
81
- AIXM.config.mid_region = 'LF'
82
- _(subject.to_xml).must_match /<MkrUid mid="f3463c39-b380-d31f-b42a-5dfa0b4edb12">/
83
- end
84
- end
85
- end
@@ -1,95 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::NDB do
4
- subject do
5
- AIXM::Factory.ndb
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, :type
15
- end
16
-
17
- it "looks up valid values" do
18
- _(subject.tap { |s| s.type = :en_route }.type).must_equal :en_route
19
- _(subject.tap { |s| s.type = :L }.type).must_equal :locator
20
- end
21
- end
22
-
23
- describe :f= do
24
- it "fails on invalid values" do
25
- _([nil, :foobar, 123]).wont_be_written_to subject, :f
26
- end
27
-
28
- it "accepts valid values" do
29
- _([AIXM.f(200, :khz)]).must_be_written_to subject, :f
30
- end
31
- end
32
-
33
- describe :kind do
34
- it "must return class/type combo" do
35
- _(subject.kind).must_equal "NDB:B"
36
- end
37
- end
38
-
39
- describe :to_xml do
40
- it "builds correct complete OFMX" do
41
- AIXM.ofmx!
42
- _(subject.to_xml).must_equal <<~END
43
- <!-- NavigationalAid: [NDB:B] NNN / NDB NAVAID -->
44
- <Ndb source="LF|GEN|0.0 FACTORY|0|0">
45
- <NdbUid>
46
- <codeId>NNN</codeId>
47
- <geoLat>47.85916667N</geoLat>
48
- <geoLong>007.56000000E</geoLong>
49
- </NdbUid>
50
- <OrgUid>
51
- <txtName>FRANCE</txtName>
52
- </OrgUid>
53
- <txtName>NDB NAVAID</txtName>
54
- <valFreq>555</valFreq>
55
- <uomFreq>KHZ</uomFreq>
56
- <codeClass>B</codeClass>
57
- <codeDatum>WGE</codeDatum>
58
- <valElev>500</valElev>
59
- <uomDistVer>FT</uomDistVer>
60
- <Ntt>
61
- <codeWorkHr>H24</codeWorkHr>
62
- </Ntt>
63
- <txtRmk>ndb navaid</txtRmk>
64
- </Ndb>
65
- END
66
- end
67
-
68
- it "builds correct minimal OFMX" do
69
- AIXM.ofmx!
70
- subject.name = subject.type = subject.z = subject.timetable = subject.remarks = nil
71
- _(subject.to_xml).must_equal <<~END
72
- <!-- NavigationalAid: [NDB] NNN -->
73
- <Ndb source="LF|GEN|0.0 FACTORY|0|0">
74
- <NdbUid>
75
- <codeId>NNN</codeId>
76
- <geoLat>47.85916667N</geoLat>
77
- <geoLong>007.56000000E</geoLong>
78
- </NdbUid>
79
- <OrgUid>
80
- <txtName>FRANCE</txtName>
81
- </OrgUid>
82
- <valFreq>555</valFreq>
83
- <uomFreq>KHZ</uomFreq>
84
- <codeDatum>WGE</codeDatum>
85
- </Ndb>
86
- END
87
- end
88
-
89
- it "builds OFMX with mid" do
90
- AIXM.ofmx!
91
- AIXM.config.mid_region = 'LF'
92
- _(subject.to_xml).must_match /<NdbUid mid="be82074f-4044-8044-5f64-d6080ce3d0e4">/
93
- end
94
- end
95
- end
@@ -1,94 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::TACAN do
4
- subject do
5
- AIXM::Factory.tacan
6
- end
7
-
8
- describe :channel= do
9
- it "fails on invalid values" do
10
- _([nil, :foobar, 123, '0X', '127Y', '12Z']).wont_be_written_to subject, :channel
11
- end
12
- end
13
-
14
- describe :ghost_f do
15
- it "must be derived from the channel" do
16
- _(subject.tap { |s| s.channel = '1X' }.ghost_f.freq).must_equal 134.4
17
- _(subject.tap { |s| s.channel = '12Y' }.ghost_f.freq).must_equal 135.55
18
- _(subject.tap { |s| s.channel = '16Y' }.ghost_f.freq).must_equal 135.95
19
- _(subject.tap { |s| s.channel = '17X' }.ghost_f.freq).must_equal 108
20
- _(subject.tap { |s| s.channel = '30X' }.ghost_f.freq).must_equal 109.3
21
- _(subject.tap { |s| s.channel = '59Y' }.ghost_f.freq).must_equal 112.25
22
- _(subject.tap { |s| s.channel = '60X' }.ghost_f.freq).must_equal 133.3
23
- _(subject.tap { |s| s.channel = '64Y' }.ghost_f.freq).must_equal 133.75
24
- _(subject.tap { |s| s.channel = '69Y' }.ghost_f.freq).must_equal 134.25
25
- _(subject.tap { |s| s.channel = '70X' }.ghost_f.freq).must_equal 112.30
26
- _(subject.tap { |s| s.channel = '100X' }.ghost_f.freq).must_equal 115.3
27
- _(subject.tap { |s| s.channel = '126Y' }.ghost_f.freq).must_equal 117.95
28
- end
29
- end
30
-
31
- describe :kind do
32
- it "must return class/type combo" do
33
- _(subject.kind).must_equal "TACAN"
34
- end
35
- end
36
-
37
- describe :to_xml do
38
- it "builds correct complete OFMX" do
39
- AIXM.ofmx!
40
- _(subject.to_xml).must_equal <<~END
41
- <!-- NavigationalAid: [TACAN] TTT / TACAN NAVAID -->
42
- <Tcn source="LF|GEN|0.0 FACTORY|0|0">
43
- <TcnUid>
44
- <codeId>TTT</codeId>
45
- <geoLat>47.85916667N</geoLat>
46
- <geoLong>007.56000000E</geoLong>
47
- </TcnUid>
48
- <OrgUid>
49
- <txtName>FRANCE</txtName>
50
- </OrgUid>
51
- <txtName>TACAN NAVAID</txtName>
52
- <codeChannel>29X</codeChannel>
53
- <valGhostFreq>109.2</valGhostFreq>
54
- <uomGhostFreq>MHZ</uomGhostFreq>
55
- <codeDatum>WGE</codeDatum>
56
- <valElev>500</valElev>
57
- <uomDistVer>FT</uomDistVer>
58
- <Ttt>
59
- <codeWorkHr>H24</codeWorkHr>
60
- </Ttt>
61
- <txtRmk>tacan navaid</txtRmk>
62
- </Tcn>
63
- END
64
- end
65
-
66
- it "builds correct minimal OFMX" do
67
- AIXM.ofmx!
68
- subject.name = subject.z = subject.timetable = subject.remarks = nil
69
- _(subject.to_xml).must_equal <<~END
70
- <!-- NavigationalAid: [TACAN] TTT -->
71
- <Tcn source="LF|GEN|0.0 FACTORY|0|0">
72
- <TcnUid>
73
- <codeId>TTT</codeId>
74
- <geoLat>47.85916667N</geoLat>
75
- <geoLong>007.56000000E</geoLong>
76
- </TcnUid>
77
- <OrgUid>
78
- <txtName>FRANCE</txtName>
79
- </OrgUid>
80
- <codeChannel>29X</codeChannel>
81
- <valGhostFreq>109.2</valGhostFreq>
82
- <uomGhostFreq>MHZ</uomGhostFreq>
83
- <codeDatum>WGE</codeDatum>
84
- </Tcn>
85
- END
86
- end
87
-
88
- it "builds OFMX with mid" do
89
- AIXM.ofmx!
90
- AIXM.config.mid_region = 'LF'
91
- _(subject.to_xml).must_match /<TcnUid mid="8776071f-114a-4996-84ef-2d7848c503f5">/
92
- end
93
- end
94
- end
@@ -1,251 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::VOR do
4
- context "VOR" do
5
- subject do
6
- AIXM::Factory.vor
7
- end
8
-
9
- describe :type= do
10
- it "fails on invalid values" do
11
- _([nil, :foobar, 123]).wont_be_written_to subject, :type
12
- end
13
-
14
- it "looks up valid values" do
15
- _(subject.tap { |s| s.type = :conventional }.type).must_equal :conventional
16
- _(subject.tap { |s| s.type = :DVOR }.type).must_equal :doppler
17
- end
18
- end
19
-
20
- describe :f= do
21
- it "fails on invalid values" do
22
- _([nil, :foobar, 123]).wont_be_written_to subject, :f
23
- end
24
-
25
- it "accepts valid values" do
26
- _([AIXM.f(110, :mhz)]).must_be_written_to subject, :f
27
- end
28
- end
29
-
30
- describe :north= do
31
- it "fails on invalid values" do
32
- _([nil, :foobar, 123]).wont_be_written_to subject, :north
33
- end
34
-
35
- it "looks up valid values" do
36
- _(subject.tap { |s| s.north = :magnetic }.north).must_equal :magnetic
37
- _(subject.tap { |s| s.north = :TRUE }.north).must_equal :geographic
38
- end
39
- end
40
-
41
- describe :kind do
42
- it "must return class/type combo" do
43
- _(subject.kind).must_equal "VOR:VOR"
44
- end
45
- end
46
-
47
- describe :to_xml do
48
- it "builds correct complete OFMX" do
49
- AIXM.ofmx!
50
- _(subject.to_xml).must_equal <<~END
51
- <!-- NavigationalAid: [VOR:VOR] VVV / VOR NAVAID -->
52
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
53
- <VorUid>
54
- <codeId>VVV</codeId>
55
- <geoLat>47.85916667N</geoLat>
56
- <geoLong>007.56000000E</geoLong>
57
- </VorUid>
58
- <OrgUid>
59
- <txtName>FRANCE</txtName>
60
- </OrgUid>
61
- <txtName>VOR NAVAID</txtName>
62
- <codeType>VOR</codeType>
63
- <valFreq>111</valFreq>
64
- <uomFreq>MHZ</uomFreq>
65
- <codeTypeNorth>TRUE</codeTypeNorth>
66
- <codeDatum>WGE</codeDatum>
67
- <valElev>500</valElev>
68
- <uomDistVer>FT</uomDistVer>
69
- <Vtt>
70
- <codeWorkHr>H24</codeWorkHr>
71
- </Vtt>
72
- <txtRmk>vor navaid</txtRmk>
73
- </Vor>
74
- END
75
- end
76
-
77
- it "builds correct minimal OFMX" do
78
- AIXM.ofmx!
79
- subject.name = subject.z = subject.timetable = subject.remarks = nil
80
- _(subject.to_xml).must_equal <<~END
81
- <!-- NavigationalAid: [VOR:VOR] VVV -->
82
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
83
- <VorUid>
84
- <codeId>VVV</codeId>
85
- <geoLat>47.85916667N</geoLat>
86
- <geoLong>007.56000000E</geoLong>
87
- </VorUid>
88
- <OrgUid>
89
- <txtName>FRANCE</txtName>
90
- </OrgUid>
91
- <codeType>VOR</codeType>
92
- <valFreq>111</valFreq>
93
- <uomFreq>MHZ</uomFreq>
94
- <codeTypeNorth>TRUE</codeTypeNorth>
95
- <codeDatum>WGE</codeDatum>
96
- </Vor>
97
- END
98
- end
99
-
100
- it "builds OFMX with mid" do
101
- AIXM.ofmx!
102
- AIXM.config.mid_region = 'LF'
103
- _(subject.to_xml).must_match /<VorUid mid="627bea52-cca8-f407-88be-90a85a333741">/
104
- end
105
- end
106
- end
107
-
108
- context "VOR/DME" do
109
- subject do
110
- AIXM::Factory.vor.tap do |vor|
111
- vor.name = "VOR/DME NAVAID"
112
- vor.remarks = "vor/dme navaid"
113
- vor.associate_dme(channel: '84X')
114
- end
115
- end
116
-
117
- describe :kind do
118
- it "must return class/type combo" do
119
- _(subject.kind).must_equal "VOR:VOR"
120
- end
121
- end
122
-
123
- describe :to_xml do
124
- it "builds correct OFMX" do
125
- AIXM.ofmx!
126
- _(subject.to_xml).must_equal <<~END
127
- <!-- NavigationalAid: [VOR:VOR] VVV / VOR/DME NAVAID -->
128
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
129
- <VorUid>
130
- <codeId>VVV</codeId>
131
- <geoLat>47.85916667N</geoLat>
132
- <geoLong>007.56000000E</geoLong>
133
- </VorUid>
134
- <OrgUid>
135
- <txtName>FRANCE</txtName>
136
- </OrgUid>
137
- <txtName>VOR/DME NAVAID</txtName>
138
- <codeType>VOR</codeType>
139
- <valFreq>111</valFreq>
140
- <uomFreq>MHZ</uomFreq>
141
- <codeTypeNorth>TRUE</codeTypeNorth>
142
- <codeDatum>WGE</codeDatum>
143
- <valElev>500</valElev>
144
- <uomDistVer>FT</uomDistVer>
145
- <Vtt>
146
- <codeWorkHr>H24</codeWorkHr>
147
- </Vtt>
148
- <txtRmk>vor/dme navaid</txtRmk>
149
- </Vor>
150
- <!-- NavigationalAid: [DME] VVV / VOR/DME NAVAID -->
151
- <Dme>
152
- <DmeUid>
153
- <codeId>VVV</codeId>
154
- <geoLat>47.85916667N</geoLat>
155
- <geoLong>007.56000000E</geoLong>
156
- </DmeUid>
157
- <OrgUid>
158
- <txtName>FRANCE</txtName>
159
- </OrgUid>
160
- <VorUid>
161
- <codeId>VVV</codeId>
162
- <geoLat>47.85916667N</geoLat>
163
- <geoLong>007.56000000E</geoLong>
164
- </VorUid>
165
- <txtName>VOR/DME NAVAID</txtName>
166
- <codeChannel>84X</codeChannel>
167
- <codeDatum>WGE</codeDatum>
168
- <valElev>500</valElev>
169
- <uomDistVer>FT</uomDistVer>
170
- <Dtt>
171
- <codeWorkHr>H24</codeWorkHr>
172
- </Dtt>
173
- <txtRmk>vor/dme navaid</txtRmk>
174
- </Dme>
175
- END
176
- end
177
- end
178
- end
179
-
180
- context "complete VORTAC" do
181
- subject do
182
- AIXM::Factory.vor.tap do |vor|
183
- vor.name = "VORTAC NAVAID"
184
- vor.remarks = "vortac navaid"
185
- vor.associate_tacan(channel: '54X')
186
- end
187
- end
188
-
189
- describe :kind do
190
- it "must return class/type combo" do
191
- _(subject.kind).must_equal "VOR:VOR"
192
- end
193
- end
194
-
195
- describe :to_xml do
196
- it "builds correct OFMX" do
197
- AIXM.ofmx!
198
- _(subject.to_xml).must_equal <<~END
199
- <!-- NavigationalAid: [VOR:VOR] VVV / VORTAC NAVAID -->
200
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
201
- <VorUid>
202
- <codeId>VVV</codeId>
203
- <geoLat>47.85916667N</geoLat>
204
- <geoLong>007.56000000E</geoLong>
205
- </VorUid>
206
- <OrgUid>
207
- <txtName>FRANCE</txtName>
208
- </OrgUid>
209
- <txtName>VORTAC NAVAID</txtName>
210
- <codeType>VOR</codeType>
211
- <valFreq>111</valFreq>
212
- <uomFreq>MHZ</uomFreq>
213
- <codeTypeNorth>TRUE</codeTypeNorth>
214
- <codeDatum>WGE</codeDatum>
215
- <valElev>500</valElev>
216
- <uomDistVer>FT</uomDistVer>
217
- <Vtt>
218
- <codeWorkHr>H24</codeWorkHr>
219
- </Vtt>
220
- <txtRmk>vortac navaid</txtRmk>
221
- </Vor>
222
- <!-- NavigationalAid: [TACAN] VVV / VORTAC NAVAID -->
223
- <Tcn>
224
- <TcnUid>
225
- <codeId>VVV</codeId>
226
- <geoLat>47.85916667N</geoLat>
227
- <geoLong>007.56000000E</geoLong>
228
- </TcnUid>
229
- <OrgUid>
230
- <txtName>FRANCE</txtName>
231
- </OrgUid>
232
- <VorUid>
233
- <codeId>VVV</codeId>
234
- <geoLat>47.85916667N</geoLat>
235
- <geoLong>007.56000000E</geoLong>
236
- </VorUid>
237
- <txtName>VORTAC NAVAID</txtName>
238
- <codeChannel>54X</codeChannel>
239
- <codeDatum>WGE</codeDatum>
240
- <valElev>500</valElev>
241
- <uomDistVer>FT</uomDistVer>
242
- <Ttt>
243
- <codeWorkHr>H24</codeWorkHr>
244
- </Ttt>
245
- <txtRmk>vortac navaid</txtRmk>
246
- </Tcn>
247
- END
248
- end
249
- end
250
- end
251
- end