nmea_plus 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -4
  3. data/lib/nmea_plus/ais_message_factory.rb +2 -3
  4. data/lib/nmea_plus/message/ais/vdo.rb +14 -0
  5. data/lib/nmea_plus/message/base.rb +17 -9
  6. data/lib/nmea_plus/message/nmea/apa.rb +24 -0
  7. data/lib/nmea_plus/message/nmea/base_nmea.rb +2 -2
  8. data/lib/nmea_plus/message/nmea/bec.rb +12 -0
  9. data/lib/nmea_plus/message/nmea/ber.rb +17 -0
  10. data/lib/nmea_plus/message/nmea/bpi.rb +17 -0
  11. data/lib/nmea_plus/message/nmea/bwr.rb +10 -0
  12. data/lib/nmea_plus/message/nmea/dbk.rb +9 -0
  13. data/lib/nmea_plus/message/nmea/dbs.rb +4 -0
  14. data/lib/nmea_plus/message/nmea/dcn.rb +47 -1
  15. data/lib/nmea_plus/message/nmea/dru.rb +33 -0
  16. data/lib/nmea_plus/message/nmea/gda.rb +39 -0
  17. data/lib/nmea_plus/message/nmea/gdf.rb +19 -0
  18. data/lib/nmea_plus/message/nmea/gdp.rb +19 -0
  19. data/lib/nmea_plus/message/nmea/gla.rb +20 -0
  20. data/lib/nmea_plus/message/nmea/glf.rb +19 -0
  21. data/lib/nmea_plus/message/nmea/glp.rb +19 -0
  22. data/lib/nmea_plus/message/nmea/goa.rb +20 -0
  23. data/lib/nmea_plus/message/nmea/gof.rb +19 -0
  24. data/lib/nmea_plus/message/nmea/gop.rb +19 -0
  25. data/lib/nmea_plus/message/nmea/gtd.rb +12 -0
  26. data/lib/nmea_plus/message/nmea/gxa.rb +14 -18
  27. data/lib/nmea_plus/message/nmea/gxf.rb +19 -0
  28. data/lib/nmea_plus/message/nmea/gxp.rb +19 -0
  29. data/lib/nmea_plus/message/nmea/hcc.rb +17 -0
  30. data/lib/nmea_plus/message/nmea/hcd.rb +28 -0
  31. data/lib/nmea_plus/message/nmea/hdg.rb +0 -1
  32. data/lib/nmea_plus/message/nmea/hdm.rb +5 -0
  33. data/lib/nmea_plus/message/nmea/hdt.rb +2 -0
  34. data/lib/nmea_plus/message/nmea/htc.rb +11 -0
  35. data/lib/nmea_plus/message/nmea/hvd.rb +23 -0
  36. data/lib/nmea_plus/message/nmea/hvm.rb +15 -0
  37. data/lib/nmea_plus/message/nmea/ima.rb +40 -0
  38. data/lib/nmea_plus/message/nmea/mda.rb +44 -0
  39. data/lib/nmea_plus/message/nmea/mhu.rb +22 -0
  40. data/lib/nmea_plus/message/nmea/mmb.rb +19 -0
  41. data/lib/nmea_plus/message/nmea/mta.rb +16 -0
  42. data/lib/nmea_plus/message/nmea/mwh.rb +18 -0
  43. data/lib/nmea_plus/message/nmea/mws.rb +18 -0
  44. data/lib/nmea_plus/message/nmea/oln.rb +42 -3
  45. data/lib/nmea_plus/message/nmea/olw.rb +15 -0
  46. data/lib/nmea_plus/message/nmea/omp.rb +16 -0
  47. data/lib/nmea_plus/message/nmea/onz.rb +14 -0
  48. data/lib/nmea_plus/message/nmea/{pashr.rb → proprietary/pashr.rb} +1 -1
  49. data/lib/nmea_plus/message/nmea/r00.rb +9 -1
  50. data/lib/nmea_plus/message/nmea/rmc.rb +1 -1
  51. data/lib/nmea_plus/message/nmea/rnn.rb +18 -0
  52. data/lib/nmea_plus/message/nmea/sbk.rb +17 -0
  53. data/lib/nmea_plus/message/nmea/scd.rb +22 -0
  54. data/lib/nmea_plus/message/nmea/scy.rb +17 -0
  55. data/lib/nmea_plus/message/nmea/sdb.rb +14 -0
  56. data/lib/nmea_plus/message/nmea/sgd.rb +21 -0
  57. data/lib/nmea_plus/message/nmea/sgr.rb +22 -0
  58. data/lib/nmea_plus/message/nmea/siu.rb +21 -0
  59. data/lib/nmea_plus/message/nmea/slc.rb +66 -0
  60. data/lib/nmea_plus/message/nmea/snc.rb +35 -0
  61. data/lib/nmea_plus/message/nmea/snu.rb +18 -0
  62. data/lib/nmea_plus/message/nmea/sps.rb +14 -0
  63. data/lib/nmea_plus/message/nmea/ssf.rb +29 -0
  64. data/lib/nmea_plus/message/nmea/stc.rb +12 -0
  65. data/lib/nmea_plus/message/nmea/str.rb +38 -0
  66. data/lib/nmea_plus/message/nmea/sys.rb +29 -0
  67. data/lib/nmea_plus/message/nmea/tec.rb +20 -0
  68. data/lib/nmea_plus/message/nmea/tep.rb +14 -0
  69. data/lib/nmea_plus/message/nmea/tga.rb +20 -0
  70. data/lib/nmea_plus/message/nmea/tif.rb +35 -0
  71. data/lib/nmea_plus/message/nmea/trf.rb +17 -1
  72. data/lib/nmea_plus/message/nmea/trp.rb +14 -0
  73. data/lib/nmea_plus/message/nmea/trs.rb +41 -0
  74. data/lib/nmea_plus/message/nmea/vcd.rb +23 -0
  75. data/lib/nmea_plus/message/nmea/vpe.rb +17 -0
  76. data/lib/nmea_plus/message/nmea/vta.rb +23 -0
  77. data/lib/nmea_plus/message/nmea/vti.rb +23 -0
  78. data/lib/nmea_plus/message/nmea/vwe.rb +14 -0
  79. data/lib/nmea_plus/message/nmea/vwr.rb +15 -2
  80. data/lib/nmea_plus/message/nmea/vwt.rb +35 -0
  81. data/lib/nmea_plus/message/nmea/wdc.rb +20 -0
  82. data/lib/nmea_plus/message/nmea/wdr.rb +12 -0
  83. data/lib/nmea_plus/message/nmea/wfm.rb +12 -0
  84. data/lib/nmea_plus/message/nmea/wnc.rb +7 -0
  85. data/lib/nmea_plus/message/nmea/wnr.rb +12 -0
  86. data/lib/nmea_plus/message/nmea/ywp.rb +17 -0
  87. data/lib/nmea_plus/message/nmea/yws.rb +26 -0
  88. data/lib/nmea_plus/message/nmea/zaa.rb +14 -0
  89. data/lib/nmea_plus/message/nmea/zcd.rb +25 -0
  90. data/lib/nmea_plus/message/nmea/zev.rb +25 -0
  91. data/lib/nmea_plus/message/nmea/zfi.rb +15 -0
  92. data/lib/nmea_plus/message/nmea/zfo.rb +1 -1
  93. data/lib/nmea_plus/message/nmea/zlz.rb +19 -0
  94. data/lib/nmea_plus/message/nmea/zpi.rb +15 -0
  95. data/lib/nmea_plus/message/nmea/zta.rb +15 -0
  96. data/lib/nmea_plus/message/nmea/zte.rb +15 -0
  97. data/lib/nmea_plus/message/nmea/zti.rb +12 -0
  98. data/lib/nmea_plus/message/nmea/zwp.rb +12 -0
  99. data/lib/nmea_plus/message/nmea/zzu.rb +15 -0
  100. data/lib/nmea_plus/nmea_message_factory.rb +82 -2
  101. data/lib/nmea_plus/version.rb +1 -1
  102. metadata +79 -3
