class AIXM::Feature::NavigationalAid::TACAN

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
  region: 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

@see gitlab.com/openflightmaps/ofmx/wikis/Navigational-aid#tcn-tacan

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

Public Instance Methods

to_uid() click to toggle source

@return [String] UID markup

   # File lib/aixm/feature/navigational_aid/tacan.rb
32 def to_uid
33   builder = Builder::XmlMarkup.new(indent: 2)
34   builder.TcnUid({ region: (region if AIXM.ofmx?) }.compact) do |tcn_uid|
35     tcn_uid.codeId(id)
36     tcn_uid.geoLat(xy.lat(AIXM.schema))
37     tcn_uid.geoLong(xy.long(AIXM.schema))
38   end
39 end
to_xml() click to toggle source

@return [String] AIXM or OFMX markup

   # File lib/aixm/feature/navigational_aid/tacan.rb
43 def to_xml
44   builder = to_builder
45   builder.Tcn({ source: (source if AIXM.ofmx?) }.compact) do |tcn|
46     tcn << to_uid.indent(2)
47     tcn << organisation.to_uid.indent(2)
48     tcn << vor.to_uid.indent(2) if vor
49     tcn.txtName(name) if name
50     tcn.codeChannel(channel)
51     if !vor && AIXM.ofmx?
52       tcn.valGhostFreq(ghost_f.freq.trim)
53       tcn.uomGhostFreq('MHZ')
54     end
55     tcn.codeDatum('WGE')
56     if z
57       tcn.valElev(z.alt)
58       tcn.uomDistVer(z.unit.upcase.to_s)
59     end
60     tcn << timetable.to_xml(as: :Ttt).indent(2) if timetable
61     tcn.txtRmk(remarks) if remarks
62     tcn.target!
63   end
64 end