Fixed ground velocity return and updated velocity docstring

This commit is contained in:
Alexander Hirsch
2019-05-17 05:59:14 -07:00
parent c9159feb7d
commit b813e41343
2 changed files with 15 additions and 7 deletions

View File

@@ -151,9 +151,16 @@ def velocity(msg):
msg (string): 28 bytes hexadecimal message string
Returns:
(int, float, int, string): speed (kt), ground track or heading (degree),
rate of climb/descend (ft/min), and speed type
('GS' for ground speed, 'AS' for airspeed)
(int, float, int, string, string, string): speed (kt),
ground track or heading (degree),
rate of climb/descent (ft/min), speed type
('GS' for ground speed, 'AS' for airspeed),
direction source ('gnd_trk' for ground track, 'mag_hdg' for
magnetic heading), rate of climb/descent source ('Baro' for
barometer, 'GNSS' for GNSS constellation).
In the case of surface messages, None will be put in place
for direction, vertical rate, and their respective sources.
"""
if 5 <= typecode(msg) <= 8:

View File

@@ -147,9 +147,10 @@ def surface_velocity(msg):
msg (string): 28 bytes hexadecimal message string
Returns:
(int, float, int, string): speed (kt), ground track (degree),
rate of climb/descend (ft/min), and speed type
('GS' for ground speed, 'AS' for airspeed)
(int, float, None, string, None, None): speed (kt),
ground track (degree), None for rate of climb/descend (ft/min),
and speed type ('GS' for ground speed), direction source
('gnd_trk' for ground track), None rate of climb/descent source.
"""
if common.typecode(msg) < 5 or common.typecode(msg) > 8:
@@ -182,4 +183,4 @@ def surface_velocity(msg):
spd = kts[i-1] + (mov-movs[i-1]) * step
spd = round(spd, 2)
return spd, trk, 0, 'GS'
return spd, trk, None, 'GS', None, None