pyfastnet 2.0.6__tar.gz → 2.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {pyfastnet-2.0.6/pyfastnet.egg-info → pyfastnet-2.0.8}/PKG-INFO +2 -3
  2. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/decode_fastnet.py +15 -6
  3. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/mappings.py +21 -11
  4. {pyfastnet-2.0.6 → pyfastnet-2.0.8/pyfastnet.egg-info}/PKG-INFO +2 -3
  5. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/setup.py +1 -1
  6. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_channels.py +2 -3
  7. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/LICENSE +0 -0
  8. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/MANIFEST.in +0 -0
  9. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/README.md +0 -0
  10. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/__init__.py +0 -0
  11. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/frame_buffer.py +0 -0
  12. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/logger.py +0 -0
  13. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/fastnet_decoder/utils.py +0 -0
  14. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/pyfastnet.egg-info/SOURCES.txt +0 -0
  15. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/pyfastnet.egg-info/dependency_links.txt +0 -0
  16. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/pyfastnet.egg-info/top_level.txt +0 -0
  17. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/setup.cfg +0 -0
  18. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_apparent_frame.py +0 -0
  19. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_autopilot_frame.py +0 -0
  20. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_depth_frame.py +0 -0
  21. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_format07_msb_regression.py +0 -0
  22. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_format08_layout.py +0 -0
  23. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_heel_frame.py +0 -0
  24. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_rudder_frame.py +0 -0
  25. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_tide_frame.py +0 -0
  26. {pyfastnet-2.0.6 → pyfastnet-2.0.8}/tests/test_true_frame.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.2
2
2
  Name: pyfastnet
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: A Python library for decoding FastNet protocol data streams.
5
5
  Home-page: https://github.com/ghotihook/pyfastnet
6
6
  Author: Alex Salmon
@@ -17,7 +17,6 @@ Dynamic: classifier
17
17
  Dynamic: description
18
18
  Dynamic: description-content-type
19
19
  Dynamic: home-page
20
- Dynamic: license-file
21
20
  Dynamic: requires-python
22
21
  Dynamic: summary
23
22
 
@@ -16,15 +16,24 @@ _DECIMAL_PLACES_MAP = {1: 0, 10: 1, 100: 2, 1000: 3}
16
16
  # "°M" → magnetic bearing, suffix added after value
17
17
 
18
18
  def _sign_from_layout(layout: str) -> int:
19
- return -1 if layout in ("-[data]", "=[data]") else 1
19
+ return -1 if layout in ("-[data]", "=[data]", "L[data]") else 1
20
20
 
21
21
 
22
22
  def _display_from_layout(layout: str, formatted: str) -> str:
23
- if layout == "°M": return f"{formatted}°M"
24
- if layout == "H[data]": return f"H{formatted}"
25
- if layout == "[data]H": return f"{formatted}H"
26
- if layout == "[data]=": return f"{formatted}="
27
- if layout == "[data]-": return f"{formatted}-"
23
+ if layout is None: return formatted
24
+ if layout == "°M": return f"{formatted}°M"
25
+ if layout == "H[data]": return f"H{formatted}"
26
+ if layout == "[data]H": return f"{formatted}H"
27
+ if layout == "[data]=": return f"{formatted}="
28
+ if layout == "[data]-": return f"{formatted}-"
29
+ if layout == "[data]°C": return f"{formatted}°C"
30
+ if layout == "[data]°F": return f"{formatted}°F"
31
+ if layout == "[data]L": return f"{formatted}L"
32
+ if layout == "L[data]": return f"L{formatted}"
33
+ if layout == "[data]z": return f"{formatted}z"
34
+ if layout == "z[data]": return f"z{formatted}"
35
+ if layout == "u[data]": return f"u{formatted}"
36
+ if layout == "d[data]": return f"d{formatted}"
28
37
  return formatted
29
38
 
30
39
 
