aixm 0.3.8 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +33 -3
- data/README.md +166 -56
- data/exe/ckmid +14 -0
- data/exe/mkmid +14 -0
- data/lib/aixm.rb +16 -6
- data/lib/aixm/association.rb +369 -0
- data/lib/aixm/classes.rb +43 -0
- data/lib/aixm/component/fato.rb +45 -53
- data/lib/aixm/component/frequency.rb +11 -12
- data/lib/aixm/component/geometry.rb +36 -38
- data/lib/aixm/component/geometry/arc.rb +2 -2
- data/lib/aixm/component/geometry/border.rb +6 -3
- data/lib/aixm/component/geometry/circle.rb +8 -2
- data/lib/aixm/component/geometry/point.rb +8 -2
- data/lib/aixm/component/helipad.rb +30 -38
- data/lib/aixm/component/layer.rb +28 -19
- data/lib/aixm/component/lighting.rb +12 -13
- data/lib/aixm/component/runway.rb +44 -48
- data/lib/aixm/{feature → component}/service.rb +37 -36
- data/lib/aixm/component/surface.rb +3 -3
- data/lib/aixm/component/timetable.rb +2 -2
- data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
- data/lib/aixm/config.rb +2 -1
- data/lib/aixm/document.rb +27 -50
- data/lib/aixm/executables.rb +85 -0
- data/lib/aixm/feature.rb +13 -3
- data/lib/aixm/feature/address.rb +12 -13
- data/lib/aixm/feature/airport.rb +103 -128
- data/lib/aixm/feature/airspace.rb +44 -17
- data/lib/aixm/feature/navigational_aid.rb +7 -9
- data/lib/aixm/feature/navigational_aid/designated_point.rb +13 -15
- data/lib/aixm/feature/navigational_aid/dme.rb +11 -12
- data/lib/aixm/feature/navigational_aid/marker.rb +7 -3
- data/lib/aixm/feature/navigational_aid/ndb.rb +7 -3
- data/lib/aixm/feature/navigational_aid/tacan.rb +7 -3
- data/lib/aixm/feature/navigational_aid/vor.rb +23 -15
- data/lib/aixm/feature/obstacle.rb +29 -43
- data/lib/aixm/feature/obstacle_group.rb +37 -34
- data/lib/aixm/feature/organisation.rb +21 -5
- data/lib/aixm/feature/unit.rb +36 -46
- data/lib/aixm/memoize.rb +89 -0
- data/lib/aixm/object.rb +9 -0
- data/lib/aixm/payload_hash.rb +114 -0
- data/lib/aixm/refinements.rb +29 -76
- data/lib/aixm/shortcuts.rb +5 -42
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/xy.rb +1 -1
- data/schemas/ofmx/0/OFMX-Features.xsd +152 -20
- data/schemas/ofmx/0/OFMX-Snapshot.xsd +0 -5
- metadata +107 -156
- metadata.gz.sig +2 -0
- data/.github/workflows/test.yml +0 -26
- data/.gitignore +0 -6
- data/.ruby-version +0 -1
- data/.yardopts +0 -3
- data/Guardfile +0 -8
- data/aixm.gemspec +0 -35
- data/gems.rb +0 -3
- data/lib/aixm/component.rb +0 -6
- data/rakefile.rb +0 -36
- data/spec/factory.rb +0 -559
- data/spec/lib/aixm/a_spec.rb +0 -203
- data/spec/lib/aixm/component/fato_spec.rb +0 -267
- data/spec/lib/aixm/component/frequency_spec.rb +0 -74
- data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -73
- data/spec/lib/aixm/component/geometry/border_spec.rb +0 -38
- data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -68
- data/spec/lib/aixm/component/geometry/point_spec.rb +0 -37
- data/spec/lib/aixm/component/geometry_spec.rb +0 -316
- data/spec/lib/aixm/component/helipad_spec.rb +0 -193
- data/spec/lib/aixm/component/layer_spec.rb +0 -135
- data/spec/lib/aixm/component/lighting_spec.rb +0 -94
- data/spec/lib/aixm/component/runway_spec.rb +0 -479
- data/spec/lib/aixm/component/surface_spec.rb +0 -124
- data/spec/lib/aixm/component/timetable_spec.rb +0 -47
- data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -94
- data/spec/lib/aixm/config_spec.rb +0 -41
- data/spec/lib/aixm/d_spec.rb +0 -150
- data/spec/lib/aixm/document_spec.rb +0 -1884
- data/spec/lib/aixm/errors_spec.rb +0 -14
- data/spec/lib/aixm/f_spec.rb +0 -85
- data/spec/lib/aixm/feature/address_spec.rb +0 -60
- data/spec/lib/aixm/feature/airport_spec.rb +0 -776
- data/spec/lib/aixm/feature/airspace_spec.rb +0 -394
- data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -103
- data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -98
- data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -85
- data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -95
- data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -94
- data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -251
- data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
- data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -330
- data/spec/lib/aixm/feature/obstacle_spec.rb +0 -284
- data/spec/lib/aixm/feature/organisation_spec.rb +0 -83
- data/spec/lib/aixm/feature/service_spec.rb +0 -59
- data/spec/lib/aixm/feature/unit_spec.rb +0 -238
- data/spec/lib/aixm/feature_spec.rb +0 -38
- data/spec/lib/aixm/p_spec.rb +0 -189
- data/spec/lib/aixm/refinements_spec.rb +0 -430
- data/spec/lib/aixm/version_spec.rb +0 -7
- data/spec/lib/aixm/w_spec.rb +0 -150
- data/spec/lib/aixm/xy_spec.rb +0 -180
- data/spec/lib/aixm/z_spec.rb +0 -94
- data/spec/macros/marking.rb +0 -12
- data/spec/macros/organisation.rb +0 -11
- data/spec/macros/remarks.rb +0 -12
- data/spec/macros/timetable.rb +0 -11
- data/spec/macros/xy.rb +0 -11
- data/spec/macros/z_qnh.rb +0 -11
- data/spec/sounds/failure.mp3 +0 -0
- data/spec/sounds/success.mp3 +0 -0
- data/spec/spec_helper.rb +0 -62
data/spec/lib/aixm/a_spec.rb
DELETED
@@ -1,203 +0,0 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::A do
|
4
|
-
let :subject_2 do
|
5
|
-
AIXM.a('0')
|
6
|
-
end
|
7
|
-
|
8
|
-
let :subject_3 do
|
9
|
-
AIXM.a(0)
|
10
|
-
end
|
11
|
-
|
12
|
-
describe :initialize do
|
13
|
-
it "fails on invalid values" do
|
14
|
-
_{ AIXM.a('foobar') }.must_raise ArgumentError
|
15
|
-
end
|
16
|
-
|
17
|
-
it "parses String as angle with precision=2" do
|
18
|
-
AIXM.a('34L').tap do |h|
|
19
|
-
_(h.deg).must_equal 340
|
20
|
-
_(h.precision).must_equal 2
|
21
|
-
_(h.suffix).must_equal :L
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
it "parses Numeric as angle with precision=3" do
|
26
|
-
AIXM.a(12).tap do |h|
|
27
|
-
_(h.deg).must_equal 12
|
28
|
-
_(h.precision).must_equal 3
|
29
|
-
_(h.suffix).must_be :nil?
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe :to_s do
|
35
|
-
context "precision=2" do
|
36
|
-
it "rounds and zero-pad deg to length 2 and concats suffix" do
|
37
|
-
_(AIXM.a('05').to_s).must_equal '05'
|
38
|
-
_(AIXM.a('05').tap { |a| a.suffix = :L }.to_s).must_equal '05L'
|
39
|
-
_(AIXM.a('05').tap { |a| a.deg = 0 }.to_s).must_equal '36'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "precition=3" do
|
44
|
-
it "rounds and zero-pad deg to length 3" do
|
45
|
-
_(AIXM.a(5).to_s).must_equal '005'
|
46
|
-
_(AIXM.a(5).tap { |a| a.deg = 0 }.to_s).must_equal '000'
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe :deg= do
|
52
|
-
it "fails on invalid values" do
|
53
|
-
_([:foobar, '1', -1, 361]).wont_be_written_to subject_2, :deg
|
54
|
-
_([:foobar, '1', -1, 361]).wont_be_written_to subject_3, :deg
|
55
|
-
end
|
56
|
-
|
57
|
-
context "precision=2" do
|
58
|
-
it "rounds to 10 degree steps" do
|
59
|
-
_(subject_2.tap { |s| s.deg = 0 }.deg).must_equal 0
|
60
|
-
_(subject_2.tap { |s| s.deg = 5 }.deg).must_equal 10
|
61
|
-
_(subject_2.tap { |s| s.deg = 154 }.deg).must_equal 150
|
62
|
-
_(subject_2.tap { |s| s.deg = 359 }.deg).must_equal 0
|
63
|
-
_(subject_2.tap { |s| s.deg = 360 }.deg).must_equal 0
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context "precision=3" do
|
68
|
-
it "accepts 1 degree steps" do
|
69
|
-
_(subject_3.tap { |s| s.deg = 0 }.deg).must_equal 0
|
70
|
-
_(subject_3.tap { |s| s.deg = 5 }.deg).must_equal 5
|
71
|
-
_(subject_3.tap { |s| s.deg = 154 }.deg).must_equal 154
|
72
|
-
_(subject_3.tap { |s| s.deg = 359 }.deg).must_equal 359
|
73
|
-
_(subject_3.tap { |s| s.deg = 360 }.deg).must_equal 0
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe :suffix= do
|
79
|
-
context "precision=2" do
|
80
|
-
it "fails on invalid values" do
|
81
|
-
_([123, 'r']).wont_be_written_to subject_2, :suffix
|
82
|
-
end
|
83
|
-
|
84
|
-
it "accepts nil value" do
|
85
|
-
_([nil]).must_be_written_to subject_2, :suffix
|
86
|
-
end
|
87
|
-
|
88
|
-
it "symbolizes valid values" do
|
89
|
-
_(subject_2.tap { |s| s.suffix = 'Z' }.suffix).must_equal :Z
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
context "precision=3" do
|
94
|
-
it "always fails" do
|
95
|
-
_{ subject_3.tap { |s| s.suffix = 'Z' } }.must_raise RuntimeError
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
describe :invert do
|
101
|
-
it "must calculate inverse deg correctly" do
|
102
|
-
{ 0 => 180, 90 => 270, 179 => 359, 180 => 0, 270 => 90, 359 => 179, 360 => 180 }.each do |from, to|
|
103
|
-
_(AIXM.a(from).invert.deg).must_equal to
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
it "must invert left/right suffix" do
|
108
|
-
_(AIXM.a('34L').invert.suffix).must_equal :R
|
109
|
-
end
|
110
|
-
|
111
|
-
it "must leave other suffixes untouched" do
|
112
|
-
_(AIXM.a('35X').invert.suffix).must_equal :X
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
describe :inverse_of? do
|
117
|
-
it "must return true for inverse pairs" do
|
118
|
-
_(AIXM.a('34L').inverse_of?(AIXM.a('16R'))).must_equal true
|
119
|
-
end
|
120
|
-
|
121
|
-
it "must return false for non-inverse pairs" do
|
122
|
-
_(AIXM.a('34L').inverse_of?(AIXM.a('12L'))).must_equal false
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
describe :+ do
|
127
|
-
context "precision=2" do
|
128
|
-
it "adds degrees as Integer" do
|
129
|
-
_((subject_2 + 14)).must_equal AIXM.a('01')
|
130
|
-
_((subject_2 + 16)).must_equal AIXM.a('02')
|
131
|
-
_((subject_2 + 370)).must_equal AIXM.a('01')
|
132
|
-
_((AIXM.a('05L') + 20)).must_equal AIXM.a('07L')
|
133
|
-
end
|
134
|
-
|
135
|
-
it "adds another angle" do
|
136
|
-
_((AIXM.a('10') + AIXM.a('08'))).must_equal AIXM.a('18')
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
context "precision=3" do
|
141
|
-
it "adds degrees as Integer" do
|
142
|
-
_((subject_3 + 15)).must_equal AIXM.a(15)
|
143
|
-
_((subject_3 + 370)).must_equal AIXM.a(10)
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
describe :- do
|
149
|
-
context "precision=2" do
|
150
|
-
it "subtracts degrees as Integer" do
|
151
|
-
_((subject_2 - 14)).must_equal AIXM.a('35')
|
152
|
-
_((subject_2 - 16)).must_equal AIXM.a('34')
|
153
|
-
_((AIXM.a('05') - 20)).must_equal AIXM.a('03')
|
154
|
-
_((AIXM.a('05L') - 20)).must_equal AIXM.a('03L')
|
155
|
-
end
|
156
|
-
|
157
|
-
it "subtracts another angle" do
|
158
|
-
_((AIXM.a('10') - AIXM.a('08'))).must_equal AIXM.a('02')
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
context "precision=3" do
|
163
|
-
it "subtracts degrees as Integer" do
|
164
|
-
_((subject_3 - 15)).must_equal AIXM.a(345)
|
165
|
-
_((AIXM.a(55) - 20)).must_equal AIXM.a(35)
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
describe :== do
|
171
|
-
it "recognizes angles with identical deg and suffix as equal" do
|
172
|
-
_(AIXM.a('34L')).must_equal AIXM.a('34L')
|
173
|
-
end
|
174
|
-
|
175
|
-
it "recognizes angles with different deg or suffix as unequal" do
|
176
|
-
_(AIXM.a('34L')).wont_equal AIXM.a('35L')
|
177
|
-
_(AIXM.a('34L')).wont_equal AIXM.a('34R')
|
178
|
-
end
|
179
|
-
|
180
|
-
it "recognizes angles with different precision as unequal" do
|
181
|
-
_(AIXM.a('34')).wont_equal AIXM.a(340)
|
182
|
-
end
|
183
|
-
|
184
|
-
it "recognizes objects of different class as unequal" do
|
185
|
-
_(subject_2).wont_equal :oggy
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
describe :hash do
|
190
|
-
it "returns an integer" do
|
191
|
-
_(subject_2.hash).must_be_instance_of Integer
|
192
|
-
end
|
193
|
-
|
194
|
-
it "returns different hashes for different precisions" do
|
195
|
-
_(subject_2.hash).wont_equal subject_3.hash
|
196
|
-
end
|
197
|
-
|
198
|
-
it "allows for the use of instances as hash keys" do
|
199
|
-
dupe = subject_2.dup
|
200
|
-
_({ subject_2 => true }[dupe]).must_equal true
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|
@@ -1,267 +0,0 @@
|
|
1
|
-
require_relative '../../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::Component::FATO do
|
4
|
-
subject do
|
5
|
-
AIXM::Factory.airport.fatos.first
|
6
|
-
end
|
7
|
-
|
8
|
-
describe :name= do
|
9
|
-
it "fails on invalid values" do
|
10
|
-
_([nil, :foobar, 123]).wont_be_written_to subject, :name
|
11
|
-
end
|
12
|
-
|
13
|
-
it "upcases and transcodes valid values" do
|
14
|
-
_(subject.tap { |s| s.name = 'h1' }.name).must_equal 'H1'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe :length= do
|
19
|
-
it "fails on invalid values" do
|
20
|
-
_([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :length
|
21
|
-
end
|
22
|
-
|
23
|
-
it "accepts nil value" do
|
24
|
-
_([nil]).must_be_written_to subject, :length
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe :width= do
|
29
|
-
it "fails on invalid values" do
|
30
|
-
_([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :width
|
31
|
-
end
|
32
|
-
|
33
|
-
it "accepts nil value" do
|
34
|
-
_([nil]).must_be_written_to subject, :width
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe :marking= do
|
39
|
-
macro :marking
|
40
|
-
end
|
41
|
-
|
42
|
-
describe :profile= do
|
43
|
-
it "accepts nil value" do
|
44
|
-
_([nil]).must_be_written_to subject, :profile
|
45
|
-
end
|
46
|
-
|
47
|
-
it "stringifies valid values" do
|
48
|
-
_(subject.tap { |s| s.profile = 'foobar' }.profile).must_equal 'foobar'
|
49
|
-
_(subject.tap { |s| s.profile = 123 }.profile).must_equal '123'
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe :status= do
|
54
|
-
it "fails on invalid values" do
|
55
|
-
_([:foobar, 123]).wont_be_written_to subject, :status
|
56
|
-
end
|
57
|
-
|
58
|
-
it "accepts nil value" do
|
59
|
-
_([nil]).must_be_written_to subject, :status
|
60
|
-
end
|
61
|
-
|
62
|
-
it "looks up valid values" do
|
63
|
-
_(subject.tap { |s| s.status = :closed }.status).must_equal :closed
|
64
|
-
_(subject.tap { |s| s.status = :SPOWER }.status).must_equal :secondary_power
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe :remarks= do
|
69
|
-
macro :remarks
|
70
|
-
end
|
71
|
-
|
72
|
-
describe :xml= do
|
73
|
-
it "builds correct complete OFMX" do
|
74
|
-
AIXM.ofmx!
|
75
|
-
_(subject.to_xml).must_equal <<~END
|
76
|
-
<Fto>
|
77
|
-
<FtoUid>
|
78
|
-
<AhpUid>
|
79
|
-
<codeId>LFNT</codeId>
|
80
|
-
</AhpUid>
|
81
|
-
<txtDesig>H1</txtDesig>
|
82
|
-
</FtoUid>
|
83
|
-
<valLen>35</valLen>
|
84
|
-
<valWid>35</valWid>
|
85
|
-
<uomDim>M</uomDim>
|
86
|
-
<codeComposition>CONC</codeComposition>
|
87
|
-
<codePreparation>PAVED</codePreparation>
|
88
|
-
<codeCondSfc>FAIR</codeCondSfc>
|
89
|
-
<valPcnClass>30</valPcnClass>
|
90
|
-
<codePcnPavementType>F</codePcnPavementType>
|
91
|
-
<codePcnPavementSubgrade>A</codePcnPavementSubgrade>
|
92
|
-
<codePcnMaxTirePressure>W</codePcnMaxTirePressure>
|
93
|
-
<codePcnEvalMethod>U</codePcnEvalMethod>
|
94
|
-
<txtPcnNote>Cracks near the center</txtPcnNote>
|
95
|
-
<valSiwlWeight>1500</valSiwlWeight>
|
96
|
-
<uomSiwlWeight>KG</uomSiwlWeight>
|
97
|
-
<valSiwlTirePressure>0.5</valSiwlTirePressure>
|
98
|
-
<uomSiwlTirePressure>MPA</uomSiwlTirePressure>
|
99
|
-
<valAuwWeight>8</valAuwWeight>
|
100
|
-
<uomAuwWeight>T</uomAuwWeight>
|
101
|
-
<txtProfile>Northwest from RWY 12/30</txtProfile>
|
102
|
-
<txtMarking>Dashed white lines</txtMarking>
|
103
|
-
<codeSts>OTHER</codeSts>
|
104
|
-
<txtRmk>Authorizaton by AD operator required</txtRmk>
|
105
|
-
</Fto>
|
106
|
-
<Fdn>
|
107
|
-
<FdnUid>
|
108
|
-
<FtoUid>
|
109
|
-
<AhpUid>
|
110
|
-
<codeId>LFNT</codeId>
|
111
|
-
</AhpUid>
|
112
|
-
<txtDesig>H1</txtDesig>
|
113
|
-
</FtoUid>
|
114
|
-
<txtDesig>35</txtDesig>
|
115
|
-
</FdnUid>
|
116
|
-
<valTrueBrg>355</valTrueBrg>
|
117
|
-
<valMagBrg>354</valMagBrg>
|
118
|
-
<txtRmk>Avoid flight over residental area</txtRmk>
|
119
|
-
</Fdn>
|
120
|
-
<Fls>
|
121
|
-
<FlsUid>
|
122
|
-
<FdnUid>
|
123
|
-
<FtoUid>
|
124
|
-
<AhpUid>
|
125
|
-
<codeId>LFNT</codeId>
|
126
|
-
</AhpUid>
|
127
|
-
<txtDesig>H1</txtDesig>
|
128
|
-
</FtoUid>
|
129
|
-
<txtDesig>35</txtDesig>
|
130
|
-
</FdnUid>
|
131
|
-
<codePsn>AIM</codePsn>
|
132
|
-
</FlsUid>
|
133
|
-
<txtDescr>omnidirectional</txtDescr>
|
134
|
-
<codeIntst>LIM</codeIntst>
|
135
|
-
<codeColour>GRN</codeColour>
|
136
|
-
<txtRmk>lighting remarks</txtRmk>
|
137
|
-
</Fls>
|
138
|
-
END
|
139
|
-
end
|
140
|
-
|
141
|
-
it "builds correct minimal OFMX" do
|
142
|
-
AIXM.ofmx!
|
143
|
-
%i(length width profile marking status remarks).each { |a| subject.send(:"#{a}=", nil) }
|
144
|
-
%i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
|
145
|
-
subject.directions['35'].instance_eval { @lightings.clear }
|
146
|
-
_(subject.to_xml).must_equal <<~END
|
147
|
-
<Fto>
|
148
|
-
<FtoUid>
|
149
|
-
<AhpUid>
|
150
|
-
<codeId>LFNT</codeId>
|
151
|
-
</AhpUid>
|
152
|
-
<txtDesig>H1</txtDesig>
|
153
|
-
</FtoUid>
|
154
|
-
</Fto>
|
155
|
-
<Fdn>
|
156
|
-
<FdnUid>
|
157
|
-
<FtoUid>
|
158
|
-
<AhpUid>
|
159
|
-
<codeId>LFNT</codeId>
|
160
|
-
</AhpUid>
|
161
|
-
<txtDesig>H1</txtDesig>
|
162
|
-
</FtoUid>
|
163
|
-
<txtDesig>35</txtDesig>
|
164
|
-
</FdnUid>
|
165
|
-
<valTrueBrg>355</valTrueBrg>
|
166
|
-
<valMagBrg>354</valMagBrg>
|
167
|
-
<txtRmk>Avoid flight over residental area</txtRmk>
|
168
|
-
</Fdn>
|
169
|
-
END
|
170
|
-
end
|
171
|
-
|
172
|
-
it "builds OFMX with mid" do
|
173
|
-
AIXM.ofmx!
|
174
|
-
AIXM.config.mid_region = 'LF'
|
175
|
-
_(subject.to_xml).must_match /<FtoUid mid="9753290e-774e-2600-9b16-f7f951e06e9d">/
|
176
|
-
_(subject.to_xml).must_match /<FdnUid mid="ac550e74-73e2-4feb-4934-d0b4aafccfe6">/
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
describe AIXM::Component::FATO::Direction do
|
182
|
-
subject do
|
183
|
-
AIXM::Factory.airport.fatos.first.directions['35']
|
184
|
-
end
|
185
|
-
|
186
|
-
describe :name= do
|
187
|
-
it "fails on invalid values" do
|
188
|
-
_([nil, :foobar, 'OGGY']).wont_be_written_to subject, :name
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
describe :geographic_orientation= do
|
193
|
-
it "fails on invalid values" do
|
194
|
-
_([:foobar, -1, 10]).wont_be_written_to subject, :geographic_orientation
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
describe :remarks= do
|
199
|
-
macro :remarks
|
200
|
-
end
|
201
|
-
|
202
|
-
describe :magnetic_orientation do
|
203
|
-
it "is calculated correctly" do
|
204
|
-
subject.geographic_orientation = AIXM.a(16)
|
205
|
-
_(subject.magnetic_orientation).must_equal AIXM.a(15)
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
describe :xml= do
|
210
|
-
it "builds correct complete OFMX" do
|
211
|
-
AIXM.ofmx!
|
212
|
-
_(subject.to_xml).must_equal <<~END
|
213
|
-
<Fdn>
|
214
|
-
<FdnUid>
|
215
|
-
<FtoUid>
|
216
|
-
<AhpUid>
|
217
|
-
<codeId>LFNT</codeId>
|
218
|
-
</AhpUid>
|
219
|
-
<txtDesig>H1</txtDesig>
|
220
|
-
</FtoUid>
|
221
|
-
<txtDesig>35</txtDesig>
|
222
|
-
</FdnUid>
|
223
|
-
<valTrueBrg>355</valTrueBrg>
|
224
|
-
<valMagBrg>354</valMagBrg>
|
225
|
-
<txtRmk>Avoid flight over residental area</txtRmk>
|
226
|
-
</Fdn>
|
227
|
-
<Fls>
|
228
|
-
<FlsUid>
|
229
|
-
<FdnUid>
|
230
|
-
<FtoUid>
|
231
|
-
<AhpUid>
|
232
|
-
<codeId>LFNT</codeId>
|
233
|
-
</AhpUid>
|
234
|
-
<txtDesig>H1</txtDesig>
|
235
|
-
</FtoUid>
|
236
|
-
<txtDesig>35</txtDesig>
|
237
|
-
</FdnUid>
|
238
|
-
<codePsn>AIM</codePsn>
|
239
|
-
</FlsUid>
|
240
|
-
<txtDescr>omnidirectional</txtDescr>
|
241
|
-
<codeIntst>LIM</codeIntst>
|
242
|
-
<codeColour>GRN</codeColour>
|
243
|
-
<txtRmk>lighting remarks</txtRmk>
|
244
|
-
</Fls>
|
245
|
-
END
|
246
|
-
end
|
247
|
-
|
248
|
-
it "builds correct minimal OFMX" do
|
249
|
-
AIXM.ofmx!
|
250
|
-
%i(geographic_orientation remarks).each { |a| subject.send(:"#{a}=", nil) }
|
251
|
-
subject.instance_eval { @lightings.clear }
|
252
|
-
_(subject.to_xml).must_equal <<~END
|
253
|
-
<Fdn>
|
254
|
-
<FdnUid>
|
255
|
-
<FtoUid>
|
256
|
-
<AhpUid>
|
257
|
-
<codeId>LFNT</codeId>
|
258
|
-
</AhpUid>
|
259
|
-
<txtDesig>H1</txtDesig>
|
260
|
-
</FtoUid>
|
261
|
-
<txtDesig>35</txtDesig>
|
262
|
-
</FdnUid>
|
263
|
-
</Fdn>
|
264
|
-
END
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|