Class: AIXM::Component::Helipad

Inherits:
Object
  • Object
show all
Defined in:
lib/aixm/component/helipad.rb

Overview

Helipads are TLOF (touch-down and lift-off areas) e.g. for helicopters.

Cheat Sheet in Pseudo Code:

helipad = AIXM.helipad(
  name: String
)
helipad.xy = AIXM.xy
helipad.z = AIXM.z or nil
helipad.length = AIXM.d or nil   # must use same unit as width
helipad.width = AIXM.d or nil    # must use same unit as length
helipad.composition = COMPOSITIONS or nil
helipad.status = STATUSES or nil
helipad.remarks = String or nil

Constant Summary collapse

COMPOSITIONS =
{
  ASPH: :asphalt,
  BITUM: :bitumen,        # dug up, bound and rolled ground
  CONC: :concrete,
  GRAVE: :gravel,         # small and midsize rounded stones
  MACADAM: :macadam,      # small rounded stones
  SAND: :sand,
  GRADE: :graded_earth,   # graded or rolled earth possibly with some grass
  GRASS: :grass,          # lawn
  WATER: :water,
  OTHER: :other           # specify in remarks
}.freeze
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

Instance Method Summary collapse

Constructor Details

#initialize(name:) ⇒ Helipad

Returns a new instance of Helipad


71
72
73
# File 'lib/aixm/component/helipad.rb', line 71

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

Instance Attribute Details

#airportAIXM::Feature::Airport

Returns airport this helipad belongs to

Returns:


45
46
47
# File 'lib/aixm/component/helipad.rb', line 45

def airport
  @airport
end

#compositionSymbol?

Returns composition of the surface (see COMPOSITIONS)

Returns:

  • (Symbol, nil)

    composition of the surface (see COMPOSITIONS)


63
64
65
# File 'lib/aixm/component/helipad.rb', line 63

def composition
  @composition
end

#lengthAIXM::D?

Returns length

Returns:


57
58
59
# File 'lib/aixm/component/helipad.rb', line 57

def length
  @length
end

#nameString

Returns full name (e.g. “H1”)

Returns:

  • (String)

    full name (e.g. “H1”)


48
49
50
# File 'lib/aixm/component/helipad.rb', line 48

def name
  @name
end

#remarksString?

Returns free text remarks

Returns:

  • (String, nil)

    free text remarks


69
70
71
# File 'lib/aixm/component/helipad.rb', line 69

def remarks
  @remarks
end

#statusSymbol?

Returns status of the helipad (see STATUSES) or nil for normal operation

Returns:

  • (Symbol, nil)

    status of the helipad (see STATUSES) or nil for normal operation


66
67
68
# File 'lib/aixm/component/helipad.rb', line 66

def status
  @status
end

#widthAIXM::D?

Returns width

Returns:


60
61
62
# File 'lib/aixm/component/helipad.rb', line 60

def width
  @width
end

#xyAIXM::XY

Returns center point

Returns:


51
52
53
# File 'lib/aixm/component/helipad.rb', line 51

def xy
  @xy
end

#zAIXM::Z?

Returns elevation in :qnh

Returns:

  • (AIXM::Z, nil)

    elevation in :qnh


54
55
56
# File 'lib/aixm/component/helipad.rb', line 54

def z
  @z
end

Instance Method Details

#inspectString

Returns:

  • (String)

76
77
78
# File 'lib/aixm/component/helipad.rb', line 76

def inspect
  %Q(#<#{self.class} name=#{name.inspect}>)
end

#to_uidString

Returns UID markup

Returns:

  • (String)

    UID markup


130
131
132
133
134
135
136
# File 'lib/aixm/component/helipad.rb', line 130

def to_uid
  builder = Builder::XmlMarkup.new(indent: 2)
  builder.TlaUid do |tla_uid|
    tla_uid << airport.to_uid.indent(2)
    tla_uid.txtDesig(name)
  end
end

#to_xmlString

Returns AIXM or OFMX markup

Returns:

  • (String)

    AIXM or OFMX markup


139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/aixm/component/helipad.rb', line 139

def to_xml
  builder = Builder::XmlMarkup.new(indent: 2)
  builder.Tla do |tla|
    tla << to_uid.indent(2)
    tla.geoLat(xy.lat(AIXM.schema))
    tla.geoLong(xy.long(AIXM.schema))
    tla.codeDatum('WGE')
    if z
      tla.valElev(z.alt)
      tla.uomDistVer(z.unit.upcase.to_s)
    end
    tla.valLen(length.dist.trim) if length
    tla.valWid(width.dist.trim) if width
    tla.uomDim(length.unit.to_s.upcase) if length
    tla.uomDim(width.unit.to_s.upcase) if width && !length
    tla.codeComposition(COMPOSITIONS.key(composition).to_s) if composition
    tla.codeSts(STATUSES.key(status).to_s) if status
    tla.txtRmk(remarks) if remarks
  end
end