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

correct time display

parent 3a153442
No related branches found
No related tags found
No related merge requests found
......@@ -140,10 +140,12 @@ def perform_file_upload(com_if: CommunicationInterface, tmtc_printer: TmTcPrinte
str(file_transfer_helper.number_of_append_packets) + " append packets."
LOGGER.info(print_string)
interval = 0.5
last_sent = time.time()
total_time = interval * total_num_packets
idx = 1
reception_deque = deque()
while tc_queue:
next_send = last_sent + interval
(tc_packet, tc_info) = tc_queue.pop()
if not isinstance(tc_packet, str):
# print_string = "Sending packet " + str(idx) + ".."
......@@ -153,14 +155,15 @@ def perform_file_upload(com_if: CommunicationInterface, tmtc_printer: TmTcPrinte
tmtc_printer.print_telecommand(tc_packet, tc_info)
elif tc_packet == "print":
LOGGER.info(tc_info)
time.sleep(0.5)
remaining_time_string = "Remaining time: " + str(total_time - (idx - 2) * interval) + \
" seconds"
print_progress_bar(idx - 2, total_num_packets, print_end="\n", suffix=remaining_time_string)
# sys.stdout.write("\033[F") # Cursor up one line
reception_deque.extend(tm_listener.retrieve_tm_packet_queue())
time_to_sleep = next_send - time.time()
last_sent = next_send
time.sleep(time_to_sleep)
print_string = "BinaryUploader: All binary packets were sent!"
LOGGER.info(print_string)
print_string = str(reception_deque.__len__()) + " replies received."
......
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