Class: NMEAPlus::Message::AIS::VDMPayload::VDMMsg8d1f31

Inherits:
VDMMsg8DynamicPayload show all
Defined in:
lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb

Overview

Type 8: Binary Broadcast Message Subtype: Meteorological and Hydrological Data (IMO289)

Instance Attribute Summary collapse

Attributes inherited from Payload

#fill_bits, #payload_bitstring

Instance Method Summary collapse

Methods inherited from Payload

#_2b_data_string, #_6b_ascii, #_6b_boolean, #_6b_integer, #_6b_integer_scaled, #_6b_integer_scaled_shifted, #_6b_negated_boolean, #_6b_string, #_6b_string_nullterminated, #_6b_unsigned_integer, #_6b_unsigned_integer_scaled, #_6b_unsigned_integer_scaled_shifted, #_8b_data_string, #_access, #_bit_slices, #_get_date_mdhm, #_object_by_name, #initialize, payload_reader

Constructor Details

This class inherits a constructor from NMEAPlus::Message::AIS::VDMPayload::Payload

Instance Attribute Details

#air_pressure_hpaObject (readonly)

Returns The field defined by the 9 bits starting at payload bit 182, formatted with the function Payload#_UU(1, 799, 511).

Returns:

  • The field defined by the 9 bits starting at payload bit 182, formatted with the function Payload#_UU(1, 799, 511)



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

payload_reader :air_pressure_hpa, 182, 9, :_UU, 1, 799, 511

#air_pressure_tendencyObject (readonly)

Returns The field defined by the 2 bits starting at payload bit 191, formatted with the function Payload#_u(3, , ).

Returns:

  • The field defined by the 2 bits starting at payload bit 191, formatted with the function Payload#_u(3, , )



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

payload_reader :air_pressure_tendency, 191, 2, :_u, 3

#air_pressure_tendency_descriptionString (readonly)

Returns pressure tendency description.

Returns:

  • (String)

    pressure tendency description



35
36
37
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 35

def air_pressure_tendency_description
  trend_description(air_pressure_tendency)
end

#air_temperatureObject (readonly)

Returns The field defined by the 11 bits starting at payload bit 154, formatted with the function Payload#_I(10, -1024, ).

Returns:

  • The field defined by the 11 bits starting at payload bit 154, formatted with the function Payload#_I(10, -1024, )



27
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 27

payload_reader :air_temperature, 154, 11, :_I, 10, -1024

#current_timeTime (readonly)

Returns current time, assumed to be in UTC.

Returns:

  • (Time)

    current time, assumed to be in UTC



16
17
18
19
20
21
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 16

def current_time
  day    = _u(106, 5)
  hour   = _u(111, 5)
  minute = _u(116, 6)
  _get_date_mdhm(nil, day, hour, minute)
end

#dew_pointObject (readonly)

Returns The field defined by the 10 bits starting at payload bit 172, formatted with the function Payload#_I(10, 501, ).

Returns:

  • The field defined by the 10 bits starting at payload bit 172, formatted with the function Payload#_I(10, 501, )



29
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 29

payload_reader :dew_point, 172, 10, :_I, 10, 501

#horizontal_visibilityObject (readonly)

Returns The field defined by the 8 bits starting at payload bit 194, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 194, formatted with the function Payload#_U(10, 255, )



40
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 40

payload_reader :horizontal_visibility, 194, 8, :_U, 10, 255

#ice_codeObject (readonly)

Returns The field defined by the 2 bits starting at payload bit 348, formatted with the function Payload#_u(3, , ).

Returns:

  • The field defined by the 2 bits starting at payload bit 348, formatted with the function Payload#_u(3, , )



109
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 109

payload_reader :ice_code, 348, 2, :_u, 3

#latitudeObject (readonly)

Returns The field defined by the 24 bits starting at payload bit 81, formatted with the function Payload#_I(60 * 10**3, 91, ).

Returns:

  • The field defined by the 24 bits starting at payload bit 81, formatted with the function Payload#_I(60 * 10**3, 91, )



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

payload_reader :latitude, 81, 24, :_I, 60 * 10**3, 91

#longitudeObject (readonly)

Returns The field defined by the 25 bits starting at payload bit 56, formatted with the function Payload#_I(60 * 10**3, 181, ).

Returns:

  • The field defined by the 25 bits starting at payload bit 56, formatted with the function Payload#_I(60 * 10**3, 181, )



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

payload_reader :longitude, 56, 25, :_I, 60 * 10**3, 181

#position_10m_accuracy?Object (readonly)

Returns The field defined by the 1 bits starting at payload bit 105, formatted with the function Payload#_b(, , ).

Returns:

  • The field defined by the 1 bits starting at payload bit 105, formatted with the function Payload#_b(, , )



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

payload_reader :position_10m_accuracy?, 105, 1, :_b

#precipitation_typeObject (readonly)

