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

Inherits:
DME show all
Includes:
Memoize
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
  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

Constant Summary

Constants inherited from DME

DME::CHANNEL_RE

Constants inherited from AIXM::Feature

REGION_RE

Instance Attribute Summary

Attributes inherited from DME

#channel

Attributes inherited from AIXM::Feature::NavigationalAid

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

Attributes inherited from AIXM::Feature

#region, #source

Instance Method Summary collapse

Methods included from Memoize

cache, included, method

Methods inherited from DME

#ghost_f, #initialize, #vor

Methods inherited from AIXM::Feature::NavigationalAid

#initialize, #inspect, #kind, #organisation

Methods included from Association

included

Methods inherited from AIXM::Feature

#==, #initialize

Constructor Details

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

Instance Method Details

#to_uidString

Returns UID markup.

Returns:

  • (String)

    UID markup


32
33
34
35
36
37
38
39
# File 'lib/aixm/feature/navigational_aid/tacan.rb', line 32

def to_uid
  builder = Builder::XmlMarkup.new(indent: 2)
  builder.TcnUid({ region: (region if AIXM.ofmx?) }.compact) do |tcn_uid|
    tcn_uid.codeId(id)
    tcn_uid.geoLat(xy.lat(AIXM.schema))
    tcn_uid.geoLong(xy.long(AIXM.schema))
  end
end

#to_xmlString

Returns AIXM or OFMX markup.

Returns:

  • (String)

    AIXM or OFMX markup


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/aixm/feature/navigational_aid/tacan.rb', line 43

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