Class: AIXM::Component::Service

Inherits:
AIXM::Component show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::Remarks, AIXM::Concerns::Timetable
Defined in:
lib/aixm/component/service.rb

Overview

Service provided by a unit.

Cheat Sheet in Pseudo Code:

service = AIXM.service(
  type: TYPES
)
service.timetable = AIXM.timetable or nil
service.remarks = String or nil
service.add_frequency(AIXM.frequency)

Constant Summary collapse

TYPES =
{
  ACS: :area_control_service,
  ADS: :automatic_dependent_surveillance_service,
  ADVS: :advisory_service,
  AFIS: :aerodrome_flight_information_service,
  AFS: :aeronautical_fixed_service,
  AIS: :aeronautical_information_service,
  ALRS: :alerting_service,
  AMS: :aeronautical_mobile_service,
  AMSS: :aeronautical_mobile_satellite_service,
  APP: :approach_control_service,
  'APP-ARR': :approach_control_service_for_arrival,
  'APP-DEP': :approach_control_service_for_departure,
  ARTCC: :air_route_traffic_control_centre_service,
  ATC: :air_traffic_control_service,
  ATFM: :air_traffic_flow_management_service,
  ATIS: :automated_terminal_information_service,
  'ATIS-ARR': :automated_terminal_information_service_for_arrival,
  'ATIS-DEP': :automated_terminal_information_service_for_departure,
  ATM: :air_traffic_management_service,
  ATS: :air_traffic_service,
  BOF: :briefing_service,
  BS: :commercial_broadcasting_service,
  COM: :communications_service,
  CTAF: :common_traffic_advisory_frequency_service,
  DVDF: :doppler_vdf_service,
  EFAS: :en_route_flight_advisory_service,
  ENTRY: :entry_clearance_service,
  EXIT: :exit_clearance_service,
  FCST: :forecasting_service,
  FIS: :flight_information_service,
  FISA: :automated_flight_information_service,
  FSS: :flight_service_station_service,
  GCA: :ground_controlled_approach_service,
  INFO: :information_provision_service,
  MET: :meteorological_service,
  NOF: :international_notam_service,
  OAC: :oceanic_area_control_service,
  OVERFLT: :overflight_clearance_service,
  PAR: :precision_approach_radar_service,
  RAC: :rules_of_the_air_and_air_traffic_services,
  RADAR: :radar_service,
  RAF: :regional_area_forecasting_service,
  RCC: :rescue_coordination_service,
  SAR: :search_and_rescue_service,
  SIGMET: :sigmet_service,
  SMC: :surface_movement_control_service,
  SMR: :surface_movement_radar_service,
  SRA: :surveillance_radar_approach_service,
  SSR: :secondary_surveillance_radar_service,
  TAR: :terminal_area_radar_service,
  TWEB: :transcribed_weather_broadcast_service,
  TWR: :aerodrome_control_tower_service,
  UAC: :upper_area_control_service,
  UDF: :uhf_direction_finding_service,
  VDF: :vdf_direction_finding_service,
  VOLMET: :volmet_service,
  VOT: :vor_test_facility,
  OTHER: :other   # specify in remarks
}.freeze
GUESSED_UNIT_TYPES_MAP =

Map service types to guessed unit types