@@ -281,18 +281,28 @@ SEGMENT_A = {
281
281
  0x20: "[data]-", 0xa0: "-[data]",
282
282
  0x8c: "=[data]", 0x0c: "[data]=",
283
283
  0xf3: "H[data]", 0x73: "[data]H",
284
- 0x00: " ",
285
284
 
286
- # Plain-positive layout codes (no sign decoration) confirmed from raw log replay
287
- 0x80: " ", # depth channels (0xC1/C2/C3)
288
- 0x5c: " ", # sea temperature °C
289
- 0x74: " ", # sea temperature °F
290
- 0x58: " ", # autopilot compass target (0–360° bearing)
291
- 0x99: " ", # VMG positive direction
292
- 0xbb: " ", # VMG / tidal drift positive
293
- 0xd8: " ", # leeway (always 0.0 in captured data; defaulted to plain)
294
- 0x54: " ", # true wind angle positive (starboard tack)
295
- 0x01: " ", # linear sensor null/zero state
285
+ # Blank no segments lit, no indicator symbol
286
+ 0x00: None, # AFTER, all blank — COG, SOG
287
+ 0x80: None, # BEFORE, all blank — Depth (m/ft/fm)
288
+
289
+ # Confirmed symbols
290
+ 0xbb: "d[data]", # 'd' BEFORE — Tidal Drift
291
+ 0x99: "u[data]", # 'u' BEFORE VMG (upwind indicator)
292
+ 0x58: "[data]L", # 'L' AFTER — AP Compass Target
293
+ 0xd8: "L[data]", # 'L' BEFORE Leeway port/negative
294
+
295
+ # AP Off Course — dog-leg symbol, direction shown by z position
296
+ 0x32: "[data]z", # z after value — AP Off Course one direction
297
+ 0x61: "z[data]", # z before value — AP Off Course other direction
298
+
299
+ # Temperature suffixes
300
+ 0x5c: "[data]°C", # 'C' shape AFTER — Sea Temperature °C
301
+ 0x74: "[data]°F", # 'F' shape AFTER — Sea Temperature °F
302
+
303
+ # TBC — symbol seen but not yet identified
304
+ 0x01: "TBC", # lower-right segment only — Linear sensors, Node Reset
305
+ 0x54: "TBC", # upper-left+lower-left+top — True Wind Angle starboard
296
306
  }
297
307
 
298
308
  SEGMENT_B = {
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.2
2
2
  Name: pyfastnet
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: A Python library for decoding FastNet protocol data streams.
5
5
  Home-page: https://github.com/ghotihook/pyfastnet
6
6
  Author: Alex Salmon
@@ -17,7 +17,6 @@ Dynamic: classifier
17
17
  Dynamic: description
18
18
  Dynamic: description-content-type
19
19
  Dynamic: home-page
20
- Dynamic: license-file
21
20
  Dynamic: requires-python
22
21
  Dynamic: summary
23
22
 
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pyfastnet",
5
- version="2.0.6", # Ensure this matches your intended version
5
+ version="2.0.8", # Ensure this matches your intended version
6
6
  author="Alex Salmon",
7
7
  author_email="alex@ivila.net",
8
8
  description="A Python library for decoding FastNet protocol data streams.",
@@ -249,7 +249,6 @@ class TestHeelAndTrim(unittest.TestCase):
249
249
  class TestSeaTemperature(unittest.TestCase):
250
250
  """
251
251
  Stored-log frame also carries sea temperature in Celsius and Fahrenheit.
252
- Format 0x07 with a segment byte not present in SEGMENT_A → layout '?'.
253
252
  Cross-check: 23 °C ≈ 73 °F within 1 degree rounding.
254
253
  """
255
254
  FRAME = "ff011801e7cd840000acc7cf84ff0000001f17005c00171e17007400494f"
@@ -259,11 +258,11 @@ class TestSeaTemperature(unittest.TestCase):
259
258
 
260
259
  def test_sea_temp_celsius(self):
261
260
  self.assertEqual(self.v["Sea Temperature (°C)"]["value"], 23.0)
262
- self.assertEqual(self.v["Sea Temperature (°C)"]["display_text"], "23")
261
+ self.assertEqual(self.v["Sea Temperature (°C)"]["display_text"], "23°C")
263
262
 
264
263
  def test_sea_temp_fahrenheit(self):
265
264
  self.assertEqual(self.v["Sea Temperature (°F)"]["value"], 73.0)
266
- self.assertEqual(self.v["Sea Temperature (°F)"]["display_text"], "73")
265
+ self.assertEqual(self.v["Sea Temperature (°F)"]["display_text"], "73°F")
267
266
 
268
267
  def test_cross_unit_consistency(self):
269
268
  c = self.v["Sea Temperature (°C)"]["value"]
File without changes
File without changes
File without changes
File without changes