Class: AIXM::Feature::NavigationalAid::DME
- Inherits:
-
AIXM::Feature::NavigationalAid
- Object
- AIXM::Feature
- AIXM::Feature::NavigationalAid
- AIXM::Feature::NavigationalAid::DME
- Defined in:
- lib/aixm/feature/navigational_aid/dme.rb
Overview
Distance measuring equipment (DME) is a transponder-based radio navigation technology which measures slant range distance by timing the propagation delay of VHF or UHF signals. They operate in the frequency band between 962 MHz and 1213 MHz.
Cheat Sheet in Pseudo Code:
dme = AIXM.dme(
source: String or nil
organisation: AIXM.organisation
id: String
name: String
xy: AIXM.xy
z: AIXM.z or nil
channel: String
)
dme. = AIXM. or nil
dme.remarks = String or nil
Direct Known Subclasses
Constant Summary collapse
- CHANNEL_RE =
/\A([1-9]|[1-9]\d|1[0-1]\d|12[0-6])[XY]\z/.freeze
Instance Attribute Summary collapse
-
#channel ⇒ String
Radio channel.
-
#vor ⇒ AIXM::Feature::NavigationalAid::VOR?
readonly
Associated VOR.
Attributes inherited from AIXM::Feature::NavigationalAid
#id, #name, #remarks, #timetable, #xy, #z
Attributes inherited from AIXM::Feature
Instance Method Summary collapse
-
#ghost_f ⇒ AIXM::F
Ghost frequency matching the channel.
-
#initialize(channel:, **arguments) ⇒ DME
constructor
A new instance of DME.
-
#to_uid ⇒ String
UID markup.
-
#to_xml ⇒ String
AIXM or OFMX markup.
Methods inherited from AIXM::Feature::NavigationalAid
Methods inherited from AIXM::Feature
Constructor Details
#initialize(channel:, **arguments) ⇒ DME
Returns a new instance of DME.
37 38 39 40 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 37 def initialize(channel:, **arguments) super(**arguments) self.channel = channel end |
Instance Attribute Details
#channel ⇒ String
Returns radio channel.
32 33 34 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 32 def channel @channel end |
#vor ⇒ AIXM::Feature::NavigationalAid::VOR?
Returns associated VOR.
35 36 37 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 35 def vor @vor end |
Instance Method Details
#ghost_f ⇒ AIXM::F
Returns ghost frequency matching the channel.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 48 def ghost_f if channel number, letter = channel.split(/(?=[XY])/) integer = case number.to_i when (1..16) then 13430 when (17..59) then 10630 when (60..69) then 12730 when (70..126) then 10530 end integer += number.to_i * 10 integer += 5 if letter == 'Y' AIXM.f(integer.to_f / 100, :mhz) end end |
#to_uid ⇒ String
Returns UID markup.
70 71 72 73 74 75 76 77 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 70 def to_uid builder = Builder::XmlMarkup.new(indent: 2) builder.DmeUid do |dme_uid| dme_uid.codeId(id) dme_uid.geoLat(xy.lat(AIXM.schema)) dme_uid.geoLong(xy.long(AIXM.schema)) end end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/aixm/feature/navigational_aid/dme.rb', line 80 def to_xml builder = to_builder builder.Dme({ source: (source if AIXM.ofmx?) }.compact) do |dme| dme << to_uid.indent(2) dme << organisation.to_uid.indent(2) dme << vor.to_uid.indent(2) if vor dme.txtName(name) if name dme.codeChannel(channel) unless vor dme.valGhostFreq(ghost_f.freq.trim) dme.uomGhostFreq('MHZ') end dme.codeDatum('WGE') if z dme.valElev(z.alt) dme.uomDistVer(z.unit.upcase.to_s) end dme << .to_xml(as: :Dtt).indent(2) if dme.txtRmk(remarks) if remarks dme.target! end end |