diff --git a/config/obsw_config.py b/config/obsw_config.py index feec9ba145da897e2a4094f2381344f8d97ebf8f..c1da8d42885281c25f0c98d8a2128b97a33a71c2 100644 --- a/config/obsw_config.py +++ b/config/obsw_config.py @@ -101,6 +101,7 @@ G_PRINT_TO_FILE = True G_PRINT_HK_DATA = False G_PRINT_RAW_TM = False G_PRINT_TM = True +G_RESEND_TC = False """ These objects are set for the Unit Test, no better solution found yet @@ -167,6 +168,7 @@ def set_globals(args): G_PRINT_RAW_TM = args.rawDataPrint G_COM_PORT = args.com_port G_TM_TIMEOUT = args.tm_timeout + G_RESEND_TC = args.resend_tc from obsw_user_code import global_setup_hook global_setup_hook() diff --git a/sendreceive/obsw_command_sender_receiver.py b/sendreceive/obsw_command_sender_receiver.py index 21ad35b7830ad19991c2f93919293ae24b1806d9..d91a0f7a31815253dfa4c67a61345abf7aedf25a 100644 --- a/sendreceive/obsw_command_sender_receiver.py +++ b/sendreceive/obsw_command_sender_receiver.py @@ -150,10 +150,14 @@ class CommandSenderReceiver: if self._start_time != 0: self._elapsed_time = time.time() - self._start_time if self._elapsed_time >= self._tm_timeout * self._tc_send_timeout_factor: - logger.info("CommandSenderReceiver: Timeout, sending TC again !") - self._com_interface.send_telecommand(self._last_tc, self._last_tc_info) - self._timeout_counter = self._timeout_counter + 1 - self._start_time = time.time() + if g.G_RESEND_TC: + logger.info("CommandSenderReceiver: Timeout, sending TC again !") + self._com_interface.send_telecommand(self._last_tc, self._last_tc_info) + self._timeout_counter = self._timeout_counter + 1 + self._start_time = time.time() + else: + # todo: we could also stop sending and clear the TC queue + self._reply_received = True time.sleep(0.5) def print_tm_queue(self, tm_queue: PusTmQueueT): diff --git a/utility/obsw_args_parser.py b/utility/obsw_args_parser.py index e2cce09934cfe285c8026b82ad6a0b527ab2cb44..221547f94edd4d5791f358398ebae092874410bf 100644 --- a/utility/obsw_args_parser.py +++ b/utility/obsw_args_parser.py @@ -48,6 +48,9 @@ def parse_input_arguments(): arg_parser.add_argument( '--hk', dest='print_hk', help='Supply -k or --hk to print HK data', action='store_true') arg_parser.add_argument('--COM', dest="com_port", help='COM Port for serial communication') + arg_parser.add_argument( + '--rs', dest="resend_tc", help='Specify whether TCs are sent again after timeout', + action='store_true') if len(sys.argv) == 1: print("No Input Arguments specified.")