Returns The field defined by the 3 bits starting at payload bit 336, formatted with the function Payload#_u(7, , ).

Returns:

  • The field defined by the 3 bits starting at payload bit 336, formatted with the function Payload#_u(7, , )



77
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 77

payload_reader :precipitation_type, 336, 3, :_u, 7

#relative_humidityObject (readonly)

Returns The field defined by the 7 bits starting at payload bit 165, formatted with the function Payload#_u(101, , ).

Returns:

  • The field defined by the 7 bits starting at payload bit 165, formatted with the function Payload#_u(101, , )



28
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 28

payload_reader :relative_humidity, 165, 7, :_u, 101

#salinityFloat (readonly)

Returns salinity.

Returns:

  • (Float)

    salinity



98
99
100
101
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 98

def salinity
  ret = _U(339, 9, 10)
  return nil if ret > 51.0 # 51.1 for sensor not available, otherwise n/a
end

#salinity_sensor_unavailable?bool (readonly)

Returns:

  • (bool)


105
106
107
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 105

def salinity_sensor_unavailable?
  _u(339, 9) == 511
end

#sea_state_beaufortObject (readonly)

Returns The field defined by the 4 bits starting at payload bit 322, formatted with the function Payload#_e(, , ).

Returns:

  • The field defined by the 4 bits starting at payload bit 322, formatted with the function Payload#_e(, , )



74
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 74

payload_reader :sea_state_beaufort, 322, 4, :_e

#swell_directionObject (readonly)

Returns The field defined by the 9 bits starting at payload bit 313, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 313, formatted with the function Payload#_u(360, , )



73
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 73

payload_reader :swell_direction, 313, 9, :_u, 360

#swell_heightObject (readonly)

Returns The field defined by the 8 bits starting at payload bit 299, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 299, formatted with the function Payload#_U(10, 255, )



71
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 71

payload_reader :swell_height, 299, 8, :_U, 10, 255

#swell_periodObject (readonly)

Returns The field defined by the 6 bits starting at payload bit 307, formatted with the function Payload#_u(63, , ).

Returns:

  • The field defined by the 6 bits starting at payload bit 307, formatted with the function Payload#_u(63, , )



72
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 72

payload_reader :swell_period, 307, 6, :_u, 63

#visibility_greater_thanObject (readonly)

Returns The field defined by the 1 bits starting at payload bit 193, formatted with the function Payload#_b(, , ).

Returns:

  • The field defined by the 1 bits starting at payload bit 193, formatted with the function Payload#_b(, , )



39
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 39

payload_reader :visibility_greater_than, 193, 1, :_b

#water_current_depth1Float (readonly)

surface water current

Returns:

  • (Float)

    depth of measurement



56
57
58
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 56

def water_current_depth1
  0
end

#water_current_depth2Object (readonly)

Returns The field defined by the 5 bits starting at payload bit 249, formatted with the function Payload#_U(10, 31, ).

Returns:

  • The field defined by the 5 bits starting at payload bit 249, formatted with the function Payload#_U(10, 31, )



62
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 62

payload_reader :water_current_depth2, 249, 5, :_U, 10, 31

#water_current_depth3Object (readonly)

Returns The field defined by the 5 bits starting at payload bit 271, formatted with the function Payload#_U(10, 31, ).

Returns:

  • The field defined by the 5 bits starting at payload bit 271, formatted with the function Payload#_U(10, 31, )



66
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 66

payload_reader :water_current_depth3, 271, 5, :_U, 10, 31

#water_current_direction1Object (readonly)

Returns The field defined by the 9 bits starting at payload bit 223, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 223, formatted with the function Payload#_u(360, , )



51
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 51

payload_reader :water_current_direction1, 223, 9, :_u, 360

#water_current_direction2Object (readonly)

Returns The field defined by the 9 bits starting at payload bit 240, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 240, formatted with the function Payload#_u(360, , )



61
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 61

payload_reader :water_current_direction2, 240, 9, :_u, 360

#water_current_direction3Object (readonly)

Returns The field defined by the 9 bits starting at payload bit 262, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 262, formatted with the function Payload#_u(360, , )



65
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 65

payload_reader :water_current_direction3, 262, 9, :_u, 360

#water_current_speed1Object (readonly)

Returns The field defined by the 8 bits starting at payload bit 215, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 215, formatted with the function Payload#_U(10, 255, )



50
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 50

payload_reader :water_current_speed1, 215, 8, :_U, 10, 255

#water_current_speed2Object (readonly)

Returns The field defined by the 8 bits starting at payload bit 232, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 232, formatted with the function Payload#_U(10, 255, )



60
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 60

payload_reader :water_current_speed2, 232, 8, :_U, 10, 255

#water_current_speed3Object (readonly)

Returns The field defined by the 8 bits starting at payload bit 254, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 254, formatted with the function Payload#_U(10, 255, )



64
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 64

