mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-07 08:23:56 -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()
|
keys = nv_pairs.keys()
|
||||||
def sort_key(value):
|
def sort_key(value):
|
||||||
description = nv_pairs[value]
|
description = nv_pairs[value]
|
||||||
if zero_at_top and value == "0":
|
if zero_at_top:
|
||||||
# make sure this item goes at the top of the list:
|
# make sure -1 and 0 appear at the top of the list
|
||||||
return "AAAAAAA"
|
if value == "-1":
|
||||||
|
return "0000000"
|
||||||
|
if value == "0":
|
||||||
|
return "0000001"
|
||||||
return description
|
return description
|
||||||
return sorted(keys, key=sort_key)
|
return sorted(keys, key=sort_key)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user