From a287543158a141dbffd0e4b00b1eb702bb1c8692 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Thu, 22 Oct 2020 18:37:43 +0200 Subject: [PATCH] tweaks --- utility/obsw_binary_uploader.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py index 718f726..60c3de6 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) -- GitLab