class AIXM::Component::Lighting
Lighting
of a runway, helipad etc
Cheat Sheet in Pseudo Code:¶ ↑
lighting = AIXM.lighting( position: POSITIONS ) lighting.description = String or nil lighting.intensity = INTENSITIES or nil lighting.color = COLORS or nil lighting.remarks = String or nil
@see gitlab.com/openflightmaps/ofmx/wikis/Airport#rls-runway-direction-lighting @see gitlab.com/openflightmaps/ofmx/wikis/Airport#fls-fato-direction-lighting @see gitlab.com/openflightmaps/ofmx/wikis/Airport#tls-helipad-tlof-lighting
Constants
- COLORS
- INTENSITIES
- POSITIONS
Attributes
color[R]
@return [Symbol, nil] color of lights (see {COLORS})
description[R]
@return [String, nil] detailed description
intensity[R]
@return [Symbol, nil] intensity of lights (see {INTENSITIES})
position[R]
@return [Symbol, nil] position of the lighting system (see {POSITIONS})
remarks[R]
@return [String, nil] free text remarks
Public Class Methods
new(position:)
click to toggle source
# File lib/aixm/component/lighting.rb 79 def initialize(position:) 80 self.position = position 81 end
Public Instance Methods
color=(value)
click to toggle source
# File lib/aixm/component/lighting.rb 100 def color=(value) 101 @color = value.nil? ? nil : COLORS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid color") 102 end
description=(value)
click to toggle source
# File lib/aixm/component/lighting.rb 92 def description=(value) 93 @description = value&.to_s 94 end
inspect()
click to toggle source
@return [String]
# File lib/aixm/component/lighting.rb 84 def inspect 85 %Q(#<#{self.class} position=#{position.inspect}>) 86 end
intensity=(value)
click to toggle source
# File lib/aixm/component/lighting.rb 96 def intensity=(value) 97 @intensity = value.nil? ? nil : INTENSITIES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid intensity") 98 end
position=(value)
click to toggle source
# File lib/aixm/component/lighting.rb 88 def position=(value) 89 @position = POSITIONS.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid position") 90 end
remarks=(value)
click to toggle source
# File lib/aixm/component/lighting.rb 104 def remarks=(value) 105 @remarks = value&.to_s 106 end
to_uid(as:)
click to toggle source
@return [String] UID markup
# File lib/aixm/component/lighting.rb 109 def to_uid(as:) 110 builder = Builder::XmlMarkup.new(indent: 2) 111 builder.tag!(as) do |tag| 112 tag << lightable.to_uid.indent(2) 113 tag.codePsn(POSITIONS.key(position).to_s) 114 end 115 end
to_xml(as:)
click to toggle source
@return [String] AIXM
or OFMX markup
# File lib/aixm/component/lighting.rb 119 def to_xml(as:) 120 builder = Builder::XmlMarkup.new(indent: 2) 121 builder.tag!(as) do |tag| 122 tag << to_uid(as: "#{as}Uid").indent(2) 123 tag.txtDescr(description) if description 124 tag.codeIntst(INTENSITIES.key(intensity).to_s) if intensity 125 tag.codeColour(COLORS.key(color).to_s) if color 126 tag.txtRmk(remarks) if remarks 127 end 128 builder.target! 129 end