minor update

This commit is contained in:
junzis 2017-07-21 16:02:40 +02:00
parent 0e29a4d18a
commit 27daf52850
2 changed files with 3 additions and 3 deletions

View File

@ -678,9 +678,9 @@ def altitude_diff(msg):
msgbin = util.hex2bin(msg) msgbin = util.hex2bin(msg)
sign = -1 if int(msgbin[80]) else 1 sign = -1 if int(msgbin[80]) else 1
value = util.bin2int(msgbin[81:88]) * 25 value = util.bin2int(msgbin[81:88])
if value == 0 or value == 127: if value == 0 or value == 127:
return None return None
else: else:
return sign * value return sign * (value - 1) * 25 # in ft.

View File

@ -61,7 +61,7 @@ def test_adsb_velocity():
assert vgs == (159, 182.9, -832, 'GS') assert vgs == (159, 182.9, -832, 'GS')
assert vas == (376, 244.0, -2304, 'AS') assert vas == (376, 244.0, -2304, 'AS')
assert vgs_surface == (19.0, 42.2, 0 , 'GS') assert vgs_surface == (19.0, 42.2, 0 , 'GS')
assert adsb.altitude_diff('8D485020994409940838175B284F') == 575 assert adsb.altitude_diff('8D485020994409940838175B284F') == 550
def test_nic(): def test_nic():