some renaming

This commit is contained in:
Robin Müller 2022-10-27 15:32:50 +02:00
parent 10cca44fbe
commit 38d180f258
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -207,7 +207,7 @@ class TcHandler(TcHandlerBase):
cfdp_in_ccsds_wrapper: CfdpInCcsdsWrapper, cfdp_in_ccsds_wrapper: CfdpInCcsdsWrapper,
pus_verificator: PusVerificator, pus_verificator: PusVerificator,
file_logger: logging.Logger, file_logger: logging.Logger,
raw_logger: RawTmtcTimedLogWrapper, raw_pus_logger: RawTmtcTimedLogWrapper,
gui: bool, gui: bool,
): ):
super().__init__() super().__init__()
@ -215,8 +215,8 @@ class TcHandler(TcHandlerBase):
self.cfdp_dest_id = CFDP_REMOTE_ENTITY_ID self.cfdp_dest_id = CFDP_REMOTE_ENTITY_ID
self.seq_count_provider = seq_count_provider self.seq_count_provider = seq_count_provider
self.pus_verificator = pus_verificator self.pus_verificator = pus_verificator
self.file_logger = file_logger self.pus_file_logger = file_logger
self.raw_logger = raw_logger self.pus_raw_logger = raw_pus_logger
self.gui = gui self.gui = gui
self.queue_helper = DefaultPusQueueHelper( self.queue_helper = DefaultPusQueueHelper(
queue_wrapper=None, queue_wrapper=None,
@ -249,10 +249,10 @@ class TcHandler(TcHandlerBase):
# Add TC after Sequence Count stamping # Add TC after Sequence Count stamping
self.pus_verificator.add_tc(pus_tc_wrapper.pus_tc) self.pus_verificator.add_tc(pus_tc_wrapper.pus_tc)
raw_tc = pus_tc_wrapper.pus_tc.pack() raw_tc = pus_tc_wrapper.pus_tc.pack()
self.raw_logger.log_tc(pus_tc_wrapper.pus_tc) self.pus_raw_logger.log_tc(pus_tc_wrapper.pus_tc)
tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}" tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}"
LOGGER.info(tc_info_string) LOGGER.info(tc_info_string)
self.file_logger.info( self.pus_file_logger.info(
f"{get_current_time_string(True)}: {tc_info_string}" f"{get_current_time_string(True)}: {tc_info_string}"
) )
send_params.com_if.send(raw_tc) send_params.com_if.send(raw_tc)
@ -262,6 +262,7 @@ class TcHandler(TcHandlerBase):
# TODO: Log raw CFDP packets similarly to how PUS packets are logged. # TODO: Log raw CFDP packets similarly to how PUS packets are logged.
# - Log full raw format including space packet wrapper # - Log full raw format including space packet wrapper
# - Log context information: Transaction ID, and PDU type and directive # - Log context information: Transaction ID, and PDU type and directive
# Could re-use file logger. Should probably do that
# print(f"sending packet: [{cfdp_packet_in_ccsds.space_packet.pack()}]") # print(f"sending packet: [{cfdp_packet_in_ccsds.space_packet.pack()}]")
# with open(f"cfdp_packet_{self.cfdp_counter}", "wb") as of: # with open(f"cfdp_packet_{self.cfdp_counter}", "wb") as of:
# of.write(cfdp_packet_in_ccsds.space_packet.pack()) # of.write(cfdp_packet_in_ccsds.space_packet.pack())
@ -269,7 +270,7 @@ class TcHandler(TcHandlerBase):
elif entry_helper.entry_type == TcQueueEntryType.LOG: elif entry_helper.entry_type == TcQueueEntryType.LOG:
log_entry = entry_helper.to_log_entry() log_entry = entry_helper.to_log_entry()
LOGGER.info(log_entry.log_str) LOGGER.info(log_entry.log_str)
self.file_logger.info(log_entry.log_str) self.pus_file_logger.info(log_entry.log_str)
def handle_cfdp_procedure(self, info: ProcedureWrapper): def handle_cfdp_procedure(self, info: ProcedureWrapper):
cfdp_procedure = info.to_cfdp_procedure() cfdp_procedure = info.to_cfdp_procedure()
@ -396,7 +397,7 @@ def setup_tmtc_handlers(
seq_count_provider=seq_count_provider, seq_count_provider=seq_count_provider,
pus_verificator=verificator, pus_verificator=verificator,
file_logger=printer.file_logger, file_logger=printer.file_logger,
raw_logger=raw_logger, raw_pus_logger=raw_logger,
gui=gui, gui=gui,
cfdp_in_ccsds_wrapper=cfdp_in_ccsds_wrapper, cfdp_in_ccsds_wrapper=cfdp_in_ccsds_wrapper,
) )