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
+10 -3
View File
@@ -151,9 +151,16 @@ def velocity(msg):
msg (string): 28 bytes hexadecimal message string msg (string): 28 bytes hexadecimal message string
Returns: Returns:
(int, float, int, string): speed (kt), ground track or heading (degree), (int, float, int, string, string, string): speed (kt),
rate of climb/descend (ft/min), and speed type ground track or heading (degree),
('GS' for ground speed, 'AS' for airspeed) 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: if 5 <= typecode(msg) <= 8:
+5 -4
View File
@@ -147,9 +147,10 @@ def surface_velocity(msg):
msg (string): 28 bytes hexadecimal message string msg (string): 28 bytes hexadecimal message string
Returns: Returns:
(int, float, int, string): speed (kt), ground track (degree), (int, float, None, string, None, None): speed (kt),
rate of climb/descend (ft/min), and speed type ground track (degree), None for rate of climb/descend (ft/min),
('GS' for ground speed, 'AS' for airspeed) 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: 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 = kts[i-1] + (mov-movs[i-1]) * step
spd = round(spd, 2) spd = round(spd, 2)
return spd, trk, 0, 'GS' return spd, trk, None, 'GS', None, None