Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameters.xml sort parameters by name, sort enums by value #8337

Merged
merged 1 commit into from
Nov 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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