diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py index 718f7265a8a1a98aa0666ef4cb3d04926276ab74..60c3de66a08d7a357d2ae58b547c3c0d61c3d09b 100644 --- a/utility/obsw_binary_uploader.py +++ b/utility/obsw_binary_uploader.py @@ -36,6 +36,8 @@ class BinaryFileUploader: self.com_if = com_if self.tmtc_printer = tmtc_printer self.tm_listener = tm_listener + self.iobc = False + self.send_interval = 1.0 def perform_file_upload(self): gui_cl_prompt = input("GUI(0) or command line version (1)? [0/1]: ") @@ -86,8 +88,12 @@ class BinaryFileUploader: iobc_prompt = input("iOBC? [y/n]: ") if iobc_prompt in ['y', 'yes', 1]: + self.iobc = True + self.send_interval = 0.8 iobc_prompt = True else: + self.iobc = False + self.send_interval = 0.6 iobc_prompt = False bootloader_prompt = input("Bootloader (0) or Software Image (1)? [0/1]: ") @@ -184,13 +190,12 @@ class BinaryFileUploader: def __perform_send_algorithm(self, tc_queue: Deque, number_of_packets: int, reception_deque: Deque): - interval = 0.8 last_check = time.time() last_sent = time.time() - total_time = interval * number_of_packets + total_time = self.send_interval * number_of_packets idx = 1 while tc_queue: - next_send = last_sent + interval + next_send = last_sent + self.send_interval (tc_packet, tc_info) = tc_queue.pop() if not isinstance(tc_packet, str): # print_string = "Sending packet " + str(idx) + ".." @@ -201,7 +206,7 @@ class BinaryFileUploader: elif tc_packet == "print": LOGGER.info(tc_info) remaining_time_string = "Remaining time: " + \ - str(round(total_time - (idx - 2) * interval, 2)) + \ + str(round(total_time - (idx - 2) * self.send_interval, 2)) + \ " seconds" print_progress_bar(idx - 2, number_of_packets, print_end="\n", suffix=remaining_time_string)