aixm 0.3.7 → 1.0.0
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 +0 -0
- data/CHANGELOG.md +72 -6
- data/README.md +191 -53
- data/exe/ckmid +11 -0
- data/exe/mkmid +11 -0
- data/lib/aixm/association.rb +367 -0
- data/lib/aixm/classes.rb +44 -0
- data/lib/aixm/component/fato.rb +44 -52
- data/lib/aixm/component/frequency.rb +13 -14
- data/lib/aixm/component/geometry/arc.rb +2 -2
- data/lib/aixm/component/geometry/border.rb +14 -5
- data/lib/aixm/component/geometry/circle.rb +8 -2
- data/lib/aixm/component/geometry/point.rb +10 -3
- data/lib/aixm/component/geometry/rhumb_line.rb +54 -0
- data/lib/aixm/component/geometry.rb +38 -38
- data/lib/aixm/component/helipad.rb +29 -37
- data/lib/aixm/component/layer.rb +28 -19
- data/lib/aixm/component/lighting.rb +11 -12
- data/lib/aixm/component/runway.rb +46 -53
- data/lib/aixm/{feature → component}/service.rb +36 -35
- data/lib/aixm/component/surface.rb +3 -3
- data/lib/aixm/component/timetable.rb +5 -3
- data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
- data/lib/aixm/config.rb +6 -3
- data/lib/aixm/document.rb +31 -49
- data/lib/aixm/executables.rb +85 -0
- data/lib/aixm/f.rb +28 -0
- data/lib/aixm/feature/address.rb +20 -15
- data/lib/aixm/feature/airport.rb +113 -129
- data/lib/aixm/feature/airspace.rb +54 -23
- data/lib/aixm/feature/navigational_aid/designated_point.rb +12 -14
- data/lib/aixm/feature/navigational_aid/dme.rb +10 -11
- data/lib/aixm/feature/navigational_aid/marker.rb +6 -2
- data/lib/aixm/feature/navigational_aid/ndb.rb +6 -2
- data/lib/aixm/feature/navigational_aid/tacan.rb +6 -2
- data/lib/aixm/feature/navigational_aid/vor.rb +22 -14
- data/lib/aixm/feature/navigational_aid.rb +7 -9
- data/lib/aixm/feature/obstacle.rb +22 -20
- data/lib/aixm/feature/obstacle_group.rb +30 -30
- data/lib/aixm/feature/organisation.rb +20 -4
- data/lib/aixm/feature/unit.rb +35 -45
- data/lib/aixm/feature.rb +13 -3
- 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 +34 -50
- data/lib/aixm/shortcuts.rb +6 -43
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/xy.rb +9 -1
- data/lib/aixm.rb +18 -7
- data/schemas/ofmx/{0 → 0.1}/OFMX-CSV-Obstacle.json +0 -0
- data/schemas/ofmx/{0 → 0.1}/OFMX-CSV.json +0 -0
- data/schemas/ofmx/{0 → 0.1}/OFMX-DataTypes.xsd +52 -2
- data/schemas/ofmx/{0 → 0.1}/OFMX-Features.xsd +225 -14
- data/schemas/ofmx/{0 → 0.1}/OFMX-Snapshot.xsd +0 -5
- data.tar.gz.sig +0 -0
- metadata +116 -164
- metadata.gz.sig +0 -0
- data/.gitignore +0 -6
- data/.ruby-version +0 -1
- data/.travis.yml +0 -8
- 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 -22
- data/spec/factory.rb +0 -559
- data/spec/lib/aixm/a_spec.rb +0 -203
- data/spec/lib/aixm/component/fato_spec.rb +0 -260
- data/spec/lib/aixm/component/frequency_spec.rb +0 -75
- data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -75
- data/spec/lib/aixm/component/geometry/border_spec.rb +0 -33
- data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -70
- data/spec/lib/aixm/component/geometry/point_spec.rb +0 -39
- data/spec/lib/aixm/component/geometry_spec.rb +0 -321
- data/spec/lib/aixm/component/helipad_spec.rb +0 -187
- data/spec/lib/aixm/component/layer_spec.rb +0 -137
- data/spec/lib/aixm/component/lighting_spec.rb +0 -88
- data/spec/lib/aixm/component/runway_spec.rb +0 -472
- data/spec/lib/aixm/component/surface_spec.rb +0 -124
- data/spec/lib/aixm/component/timetable_spec.rb +0 -49
- data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -97
- 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 -1875
- 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 -55
- data/spec/lib/aixm/feature/airport_spec.rb +0 -770
- data/spec/lib/aixm/feature/airspace_spec.rb +0 -390
- data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -98
- data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -92
- data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -79
- data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -89
- data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -88
- data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -245
- data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
- data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -326
- data/spec/lib/aixm/feature/obstacle_spec.rb +0 -279
- data/spec/lib/aixm/feature/organisation_spec.rb +0 -77
- data/spec/lib/aixm/feature/service_spec.rb +0 -59
- data/spec/lib/aixm/feature/unit_spec.rb +0 -230
- 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 -381
- 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 -55
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,260 +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>356</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>356</valMagBrg>
|
167
|
-
<txtRmk>Avoid flight over residental area</txtRmk>
|
168
|
-
</Fdn>
|
169
|
-
END
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
describe AIXM::Component::FATO::Direction do
|
175
|
-
subject do
|
176
|
-
AIXM::Factory.airport.fatos.first.directions['35']
|
177
|
-
end
|
178
|
-
|
179
|
-
describe :name= do
|
180
|
-
it "fails on invalid values" do
|
181
|
-
[nil, :foobar, 'OGGY'].wont_be_written_to subject, :name
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
describe :geographic_orientation= do
|
186
|
-
it "fails on invalid values" do
|
187
|
-
[:foobar, -1, 10].wont_be_written_to subject, :geographic_orientation
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
describe :remarks= do
|
192
|
-
macro :remarks
|
193
|
-
end
|
194
|
-
|
195
|
-
describe :magnetic_orientation do
|
196
|
-
it "is calculated correctly" do
|
197
|
-
subject.geographic_orientation = AIXM.a(16)
|
198
|
-
subject.magnetic_orientation.must_equal AIXM.a(17)
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
describe :xml= do
|
203
|
-
it "builds correct complete OFMX" do
|
204
|
-
AIXM.ofmx!
|
205
|
-
subject.to_xml.must_equal <<~END
|
206
|
-
<Fdn>
|
207
|
-
<FdnUid>
|
208
|
-
<FtoUid>
|
209
|
-
<AhpUid>
|
210
|
-
<codeId>LFNT</codeId>
|
211
|
-
</AhpUid>
|
212
|
-
<txtDesig>H1</txtDesig>
|
213
|
-
</FtoUid>
|
214
|
-
<txtDesig>35</txtDesig>
|
215
|
-
</FdnUid>
|
216
|
-
<valTrueBrg>355</valTrueBrg>
|
217
|
-
<valMagBrg>356</valMagBrg>
|
218
|
-
<txtRmk>Avoid flight over residental area</txtRmk>
|
219
|
-
</Fdn>
|
220
|
-
<Fls>
|
221
|
-
<FlsUid>
|
222
|
-
<FdnUid>
|
223
|
-
<FtoUid>
|
224
|
-
<AhpUid>
|
225
|
-
<codeId>LFNT</codeId>
|
226
|
-
</AhpUid>
|
227
|
-
<txtDesig>H1</txtDesig>
|
228
|
-
</FtoUid>
|
229
|
-
<txtDesig>35</txtDesig>
|
230
|
-
</FdnUid>
|
231
|
-
<codePsn>AIM</codePsn>
|
232
|
-
</FlsUid>
|
233
|
-
<txtDescr>omnidirectional</txtDescr>
|
234
|
-
<codeIntst>LIM</codeIntst>
|
235
|
-
<codeColour>GRN</codeColour>
|
236
|
-
<txtRmk>lighting remarks</txtRmk>
|
237
|
-
</Fls>
|
238
|
-
END
|
239
|
-
end
|
240
|
-
|
241
|
-
it "builds correct minimal OFMX" do
|
242
|
-
AIXM.ofmx!
|
243
|
-
%i(geographic_orientation remarks).each { |a| subject.send(:"#{a}=", nil) }
|
244
|
-
subject.instance_eval { @lightings.clear }
|
245
|
-
subject.to_xml.must_equal <<~END
|
246
|
-
<Fdn>
|
247
|
-
<FdnUid>
|
248
|
-
<FtoUid>
|
249
|
-
<AhpUid>
|
250
|
-
<codeId>LFNT</codeId>
|
251
|
-
</AhpUid>
|
252
|
-
<txtDesig>H1</txtDesig>
|
253
|
-
</FtoUid>
|
254
|
-
<txtDesig>35</txtDesig>
|
255
|
-
</FdnUid>
|
256
|
-
</Fdn>
|
257
|
-
END
|
258
|
-
end
|
259
|
-
end
|
260
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require_relative '../../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::Component::Frequency do
|
4
|
-
subject do
|
5
|
-
AIXM::Factory.frequency
|
6
|
-
end
|
7
|
-
|
8
|
-
describe :initialize do
|
9
|
-
it "sets defaults" do
|
10
|
-
subject = AIXM::Component::Frequency.new(
|
11
|
-
transmission_f: AIXM.f(123.35, :mhz),
|
12
|
-
callsigns: { en: "PUJAUT CONTROL", fr: "PUJAUT CONTROLE" }
|
13
|
-
)
|
14
|
-
subject.reception_f.must_equal subject.transmission_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe :transmission_f= do
|
19
|
-
it "fails on invalid values" do
|
20
|
-
[nil, :foobar, 123].wont_be_written_to subject, :transmission_f
|
21
|
-
end
|
22
|
-
|
23
|
-
it "accepts valid values" do
|
24
|
-
[AIXM::Factory.f].must_be_written_to subject, :transmission_f
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe :callsigns= do
|
29
|
-
it "fails on invalid values" do
|
30
|
-
[nil, :foobar, 123].wont_be_written_to subject, :callsigns
|
31
|
-
end
|
32
|
-
|
33
|
-
it "downcases language codes" do
|
34
|
-
subject.tap { |s| s.callsigns = { EN: "FOOBAR" } }.callsigns.must_equal(en: "FOOBAR")
|
35
|
-
end
|
36
|
-
|
37
|
-
it "upcases and transcodes callsigns" do
|
38
|
-
subject.tap { |s| s.callsigns = { fr: "Nîmes-Alès" } }.callsigns.must_equal(fr: "NIMES-ALES")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe :reception_f= do
|
43
|
-
it "fails on invalid values" do
|
44
|
-
[:foobar, 123].wont_be_written_to subject, :reception_f
|
45
|
-
end
|
46
|
-
|
47
|
-
it "accepts valid values" do
|
48
|
-
[nil, AIXM::Factory.f].must_be_written_to subject, :reception_f
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe :type= do
|
53
|
-
it "fails on invalid values" do
|
54
|
-
-> { subject.type = :foobar }.must_raise ArgumentError
|
55
|
-
end
|
56
|
-
|
57
|
-
it "accepts nil value" do
|
58
|
-
[nil].must_be_written_to subject, :type
|
59
|
-
end
|
60
|
-
|
61
|
-
it "looks up valid values" do
|
62
|
-
subject.tap { |s| s.type = :standard }.type.must_equal :standard
|
63
|
-
subject.tap { |s| s.type = :ALT }.type.must_equal :alternative
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
describe :timetable= do
|
68
|
-
macro :timetable
|
69
|
-
end
|
70
|
-
|
71
|
-
describe :remarks= do
|
72
|
-
macro :remarks
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require_relative '../../../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::Component::Geometry::Arc do
|
4
|
-
subject do
|
5
|
-
AIXM.arc(
|
6
|
-
xy: AIXM.xy(lat: 11.1, long: 33.3),
|
7
|
-
center_xy: AIXM.xy(lat: 22.2, long: 33.3),
|
8
|
-
clockwise: true
|
9
|
-
)
|
10
|
-
end
|
11
|
-
|
12
|
-
describe :center_xy= do
|
13
|
-
it "fails on invalid values" do
|
14
|
-
[nil, 123].wont_be_written_to subject, :xy
|
15
|
-
end
|
16
|
-
|
17
|
-
it "accepts valid values" do
|
18
|
-
[AIXM::Factory.xy].must_be_written_to subject, :xy
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe :clockwise= do
|
23
|
-
it "fails on invalid values" do
|
24
|
-
[nil, 0].wont_be_written_to subject, :clockwise
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe :clockwise? do
|
29
|
-
it "must return true or false" do
|
30
|
-
xy = AIXM.xy(lat: 11.1, long: 22.2)
|
31
|
-
AIXM.arc(xy: xy, center_xy: xy, clockwise: true).must_be :clockwise?
|
32
|
-
AIXM.arc(xy: xy, center_xy: xy, clockwise: false).wont_be :clockwise?
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
describe :to_xml do
|
37
|
-
it "builds correct AIXM for clockwise arcs" do
|
38
|
-
subject = AIXM.arc(
|
39
|
-
xy: AIXM.xy(lat: 11.1, long: 33.3),
|
40
|
-
center_xy: AIXM.xy(lat: 22.2, long: 33.3),
|
41
|
-
clockwise: true
|
42
|
-
)
|
43
|
-
AIXM.aixm!
|
44
|
-
subject.to_xml.must_equal <<~END
|
45
|
-
<Avx>
|
46
|
-
<codeType>CWA</codeType>
|
47
|
-
<geoLat>110600.00N</geoLat>
|
48
|
-
<geoLong>0331800.00E</geoLong>
|
49
|
-
<codeDatum>WGE</codeDatum>
|
50
|
-
<geoLatArc>221200.00N</geoLatArc>
|
51
|
-
<geoLongArc>0331800.00E</geoLongArc>
|
52
|
-
</Avx>
|
53
|
-
END
|
54
|
-
end
|
55
|
-
|
56
|
-
it "builds correct AIXM for counter-clockwise arcs" do
|
57
|
-
subject = AIXM.arc(
|
58
|
-
xy: AIXM.xy(lat: 11.1, long: 33.3),
|
59
|
-
center_xy: AIXM.xy(lat: 22.2, long: 33.3),
|
60
|
-
clockwise: false
|
61
|
-
)
|
62
|
-
AIXM.aixm!
|
63
|
-
subject.to_xml.must_equal <<~END
|
64
|
-
<Avx>
|
65
|
-
<codeType>CCA</codeType>
|
66
|
-
<geoLat>110600.00N</geoLat>
|
67
|
-
<geoLong>0331800.00E</geoLong>
|
68
|
-
<codeDatum>WGE</codeDatum>
|
69
|
-
<geoLatArc>221200.00N</geoLatArc>
|
70
|
-
<geoLongArc>0331800.00E</geoLongArc>
|
71
|
-
</Avx>
|
72
|
-
END
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require_relative '../../../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::Component::Geometry::Border do
|
4
|
-
subject do
|
5
|
-
AIXM.border(
|
6
|
-
xy: AIXM.xy(lat: 11.1, long: 22.2),
|
7
|
-
name: 'FRANCE-SWITZERLAND'
|
8
|
-
)
|
9
|
-
end
|
10
|
-
|
11
|
-
describe :name= do
|
12
|
-
it "fails on invalid values" do
|
13
|
-
[nil, :foobar, 123].wont_be_written_to subject, :name
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe :to_xml do
|
18
|
-
it "builds correct AIXM" do
|
19
|
-
AIXM.aixm!
|
20
|
-
subject.to_xml.must_equal <<~END
|
21
|
-
<Avx>
|
22
|
-
<GbrUid>
|
23
|
-
<txtName>FRANCE-SWITZERLAND</txtName>
|
24
|
-
</GbrUid>
|
25
|
-
<codeType>FNT</codeType>
|
26
|
-
<geoLat>110600.00N</geoLat>
|
27
|
-
<geoLong>0221200.00E</geoLong>
|
28
|
-
<codeDatum>WGE</codeDatum>
|
29
|
-
</Avx>
|
30
|
-
END
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|