class AIXM::Component::Frequency

Frequencies used by a service.

By default, {#reception_f} is set to the same value as {#transmission_f} since most services rely on simplex (aka: non-duplex) two-way communication. For services with one-way communication only such as ATIS, the {#reception_f} has to be set to nil explicitly!

Cheat Sheet in Pseudo Code:

frequency = AIXM.frequency(
  transmission_f: AIXM.f
  callsigns: Hash
)
frequency.reception_f = AIXM.f or nil
frequency.type = TYPES or nil
frequency.timetable = AIXM.timetable or nil
frequency.remarks = String or nil

@see gitlab.com/openflightmaps/ofmx/wikis/Organisation#fqy-frequency

Constants

TYPES

Attributes

callsigns[R]

@example

{ en: "STRASBOURG CONTROL", fr: "STRASBOURG CONTROLE" }

@return [Hash] map from languages (ISO 639-1) to callsigns

reception_f[R]

@note One-way services such as ATIS should set this to nil and simplex

(aka: non-duplex) communication should set this to {#transmission_f}.

@return [AIXM::F, nil] frequency for reception (incoming)

remarks[R]

@return [String, nil] free text remarks

timetable[R]

@return [AIXM::Component::Timetable, nil] operating hours

transmission_f[R]

@return [AIXM::F] frequency for transmission (outgoing)

type[R]

@return [Symbol, nil] type of frequency (see {TYPES})

Public Class Methods

new(transmission_f:, callsigns:) click to toggle source
   # File lib/aixm/component/frequency.rb
65 def initialize(transmission_f:, callsigns:)
66   self.transmission_f, self.callsigns = transmission_f, callsigns
67   self.reception_f = transmission_f
68 end

Public Instance Methods

callsigns=(value) click to toggle source
   # File lib/aixm/component/frequency.rb
80 def callsigns=(value)
81   fail(ArgumentError, "invalid callsigns") unless value.is_a?(Hash)
82   @callsigns = value.transform_keys { _1.to_sym.downcase }.transform_values { _1.to_s.uptrans }
83 end
inspect() click to toggle source

@return [String]

   # File lib/aixm/component/frequency.rb
71 def inspect
72   %Q(#<#{self.class} transmission_f=#{transmission_f.inspect} callsigns=#{callsigns.inspect}>)
73 end
reception_f=(value) click to toggle source
   # File lib/aixm/component/frequency.rb
85 def reception_f=(value)
86   fail(ArgumentError, "invalid reception_f") unless value.nil? || value.is_a?(AIXM::F)
87   @reception_f = value
88 end
remarks=(value) click to toggle source
    # File lib/aixm/component/frequency.rb
 99 def remarks=(value)
100   @remarks = value&.to_s
101 end
timetable=(value) click to toggle source
   # File lib/aixm/component/frequency.rb
94 def timetable=(value)
95   fail(ArgumentError, "invalid timetable") unless value.nil? || value.is_a?(AIXM::Component::Timetable)
96   @timetable = value
97 end
to_uid() click to toggle source

@return [String] UID markup

    # File lib/aixm/component/frequency.rb
104 def to_uid
105   builder = Builder::XmlMarkup.new(indent: 2)
106   builder.FqyUid do |fqy_uid|
107     fqy_uid << service.to_uid.indent(2)
108     fqy_uid.valFreqTrans(transmission_f.freq)
109   end
110 end
to_xml() click to toggle source

@return [String] AIXM or OFMX markup

    # File lib/aixm/component/frequency.rb
114 def to_xml
115   builder = Builder::XmlMarkup.new(indent: 2)
116   builder.Fqy do |fqy|
117     fqy << to_uid.indent(2)
118     fqy.valFreqRec(reception_f.freq) if reception_f
119     fqy.uomFreq(transmission_f.unit.upcase.to_s)
120     fqy << timetable.to_xml(as: :Ftt).indent(2) if timetable
121     fqy.txtRmk(remarks) if remarks
122     callsigns.each do |language, callsign|
123       fqy.Cdl do |cdl|
124         cdl.txtCallSign(callsign)
125         cdl.codeLang(language.upcase.to_s)
126       end
127     end
128     fqy.target!
129   end
130 end
transmission_f=(value) click to toggle source
   # File lib/aixm/component/frequency.rb
75 def transmission_f=(value)
76   fail(ArgumentError, "invalid transmission_f") unless value.is_a? AIXM::F
77   @transmission_f = value
78 end
type=(value) click to toggle source
   # File lib/aixm/component/frequency.rb
90 def type=(value)
91   @type = value.nil? ? nil : TYPES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid type")
92 end