forked from Archive/PX4-Autopilot
parameters.xml sort parameters by name, sort enums by value
This commit is contained in:
parent
698bc7d848
commit
85a7a0a86a
|
@ -31,8 +31,7 @@ class ParameterGroup(object):
|
||||||
object. Note that returned object is not a copy. Modifications affect
|
object. Note that returned object is not a copy. Modifications affect
|
||||||
state of the parser.
|
state of the parser.
|
||||||
"""
|
"""
|
||||||
return sorted(self.params,
|
return sorted(self.params, key=lambda param: param.name)
|
||||||
key=lambda x: x.GetFieldValue("code"))
|
|
||||||
|
|
||||||
class Parameter(object):
|
class Parameter(object):
|
||||||
"""
|
"""
|
||||||
|
@ -109,10 +108,7 @@ class Parameter(object):
|
||||||
"""
|
"""
|
||||||
Return list of existing value codes in convenient order
|
Return list of existing value codes in convenient order
|
||||||
"""
|
"""
|
||||||
keys = self.values.keys()
|
return sorted(self.values.keys(), key=float)
|
||||||
#keys = sorted(keys)
|
|
||||||
#keys = sorted(keys, key=lambda x: self.priority.get(x, 0), reverse=True)
|
|
||||||
return keys
|
|
||||||
|
|
||||||
def GetEnumValue(self, code):
|
def GetEnumValue(self, code):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue