Class: AIXM::Feature::NavigationalAid::TACAN

Inherits:
DME show all
Defined in:
lib/aixm/feature/navigational_aid/tacan.rb

Overview

TACAN (tactical air navigation system) are military systems which also provide DME service to civilian aircraft and therefore operate in the frequency band between 960 MHz and 1215 MHz.

Cheat Sheet in Pseudo Code:

tacan = AIXM.tacan(
  source: String or nil
  organisation: AIXM.organisation
  id: String
  name: String
  xy: AIXM.xy
  z: AIXM.z or nil
  channel: String
)

tacan.timetable = AIXM.timetable or nil tacan.remarks = String or nil

Constant Summary

Constants inherited from DME

DME::CHANNEL_RE

Instance Attribute Summary

Attributes inherited from DME

#channel, #vor

Attributes inherited from AIXM::Feature::NavigationalAid

#id, #name, #remarks, #timetable, #xy, #z

Attributes inherited from AIXM::Feature

#source

Instance Method Summary collapse

Methods inherited from DME

#ghost_f, #initialize

Methods inherited from AIXM::Feature::NavigationalAid

#initialize, #inspect, #kind

Methods inherited from AIXM::Feature

#==, #initialize

Constructor Details

This class inherits a constructor from AIXM::Feature::NavigationalAid::DME

Instance Method Details

#to_uidString


29
30
31
32
33
34
35
36
# File 'lib/aixm/feature/navigational_aid/tacan.rb', line 29

def to_uid
  builder = Builder::XmlMarkup.new(indent: 2)
  builder.TcnUid do |tcn_uid|
    tcn_uid.codeId(id)
    tcn_uid.geoLat(xy.lat(AIXM.schema))
    tcn_uid.geoLong(xy.long(AIXM.schema))
  end.insert_payload_hash(region: AIXM.config.mid_region)
end

#to_xmlString


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/aixm/feature/navigational_aid/tacan.rb', line 39

def to_xml
  builder = to_builder
  builder.Tcn({ source: (source if AIXM.ofmx?) }.compact) do |tcn|
    tcn << to_uid.indent(2)
    tcn << organisation.to_uid.indent(2)
    tcn << vor.to_uid.indent(2) if vor
    tcn.txtName(name) if name
    tcn.codeChannel(channel)
    if !vor && AIXM.ofmx?
      tcn.valGhostFreq(ghost_f.freq.trim)
      tcn.uomGhostFreq('MHZ')
    end
    tcn.codeDatum('WGE')
    if z
      tcn.valElev(z.alt)
      tcn.uomDistVer(z.unit.upcase.to_s)
    end
    tcn << timetable.to_xml(as: :Ttt).indent(2) if timetable
    tcn.txtRmk(remarks) if remarks
    tcn.target!
  end
end