Skip to content

Commit

Permalink
re-add boolean attribute to the parameters xml
Browse files Browse the repository at this point in the history
and small cleanup, make Volatile as bool in the internal variable
  • Loading branch information
BazookaJoe1900 authored and bkueng committed Jan 26, 2021
1 parent 39ef2fd commit f45b67a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib/parameters/px4params/jsonout.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def __init__(self, groups, board, inject_xml_file_name):
if (param.GetCategory()):
curr_param['category'] = param.GetCategory()

if (param.GetVolatile() == "true"):
curr_param['volatile'] = param.GetVolatile()
if param.GetVolatile():
curr_param['volatile'] = "True"

last_param_name = param.GetName()
for code in param.GetFieldCodes():
Expand Down
4 changes: 2 additions & 2 deletions src/lib/parameters/px4params/srcparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(self, name, type, default = ""):
self.name = name
self.type = type
self.default = default
self.volatile = "false"
self.category = ""
self.volatile = False
self.boolean = False

def GetName(self):
Expand Down Expand Up @@ -102,7 +102,7 @@ def SetVolatile(self):
"""
Set volatile flag
"""
self.volatile = "true"
self.volatile = True

def SetBoolean(self):
"""
Expand Down
6 changes: 4 additions & 2 deletions src/lib/parameters/px4params/xmlout.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def __init__(self, groups, board):
xml_param.attrib["name"] = param.GetName()
xml_param.attrib["default"] = param.GetDefault()
xml_param.attrib["type"] = param.GetType()
if (param.GetVolatile() == "true"):
xml_param.attrib["volatile"] = param.GetVolatile()
if param.GetVolatile():
xml_param.attrib["volatile"] = "true"
if param.GetBoolean():
xml_param.attrib["boolean"] = "true"
if (param.GetCategory()):
xml_param.attrib["category"] = param.GetCategory()
last_param_name = param.GetName()
Expand Down

0 comments on commit f45b67a

Please sign in to comment.