Skip to content

Commit

Permalink
parameters.xml sort parameters by name, sort enums by value
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Nov 22, 2017
1 parent 698bc7d commit 94e27be
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/modules/systemlib/param/px4params/srcparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def GetParams(self):
object. Note that returned object is not a copy. Modifications affect
state of the parser.
"""
return sorted(self.params,
key=lambda x: x.GetFieldValue("code"))
return sorted(self.params, key=lambda param: param.name)

class Parameter(object):
"""
Expand Down Expand Up @@ -109,10 +108,7 @@ def GetEnumCodes(self):
"""
Return list of existing value codes in convenient order
"""
keys = self.values.keys()
#keys = sorted(keys)
#keys = sorted(keys, key=lambda x: self.priority.get(x, 0), reverse=True)
return keys
return sorted(self.values.keys(), key=float)

def GetEnumValue(self, code):
"""
Expand Down

0 comments on commit 94e27be

Please sign in to comment.