@@ -0,0 +1,40 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # IMA - Vessel Identification
7
+ # Limited utility, no recommended replacement
8
+ class IMA < NMEAPlus::Message::NMEA::NMEAMessage
9
+ # 12 character vessel name
10
+ field_reader :vessel_name, 1, :_string
11
+
12
+ # Radio call sign
13
+ field_reader :call_sign, 2, :_string
14
+
15
+ # Latitude, N/S
16
+ # @!parse attr_reader :latitude
17
+ # @return [Float]
18
+ def latitude
19
+ self.class.degrees_minutes_to_decimal(@fields[3], @fields[4])
20
+ end
21
+
22
+ # Longitude, E/W
23
+ # @!parse attr_reader :longitude
24
+ # @return [Float]
25
+ def longitude
26
+ self.class.degrees_minutes_to_decimal(@fields[5], @fields[6])
27
+ end
28
+
29
+ # Heading, degrees True
30
+ field_reader :true_heading_degrees, 7, :_float
31
+
32
+ # Heading, degrees Magnetic
33
+ field_reader :magnetic_heading_degrees, 9, :_float
34
+
35
+ # Speed, knots
36
+ field_reader :speed_knots, 11, :_float
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,44 @@
1
+ require_relative "mmb"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MDA - Meteorological Composite
7
+ #
8
+ # Barometric pressure, air and water temperature, humidity, dew point and wind speed and direction relative to the surface
9
+ # of the earth.
10
+ # The use of $--MTW, $--MWV and $--XDR is recommended.
11
+ # @see MTW
12
+ # @see MWV
13
+ # @see XDR
14
+ class MDA < NMEAPlus::Message::NMEA::MMB
15
+ # Air temperature, degrees C
16
+ field_reader :air_temperature_celsius, 5, :_float
17
+
18
+ # Water temperature, degrees C
19
+ field_reader :water_temperature_celsius, 7, :_float
20
+
21
+ # Relative humidity, percent
22
+ field_reader :relative_humidity_percent, 9, :_float
23
+
24
+ # Absolute humidity, percent
25
+ field_reader :absolute_humidity_percent, 10, :_float
26
+
27
+ # Dew point, degrees C
28
+ field_reader :dew_point_celsius, 11, :_float
29
+
30
+ # Wind direction, degrees True
31
+ field_reader :wind_true_direction_degrees, 13, :_float
32
+
33
+ # Wind direction, degrees Magnetic
34
+ field_reader :wind_magnetic_direction_degrees, 15, :_float
35
+
36
+ # Wind speed, knots
37
+ field_reader :wind_speed_knots, 17, :_float
38
+
39
+ # Wind speed, meters/second
40
+ field_reader :wind_speed_ms, 19, :_float
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,22 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MHU - Humidity
7
+ #
8
+ # The use of $--XDR is recommended.
9
+ # @see XDR
10
+ class MHU < NMEAPlus::Message::NMEA::NMEAMessage
11
+ # Relative humidity, percent
12
+ field_reader :relative_humidity_percent, 1, :_float
13
+
14
+ # Absolute humidity, percent
15
+ field_reader :absolute_humidity_percent, 2, :_float
16
+
17
+ # Dew point, degrees C
18
+ field_reader :dew_point_celsius, 3, :_float
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MMB - Barometer
7
+ #
8
+ # The use of $--XDR is recommended.
9
+ # @see XDR
10
+ class MMB < NMEAPlus::Message::NMEA::NMEAMessage
11
+ # Barometric pressure, inches of mercury
12
+ field_reader :barometric_pressure_inches, 1, :_float
13
+
14
+ # Barometric pressure, bars
15
+ field_reader :barometric_pressure_bars, 3, :_float
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MTA - Air Temperature
7
+ #
8
+ # The use of $--XDR is recommended.
9
+ # @see XDR
10
+ class MTA < NMEAPlus::Message::NMEA::NMEAMessage
11
+ # Temperature, degrees C
12
+ field_reader :temperature_celsius, 1, :_float
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MWH - Wave Height
7
+ #
8
+ # Limited utility, no recommended replacement.
9
+ class MWH < NMEAPlus::Message::NMEA::NMEAMessage
10
+ # Wave height, feet
11
+ field_reader :wave_height_feet, 1, :_float
12
+
13
+ # Wave height, meters
14
+ field_reader :wave_height_meters, 3, :_float
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # MWS - Wind & Sea State
7
+ #
8
+ # Limited utility, no recommended replacement.
9
+ class MWS < NMEAPlus::Message::NMEA::NMEAMessage
10
+ # Beaufort Wind Force Code
11
+ field_reader :beaufort_wind_force, 1, :_integer
12
+
13
+ # Beaufort Sea State Code
14
+ field_reader :beaufort_sea_state, 2, :_integer
15
+ end
16
+ end
17
+ end
18
+ end
@@ -4,17 +4,56 @@ module NMEAPlus
4
4
  module Message
