mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-31 04:58:30 -04:00
Tools: param AlphabeticalZeroAtTop handles -1
This commit is contained in:
parent
a953cc2019
commit
5be8b19ce4
9
Tools/autotest/param_metadata/xmlemit.py
Normal file → Executable file
9
Tools/autotest/param_metadata/xmlemit.py
Normal file → Executable file
@ -69,9 +69,12 @@ class XmlEmit(Emit):
|
||||
keys = nv_pairs.keys()
|
||||
def sort_key(value):
|
||||
description = nv_pairs[value]
|
||||
if zero_at_top and value == "0":
|
||||
# make sure this item goes at the top of the list:
|
||||
return "AAAAAAA"
|
||||
if zero_at_top:
|
||||
# make sure -1 and 0 appear at the top of the list
|
||||
if value == "-1":
|
||||
return "0000000"
|
||||
if value == "0":
|
||||
return "0000001"
|
||||
return description
|
||||
return sorted(keys, key=sort_key)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user