class AIXM::Feature::NavigationalAid::VOR
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 region: 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.timetable = AIXM.timetable 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
@see gitlab.com/openflightmaps/ofmx/wikis/Navigational-aid#vor-vor
Constants
- NORTHS
- TYPES
Attributes
f[R]
@return [AIXM::F] radio requency
north[R]
@return [Symbol] north indication (see {NORTHS})
type[R]
@return [Symbol] type of VOR
(see {TYPES})
Public Class Methods
new(source: nil, region: nil)
click to toggle source
# File lib/aixm/feature.rb 15 def initialize(source: nil, region: nil) 16 self.source = source 17 self.region = region || AIXM.config.region 18 end
new(type:, f:, north:, **arguments)
click to toggle source
Calls superclass method
AIXM::Feature::NavigationalAid::new
# File lib/aixm/feature/navigational_aid/vor.rb 69 def initialize(type:, f:, north:, **arguments) 70 super(**arguments) 71 self.type, self.f, self.north = type, f, north 72 end
Public Instance Methods
associate_dme(channel:)
click to toggle source
Associate a DME
which turns the VOR
into a VOR/DME
# File lib/aixm/feature/navigational_aid/vor.rb 88 def associate_dme(channel:) 89 self.dme = AIXM.dme(region: region, organisation: organisation, id: id, name: name, xy: xy, z: z, channel: channel) 90 dme.timetable, @dme.remarks = timetable, remarks 91 end
associate_tacan(channel:)
click to toggle source
Associate a TACAN
which turns the VOR
into a VORTAC
# File lib/aixm/feature/navigational_aid/vor.rb 94 def associate_tacan(channel:) 95 self.tacan = AIXM.tacan(region: region, organisation: organisation, id: id, name: name, xy: xy, z: z, channel: channel) 96 tacan.timetable, @tacan.remarks = timetable, remarks 97 end
f=(value)
click to toggle source
# File lib/aixm/feature/navigational_aid/vor.rb 78 def f=(value) 79 fail(ArgumentError, "invalid f") unless value.is_a?(F) && value.between?(108, 117.95, :mhz) 80 @f = value 81 end
north=(value)
click to toggle source
# File lib/aixm/feature/navigational_aid/vor.rb 83 def north=(value) 84 @north = NORTHS.lookup(value&.to_s&.to_sym, nil) || fail(ArgumentError, "invalid north") 85 end
north_key()
click to toggle source
@api private
# File lib/aixm/feature/navigational_aid/vor.rb 140 def north_key 141 NORTHS.key(north) 142 end
to_uid()
click to toggle source
@return [String] UID markup
# File lib/aixm/feature/navigational_aid/vor.rb 100 def to_uid 101 builder = Builder::XmlMarkup.new(indent: 2) 102 builder.VorUid({ region: (region if AIXM.ofmx?) }.compact) do |vor_uid| 103 vor_uid.codeId(id) 104 vor_uid.geoLat(xy.lat(AIXM.schema)) 105 vor_uid.geoLong(xy.long(AIXM.schema)) 106 end 107 end
to_xml()
click to toggle source
@return [String] AIXM
or OFMX markup
# File lib/aixm/feature/navigational_aid/vor.rb 111 def to_xml 112 builder = to_builder 113 builder.Vor({ source: (source if AIXM.ofmx?) }.compact) do |vor| 114 vor << to_uid.indent(2) 115 vor << organisation.to_uid.indent(2) 116 vor.txtName(name) if name 117 vor.codeType(type_key.to_s) 118 vor.valFreq(f.freq.trim) 119 vor.uomFreq(f.unit.upcase.to_s) 120 vor.codeTypeNorth(north_key.to_s) 121 vor.codeDatum('WGE') 122 if z 123 vor.valElev(z.alt) 124 vor.uomDistVer(z.unit.upcase.to_s) 125 end 126 vor << timetable.to_xml(as: :Vtt).indent(2) if timetable 127 vor.txtRmk(remarks) if remarks 128 end 129 builder << @dme.to_xml if @dme 130 builder << @tacan.to_xml if @tacan 131 builder.target! 132 end
type=(value)
click to toggle source
# File lib/aixm/feature/navigational_aid/vor.rb 74 def type=(value) 75 @type = TYPES.lookup(value&.to_s&.to_sym, nil) || fail(ArgumentError, "invalid type") 76 end
type_key()
click to toggle source
@api private
# File lib/aixm/feature/navigational_aid/vor.rb 135 def type_key 136 TYPES.key(type) 137 end