5
5
  module NMEA
6
6
  # OLN - Omega Lane Numbers
7
+ # Omega Lines of Positions (LOPs).
8
+ #
9
+ # OMEGA system is not operational, no recommended replacement.
7
10
  class OLN < NMEAPlus::Message::NMEA::NMEAMessage
11
+ # container for Omega lane indicators
12
+ class OmegaLanePair
13
+ # @return [String]
14
+ attr_accessor :label
15
+
16
+ # first item in the pair
17
+ # @return [Float]
18
+ attr_accessor :first
19
+
20
+ # second item in the pair
21
+ # @return [Float]
22
+ attr_accessor :second
23
+
24
+ # @param arr [Array] a string and 2 integers
25
+ def initialize(arr)
26
+ @label = arr[0]
27
+ @first = arr[1].to_i
28
+ @second = arr[2].to_i
29
+ end
30
+ end
31
+
32
+ # Pair 1
33
+ # @!parse attr_reader :omega_pair1
34
+ # @return [OmegaLanePair]
8
35
  def omega_pair1
9
- @fields[1..3].join(",")
36
+ OmegaLanePair.new(@fields[1..3])
10
37
  end
11
38
 
39
+ # Pair 2
40
+ # @!parse attr_reader :omega_pair2
41
+ # @return [OmegaLanePair]
12
42
  def omega_pair2
13
- @fields[4..6].join(",")
43
+ OmegaLanePair.new(@fields[4..6])
14
44
  end
15
45
 
46
+ # Pair 3, AB-GH
47
+ # @!parse attr_reader :omega_pair3
48
+ # @return [OmegaLanePair]
16
49
  def omega_pair3
17
- @fields[7..9].join(",")
50
+ OmegaLanePair.new(@fields[7..9])
51
+ end
52
+
53
+ # @!parse attr_reader :omega_pairs
54
+ # @return [Array<OmegaLanePair>]
55
+ def omega_pairs
56
+ [omega_pair1, omega_pair2, omega_pair3]
18
57
  end
19
58
 
20
59
  end
@@ -0,0 +1,15 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # OLW - Omega Lane Width
7
+ #
8
+ # OMEGA system is not operational, no recommended replacement.
9
+ class OLW < NMEAPlus::Message::NMEA::NMEAMessage
10
+ field_reader :width_nautical_miles, 1, :_float
11
+ field_reader :width_meters, 3, :_float
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # OMP - OMEGA
7
+ #
8
+ # OMEGA system is not operational, no recommended replacement.
9
+ class OMP < NMEAPlus::Message::NMEA::NMEAMessage
10
+ field_reader :pair1, 2, :_string
11
+ field_reader :pair2, 4, :_string
12
+ field_reader :pair3, 6, :_string
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # ONZ- Omega Zone Number
7
+ #
8
+ # OMEGA system is not operational, no recommended replacement.
9
+ class ONZ < NMEAPlus::Message::NMEA::NMEAMessage
10
+ field_reader :station_identifier, 1, :_string
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,4 +1,4 @@
1
- require_relative "base_nmea"
1
+ require_relative "../base_nmea"
2
2
 
3
3
  module NMEAPlus
4
4
  module Message
