Class: AIXM::Component::Lighting
- Inherits:
-
Object
- Object
- AIXM::Component::Lighting
- Defined in:
- lib/aixm/component/lighting.rb
Overview
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
Constant Summary collapse
- POSITIONS =
{ TDZ: :touch_down_zone, AIM: :aiming_point, CL: :center_line, EDGE: :edge, THR: :threshold, SWYEDGE: :stopway_edge, DESIG: :runway_designation, AFTTHR: :after_threshold, DISPTHR: :displaced_threshold, SWYCL: :stopway_center_line, END: :runway_end, SWYEND: :stopway_end, TWYINT: :taxiway_intersection, HOLDBAY: :taxyway_hold_bay, RTWYINT: :rapid_taxiway_intersection, OTHER: :other # specify in remarks }
- INTENSITIES =
{ LIL: :low, LIM: :medium, LIH: :high, OTHER: :other # specify in remarks }
- COLORS =
{ YEL: :yellow, RED: :red, WHI: :white, BLU: :blue, GRN: :green, PRP: :purple, OTHER: :other # specify in remarks }
Instance Attribute Summary collapse
-
#color ⇒ Symbol?
Color of lights (see COLORS).
-
#description ⇒ String?
Detailed description.
-
#intensity ⇒ Symbol?
Intensity of lights (see INTENSITIES).
-
#lightable ⇒ AIXM::Component::Runway::Direction, ...
readonly
Lighted entity.
-
#position ⇒ Symbol?
Position of the lighting system (see POSITIONS).
-
#remarks ⇒ String?
Free text remarks.
Instance Method Summary collapse
-
#initialize(position:) ⇒ Lighting
constructor
A new instance of Lighting.
- #inspect ⇒ String
-
#to_uid(as:) ⇒ String
UID markup.
-
#to_xml(as:) ⇒ String
AIXM or OFMX markup.
Constructor Details
#initialize(position:) ⇒ Lighting
Returns a new instance of Lighting.
75 76 77 |
# File 'lib/aixm/component/lighting.rb', line 75 def initialize(position:) self.position = position end |
Instance Attribute Details
#color ⇒ Symbol?
Returns color of lights (see COLORS).
70 71 72 |
# File 'lib/aixm/component/lighting.rb', line 70 def color @color end |
#description ⇒ String?
Returns detailed description.
64 65 66 |
# File 'lib/aixm/component/lighting.rb', line 64 def description @description end |
#intensity ⇒ Symbol?
Returns intensity of lights (see INTENSITIES).
67 68 69 |
# File 'lib/aixm/component/lighting.rb', line 67 def intensity @intensity end |
#lightable ⇒ AIXM::Component::Runway::Direction, ...
Returns lighted entity.
58 59 60 |
# File 'lib/aixm/component/lighting.rb', line 58 def lightable @lightable end |
#position ⇒ Symbol?
Returns position of the lighting system (see POSITIONS).
61 62 63 |
# File 'lib/aixm/component/lighting.rb', line 61 def position @position end |
#remarks ⇒ String?
Returns free text remarks.
73 74 75 |
# File 'lib/aixm/component/lighting.rb', line 73 def remarks @remarks end |
Instance Method Details
#inspect ⇒ String
80 81 82 |
# File 'lib/aixm/component/lighting.rb', line 80 def inspect %Q(#<#{self.class} position=#{position.inspect}>) end |
#to_uid(as:) ⇒ String
Returns UID markup.
111 112 113 114 115 116 117 |
# File 'lib/aixm/component/lighting.rb', line 111 def to_uid(as:) builder = Builder::XmlMarkup.new(indent: 2) builder.tag!(as) do |tag| tag << lightable.to_uid.indent(2) tag.codePsn(POSITIONS.key(position).to_s) end end |
#to_xml(as:) ⇒ String
Returns AIXM or OFMX markup.
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/aixm/component/lighting.rb', line 120 def to_xml(as:) builder = Builder::XmlMarkup.new(indent: 2) builder.tag!(as) do |tag| tag << to_uid(as: "#{as}Uid").indent(2) tag.txtDescr(description) if description tag.codeIntst(INTENSITIES.key(intensity).to_s) if intensity tag.codeColour(COLORS.key(color).to_s) if color tag.txtRmk(remarks) if remarks end builder.target! end |