mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
re-add boolean attribute to the parameters xml
and small cleanup, make Volatile as bool in the internal variable
This commit is contained in:
parent
39ef2fd0b7
commit
f45b67af59
@ -52,8 +52,8 @@ class JsonOutput():
|
||||
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():
|
||||
|
||||
@ -58,8 +58,8 @@ class Parameter(object):
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.default = default
|
||||
self.volatile = "false"
|
||||
self.category = ""
|
||||
self.volatile = False
|
||||
self.boolean = False
|
||||
|
||||
def GetName(self):
|
||||
@ -102,7 +102,7 @@ class Parameter(object):
|
||||
"""
|
||||
Set volatile flag
|
||||
"""
|
||||
self.volatile = "true"
|
||||
self.volatile = True
|
||||
|
||||
def SetBoolean(self):
|
||||
"""
|
||||
|
||||
@ -39,8 +39,10 @@ class XMLOutput():
|
||||
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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user