@@ -4,8 +4,16 @@ module NMEAPlus
4
4
  module Message
5
5
  module NMEA
6
6
  # R00 - Waypoints in active route
7
+ # Waypoint identifiers, listed in order with starting waypoint first, for route number "nn".
8
+ # The use of $--RTE is recommended.
9
+ # @see RTE
7
10
  class R00 < NMEAPlus::Message::NMEA::NMEAMessage
8
- field_reader :waypoint_id, 1, :_string
11
+ # 14 field sequence of route waypoint IDs
12
+ # @!parse attr_reader :waypoint_ids
13
+ # @return [Array<String>]
14
+ def waypoint_ids
15
+ @fields[1..14]
16
+ end
9
17
  end
10
18
  end
11
19
  end
@@ -9,7 +9,7 @@ module NMEAPlus
9
9
  # @!parse attr_reader :utc_time
10
10
  # @return [Time]
11
11
  def utc_time
12
- _utc_date_time(@fields[9], @fields[1])
12
+ self.class._utc_date_time(@fields[9], @fields[1])
13
13
  end
14
14
 
15
15
  field_reader :active?, 2, :_av_boolean
@@ -0,0 +1,18 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # RNN - Routes
7
+ class RNN < NMEAPlus::Message::NMEA::NMEAMessage
8
+ field_reader :route_number, 1, :_integer
9
+
10
+ # @!parse attr_reader :waypoints
11
+ # @return [Array<Integer>]
12
+ def waypoints
13
+ @fields[2..-1].map(&:to_i)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # SBK - Loran-C Blink Status
7
+ # Loran-C warning flag for Blink indicating that one or more Loran-C stations being
8
+ # used to produce Lat/Lon and other navigation data are unreliable.
9
+ # The use of $--GLC is recommended.
10
+ # @see GLC
11
+ class SBK < NMEAPlus::Message::NMEA::NMEAMessage
12
+ # Warning Flag
13
+ field_reader :blink_flag?, 1, :_av_boolean
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # SCD - Loran-C ECDs (Envelope Cycle Discrepancies)
7
+ # The use of $--LCD is recommended.
8
+ # @see LCD
9
+ class SCD < NMEAPlus::Message::NMEA::NMEAMessage
10
+ # Master signal ECD
11
+ field_reader :master_signal_ecd, 2, :_integer
12
+
13
+ # All ECDs
14
+ # @!parse attr_reader :ecds
15
+ # @return [Array<Integer>]
16
+ def ecds
17
+ (0..5).to_a.map { |x| 2 * x + 2 } .map { |i| @fields[i].to_i }
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # SCY - Loran-C Cycle Lock Status
7
+ # Loran-C warning flags for Cycle Lock indicating that one or more Loran-C stations being
8
+ # used to produce Lat/Lon and other navigation data are unreliable.
9
+ # The use of $--GLC is recommended.
10
+ # @see GLC
11
+ class SCY < NMEAPlus::Message::NMEA::NMEAMessage
12
+ # Warning Flag
13
+ field_reader :cycle_lock_flag?, 1, :_av_boolean
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # SDB - Loran-C Signal Strength
7
+ # Limited utility, no recommended replacement.
8
+ class SDB < NMEAPlus::Message::NMEA::NMEAMessage
9
+ # Signal strength, dB
10
+ field_reader :signal_strength_db, 1, :_float
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ require_relative "base_nmea"
2
+
3
+ module NMEAPlus
4
+ module Message
5
+ module NMEA
6
+ # SGD - Position Accuracy Estimate
7
+ #
8
+ # Estimate of position accuracy based on geometric dilution of precision (GDOP)
9
+ # and system noise, in feet and nautical miles.
10
+ #
11
+ # Limited utility, no recommended replacement.
12
+ class SGD < NMEAPlus::Message::NMEA::NMEAMessage
13
+ # Accuracy, nautical miles
14
+ field_reader :accuracy_feet, 1, :_float
15
+
16
+ # Accuracy, feet
17
+ field_reader :accuracy_nautical_miles, 3, :_float
18
+ end
19
+ end
20
+ end
21
+ end