Class: NMEAPlus::Message::AIS::VDMPayload::VDMMsg5

Inherits:
VDMMsg
  • Object
show all
Defined in:
lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb

Instance Attribute Summary collapse

Attributes inherited from VDMMsg

#fill_bits, #message_type, #payload_bitstring, #repeat_indicator, #source_mmsi

Instance Method Summary collapse

Methods inherited from VDMMsg

#_2b_data_string, #_6b_ascii, #_6b_boolean, #_6b_integer, #_6b_integer_scaled, #_6b_string, #_6b_string_nullterminated, #_6b_twoscomplement, #_6b_unsigned_integer, #_6b_unsigned_integer_scaled, #_8b_data_string, #_access, #_bit_slices, payload_reader

Instance Attribute Details

#ais_versionObject (readonly)

Returns The field defined by 2 bits starting at bit 38 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



9
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 9

payload_reader :ais_version, 38, 2, :_u

#callsignObject (readonly)

Returns The field defined by 42 bits starting at bit 70 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_t().

Returns:



11
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 11

payload_reader :callsign, 70, 42, :_t

#destinationObject (readonly)

Returns The field defined by 120 bits starting at bit 302 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_t().

Returns:



31
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 31

payload_reader :destination, 302, 120, :_t

#dte?Object (readonly)

Returns The field defined by 1 bits starting at bit 422 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_b().

Returns:



32
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 32

payload_reader :dte?, 422, 1, :_b

#epfd_typeObject (readonly)

Returns The field defined by 4 bits starting at bit 270 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_e().

Returns:



18
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 18

payload_reader :epfd_type, 270, 4, :_e

#imo_numberObject (readonly)

Returns The field defined by 30 bits starting at bit 40 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



10
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 10

payload_reader :imo_number, 40, 30, :_u

#nameObject (readonly)

Returns The field defined by 120 bits starting at bit 112 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_t().

Returns:



12
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 12

payload_reader :name, 112, 120, :_t

#ship_cargo_typeObject (readonly)

Returns The field defined by 8 bits starting at bit 232 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_e().

Returns:



13
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 13

payload_reader :ship_cargo_type, 232, 8, :_e

#ship_dimension_to_bowObject (readonly)

Returns The field defined by 9 bits starting at bit 240 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



14
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 14

payload_reader :ship_dimension_to_bow, 240, 9, :_u

#ship_dimension_to_portObject (readonly)

Returns The field defined by 6 bits starting at bit 258 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



16
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 16

payload_reader :ship_dimension_to_port, 258, 6, :_u

#ship_dimension_to_starboardObject (readonly)

Returns The field defined by 6 bits starting at bit 264 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



17
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 17

payload_reader :ship_dimension_to_starboard, 264, 6, :_u

#ship_dimension_to_sternObject (readonly)

Returns The field defined by 9 bits starting at bit 249 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_u().

Returns:



15
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 15

payload_reader :ship_dimension_to_stern, 249, 9, :_u

#static_draughtObject (readonly)

Returns The field defined by 8 bits starting at bit 294 of the payload, formatted with the function NMEAPlus::Message::AIS::VDMPayload::VDMMsg#_U(1).

Returns:



30
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 30

payload_reader :static_draught, 294, 8, :_U, 1

Instance Method Details

#etaObject



20
21
22
23
24
25
26
27
28
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 20

def eta
  now = Time.now
  Time.new(now.year,
           _u(274, 4),
           _u(278, 5),
           _u(283, 5),
           _u(288, 6),
           0)
end

#ship_cargo_type_descriptionObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg5.rb', line 34

def ship_cargo_type_description
  case ship_cargo_type
  when 0 then return nil
  when 1...19 then return "(future use)"
  when 20 then return "WIG (any)"
  when 21 then return "WIG Hazardous category A"
  when 22 then return "WIG Hazardous category B"
  when 23 then return "WIG Hazardous category C"
  when 24 then return "WIG Hazardous category D"
  when 25...29 then return "WIG (future use)"
  when 30 then return "Fishing"
  when 31 then return "Towing"
  when 32 then return "Towing (large)"
  when 33 then return "Dredging/underwater ops"
  when 34 then return "Diving ops"
  when 35 then return "Military ops"
  when 36 then return "Sailing"
  when 37 then return "Pleasure craft"
  when 38, 39 then return "Reserved"
  when 40 then return "High Speed Craft"
  when 41 then return "HSC Hazardous category A"
  when 42 then return "HSC Hazardous category B"
  when 43 then return "HSC Hazardous category C"
  when 44 then return "HSC Hazardous category D"
  when 45...48 then return "HSC (reserved)"
  when 49 then return "HSC (no additional information)"
  when 50 then return "Pilot Vessel"
  when 51 then return "Search and Rescue Vessel"
  when 52 then return "Tug"
  when 53 then return "Port Tender"
  when 54 then return "Anti-pollution equipment"
  when 55 then return "Law Enforcement"
  when 56, 57 then return "Spare - Local Vessel"
  when 58 then return "Medical Transport"
  when 59 then return "Noncombatant ship according to RR Resolution No. 18"
  when 60 then return "Passenger"
  when 61 then return "Passenger, Hazardous category A"
  when 62 then return "Passenger, Hazardous category B"
  when 63 then return "Passenger, Hazardous category C"
  when 64 then return "Passenger, Hazardous category D"
  when 65..68 then return "Passenger, Reserved for future use"
  when 69 then return "Passenger, No additional information"
  when 70 then return "Cargo"
  when 71 then return "Cargo, Hazardous category A"
  when 72 then return "Cargo, Hazardous category B"
  when 73 then return "Cargo, Hazardous category C"
  when 74 then return "Cargo, Hazardous category D"
  when 75..78 then return "Cargo, Reserved for future use"
  when 79 then return "Cargo, No additional information"
  when 80 then return "Tanker"
  when 81 then return "Tanker, Hazardous category A"
  when 82 then return "Tanker, Hazardous category B"
  when 83 then return "Tanker, Hazardous category C"
  when 84 then return "Tanker, Hazardous category D"
  when 85.88 then return "Tanker, Reserved for future use"
  when 89 then return "Tanker, No additional information"
  when 90 then return "Other Type"
  when 91 then return "Other Type, Hazardous category A"
  when 92 then return "Other Type, Hazardous category B"
  when 93 then return "Other Type, Hazardous category C"
  when 94 then return "Other Type, Hazardous category D"
  when 95..98 then return "Other Type, Reserved for future use"
  when 99 then return "Other Type, no additional information"
  end
end