Skip to content

Commit

Permalink
Fix packet deployment (#3035)
Browse files Browse the repository at this point in the history
* updates to packet autocoder

* Update to ignore module name on front of channels as band-aid until FPP packets are ready

* Revert to TlmChan

* Reformatted with Black
  • Loading branch information
timcanham authored Dec 4, 2024
1 parent 805adb6 commit 9e38240
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 153 deletions.
26 changes: 26 additions & 0 deletions Autocoders/Python/bin/tlm_packet_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def generate_channel_size_dict(self, the_parsed_topology_xml, xml_filename):
# uses the topology model to process the items
# create list of used parsed component xmls
parsed_xml_dict = {}
# deployment = the_parsed_topology_xml.get_deployment()
for comp in the_parsed_topology_xml.get_instances():
if comp.get_type() in topology_model.get_base_id_dict():
parsed_xml_dict[comp.get_type()] = comp.get_comp_xml()
Expand Down Expand Up @@ -335,6 +336,18 @@ def gen_packet_file(self, xml_filename):
channel_list = []
for channel in entry:
channel_name = channel.attrib["name"]
# TKC 11/20/2024 - In order to work with the ground system,
# we have to strip off the leading module. This is a
# band-aid until FPP packets are done
name_parts = channel_name.split(".")
if len(name_parts) != 3:
raise TlmPacketParseValueError(
'Channel %s must be of the format "module.component.channel_name"'
% channel_name
)

(module, component, channel) = name_parts
channel_name = "%s.%s" % (component, channel)
if not channel_name in channel_size_dict:
raise TlmPacketParseValueError(
"Channel %s does not exist" % channel_name
Expand Down Expand Up @@ -381,6 +394,19 @@ def gen_packet_file(self, xml_filename):
)
for channel in entry:
channel_name = channel.attrib["name"]
# TKC 11/20/2024 - In order to work with the ground system,
# we have to strip off the leading module. This is a
# band-aid until FPP packets are done
name_parts = channel_name.split(".")
if len(name_parts) != 3:
raise TlmPacketParseValueError(
'Channel %s must be of the format "module.component.channel_name"'
% channel_name
)

(module, component, channel) = name_parts
channel_name = "%s.%s" % (component, channel)

if not channel_name in channel_size_dict:
raise TlmPacketParseValueError(
"Channel %s does not exist" % channel_name
Expand Down
Loading

0 comments on commit 9e38240

Please sign in to comment.