diff --git a/tnc/helpers.py b/tnc/helpers.py index 6aeef3b2..d2d2f7d9 100644 --- a/tnc/helpers.py +++ b/tnc/helpers.py @@ -131,11 +131,15 @@ def arq_reset_frame_machine(): def calculate_transfer_rate(): - #arq_tx_n_total_arq_frames = int.from_bytes(static.ARQ_TX_N_TOTAL_ARQ_FRAMES, "big") + + print(static.ARQ_TX_N_TOTAL_ARQ_FRAMES) + print(static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME) + print(static.ARQ_RX_N_CURRENT_ARQ_FRAME) + + arq_tx_n_total_arq_frames = static.ARQ_TX_N_TOTAL_ARQ_FRAMES arq_n_arq_frames_per_data_frame = static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME - arq_rx_n_current_arq_frame = static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME - + arq_rx_n_current_arq_frame = static.ARQ_RX_N_CURRENT_ARQ_FRAME if arq_tx_n_total_arq_frames == 0: total_n_frames = arq_n_arq_frames_per_data_frame @@ -163,7 +167,7 @@ def calculate_transfer_rate(): if arq_tx_n_total_arq_frames > 0: - static.ARQ_TRANSMISSION_PERCENT = int(int.from_bytes(bytes(arq_rx_n_current_arq_frame), "big") / arq_tx_n_total_arq_frames) * 100 + static.ARQ_TRANSMISSION_PERCENT = int(arq_rx_n_current_arq_frame / arq_tx_n_total_arq_frames) * 100 elif arq_n_arq_frames_per_data_frame > 0: static.ARQ_TRANSMISSION_PERCENT = int(arq_rx_n_current_arq_frame / arq_n_arq_frames_per_data_frame) * 100