Class: AIXM::Feature::NavigationalAid::VOR
- Inherits:
-
AIXM::Feature::NavigationalAid
- Object
- AIXM::Feature
- AIXM::Feature::NavigationalAid
- AIXM::Feature::NavigationalAid::VOR
- Defined in:
- lib/aixm/feature/navigational_aid/vor.rb
Overview
VHF omni directional radio range (VOR) is a type of radio navigation for aircraft to determine their position and course. They operate in the frequency band between 108.00 Mhz to 117.95 MHz.
Cheat Sheet in Pseudo Code:
vor = AIXM.vor(
source: String or nil
organisation: AIXM.organisation
id: String
name: String
xy: AIXM.xy
z: AIXM.z or nil
type: TYPES
f: AIXM.f
north: NORTHS
)
vor. = AIXM. or nil
vor.remarks = String or nil
vor.associate_dme(channel: String) # turns the VOR into a VOR/DME
vor.associate_tacan(channel: String) # turns the VOR into a VORTAC
Constant Summary collapse
- TYPES =
{ VOR: :conventional, DVOR: :doppler, OTHER: :other # specify in remarks }.freeze
- NORTHS =
{ TRUE: :geographic, GRID: :grid, # parallel to the north-south lines of the UTM grid MAG: :magnetic, OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#dme ⇒ AIXM::Feature::NavigationalAid::DME?
readonly
Associated DME.
-
#f ⇒ AIXM::F
Radio requency.
-
#north ⇒ Symbol
North indication (see NORTHS).
-
#tacan ⇒ AIXM::Feature::NavigationalAid::TACAN?
readonly
Associated TACAN.
-
#type ⇒ Symbol
Type of VOR (see TYPES).
Attributes inherited from AIXM::Feature::NavigationalAid
#id, #name, #remarks, #timetable, #xy, #z
Attributes inherited from AIXM::Feature
Instance Method Summary collapse
-
#associate_dme(channel:) ⇒ Object
Associate a DME which turns the VOR into a VOR/DME.
-
#associate_tacan(channel:) ⇒ Object
Associate a TACAN which turns the VOR into a VORTAC.
-
#initialize(type:, f:, north:, **arguments) ⇒ VOR
constructor
A new instance of VOR.
- #north_key ⇒ Object private
-
#to_uid ⇒ String
UID markup.
-
#to_xml ⇒ String
AIXM or OFMX markup.
- #type_key ⇒ Object private
Methods inherited from AIXM::Feature::NavigationalAid
Methods inherited from AIXM::Feature
Constructor Details
#initialize(type:, f:, north:, **arguments) ⇒ VOR
Returns a new instance of VOR.
60 61 62 63 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 60 def initialize(type:, f:, north:, **arguments) super(**arguments) self.type, self.f, self.north = type, f, north end |
Instance Attribute Details
#dme ⇒ AIXM::Feature::NavigationalAid::DME? (readonly)
Returns associated DME.
55 56 57 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 55 def dme @dme end |
#f ⇒ AIXM::F
Returns radio requency.
49 50 51 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 49 def f @f end |
#north ⇒ Symbol
Returns north indication (see NORTHS).
52 53 54 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 52 def north @north end |
#tacan ⇒ AIXM::Feature::NavigationalAid::TACAN? (readonly)
Returns associated TACAN.
58 59 60 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 58 def tacan @tacan end |
#type ⇒ Symbol
Returns type of VOR (see TYPES).
46 47 48 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 46 def type @type end |
Instance Method Details
#associate_dme(channel:) ⇒ Object
Associate a DME which turns the VOR into a VOR/DME
79 80 81 82 83 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 79 def associate_dme(channel:) @dme = AIXM.dme(organisation: organisation, id: id, name: name, xy: xy, z: z, channel: channel) @dme., @dme.remarks = , remarks @dme.send(:vor=, self) end |
#associate_tacan(channel:) ⇒ Object
Associate a TACAN which turns the VOR into a VORTAC
86 87 88 89 90 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 86 def associate_tacan(channel:) @tacan = AIXM.tacan(organisation: organisation, id: id, name: name, xy: xy, z: z, channel: channel) @tacan., @tacan.remarks = , remarks @tacan.send(:vor=, self) end |
#north_key ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
132 133 134 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 132 def north_key NORTHS.key(north) end |
#to_uid ⇒ String
Returns UID markup.
93 94 95 96 97 98 99 100 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 93 def to_uid builder = Builder::XmlMarkup.new(indent: 2) builder.VorUid do |vor_uid| vor_uid.codeId(id) vor_uid.geoLat(xy.lat(AIXM.schema)) vor_uid.geoLong(xy.long(AIXM.schema)) end end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 103 def to_xml builder = to_builder builder.Vor({ source: (source if AIXM.ofmx?) }.compact) do |vor| vor << to_uid.indent(2) vor << organisation.to_uid.indent(2) vor.txtName(name) if name vor.codeType(type_key.to_s) vor.valFreq(f.freq.trim) vor.uomFreq(f.unit.upcase.to_s) vor.codeTypeNorth(north_key.to_s) vor.codeDatum('WGE') if z vor.valElev(z.alt) vor.uomDistVer(z.unit.upcase.to_s) end vor << .to_xml(as: :Vtt).indent(2) if vor.txtRmk(remarks) if remarks end builder << @dme.to_xml if @dme builder << @tacan.to_xml if @tacan builder.target! end |
#type_key ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
127 128 129 |
# File 'lib/aixm/feature/navigational_aid/vor.rb', line 127 def type_key TYPES.key(type) end |