aixm 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
6
|
# Lighting of a runway, helipad etc
|
|
7
7
|
#
|
|
@@ -14,10 +14,13 @@ module AIXM
|
|
|
14
14
|
# lighting.color = COLORS or nil
|
|
15
15
|
# lighting.remarks = String or nil
|
|
16
16
|
#
|
|
17
|
-
# @see https://
|
|
18
|
-
# @see https://
|
|
19
|
-
# @see https://
|
|
17
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#rls-runway-direction-lighting
|
|
18
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#fls-fato-direction-lighting
|
|
19
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#tls-helipad-tlof-lighting
|
|
20
20
|
class Lighting
|
|
21
|
+
include AIXM::Association
|
|
22
|
+
include AIXM::Memoize
|
|
23
|
+
|
|
21
24
|
POSITIONS = {
|
|
22
25
|
TDZ: :touch_down_zone,
|
|
23
26
|
AIM: :aiming_point,
|
|
@@ -54,8 +57,9 @@ module AIXM
|
|
|
54
57
|
OTHER: :other # specify in remarks
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
#
|
|
58
|
-
|
|
60
|
+
# @!method lightable
|
|
61
|
+
# @return [AIXM::Component::Runway::Direction, AIXM::Component::FATO::Direction, AIXM::Component::Helipad] lighted entity
|
|
62
|
+
belongs_to :lightable
|
|
59
63
|
|
|
60
64
|
# @return [Symbol, nil] position of the lighting system (see {POSITIONS})
|
|
61
65
|
attr_reader :position
|
|
@@ -81,12 +85,6 @@ module AIXM
|
|
|
81
85
|
%Q(#<#{self.class} position=#{position.inspect}>)
|
|
82
86
|
end
|
|
83
87
|
|
|
84
|
-
def lightable=(value)
|
|
85
|
-
fail(ArgumentError, "invalid lightable") unless value.respond_to? :lightings
|
|
86
|
-
@lightable = value
|
|
87
|
-
end
|
|
88
|
-
private :lightable=
|
|
89
|
-
|
|
90
88
|
def position=(value)
|
|
91
89
|
@position = POSITIONS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid position")
|
|
92
90
|
end
|
|
@@ -113,8 +111,9 @@ module AIXM
|
|
|
113
111
|
builder.tag!(as) do |tag|
|
|
114
112
|
tag << lightable.to_uid.indent(2)
|
|
115
113
|
tag.codePsn(POSITIONS.key(position).to_s)
|
|
116
|
-
end
|
|
114
|
+
end
|
|
117
115
|
end
|
|
116
|
+
memoize :to_uid
|
|
118
117
|
|
|
119
118
|
# @return [String] AIXM or OFMX markup
|
|
120
119
|
def to_xml(as:)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
6
|
# Runways are landing and takeoff strips for forward propelled aircraft.
|
|
7
7
|
#
|
|
@@ -44,8 +44,11 @@ module AIXM
|
|
|
44
44
|
# runway.forth.geographic_orientation = 165
|
|
45
45
|
# runway.back = nil
|
|
46
46
|
#
|
|
47
|
-
# @see https://
|
|
47
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#rwy-runway
|
|
48
48
|
class Runway
|
|
49
|
+
include AIXM::Association
|
|
50
|
+
include AIXM::Memoize
|
|
51
|
+
|
|
49
52
|
STATUSES = {
|
|
50
53
|
CLSD: :closed,
|
|
51
54
|
WIP: :work_in_progress, # e.g. construction work
|
|
@@ -55,8 +58,21 @@ module AIXM
|
|
|
55
58
|
OTHER: :other # specify in remarks
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
#
|
|
59
|
-
|
|
61
|
+
# @!method forth
|
|
62
|
+
# @return [AIXM::Component::Runway::Direction] main direction
|
|
63
|
+
# @!method forth=(forth)
|
|
64
|
+
# @param forth [AIXM::Component::Runway::Direction]
|
|
65
|
+
has_one :forth, accept: 'AIXM::Component::Runway::Direction'
|
|
66
|
+
|
|
67
|
+
# @!method back
|
|
68
|
+
# @return [AIXM::Component::Runway::Direction, nil] reverse direction
|
|
69
|
+
# @!method back=(back)
|
|
70
|
+
# @param back [AIXM::Component::Runway::Direction, nil]
|
|
71
|
+
has_one :back, accept: 'AIXM::Component::Runway::Direction', allow_nil: true
|
|
72
|
+
|
|
73
|
+
# @!method airport
|
|
74
|
+
# @return [AIXM::Feature::Airport] airport the runway belongs to
|
|
75
|
+
belongs_to :airport
|
|
60
76
|
|
|
61
77
|
# @return [String] full name of runway (e.g. "12/30" or "16L/34R")
|
|
62
78
|
attr_reader :name
|
|
@@ -76,18 +92,12 @@ module AIXM
|
|
|
76
92
|
# @return [String, nil] free text remarks
|
|
77
93
|
attr_reader :remarks
|
|
78
94
|
|
|
79
|
-
# @return [AIXM::Component::Runway::Direction] main direction
|
|
80
|
-
attr_accessor :forth
|
|
81
|
-
|
|
82
|
-
# @return [AIXM::Component::Runway::Direction] reverse direction
|
|
83
|
-
attr_accessor :back
|
|
84
|
-
|
|
85
95
|
def initialize(name:)
|
|
86
96
|
self.name = name
|
|
87
|
-
@name.split("/").tap do |
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fail(ArgumentError, "invalid name") unless
|
|
97
|
+
@name.split("/").tap do |forth_name, back_name|
|
|
98
|
+
self.forth = Direction.new(name: AIXM.a(forth_name))
|
|
99
|
+
self.back = Direction.new(name: AIXM.a(back_name)) if back_name
|
|
100
|
+
fail(ArgumentError, "invalid name") unless !back || back.name.inverse_of?(@forth.name)
|
|
91
101
|
end
|
|
92
102
|
@surface = AIXM.surface
|
|
93
103
|
end
|
|
@@ -97,12 +107,6 @@ module AIXM
|
|
|
97
107
|
%Q(#<#{self.class} airport=#{airport&.id.inspect} name=#{name.inspect}>)
|
|
98
108
|
end
|
|
99
109
|
|
|
100
|
-
def airport=(value)
|
|
101
|
-
fail(ArgumentError, "invalid airport") unless value.is_a? AIXM::Feature::Airport
|
|
102
|
-
@airport = value
|
|
103
|
-
end
|
|
104
|
-
private :airport=
|
|
105
|
-
|
|
106
110
|
def name=(value)
|
|
107
111
|
fail(ArgumentError, "invalid name") unless value.is_a? String
|
|
108
112
|
@name = value.uptrans
|
|
@@ -138,8 +142,9 @@ module AIXM
|
|
|
138
142
|
builder.RwyUid do |rwy_uid|
|
|
139
143
|
rwy_uid << airport.to_uid.indent(2)
|
|
140
144
|
rwy_uid.txtDesig(name)
|
|
141
|
-
end
|
|
145
|
+
end
|
|
142
146
|
end
|
|
147
|
+
memoize :to_uid
|
|
143
148
|
|
|
144
149
|
# @return [String] AIXM or OFMX markup
|
|
145
150
|
def to_xml
|
|
@@ -167,16 +172,27 @@ module AIXM
|
|
|
167
172
|
# Runway directions further describe each direction {#forth} and {#back}
|
|
168
173
|
# of a runway.
|
|
169
174
|
#
|
|
170
|
-
# @see https://
|
|
175
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#rdn-runway-direction
|
|
171
176
|
class Direction
|
|
177
|
+
include AIXM::Association
|
|
178
|
+
include AIXM::Memoize
|
|
179
|
+
|
|
172
180
|
VFR_PATTERNS = {
|
|
173
181
|
L: :left,
|
|
174
182
|
R: :right,
|
|
175
183
|
E: :left_or_right
|
|
176
184
|
}
|
|
177
185
|
|
|
178
|
-
#
|
|
179
|
-
|
|
186
|
+
# @!method lightings
|
|
187
|
+
# @return [Array<AIXM::Component::Lighting>] installed lighting systems
|
|
188
|
+
# @!method add_lighting(lighting)
|
|
189
|
+
# @param lighting [AIXM::Component::Lighting]
|
|
190
|
+
# @return [self]
|
|
191
|
+
has_many :lightings, as: :lightable
|
|
192
|
+
|
|
193
|
+
# @!method runway
|
|
194
|
+
# @return [AIXM::Component::Runway] runway the runway direction is further describing
|
|
195
|
+
belongs_to :runway, readonly: true
|
|
180
196
|
|
|
181
197
|
# @return [AIXM::A] partial name of runway (e.g. "12" or "16L")
|
|
182
198
|
attr_reader :name
|
|
@@ -201,12 +217,8 @@ module AIXM
|
|
|
201
217
|
# @return [String, nil] free text remarks
|
|
202
218
|
attr_reader :remarks
|
|
203
219
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
def initialize(runway:, name:)
|
|
208
|
-
self.runway, self.name = runway, name
|
|
209
|
-
@lightings = []
|
|
220
|
+
def initialize(name:)
|
|
221
|
+
self.name = name
|
|
210
222
|
end
|
|
211
223
|
|
|
212
224
|
# @return [String]
|
|
@@ -214,12 +226,6 @@ module AIXM
|
|
|
214
226
|
%Q(#<#{self.class} airport=#{runway&.airport&.id.inspect} name=#{name.inspect}>)
|
|
215
227
|
end
|
|
216
228
|
|
|
217
|
-
def runway=(value)
|
|
218
|
-
fail(ArgumentError, "invalid runway") unless value.is_a? AIXM::Component::Runway
|
|
219
|
-
@runway = value
|
|
220
|
-
end
|
|
221
|
-
private :runway
|
|
222
|
-
|
|
223
229
|
def name=(value)
|
|
224
230
|
fail(ArgumentError, "invalid name") unless value.is_a? AIXM::A
|
|
225
231
|
@name = value
|
|
@@ -263,17 +269,6 @@ module AIXM
|
|
|
263
269
|
@remarks = value&.to_s
|
|
264
270
|
end
|
|
265
271
|
|
|
266
|
-
# Add a lighting system to the runway direction.
|
|
267
|
-
#
|
|
268
|
-
# @param lighting [AIXM::Component::Lighting] lighting instance
|
|
269
|
-
# @return [self]
|
|
270
|
-
def add_lighting(lighting)
|
|
271
|
-
fail(ArgumentError, "invalid lighting") unless lighting.is_a? AIXM::Component::Lighting
|
|
272
|
-
lighting.send(:lightable=, self)
|
|
273
|
-
@lightings << lighting
|
|
274
|
-
self
|
|
275
|
-
end
|
|
276
|
-
|
|
277
272
|
# @return [AIXM::A] magnetic orientation (magnetic bearing) in degrees
|
|
278
273
|
def magnetic_orientation
|
|
279
274
|
if geographic_orientation && runway.airport.declination
|
|
@@ -287,8 +282,9 @@ module AIXM
|
|
|
287
282
|
builder.RdnUid do |rdn_uid|
|
|
288
283
|
rdn_uid << runway.to_uid.indent(2)
|
|
289
284
|
rdn_uid.txtDesig(name)
|
|
290
|
-
end
|
|
285
|
+
end
|
|
291
286
|
end
|
|
287
|
+
memoize :to_uid
|
|
292
288
|
|
|
293
289
|
# @return [String] AIXM or OFMX markup
|
|
294
290
|
def to_xml
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
6
|
# Service provided by a unit.
|
|
7
7
|
#
|
|
8
8
|
# ===Cheat Sheet in Pseudo Code:
|
|
9
9
|
# service = AIXM.service(
|
|
10
|
-
# source: String or nil
|
|
11
10
|
# type: TYPES
|
|
12
11
|
# )
|
|
13
12
|
# service.timetable = AIXM.timetable or nil
|
|
14
13
|
# service.remarks = String or nil
|
|
15
14
|
# service.add_frequency(AIXM.frequency)
|
|
16
15
|
#
|
|
17
|
-
# @see https://
|
|
18
|
-
class Service
|
|
19
|
-
|
|
16
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Organisation#ser-service
|
|
17
|
+
class Service
|
|
18
|
+
include AIXM::Association
|
|
19
|
+
include AIXM::Memoize
|
|
20
20
|
|
|
21
21
|
TYPES = {
|
|
22
22
|
ACS: :area_control_service,
|
|
@@ -125,10 +125,21 @@ module AIXM
|
|
|
125
125
|
:vhf_direction_finding_service => :vdf_direction_finding_station,
|
|
126
126
|
:volmet_service => :meteorological_office,
|
|
127
127
|
:other => :other
|
|
128
|
-
}
|
|
128
|
+
}.freeze
|
|
129
|
+
|
|
130
|
+
# @!method frequencies
|
|
131
|
+
# @return [Array<AIXM::Component::Frequency>] frequencies used by this service
|
|
132
|
+
# @!method add_frequency(frequency)
|
|
133
|
+
# @param frequency [AIXM::Component::Frequency]
|
|
134
|
+
has_many :frequencies
|
|
129
135
|
|
|
130
|
-
#
|
|
131
|
-
|
|
136
|
+
# @!method unit
|
|
137
|
+
# @return [AIXM::Feature::Unit] unit providing this service
|
|
138
|
+
belongs_to :unit
|
|
139
|
+
|
|
140
|
+
# @!method layer
|
|
141
|
+
# @return [AIXM::Component::Layer] airspace layer this service is provided within
|
|
142
|
+
belongs_to :layer
|
|
132
143
|
|
|
133
144
|
# @return [Symbol] type of service (see {TYPES})
|
|
134
145
|
attr_reader :type
|
|
@@ -139,13 +150,9 @@ module AIXM
|
|
|
139
150
|
# @return [String, nil] free text remarks
|
|
140
151
|
attr_reader :remarks
|
|
141
152
|
|
|
142
|
-
|
|
143
|
-
attr_reader :frequencies
|
|
144
|
-
|
|
145
|
-
def initialize(source: nil, type:)
|
|
146
|
-
super(source: source)
|
|
153
|
+
def initialize(type:)
|
|
147
154
|
self.type = type
|
|
148
|
-
@
|
|
155
|
+
@sequence = 1
|
|
149
156
|
end
|
|
150
157
|
|
|
151
158
|
# @return [String]
|
|
@@ -153,12 +160,6 @@ module AIXM
|
|
|
153
160
|
%Q(#<#{self.class} type=#{type.inspect}>)
|
|
154
161
|
end
|
|
155
162
|
|
|
156
|
-
def unit=(value)
|
|
157
|
-
fail(ArgumentError, "invalid unit") unless value.is_a? AIXM::Feature::Unit
|
|
158
|
-
@unit = value
|
|
159
|
-
end
|
|
160
|
-
private :unit=
|
|
161
|
-
|
|
162
163
|
def type=(value)
|
|
163
164
|
@type = TYPES.lookup(value&.to_s&.to_sym, nil) || fail(ArgumentError, "invalid type")
|
|
164
165
|
end
|
|
@@ -172,17 +173,6 @@ module AIXM
|
|
|
172
173
|
@remarks = value&.to_s
|
|
173
174
|
end
|
|
174
175
|
|
|
175
|
-
# Add a frequency used by this service
|
|
176
|
-
#
|
|
177
|
-
# @param frequency [AIXM::Component::Frequency] frequency instance
|
|
178
|
-
# @return [self]
|
|
179
|
-
def add_frequency(frequency)
|
|
180
|
-
fail(ArgumentError, "invalid frequency") unless frequency.is_a? AIXM::Component::Frequency
|
|
181
|
-
frequency.send(:service=, self)
|
|
182
|
-
@frequencies << frequency
|
|
183
|
-
self
|
|
184
|
-
end
|
|
185
|
-
|
|
186
176
|
# Guess the unit type for this service
|
|
187
177
|
#
|
|
188
178
|
# @return [Symbol, nil] guessed unit type or +nil+ if unmappable
|
|
@@ -192,20 +182,21 @@ module AIXM
|
|
|
192
182
|
|
|
193
183
|
# @return [String] UID markup
|
|
194
184
|
def to_uid
|
|
185
|
+
resequence!
|
|
195
186
|
builder = Builder::XmlMarkup.new(indent: 2)
|
|
196
187
|
builder.SerUid do |ser_uid|
|
|
197
188
|
ser_uid << unit.to_uid.indent(2)
|
|
198
189
|
ser_uid.codeType(TYPES.key(type).to_s)
|
|
199
190
|
ser_uid.noSeq(@sequence)
|
|
200
|
-
end
|
|
191
|
+
end
|
|
201
192
|
end
|
|
193
|
+
memoize :to_uid
|
|
202
194
|
|
|
203
195
|
# @return [String] AIXM or OFMX markup
|
|
204
|
-
def to_xml
|
|
205
|
-
@sequence = sequence
|
|
196
|
+
def to_xml
|
|
206
197
|
builder = Builder::XmlMarkup.new(indent: 2)
|
|
207
|
-
builder.comment! ["Service: #{TYPES.key(type)}", unit&.
|
|
208
|
-
builder.Ser
|
|
198
|
+
builder.comment! ["Service: #{TYPES.key(type)}", unit&.send(:name_with_type)].compact.join(' by ')
|
|
199
|
+
builder.Ser do |ser|
|
|
209
200
|
ser << to_uid.indent(2)
|
|
210
201
|
ser << timetable.to_xml(as: :Stt).indent(2) if timetable
|
|
211
202
|
ser.txtRmk(remarks) if remarks
|
|
@@ -215,6 +206,16 @@ module AIXM
|
|
|
215
206
|
end
|
|
216
207
|
builder.target!
|
|
217
208
|
end
|
|
209
|
+
|
|
210
|
+
private
|
|
211
|
+
|
|
212
|
+
def resequence!
|
|
213
|
+
unit.services.sort { |a, b| a.type <=> b.type }.each.with_object({}) do |service, sequences|
|
|
214
|
+
sequences[service.type] = (sequences[service.type] || 0) + 1
|
|
215
|
+
service.instance_variable_set(:@sequence, sequences[service.type])
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
218
219
|
end
|
|
219
220
|
|
|
220
221
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
6
|
# Surface of a runway, helipad etc
|
|
7
7
|
#
|
|
@@ -21,7 +21,7 @@ module AIXM
|
|
|
21
21
|
# * +AIXM::PCN_RE+ - regular expression to match PCN notations
|
|
22
22
|
#
|
|
23
23
|
#
|
|
24
|
-
# @see https://
|
|
24
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#rwy-runway
|
|
25
25
|
class Surface
|
|
26
26
|
COMPOSITIONS = {
|
|
27
27
|
ASPH: :asphalt,
|
|
@@ -109,7 +109,7 @@ module AIXM
|
|
|
109
109
|
def pcn=(value)
|
|
110
110
|
return @pcn = {} if value.nil?
|
|
111
111
|
fail(ArgumentError, "invalid PCN") unless match = value.to_s.upcase.match(PCN_RE)
|
|
112
|
-
@pcn = match.named_captures.reject{
|
|
112
|
+
@pcn = match.named_captures.reject{ _1 == 'pcn' }
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
def siwl_weight=(value)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
6
|
# Timetables define activity time windows.
|
|
7
7
|
#
|
|
@@ -17,7 +17,7 @@ module AIXM
|
|
|
17
17
|
# * +AIXM::H24+ - continuous, all day and all night
|
|
18
18
|
# * +AIXM::H_RE+ - pattern matching working hour codes
|
|
19
19
|
#
|
|
20
|
-
# @see https://
|
|
20
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Timetable#predefined-timetable
|
|
21
21
|
class Timetable
|
|
22
22
|
CODES = {
|
|
23
23
|
H24: :continuous, # all day and all night
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
using AIXM::Refinements
|
|
2
2
|
|
|
3
3
|
module AIXM
|
|
4
|
-
|
|
4
|
+
module Component
|
|
5
5
|
|
|
6
|
-
# Vertical
|
|
6
|
+
# Vertical limit defines a 3D airspace vertically. It is often noted in
|
|
7
7
|
# AIP as follows:
|
|
8
8
|
#
|
|
9
9
|
# upper_z
|
|
@@ -13,7 +13,7 @@ module AIXM
|
|
|
13
13
|
# (min_z) whichever is lower
|
|
14
14
|
#
|
|
15
15
|
# ===Cheat Sheet in Pseudo Code:
|
|
16
|
-
#
|
|
16
|
+
# vertical_limit = AIXM.vertical_limit(
|
|
17
17
|
# upper_z: AIXM.z
|
|
18
18
|
# max_z: AIXM.z or nil
|
|
19
19
|
# lower_z: AIXM.z
|
|
@@ -24,14 +24,20 @@ module AIXM
|
|
|
24
24
|
# * +AIXM::GROUND+ - surface expressed as "0 ft QFE"
|
|
25
25
|
# * +AIXM::UNLIMITED+ - no upper limit expressed as "FL 999"
|
|
26
26
|
#
|
|
27
|
-
# @see https://
|
|
28
|
-
class
|
|
27
|
+
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airspace#ase-airspace
|
|
28
|
+
class VerticalLimit
|
|
29
|
+
include AIXM::Association
|
|
30
|
+
|
|
29
31
|
# @api private
|
|
30
32
|
TAGS = { upper_z: :Upper, lower_z: :Lower, max_z: :Max, min_z: :Mnm }.freeze
|
|
31
33
|
|
|
32
34
|
# @api private
|
|
33
35
|
CODES = { qfe: :HEI, qnh: :ALT, qne: :STD }.freeze
|
|
34
36
|
|
|
37
|
+
# @!method layer
|
|
38
|
+
# @return [AIXM::Component::Layer] layer to which this vertical limit applies
|
|
39
|
+
belongs_to :layer
|
|
40
|
+
|
|
35
41
|
# @return [AIXM::Z] upper limit
|
|
36
42
|
attr_reader :upper_z
|
|
37
43
|
|
|
@@ -50,7 +56,7 @@ module AIXM
|
|
|
50
56
|
|
|
51
57
|
# @return [String]
|
|
52
58
|
def inspect
|
|
53
|
-
payload = %i(upper_z max_z lower_z min_z).map {
|
|
59
|
+
payload = %i(upper_z max_z lower_z min_z).map { %Q(#{_1}="#{send(_1)}") if send(_1) }.compact
|
|
54
60
|
%Q(#<#{self.class} #{payload.join(' ')}>)
|
|
55
61
|
end
|
|
56
62
|
|