spec/factory.rb in aixm-0.3.5 vs spec/factory.rb in aixm-0.3.6

- old
+ new

@@ -22,10 +22,18 @@ def a AIXM.a('34L') end + def w + AIXM.w(1.5, :t) + end + + def p + AIXM.p(0.5, :mpa) + end + # Components def address AIXM.address( source: 'LF|GEN|0.0 FACTORY|0|0', @@ -34,15 +42,26 @@ ).tap do |address| address.remarks = "A/A (callsign PUJAUT)" end end + def lighting + AIXM.lighting( + position: :aiming_point + ).tap do |lighting| + lighting.description = "omnidirectional" + lighting.intensity = :medium + lighting.color = :green + lighting.remarks = "lighting remarks" + end + end + def timetable AIXM.timetable( code: :sunrise_to_sunset ).tap do |timetable| - timetable.remarks = "timetable remarks" + timetable.remarks = "timetable remarks" end end def vertical_limits AIXM.vertical_limits( @@ -315,13 +334,16 @@ ).tap do |airport| airport.gps = "LFPUJAUT" airport.z = AIXM.z(146, :qnh) airport.declination = 1.08 airport.transition_z = AIXM.z(10_000, :qnh) + airport.operator = "Municipality of Pujaut" airport.remarks = "Restricted access" airport.add_runway(runway) + airport.add_fato(fato) airport.add_helipad(helipad) + airport.helipads.first.fato = airport.fatos.first # necessary when using factories only airport.add_usage_limitation :permitted airport.add_usage_limitation(:reservation_required) do |reservation_required| reservation_required.add_condition { |c| c.aircraft = :glider } reservation_required.add_condition { |c| c.origin = :international } reservation_required.timetable = AIXM::H24 @@ -337,41 +359,78 @@ runway.width = AIXM.d(80, :m) runway.surface.composition = :asphalt runway.surface.preparation = :paved runway.surface.condition = :good runway.surface.pcn = "59/F/A/W/T" + runway.surface.siwl_weight = AIXM.w(1500, :kg) + runway.surface.siwl_tire_pressure = AIXM.p(0.5, :mpa) + runway.surface.auw_weight = AIXM.w(30, :t) runway.surface.remarks = "Paved shoulder on 2.5m on each side of the RWY." runway.status = :closed runway.remarks = "Markings eroded" runway.forth.xy = AIXM.xy(lat: %q(44°00'07.63"N), long: %q(004°45'07.81"E)) runway.forth.z = AIXM.z(145, :qnh) runway.forth.displaced_threshold = AIXM.xy(lat: %q(44°00'03.54"N), long: %q(004°45'09.30"E)) runway.forth.geographic_orientation = AIXM.a(165) runway.forth.vfr_pattern = :left_or_right runway.forth.remarks = "forth remarks" + runway.forth.add_lighting(lighting) runway.back.xy = AIXM.xy(lat: %q(43°59'25.31"N), long: %q(004°45'23.24"E)) runway.back.z = AIXM.z(147, :qnh) runway.back.displaced_threshold = AIXM.xy(lat: %q(43°59'31.84"N), long: %q(004°45'20.85"E)) runway.back.geographic_orientation = AIXM.a(345) runway.back.vfr_pattern = :left runway.back.remarks = "back remarks" + runway.back.add_lighting(lighting) end end + def fato + AIXM.fato(name: 'H1').tap do |fato| + fato.length = AIXM.d(35, :m) + fato.width = AIXM.d(35, :m) + fato.surface.composition = :concrete + fato.surface.preparation = :paved + fato.surface.condition = :fair + fato.surface.pcn = "30/F/A/W/U" + fato.surface.siwl_weight = AIXM.w(1500, :kg) + fato.surface.siwl_tire_pressure = AIXM.p(0.5, :mpa) + fato.surface.auw_weight = AIXM.w(8, :t) + fato.surface.remarks = "Cracks near the center" + fato.profile = "Northwest from RWY 12/30" + fato.marking = "Dashed white lines" + fato.status = :other + fato.remarks = "Authorizaton by AD operator required" + fato.add_direction(name: '35') do |direction| + direction.geographic_orientation = AIXM.a(355) + direction.remarks = "Avoid flight over residental area" + direction.add_lighting(lighting) + end + end + end + def helipad - AIXM.helipad(name: 'H1').tap do |helipad| - helipad.xy = AIXM.xy(lat: %q(43°59'56.94"N), long: %q(004°45'05.56"E)) + AIXM.helipad( + name: 'H1', + xy: AIXM.xy(lat: %q(43°59'56.94"N), long: %q(004°45'05.56"E)) + ).tap do |helipad| helipad.z = AIXM.z(141, :qnh) helipad.length = AIXM.d(20, :m) helipad.width = AIXM.d(20, :m) helipad.surface.composition = :concrete helipad.surface.preparation = :paved helipad.surface.condition = :fair helipad.surface.pcn = "30/F/A/W/U" - helipad.surface.remarks = "Cracks near the center." + helipad.surface.siwl_weight = AIXM.w(1500, :kg) + helipad.surface.siwl_tire_pressure = AIXM.p(0.5, :mpa) + helipad.surface.auw_weight = AIXM.w(8, :t) + helipad.surface.remarks = "Cracks near the center" + helipad.marking = "Continuous white lines" + helipad.helicopter_class = 1 helipad.status = :other helipad.remarks = "Authorizaton by AD operator required" + helipad.add_lighting(lighting) end end # Obstacle @@ -468,14 +527,13 @@ end # Document def document - time = Time.parse('2018-01-01 12:00:00 +0100') AIXM.document( region: 'LF', namespace: '00000000-0000-0000-0000-000000000000', - created_at: time, + created_at: (time = Time.parse('2018-01-01 12:00:00 +0100')), effective_at: time ).tap do |document| document.features << organisation document.features << unit document.features << airport