From 862f1d70ffc314b67325f4f466b3f64b1be813d4 Mon Sep 17 00:00:00 2001 From: Timothy Canham Date: Tue, 19 Nov 2024 20:16:26 -0800 Subject: [PATCH 1/4] updates to packet autocoder --- Autocoders/Python/bin/tlm_packet_gen.py | 3 +- Ref/Top/RefPackets.xml | 298 ++++++++++++------------ Ref/Top/instances.fpp | 18 +- 3 files changed, 160 insertions(+), 159 deletions(-) diff --git a/Autocoders/Python/bin/tlm_packet_gen.py b/Autocoders/Python/bin/tlm_packet_gen.py index bc09901302..d259ac5317 100755 --- a/Autocoders/Python/bin/tlm_packet_gen.py +++ b/Autocoders/Python/bin/tlm_packet_gen.py @@ -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() @@ -219,7 +220,7 @@ def generate_channel_size_dict(self, the_parsed_topology_xml, xml_filename): # check for channels if parsed_xml_dict[comp_type].get_channels() is not None: for chan in parsed_xml_dict[comp_type].get_channels(): - channel_name = f"{comp_name}.{chan.get_name()}" + channel_name = f"{deployment}.{comp_name}.{chan.get_name()}" if self.verbose: print("Processing Channel %s" % channel_name) chan_type = chan.get_type() diff --git a/Ref/Top/RefPackets.xml b/Ref/Top/RefPackets.xml index 898a72bf16..e38ae480c5 100644 --- a/Ref/Top/RefPackets.xml +++ b/Ref/Top/RefPackets.xml @@ -3,241 +3,241 @@ Ref/Top/RefTopologyAppAi.xml - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + @@ -245,6 +245,6 @@ - + diff --git a/Ref/Top/instances.fpp b/Ref/Top/instances.fpp index 2dc3032762..d66c054525 100644 --- a/Ref/Top/instances.fpp +++ b/Ref/Top/instances.fpp @@ -72,15 +72,15 @@ module Ref { # depending on which form of telemetry downlink # you wish to use - instance tlmSend: Svc.TlmChan base id 0x0C00 \ - queue size Default.QUEUE_SIZE \ - stack size Default.STACK_SIZE \ - priority 97 - - #instance tlmSend: Svc.TlmPacketizer base id 0x0C00 \ - # queue size Default.QUEUE_SIZE \ - # stack size Default.STACK_SIZE \ - # priority 97 + # instance tlmSend: Svc.TlmChan base id 0x0C00 \ + # queue size Default.QUEUE_SIZE \ + # stack size Default.STACK_SIZE \ + # priority 97 + + instance tlmSend: Svc.TlmPacketizer base id 0x0C00 \ + queue size Default.QUEUE_SIZE \ + stack size Default.STACK_SIZE \ + priority 97 instance prmDb: Svc.PrmDb base id 0x0D00 \ queue size Default.QUEUE_SIZE \ From 77906b6ac80b43b04035b12f7584f9cbbc8aa4cf Mon Sep 17 00:00:00 2001 From: Timothy Canham Date: Wed, 20 Nov 2024 14:53:46 -0800 Subject: [PATCH 2/4] Update to ignore module name on front of channels as band-aid until FPP packets are ready --- Autocoders/Python/bin/tlm_packet_gen.py | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Autocoders/Python/bin/tlm_packet_gen.py b/Autocoders/Python/bin/tlm_packet_gen.py index d259ac5317..344c69b13a 100755 --- a/Autocoders/Python/bin/tlm_packet_gen.py +++ b/Autocoders/Python/bin/tlm_packet_gen.py @@ -177,7 +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() + # 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() @@ -220,7 +220,7 @@ def generate_channel_size_dict(self, the_parsed_topology_xml, xml_filename): # check for channels if parsed_xml_dict[comp_type].get_channels() is not None: for chan in parsed_xml_dict[comp_type].get_channels(): - channel_name = f"{deployment}.{comp_name}.{chan.get_name()}" + channel_name = f"{comp_name}.{chan.get_name()}" if self.verbose: print("Processing Channel %s" % channel_name) chan_type = chan.get_type() @@ -336,6 +336,17 @@ 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 @@ -382,6 +393,18 @@ 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 From eec1a1e81d0019e6e4899e7fb6151f5ebea89be2 Mon Sep 17 00:00:00 2001 From: Timothy Canham Date: Wed, 20 Nov 2024 15:20:15 -0800 Subject: [PATCH 3/4] Revert to TlmChan --- Ref/Top/RefPackets.xml | 2 +- Ref/Top/instances.fpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Ref/Top/RefPackets.xml b/Ref/Top/RefPackets.xml index e38ae480c5..e212af7524 100644 --- a/Ref/Top/RefPackets.xml +++ b/Ref/Top/RefPackets.xml @@ -20,7 +20,7 @@ - + diff --git a/Ref/Top/instances.fpp b/Ref/Top/instances.fpp index d66c054525..33399937b9 100644 --- a/Ref/Top/instances.fpp +++ b/Ref/Top/instances.fpp @@ -72,15 +72,15 @@ module Ref { # depending on which form of telemetry downlink # you wish to use - # instance tlmSend: Svc.TlmChan base id 0x0C00 \ - # queue size Default.QUEUE_SIZE \ - # stack size Default.STACK_SIZE \ - # priority 97 - - instance tlmSend: Svc.TlmPacketizer base id 0x0C00 \ - queue size Default.QUEUE_SIZE \ - stack size Default.STACK_SIZE \ - priority 97 + instance tlmSend: Svc.TlmChan base id 0x0C00 \ + queue size Default.QUEUE_SIZE \ + stack size Default.STACK_SIZE \ + priority 97 + +# instance tlmSend: Svc.TlmPacketizer base id 0x0C00 \ +# queue size Default.QUEUE_SIZE \ +# stack size Default.STACK_SIZE \ +# priority 97 instance prmDb: Svc.PrmDb base id 0x0D00 \ queue size Default.QUEUE_SIZE \ From fe6bd865461d10d17a3dbe9316819e60ac5aa154 Mon Sep 17 00:00:00 2001 From: Timothy Canham Date: Fri, 22 Nov 2024 16:36:07 -0800 Subject: [PATCH 4/4] Reformatted with Black --- Autocoders/Python/bin/tlm_packet_gen.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Autocoders/Python/bin/tlm_packet_gen.py b/Autocoders/Python/bin/tlm_packet_gen.py index 344c69b13a..2502afe564 100755 --- a/Autocoders/Python/bin/tlm_packet_gen.py +++ b/Autocoders/Python/bin/tlm_packet_gen.py @@ -337,16 +337,17 @@ 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 + # 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 + 'Channel %s must be of the format "module.component.channel_name"' + % channel_name ) - (module,component,channel) = name_parts - channel_name = "%s.%s" % (component,channel) + (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 @@ -394,16 +395,17 @@ 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 + # 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 + 'Channel %s must be of the format "module.component.channel_name"' + % channel_name ) - (module,component,channel) = name_parts - channel_name = "%s.%s" % (component,channel) + (module, component, channel) = name_parts + channel_name = "%s.%s" % (component, channel) if not channel_name in channel_size_dict: raise TlmPacketParseValueError(