Class: AIXM::Component::Runway::Direction

Inherits:
Object
  • Object
show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::Memoize, AIXM::Concerns::Remarks, AIXM::Concerns::XMLBuilder
Defined in:
lib/aixm/component/runway.rb

Overview

Runway directions further describe each direction #forth and #back of a runway.

Constant Summary collapse

VFR_PATTERNS =
{
  L: :left,
  R: :right,
  E: :left_or_right
}.freeze

Instance Attribute Summary collapse

Attributes included from AIXM::Concerns::Remarks

#remarks

Instance Method Summary collapse

Methods included from AIXM::Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from AIXM::Concerns::Memoize

included, method

Methods included from AIXM::Concerns::Association

included

Constructor Details

#initialize(name:) ⇒ Direction

See the cheat sheet for examples on how to

create instances of this class.


284
285
286
287
# File 'lib/aixm/component/runway.rb', line 284

def initialize(name:)
  self.name = name
  self.vasis = AIXM.vasis
end

Instance Attribute Details

#displaced_thresholdAIXM::D?

Returns displaced threshold distance from edge of runway.

Returns:

  • (AIXM::D, nil)

    displaced threshold distance from edge of runway



270
271
272
# File 'lib/aixm/component/runway.rb', line 270

def displaced_threshold
  @displaced_threshold
end

#displaced_threshold_xyAIXM::XY?

Returns displaced threshold point.

Returns:

  • (AIXM::XY, nil)

    displaced threshold point



273
274
275
# File 'lib/aixm/component/runway.rb', line 273

def displaced_threshold_xy
  @displaced_threshold_xy
end

#geographic_bearingAIXM::A?

Returns (true) geographic bearing in degrees.

Returns:

  • (AIXM::A, nil)

    (true) geographic bearing in degrees



257
258
259
# File 'lib/aixm/component/runway.rb', line 257

def geographic_bearing
  @geographic_bearing
end

#nameAIXM::A #name=(value) ⇒ Object

Partial name of runway (e.g. “12” or “16L”)

Overloads:



254
255
256
# File 'lib/aixm/component/runway.rb', line 254

def name
  @name
end

#touch_down_zone_zAIXM::Z?

Returns elevation of the touch down zone in qnh.

Returns:

  • (AIXM::Z, nil)

    elevation of the touch down zone in qnh



267
268
269
# File 'lib/aixm/component/runway.rb', line 267

def touch_down_zone_z
  @touch_down_zone_z
end

#vasisAIXM::Component::VASIS?

Returns visual approach slope indicator system.

Returns:



277
278
279
# File 'lib/aixm/component/runway.rb', line 277

def vasis
  @vasis
end

#vfr_patternSymbol?

Returns direction of the VFR flight pattern (see VFR_PATTERNS).

Returns:

  • (Symbol, nil)

    direction of the VFR flight pattern (see VFR_PATTERNS)



280
281
282
# File 'lib/aixm/component/runway.rb', line 280

def vfr_pattern
  @vfr_pattern
end

#xyAIXM::XY

Returns center point at the beginning edge of the runway.

Returns:

  • (AIXM::XY)

    center point at the beginning edge of the runway



260
261
262
# File 'lib/aixm/component/runway.rb', line 260

def xy
  @xy
end

#zAIXM::Z?

Returns elevation of the center point at the beginning edge of the runway in qnh.

Returns:

  • (AIXM::Z, nil)

    elevation of the center point at the beginning edge of the runway in qnh



264
265
266
# File 'lib/aixm/component/runway.rb', line 264

def z
  @z
end

Instance Method Details

#add_approach_lighting(approach_lighting) ⇒ self

Parameters:

Returns:

  • (self)


241
# File 'lib/aixm/component/runway.rb', line 241

has_many :approach_lightings, as: :approach_lightable

#add_lighting(lighting) ⇒ self

Parameters:

Returns:

  • (self)


232
# File 'lib/aixm/component/runway.rb', line 232

has_many :lightings, as: :lightable

#approach_lightingsArray<AIXM::Component::ApproachLighting>

Returns installed approach lighting systems.

Returns:



241
# File 'lib/aixm/component/runway.rb', line 241

has_many :approach_lightings, as: :approach_lightable

#inspectString

Returns:

  • (String)


290
291
292
# File 'lib/aixm/component/runway.rb', line 290

def inspect
  %Q(#<#{self.class} airport=#{runway&.airport&.id.inspect} name=#{name.to_s(:runway).inspect}>)
end

#lightingsArray<AIXM::Component::Lighting>

Returns installed lighting systems.

Returns:



232
# File 'lib/aixm/component/runway.rb', line 232

has_many :lightings, as: :lightable

#magnetic_bearingAIXM::A

Returns magnetic bearing in degrees.

Returns:

  • (AIXM::A)

    magnetic bearing in degrees



353
354
355
356
357
# File 'lib/aixm/component/runway.rb', line 353

def magnetic_bearing
  if geographic_bearing && runway.airport.declination
    geographic_bearing - runway.airport.declination
  end
end

#runwayAIXM::Component::Runway

Returns runway the runway direction is further describing.

Returns:



246
# File 'lib/aixm/component/runway.rb', line 246

belongs_to :runway, readonly: true

#threshold_xyAIXM::XY

Returns displaced threshold if any or edge of runway otherwise.

Returns:

  • (AIXM::XY)

    displaced threshold if any or edge of runway otherwise



360
361
362
# File 'lib/aixm/component/runway.rb', line 360

def threshold_xy
  displaced_threshold_xy || xy
end