Skip to content
Snippets Groups Projects
Commit a2875431 authored by Robin Mueller's avatar Robin Mueller
Browse files

tweaks

parent 93c7fb64
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment