Class: AIXM::Component::Helipad
- Inherits:
-
Object
- Object
- AIXM::Component::Helipad
- Defined in:
- lib/aixm/component/helipad.rb
Overview
Helipads are TLOF (touch-down and lift-off areas) for vertical take-off aircraft such as helicopters.
Cheat Sheet in Pseudo Code:
helipad = AIXM.helipad(
name: String
xy = AIXM.xy
)
helipad.z = AIXM.z or nil
helipad.length = AIXM.d or nil # must use same unit as width
helipad.width = AIXM.d or nil # must use same unit as length
helipad.surface = AIXM.surface
helipad.marking = String or nil
helipad.fato = AIXM.fato or nil
helipad.helicopter_class = HELICOPTER_CLASSES or nil
helipad.status = STATUSES or nil
helipad.remarks = String or nil
Constant Summary collapse
- HELICOPTER_CLASSES =
{ '1': :'1', '2': :'2', '3': :'3', OTHER: :other # specify in remarks }.freeze
- STATUSES =
{ CLSD: :closed, WIP: :work_in_progress, # e.g. construction work PARKED: :parked_aircraft, # parked or disabled aircraft on helipad FAILAID: :visual_aids_failure, # failure or irregular operation of visual aids SPOWER: :secondary_power, # secondary power supply in operation OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#airport ⇒ AIXM::Feature::Airport
readonly
Airport this helipad belongs to.
-
#fato ⇒ AIXM::Component::FATO?
FATO the helipad is situated on.
-
#helicopter_class ⇒ Integer, ...
Suitable helicopter class.
-
#length ⇒ AIXM::D?
Length.
-
#lightings ⇒ Array<AIXM::Component::Lighting>
readonly
Installed lighting systems.
-
#marking ⇒ String?
Markings.
-
#name ⇒ String
Full name (e.g. “H1”).
-
#remarks ⇒ String?
Free text remarks.
-
#status ⇒ Symbol?
Status of the helipad (see STATUSES) or
nilfor normal operation. -
#surface ⇒ AIXM::Component::Surface
readonly
Surface of the helipad.
-
#width ⇒ AIXM::D?
Width.
-
#xy ⇒ AIXM::XY
Center point.
-
#z ⇒ AIXM::Z?
Elevation in
:qnh.
Instance Method Summary collapse
-
#add_lighting(lighting) ⇒ self
Add a lighting system to the runway direction.
-
#initialize(name:, xy:) ⇒ Helipad
constructor
A new instance of Helipad.
- #inspect ⇒ String
-
#to_uid ⇒ String
UID markup.
-
#to_xml ⇒ String
AIXM or OFMX markup.
Constructor Details
#initialize(name:, xy:) ⇒ Helipad
Returns a new instance of Helipad.
81 82 83 84 85 |
# File 'lib/aixm/component/helipad.rb', line 81 def initialize(name:, xy:) self.name, self.xy = name, xy @surface = AIXM.surface @lightings = [] end |
Instance Attribute Details
#airport ⇒ AIXM::Feature::Airport
Returns airport this helipad belongs to.
43 44 45 |
# File 'lib/aixm/component/helipad.rb', line 43 def airport @airport end |
#fato ⇒ AIXM::Component::FATO?
Returns FATO the helipad is situated on.
67 68 69 |
# File 'lib/aixm/component/helipad.rb', line 67 def fato @fato end |
#helicopter_class ⇒ Integer, ...
Returns suitable helicopter class.
70 71 72 |
# File 'lib/aixm/component/helipad.rb', line 70 def helicopter_class @helicopter_class end |
#length ⇒ AIXM::D?
Returns length.
55 56 57 |
# File 'lib/aixm/component/helipad.rb', line 55 def length @length end |
#lightings ⇒ Array<AIXM::Component::Lighting> (readonly)
Returns installed lighting systems.
79 80 81 |
# File 'lib/aixm/component/helipad.rb', line 79 def lightings @lightings end |
#marking ⇒ String?
Returns markings.
64 65 66 |
# File 'lib/aixm/component/helipad.rb', line 64 def marking @marking end |
#name ⇒ String
Returns full name (e.g. “H1”).
46 47 48 |
# File 'lib/aixm/component/helipad.rb', line 46 def name @name end |
#remarks ⇒ String?
Returns free text remarks.
76 77 78 |
# File 'lib/aixm/component/helipad.rb', line 76 def remarks @remarks end |
#status ⇒ Symbol?
Returns status of the helipad (see STATUSES) or nil for normal operation.
73 74 75 |
# File 'lib/aixm/component/helipad.rb', line 73 def status @status end |
#surface ⇒ AIXM::Component::Surface (readonly)
Returns surface of the helipad.
61 62 63 |
# File 'lib/aixm/component/helipad.rb', line 61 def surface @surface end |
#width ⇒ AIXM::D?
Returns width.
58 59 60 |
# File 'lib/aixm/component/helipad.rb', line 58 def width @width end |
#xy ⇒ AIXM::XY
Returns center point.
49 50 51 |
# File 'lib/aixm/component/helipad.rb', line 49 def xy @xy end |
#z ⇒ AIXM::Z?
Returns elevation in :qnh.
52 53 54 |
# File 'lib/aixm/component/helipad.rb', line 52 def z @z end |
Instance Method Details
#add_lighting(lighting) ⇒ self
Add a lighting system to the runway direction.
154 155 156 157 158 159 |
# File 'lib/aixm/component/helipad.rb', line 154 def add_lighting(lighting) fail(ArgumentError, "invalid lighting") unless lighting.is_a? AIXM::Component::Lighting lighting.send(:lightable=, self) @lightings << lighting self end |
#inspect ⇒ String
88 89 90 |
# File 'lib/aixm/component/helipad.rb', line 88 def inspect %Q(#<#{self.class} airport=#{airport&.id.inspect} name=#{name.inspect}>) end |
#to_uid ⇒ String
Returns UID markup.
162 163 164 165 166 167 168 |
# File 'lib/aixm/component/helipad.rb', line 162 def to_uid builder = Builder::XmlMarkup.new(indent: 2) builder.TlaUid do |tla_uid| tla_uid << airport.to_uid.indent(2) tla_uid.txtDesig(name) end end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/aixm/component/helipad.rb', line 171 def to_xml builder = Builder::XmlMarkup.new(indent: 2) builder.Tla do |tla| tla << to_uid.indent(2) tla << fato.to_uid.indent(2) if fato tla.geoLat(xy.lat(AIXM.schema)) tla.geoLong(xy.long(AIXM.schema)) tla.codeDatum('WGE') if z tla.valElev(z.alt) tla.uomDistVer(z.unit.upcase.to_s) end tla.valLen(length.dist.trim) if length tla.valWid(width.dist.trim) if width tla.uomDim(length.unit.to_s.upcase) if length tla.uomDim(width.unit.to_s.upcase) if width && !length unless (xml = surface.to_xml).empty? tla << xml.indent(2) end tla.codeClassHel(HELICOPTER_CLASSES.key(helicopter_class).to_s) if helicopter_class tla.txtMarking(marking) if marking tla.codeSts(STATUSES.key(status).to_s) if status tla.txtRmk(remarks) if remarks end lightings.each do |lighting| builder << lighting.to_xml(as: :Tls) end builder.target! end |