Class: AIXM::Component::Frequency

Inherits:
AIXM::Component show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::Remarks, AIXM::Concerns::Timetable
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

Attributes included from AIXM::Concerns::Remarks

#remarks

Attributes included from AIXM::Concerns::Timetable

#timetable

Attributes inherited from AIXM::Component

#meta

Instance Method Summary collapse

Methods included from AIXM::Concerns::Association

included

Methods included from AIXM::Concerns::HashEquality

#eql?, #hash

Methods included from AIXM::Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from AIXM::Concerns::Memoize

included, method

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

#callsignsHash #callsigns=(value) ⇒ Object

Map from languages (ISO 639-1) to callsigns

Examples:

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

Overloads:

  • #callsignsHash

    Returns:

    • (Hash)
  • #callsigns=(value) ⇒ Object

    Parameters:

    • value (Hash)


61
62
63
# File 'lib/aixm/component/frequency.rb', line 61

def callsigns
  @callsigns
end

#reception_fAIXM::F? #reception_f=(value) ⇒ Object

Note:

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)

Overloads:



73
74
75
# File 'lib/aixm/component/frequency.rb', line 73

def reception_f
  @reception_f
end

#transmission_fAIXM::F #transmission_f=(value) ⇒ Object

Frequency for transmission (outgoing)

Overloads:



49
50
51
# File 'lib/aixm/component/frequency.rb', line 49

def transmission_f
  @transmission_f
end

#typeSymbol? #type=(value) ⇒ Object

Type of frequency

Overloads:

  • #typeSymbol?

    Returns any of TYPES.

    Returns:

    • (Symbol, nil)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol, nil)

      any of TYPES



81
82
83
# File 'lib/aixm/component/frequency.rb', line 81

def type
  @type
end

Instance Method Details

#inspectString

Returns:

  • (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

#serviceAIXM::Component::Service

Returns service the frequency belongs to.

Returns:



41
# File 'lib/aixm/component/frequency.rb', line 41

belongs_to :service