class AIXM::Component::FATO::Direction

FATO directions further describe each direction to and from the FATO.

@see gitlab.com/openflightmaps/ofmx/wikis/Airport#fdn-fato-direction

Attributes

geographic_orientation[R]

@return [AIXM::A, nil] geographic orientation (true bearing) in degrees

name[R]

@return [AIXM::A] name of the FATO direction (e.g. ā€œ12ā€ or ā€œ16Lā€)

remarks[R]

@return [String, nil] free text remarks

Public Class Methods

new(name:) click to toggle source
    # File lib/aixm/component/fato.rb
189 def initialize(name:)
190   self.name = name
191 end

Public Instance Methods

geographic_orientation=(value) click to toggle source
    # File lib/aixm/component/fato.rb
203 def geographic_orientation=(value)
204   return @geographic_orientation = nil if value.nil?
205   fail(ArgumentError, "invalid geographic orientation") unless value.is_a? AIXM::A
206   @geographic_orientation = value
207 end
inspect() click to toggle source

@return [String]

    # File lib/aixm/component/fato.rb
194 def inspect
195   %Q(#<#{self.class} airport=#{fato&.airport&.id.inspect} name=#{name.inspect}>)
196 end
magnetic_orientation() click to toggle source

@return [AIXM::A] magnetic orientation (magnetic bearing) in degrees

    # File lib/aixm/component/fato.rb
214 def magnetic_orientation
215   if geographic_orientation && fato.airport.declination
216     geographic_orientation - fato.airport.declination
217   end
218 end
name=(value) click to toggle source
    # File lib/aixm/component/fato.rb
198 def name=(value)
199   fail(ArgumentError, "invalid name") unless value.is_a? String
200   @name = AIXM.a(value)
201 end
remarks=(value) click to toggle source
    # File lib/aixm/component/fato.rb
209 def remarks=(value)
210   @remarks = value&.to_s
211 end
to_uid() click to toggle source

@return [String] UID markup

    # File lib/aixm/component/fato.rb
221 def to_uid
222   builder = Builder::XmlMarkup.new(indent: 2)
223   builder.FdnUid do |fdn_uid|
224     fdn_uid << fato.to_uid.indent(2)
225     fdn_uid.txtDesig(name)
226   end
227 end
to_xml() click to toggle source

@return [String] AIXM or OFMX markup

    # File lib/aixm/component/fato.rb
231 def to_xml
232   builder = Builder::XmlMarkup.new(indent: 2)
233   builder.Fdn do |fdn|
234     fdn << to_uid.indent(2)
235     fdn.valTrueBrg(geographic_orientation) if geographic_orientation
236     fdn.valMagBrg(magnetic_orientation) if magnetic_orientation
237     fdn.txtRmk(remarks) if remarks
238   end
239   lightings.each do |lighting|
240     builder << lighting.to_xml(as: :Fls)
241   end
242   builder.target!
243 end