Class: AIXM::Component::Frequency
- Inherits:
-
AIXM::Component
- Object
- AIXM::Component
- AIXM::Component::Frequency
- Defined in:
- lib/aixm/component/frequency.rb
Overview
Voice 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
Constant Summary collapse
- TYPES =
{ STD: :standard, ALT: :alternative, EMRG: :emergency, GUARD: :guard, MIL: :military, CIV: :civilian, OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#callsigns ⇒ Object
Map from languages (ISO 639-1) to callsigns.
-
#reception_f ⇒ Object
Frequency for reception (incoming).
-
#transmission_f ⇒ Object
Frequency for transmission (outgoing).
-
#type ⇒ Object
Type of frequency.
Attributes included from AIXM::Concerns::Remarks
Attributes included from AIXM::Concerns::Timetable
Attributes inherited from AIXM::Component
Instance Method Summary collapse
-
#initialize(transmission_f:, callsigns:) ⇒ Frequency
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#service ⇒ AIXM::Component::Service
Service the frequency belongs to.
Methods included from AIXM::Concerns::Association
Methods included from AIXM::Concerns::HashEquality
Methods included from AIXM::Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from AIXM::Concerns::Memoize
Constructor Details
#initialize(transmission_f:, callsigns:) ⇒ Frequency
See the cheat sheet for examples on how to create instances of this class.
85 86 87 88 |
# File 'lib/aixm/component/frequency.rb', line 85 def initialize(transmission_f:, callsigns:) self.transmission_f, self.callsigns = transmission_f, callsigns self.reception_f = transmission_f end |
Instance Attribute Details
#callsigns ⇒ Hash #callsigns=(value) ⇒ Object
Map from languages (ISO 639-1) to callsigns
61 62 63 |
# File 'lib/aixm/component/frequency.rb', line 61 def callsigns @callsigns end |
#reception_f ⇒ AIXM::F? #reception_f=(value) ⇒ Object
One-way services such as ATIS should set this to nil
and simplex (aka: non-duplex) communication should set this to #transmission_f.
Frequency for reception (incoming)
73 74 75 |
# File 'lib/aixm/component/frequency.rb', line 73 def reception_f @reception_f end |
#transmission_f ⇒ AIXM::F #transmission_f=(value) ⇒ Object
Frequency for transmission (outgoing)
49 50 51 |
# File 'lib/aixm/component/frequency.rb', line 49 def transmission_f @transmission_f end |
#type ⇒ Symbol? #type=(value) ⇒ Object
Type of frequency
81 82 83 |
# File 'lib/aixm/component/frequency.rb', line 81 def type @type end |
Instance Method Details
#inspect ⇒ String
91 92 93 |
# File 'lib/aixm/component/frequency.rb', line 91 def inspect %Q(#<#{self.class} transmission_f=#{transmission_f.inspect} callsigns=#{callsigns.inspect}>) end |
#service ⇒ AIXM::Component::Service
Returns service the frequency belongs to.
41 |
# File 'lib/aixm/component/frequency.rb', line 41 belongs_to :service |