{
  :advisory_service => :advisory_centre,
  :aerodrome_control_tower_service => :aerodrome_control_tower,
  :aerodrome_flight_information_service => :aerodrome_control_tower,
  :aeronautical_information_service => :aeronautical_information_services_office,
  :air_route_traffic_control_centre_service => :air_route_traffic_control_centre,
  :air_traffic_control_service => :air_traffic_control_centre,
  :air_traffic_flow_management_service => :air_traffic_flow_management_unit,
  :air_traffic_management_service => :air_traffic_management_unit,
  :air_traffic_service => :air_traffic_services_unit,
  :approach_control_service => :approach_control_office,
  :approach_control_service_for_arrival => :arrivals_approach_control_office,
  :approach_control_service_for_departure => :depatures_approach_control_office,
  :area_control_service => :area_control_centre,
  :automated_terminal_information_service => :aerodrome_control_tower,
  :automated_terminal_information_service_for_arrival => :aerodrome_control_tower,
  :automated_terminal_information_service_for_departure => :aerodrome_control_tower,
  :automatic_dependent_surveillance_service => :automatic_dependent_surveillance_unit,
  :briefing_service => :briefing_office,
  :commercial_broadcasting_service => :commercial_broadcasting_station,
  :communications_service => :communications_office,
  :flight_information_service => :flight_information_centre,
  :flight_service_station_service => :flight_service_station,
  :forecasting_service => :forecasting_office,
  :ground_controlled_approach_service => :ground_controlled_approach_systems_office,
  :international_notam_service => :international_notam_office,
  :meteorological_service => :meteorological_office,
  :oceanic_area_control_service => :oceanic_control_centre,
  :precision_approach_radar_service => :precision_approach_radar_centre,
  :radar_service => :radar_office,
  :regional_area_forecasting_service => :regional_area_forecast_centre,
  :rescue_coordination_service => :rescue_coordination_centre,
  :search_and_rescue_service => :search_and_rescue_centre,
  :secondary_surveillance_radar_service => :secondary_surveillance_radar_centre,
  :sigmet_service => :meteorological_office,
  :surface_movement_control_service => :surface_movement_control_office,
  :surface_movement_radar_service => :surface_movement_radar_office,
  :surveillance_radar_approach_service => :surveillance_radar_approach_centre,
  :terminal_area_radar_service => :terminal_area_surveillance_radar_centre,
  :transcribed_weather_broadcast_service => :meteorological_office,
  :uhf_direction_finding_service => :uhf_direction_finding_station,
  :upper_area_control_service => :upper_area_control_centre,
  :vdf_direction_finding_service => :vdf_direction_finding_station,
  :volmet_service => :meteorological_office,
  :other => :other
}.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(type:) ⇒ Service

See the cheat sheet for examples on how to create instances of this class.



164
165
166
167
# File 'lib/aixm/component/service.rb', line 164

def initialize(type:)
  self.type = type
  @sequence = 1
end

Instance Attribute Details

#typeSymbol #type=(value) ⇒ Object

Type of service

Overloads:

  • #typeSymbol

    Returns any of TYPES.

    Returns:

    • (Symbol)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol)

      any of TYPES



160
161
162
# File 'lib/aixm/component/service.rb', line 160

def type
  @type
end

Instance Method Details

#add_frequency(frequency) ⇒ Object

Parameters:



136
# File 'lib/aixm/component/service.rb', line 136

has_many :frequencies

#airportAIXM::Feature::Airport

Returns airport this service is provided at.

Returns:



144
# File 'lib/aixm/component/service.rb', line 144

belongs_to :airport

#airspaceAIXM::Feature::Airspace

Returns airspace this service is provided in.

Returns:



148
# File 'lib/aixm/component/service.rb', line 148

belongs_to :airspace

#frequenciesArray<AIXM::Component::Frequency>

Returns frequencies used by this service.

Returns:



136
# File 'lib/aixm/component/service.rb', line 136

has_many :frequencies

#guessed_unit_typeSymbol?

Guess the unit type for this service

Returns:

  • (Symbol, nil)

    guessed unit type or nil if unmappable



181
182
183
# File 'lib/aixm/component/service.rb', line 181

def guessed_unit_type
  GUESSED_UNIT_TYPES_MAP[type]
end

#inspectString

Returns:

  • (String)


170
171
172
# File 'lib/aixm/component/service.rb', line 170

def inspect
  %Q(#<#{self.class} type=#{type.inspect}>)
end

#layerAIXM::Component::Layer

Returns airspace layer this service is provided within.

Returns:



152
# File 'lib/aixm/component/service.rb', line 152

belongs_to :layer

#unitAIXM::Feature::Unit

Returns unit providing this service.

Returns:



140
# File 'lib/aixm/component/service.rb', line 140

belongs_to :unit