payload_reader :water_current_speed3, 254, 8, :_U, 10, 255

#water_levelObject (readonly)

Returns The field defined by the 12 bits starting at payload bit 201, formatted with the function Payload#_UU(10**2, -10,, 4001).

Returns:

  • The field defined by the 12 bits starting at payload bit 201, formatted with the function Payload#_UU(10**2, -10,, 4001)



41
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 41

payload_reader :water_level, 201, 12, :_UU, 10**2, -10, 4001

#water_level_tendencyObject (readonly)

Returns The field defined by the 2 bits starting at payload bit 213, formatted with the function Payload#_u(3, , ).

Returns:

  • The field defined by the 2 bits starting at payload bit 213, formatted with the function Payload#_u(3, , )



42
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 42

payload_reader :water_level_tendency, 213, 2, :_u, 3

#water_level_tendency_descriptionString (readonly)

Returns water level tendency description.

Returns:

  • (String)

    water level tendency description



46
47
48
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 46

def water_level_tendency_description
  trend_description(water_level_tendency)
end

#water_temperatureObject (readonly)

Returns The field defined by the 10 bits starting at payload bit 326, formatted with the function Payload#_I(1, 501, ).

Returns:

  • The field defined by the 10 bits starting at payload bit 326, formatted with the function Payload#_I(1, 501, )



76
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 76

payload_reader :water_temperature, 326, 10, :_I, 1, 501

#wave_directionObject (readonly)

Returns The field defined by the 9 bits starting at payload bit 290, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 290, formatted with the function Payload#_u(360, , )



70
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 70

payload_reader :wave_direction, 290, 9, :_u, 360

#wave_heightObject (readonly)

Returns The field defined by the 8 bits starting at payload bit 276, formatted with the function Payload#_U(10, 255, ).

Returns:

  • The field defined by the 8 bits starting at payload bit 276, formatted with the function Payload#_U(10, 255, )



68
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 68

payload_reader :wave_height, 276, 8, :_U, 10, 255

#wave_periodObject (readonly)

Returns The field defined by the 6 bits starting at payload bit 284, formatted with the function Payload#_u(63, , ).

Returns:

  • The field defined by the 6 bits starting at payload bit 284, formatted with the function Payload#_u(63, , )



69
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 69

payload_reader :wave_period, 284, 6, :_u, 63

#wind_directionObject (readonly)

Returns The field defined by the 9 bits starting at payload bit 136, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 136, formatted with the function Payload#_u(360, , )



25
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 25

payload_reader :wind_direction, 136, 9, :_u, 360

#wind_direction_gustObject (readonly)

Returns The field defined by the 9 bits starting at payload bit 145, formatted with the function Payload#_u(360, , ).

Returns:

  • The field defined by the 9 bits starting at payload bit 145, formatted with the function Payload#_u(360, , )



26
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 26

payload_reader :wind_direction_gust, 145, 9, :_u, 360

#wind_speed_averageObject (readonly)

Returns The field defined by the 7 bits starting at payload bit 122, formatted with the function Payload#_u(127, , ).

Returns:

  • The field defined by the 7 bits starting at payload bit 122, formatted with the function Payload#_u(127, , )



23
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 23

payload_reader :wind_speed_average, 122, 7, :_u, 127

#wind_speed_gustObject (readonly)

Returns The field defined by the 7 bits starting at payload bit 129, formatted with the function Payload#_u(127, , ).

Returns:

  • The field defined by the 7 bits starting at payload bit 129, formatted with the function Payload#_u(127, , )



24
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 24

payload_reader :wind_speed_gust, 129, 7, :_u, 127

Instance Method Details

#ice_descriptionString

Returns the description.

Parameters:

  • code (Integer)

    The code for ice

Returns:

  • (String)

    the description



113
114
115
116
117
118
119
120
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 113

def ice_description
  case ice_code
  when 0 then return "No"
  when 1 then return "Yes"
  when 2 then return "(reserved)"
  end
  nil
end

#precipitation_descriptionString

precipitation type description

Parameters:

  • code (Integer)

    The code for precipitation

Returns:

  • (String)

    the description



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 82

def precipitation_description
  case precipitation_type
  when 0 then return "Reserved"
  when 1 then return "Rain"
  when 2 then return "Thunderstorm"
  when 3 then return "Freezing rain"
  when 4 then return "Mixed/ice"
  when 5 then return "Snow"
  when 6 then return "Reserved"
    # 7 is nil
  end
  nil
end

#trend_description(code) ⇒ String

trend description

Parameters:

  • code (Integer)

    The trend code

Returns:

  • (String)

    the description



125
126
127
128
129
130
131
132
# File 'lib/nmea_plus/message/ais/vdm_payload/vdm_msg8d1f31.rb', line 125

def trend_description(code)
  case code
  when 0 then return "steady"
  when 1 then return "decreasing"
  when 2 then return "increasing"
  end
  nil
end