Class: AIPP::LF::AIP::NavigationalAids
- Inherits:
-
AIP::Parser
- Object
- Parser
- AIP::Parser
- AIPP::LF::AIP::NavigationalAids
- Includes:
- Helpers::Base
- Defined in:
- lib/aipp/regions/LF/aip/navigational_aids.rb
Constant Summary collapse
- SOURCE_TYPES =
{ 'DME-ATT' => [:dme], 'TACAN' => [:tacan], 'VOR' => [:vor], 'VOR-DME' => [:vor, :dme], 'VORTAC' => [:vor, :tacan], 'NDB' => [:ndb] }.freeze
Constants included from Helpers::Base
Instance Attribute Summary
Attributes inherited from Parser
Instance Method Summary collapse
Methods included from Helpers::Base
#b_from, #d_from, #geometry_from, #layer_from, #organisation_lf, #origin_for, #setup, #source, #timetable_from, #xy_from, #z_from
Methods inherited from Parser
#add, dependencies, depends_on, #find, #find_by, #given, #initialize, #inspect, #link_to, #origin_for, #read, #section
Methods included from Patcher
#attach_patches, #detach_patches, included
Methods included from Debugger
#info, #original_warn, #verbose_info, #warn, #with_debugger
Constructor Details
This class inherits a constructor from AIPP::Parser
Instance Method Details
#parse ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/aipp/regions/LF/aip/navigational_aids.rb', line 15 def parse SOURCE_TYPES.each do |source_type, (primary_type, secondary_type)| verbose_info("processing #{source_type}") AIPP.cache.navfix.css(%Q(NavFix[lk^="[LF][#{source_type} "])).each do |navfix_node| attributes = { source: source(part: 'ENR', position: navfix_node.line), organisation: organisation_lf, id: navfix_node.(:Ident), xy: xy_from(navfix_node.(:Geometrie)) } if radionav_node = AIPP.cache.radionav.at_css(%Q(RadioNav:has(NavFix[pk="#{navfix_node.attr(:pk)}"]))) attributes.merge! send(primary_type, radionav_node) add( AIXM.send(primary_type, **attributes).tap do || .name = radionav_node.(:NomPhraseo) || radionav_node.(:Station) . = (radionav_node.(:HorCode)) .remarks = { "location/situation" => radionav_node.(:Situation), "range/portée" => range_from(radionav_node) }.to_remarks .send("associate_#{secondary_type}") if secondary_type end ) else verbose_info("skipping incomplete #{source_type} #{attributes[:id]}") end end end end |