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

lestarch: descriptions for commands, events, parameters, and args fix… #1132

Merged
merged 1 commit into from
Dec 1, 2021
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
26 changes: 16 additions & 10 deletions Autocoders/Python/src/fprime_ac/utils/TopDictGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ def check_for_commands(self):
command_elem.attrib["opcode"] = "%s" % (
hex(int(command.get_opcodes()[0], base=0) + self.__comp_id)
)
if "comment" in list(command_elem.attrib.keys()):
command_elem.attrib["description"] = command_elem.attrib["comment"]
if command.get_comment() is not None:
command_elem.attrib["description"] = command.get_comment()

args_elem = etree.Element("args")
for arg in command.get_args():
arg_elem = etree.Element("arg")
arg_elem.attrib["name"] = arg.get_name()
if arg.get_comment() is not None:
arg_elem.attrib["description"] = arg.get_comment()

arg_type = arg.get_type()
if isinstance(arg_type, tuple):
type_name = "{}::{}::{}".format(
Expand Down Expand Up @@ -184,8 +188,6 @@ def check_for_channels(self):
channel_elem.attrib["id"] = "%s" % (
hex(int(chan.get_ids()[0], base=0) + self.__comp_id)
)
if "comment" in list(channel_elem.attrib.keys()):
channel_elem.attrib["description"] = channel_elem.attrib["comment"]
channel_type = chan.get_type()
if isinstance(channel_type, tuple):
type_name = "{}::{}::{}".format(
Expand Down Expand Up @@ -229,13 +231,17 @@ def check_for_events(self):
)
event_elem.attrib["severity"] = event.get_severity()
format_string = event.get_format_string()
if "comment" in list(event_elem.attrib.keys()):
event_elem.attrib["description"] = event_elem.attrib["comment"]
if event.get_comment() is not None:
event_elem.attrib["description"] = event.get_comment()

args_elem = etree.Element("args")
arg_num = 0
for arg in event.get_args():
arg_elem = etree.Element("arg")
arg_elem.attrib["name"] = arg.get_name()
if arg.get_comment() is not None:
arg_elem.attrib["description"] = arg.get_comment()

arg_type = arg.get_type()
if isinstance(arg_type, tuple):
type_name = "{}::{}::{}".format(
Expand Down Expand Up @@ -294,9 +300,9 @@ def check_for_parameters(self):
command_elem_set.attrib["opcode"] = "%s" % (
hex(int(parameter.get_set_opcodes()[0], base=0) + self.__comp_id)
)
if "comment" in list(command_elem_set.attrib.keys()):
if parameter.get_comment() is not None:
command_elem_set.attrib["description"] = (
command_elem_set.attrib["comment"] + " parameter set"
parameter.get_comment() + " parameter set"
)
else:
command_elem_set.attrib["description"] = (
Expand Down Expand Up @@ -353,9 +359,9 @@ def check_for_parameters(self):
command_elem_save.attrib["opcode"] = "%s" % (
hex(int(parameter.get_save_opcodes()[0], base=0) + self.__comp_id)
)
if "comment" in list(command_elem_save.attrib.keys()):
if parameter.get_comment() is not None:
command_elem_save.attrib["description"] = (
command_elem_save.attrib["comment"] + " parameter set"
parameter.get_comment() + " parameter save"
)
else:
command_elem_save.attrib["description"] = (
Expand Down