Class: AIXM::Component::Runway
- Inherits:
-
AIXM::Component
- Object
- AIXM::Component
- AIXM::Component::Runway
- Defined in:
- lib/aixm/component/runway.rb
Overview
Runways are landing and takeoff strips for forward propelled aircraft.
By convention, the runway name is usually the composition of the runway forth name (smaller number) and the runway back name (bigger number) joined with a forward slash e.g. “12/30” or “16R/34L”.
A runway has one or to directions accessible as runway.forth
(mandatory) and runway.back
(optional). Both have identical properties.
Cheat Sheet in Pseudo Code:
runway = AIXM.runway(
name: String
)
runway.dimensions = AIXM.r or nil
runway.surface = AIXM.surface
runway.marking = String or nil
runway.status = STATUSES or nil
runway.remarks = String or nil
runway.forth.name = AIXM.a # preset based on the runway name
runway.forth.geographic_bearing = AIXM.a or nil
runway.forth.xy = AIXM.xy # center point at beginning edge of runway
runway.forth.z = AIXM.z or nil # center point at beginning edge of runway
runway.forth.touch_down_zone_z = AIXM.z or nil
runway.forth.displaced_threshold = AIXM.d or nil # sets displaced_threshold_xy as well
runway.forth.displaced_threshold_xy = AIXM.xy or nil # sets displaced_threshold as well
runway.forth.vasis = AIXM.vasis or nil (default: unspecified VASIS)
runway.forth.add_lighting = AIXM.lighting
runway.forth.add_approach_lighting = AIXM.approach_lighting
runway.forth.vfr_pattern = VFR_PATTERNS or nil
runway.forth.remarks = String or nil
Defined Under Namespace
Classes: Direction
Constant Summary collapse
- STATUSES =
{ CLSD: :closed, WIP: :work_in_progress, # e.g. construction work PARKED: :parked_aircraft, # parked or disabled aircraft on helipad FAILAID: :visual_aids_failure, # failure or irregular operation of visual aids SPOWER: :secondary_power, # secondary power supply in operation OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
Dimensions.
-
#name ⇒ Object
Full name of runway (e.g. “12/30” or “16L/34R”).
-
#status ⇒ Object
Status of the runway.
Attributes included from AIXM::Concerns::Remarks
Attributes included from AIXM::Concerns::Marking
Attributes inherited from AIXM::Component
Instance Method Summary collapse
-
#airport ⇒ AIXM::Feature::Airport
Airport the runway belongs to.
-
#back ⇒ AIXM::Component::Runway::Direction?
Reverse direction.
- #back=(back) ⇒ Object
-
#center_line ⇒ AIXM::L?
Center line of the runway.
-
#forth ⇒ AIXM::Component::Runway::Direction
Main direction.
- #forth=(forth) ⇒ Object
-
#initialize(name:) ⇒ Runway
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#surface ⇒ AIXM::Component::Surface
Surface of the runway.
- #surface=(surface) ⇒ Object
Methods included from AIXM::Concerns::Association
Methods included from AIXM::Concerns::HashEquality
Methods included from AIXM::Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from AIXM::Concerns::Memoize
Constructor Details
#initialize(name:) ⇒ Runway
See the cheat sheet for examples on how to create instances of this class.
119 120 121 122 123 124 125 126 127 |
# File 'lib/aixm/component/runway.rb', line 119 def initialize(name:) self.name = name @name.split("/").tap do |forth_name, back_name| self.forth = Direction.new(name: AIXM.a(forth_name)) self.back = Direction.new(name: AIXM.a(back_name)) if back_name fail(ArgumentError, "invalid name") unless !back || back.name.inverse_of?(@forth.name) end self.surface = AIXM.surface end |
Instance Attribute Details
#dimensions ⇒ AIXM::R? #dimensions=(value) ⇒ Object
Dimensions
106 107 108 |
# File 'lib/aixm/component/runway.rb', line 106 def dimensions @dimensions end |
#name ⇒ String #name=(value) ⇒ Object
Full name of runway (e.g. “12/30” or “16L/34R”)
98 99 100 |
# File 'lib/aixm/component/runway.rb', line 98 def name @name end |
#status ⇒ Symbol? #status=(value) ⇒ Object
Status of the runway
115 116 117 |
# File 'lib/aixm/component/runway.rb', line 115 def status @status end |
Instance Method Details
#airport ⇒ AIXM::Feature::Airport
Returns airport the runway belongs to.
90 |
# File 'lib/aixm/component/runway.rb', line 90 belongs_to :airport |
#back ⇒ AIXM::Component::Runway::Direction?
Returns reverse direction.
79 |
# File 'lib/aixm/component/runway.rb', line 79 has_one :back, accept: 'AIXM::Component::Runway::Direction', allow_nil: true |
#back=(back) ⇒ Object
79 |
# File 'lib/aixm/component/runway.rb', line 79 has_one :back, accept: 'AIXM::Component::Runway::Direction', allow_nil: true |
#center_line ⇒ AIXM::L?
Center line of the runway
The center line of unidirectional runwawys is calculated using the runway dimensions. If they are unknown, the calculation is not possible and this method returns nil
.
155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/aixm/component/runway.rb', line 155 def center_line if back || dimensions AIXM.l.add_line_point( xy: forth.xy, z: forth.z ).add_line_point( xy: (back&.xy || forth.xy.add_distance(dimensions.length, forth.geographic_bearing)), z: back&.z ) end end |
#forth ⇒ AIXM::Component::Runway::Direction
Returns main direction.
72 |
# File 'lib/aixm/component/runway.rb', line 72 has_one :forth, accept: 'AIXM::Component::Runway::Direction' |
#forth=(forth) ⇒ Object
72 |
# File 'lib/aixm/component/runway.rb', line 72 has_one :forth, accept: 'AIXM::Component::Runway::Direction' |
#inspect ⇒ String
130 131 132 |
# File 'lib/aixm/component/runway.rb', line 130 def inspect %Q(#<#{self.class} airport=#{airport&.id.inspect} name=#{name.inspect}>) end |
#surface ⇒ AIXM::Component::Surface
Returns surface of the runway.
86 |
# File 'lib/aixm/component/runway.rb', line 86 has_one :surface, accept: 'AIXM::Component::Surface' |
#surface=(surface) ⇒ Object
86 |
# File 'lib/aixm/component/runway.rb', line 86 has_one :surface, accept: 'AIXM::Component::Surface' |