diff --git a/sendreceive/obsw_command_sender_receiver.py b/sendreceive/obsw_command_sender_receiver.py index f30e18cb4e878402bb7c28f957bcd79025864f50..48232dad219d134e00b937f2bf1068c49f035951 100644 --- a/sendreceive/obsw_command_sender_receiver.py +++ b/sendreceive/obsw_command_sender_receiver.py @@ -118,7 +118,7 @@ class CommandSenderReceiver: time.sleep(wait_time) elif queue_entry_first == "print": print_string = queue_entry_second - self._tmtc_printer.print_string(print_string) + self._tmtc_printer.print_string(print_string, True) elif queue_entry_first == "export": export_name = queue_entry_second self._tmtc_printer.add_print_buffer_to_buffer_list() diff --git a/tc/obsw_pus_tc_packer.py b/tc/obsw_pus_tc_packer.py index adbee621a816dd70baf92a9a6f248c15f699b41a..ccb66f26ee18f94f7f23e5b8ab18c8b4b8b9808d 100644 --- a/tc/obsw_pus_tc_packer.py +++ b/tc/obsw_pus_tc_packer.py @@ -107,7 +107,7 @@ def pack_service9_test_into(tc_queue: TcQueueT) -> TcQueueT: def pack_service17_test_into(tc_queue: TcQueueT) -> TcQueueT: - tc_queue.appendleft(("print", "Testing Service 17.")) + tc_queue.appendleft(("print", "Testing Service 17\r")) # ping test tc_queue.appendleft(("print", "Testing Service 17: Ping Test")) command = PusTelecommand(service=17, subservice=1, ssc=1700) diff --git a/utility/obsw_tmtc_printer.py b/utility/obsw_tmtc_printer.py index 3beaff47489147b5452411d711c7be4722eb08ee..5ed2be30bfb64ba6e7ec064b869f7848aae05d54 100644 --- a/utility/obsw_tmtc_printer.py +++ b/utility/obsw_tmtc_printer.py @@ -220,23 +220,32 @@ class TmTcPrinter: str_to_print += ']' return str_to_print - def print_string(self, string: str): + def print_string(self, string: str, add_cr_to_file_buffer: bool = False): """ Print a string and adds it to the file buffer. :param string: + :param add_cr_to_file_buffer: :return: """ self.__print_buffer = string logger.info(self.__print_buffer) if self.do_print_to_file: - self.add_print_buffer_to_file_buffer() + self.add_print_buffer_to_file_buffer(add_cr_to_file_buffer) + + def add_to_print_string(self, string_to_add: str=""): + self.__print_buffer += string_to_add - def add_print_buffer_to_file_buffer(self): + def add_print_buffer_to_file_buffer(self, add_cr_to_file_buffer: bool = False): """ :return: """ if self.do_print_to_file: - self.__file_buffer = self.__file_buffer + self.__print_buffer + "\r\n" + if add_cr_to_file_buffer: + self.__file_buffer += self.__print_buffer + "\r\n\r\n" + else: + self.__file_buffer += self.__print_buffer + "\r\n" + + def add_print_buffer_to_buffer_list(self): self.file_buffer_list.append(self.__file_buffer)