Skip to content

Commit

Permalink
minor fix for bds 50 and 60; increment version to 2.19
Browse files Browse the repository at this point in the history
  • Loading branch information
junzis committed Nov 26, 2024
1 parent b4be551 commit 2c40302
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions pyModeS/decoder/bds/bds50.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def is50(msg: str) -> bool:
return False

tas = tas50(msg)
if tas is not None and tas > 500:
if tas is not None and tas > 600:
return False

if (gs is not None) and (tas is not None) and (abs(tas - gs) > 200):
Expand Down Expand Up @@ -145,11 +145,9 @@ def rtrk50(msg: str) -> Optional[float]:
if d[34] == "0":
return None

if d[36:45] == "111111111":
return None

sign = int(d[35]) # 1 -> negative value, two's complement
value = common.bin2int(d[36:45])

if sign:
value = value - 512

Expand Down
12 changes: 4 additions & 8 deletions pyModeS/decoder/bds/bds60.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ def vr60baro(msg: str) -> Optional[int]:
sign = int(d[35]) # 1 -> negative value, two's complement
value = common.bin2int(d[36:45])

if value == 0 or value == 511: # all zeros or all ones
return 0

value = value - 512 if sign else value
if sign:
value = value - 512

roc = value * 32 # feet/min
return roc
Expand All @@ -176,10 +174,8 @@ def vr60ins(msg: str) -> Optional[int]:
sign = int(d[46]) # 1 -> negative value, two's complement
value = common.bin2int(d[47:56])

if value == 0 or value == 511: # all zeros or all ones
return 0

value = value - 512 if sign else value
if sign:
value = value - 512

roc = value * 32 # feet/min
return roc
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyModeS"
version = "2.18"
version = "2.19"
description = "Python Mode-S and ADS-B Decoder"
authors = ["Junzi Sun <[email protected]>"]
license = "GNU GPL v3"
Expand Down

0 comments on commit 2c40302

Please sign in to comment.