From f10a6b0d7f924b24f3b098507768c763cc73d67d Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sat, 11 May 2024 10:43:14 +0200 Subject: [PATCH] fixed missing speed level --- freedata_gui/src/js/eventHandler.js | 10 +++++++--- freedata_gui/src/store/stateStore.js | 3 +++ freedata_server/event_manager.py | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/freedata_gui/src/js/eventHandler.js b/freedata_gui/src/js/eventHandler.js index 2178e55f..b941e40a 100644 --- a/freedata_gui/src/js/eventHandler.js +++ b/freedata_gui/src/js/eventHandler.js @@ -170,6 +170,10 @@ export function eventDispatcher(data) { case "arq": if (data["arq-transfer-outbound"]) { + + stateStore.arq_is_receiving = false; + console.log(data) + switch (data["arq-transfer-outbound"].state) { case "NEW": message = `Type: ${data.type}, Session ID: ${data["arq-transfer-outbound"].session_id}, DXCall: ${data["arq-transfer-outbound"].dxcall}, Total Bytes: ${data["arq-transfer-outbound"].total_bytes}, State: ${data["arq-transfer-outbound"].state}`; @@ -205,6 +209,7 @@ export function eventDispatcher(data) { data["arq-transfer-outbound"].statistics.snr_histogram, ); //console.log(toRaw(stateStore.arq_speed_list_timestamp.value)); + stateStore.speed_level = data["arq-transfer-outbound"].speed_level; return; case "ABORTING": @@ -240,6 +245,7 @@ export function eventDispatcher(data) { } if (data["arq-transfer-inbound"]) { + stateStore.arq_is_receiving = true; switch (data["arq-transfer-inbound"].state) { case "NEW": message = `Type: ${data.type}, Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, State: ${data["arq-transfer-inbound"].state}`; @@ -296,9 +302,7 @@ export function eventDispatcher(data) { stateStore.arq_speed_list_snr.value = toRaw( data["arq-transfer-inbound"].statistics.snr_histogram, ); - console.log(stateStore.arq_speed_list_timestamp.value); - console.log(stateStore.arq_speed_list_bpm.value); - console.log(stateStore.arq_speed_list_snr.value); + stateStore.speed_level = data["arq-transfer-inbound"].speed_level; return; case "ENDED": diff --git a/freedata_gui/src/store/stateStore.js b/freedata_gui/src/store/stateStore.js index 9f20acf8..73e349c8 100644 --- a/freedata_gui/src/store/stateStore.js +++ b/freedata_gui/src/store/stateStore.js @@ -58,6 +58,8 @@ export const useStateStore = defineStore("stateStore", () => { var arq_speed_list_bpm = ref([]); var arq_speed_list_snr = ref([]); + var arq_is_receiving = ref(false) + /* TODO Those 3 can be removed I guess , DJ2LS*/ var arq_seconds_until_finish = ref(); var arq_seconds_until_timeout = ref(); @@ -115,6 +117,7 @@ export const useStateStore = defineStore("stateStore", () => { arq_seconds_until_finish, arq_seconds_until_timeout, arq_seconds_until_timeout_percent, + arq_is_receiving, modem_connection, is_modem_running, arq_session_state, diff --git a/freedata_server/event_manager.py b/freedata_server/event_manager.py index 6624e91a..ba57e2c7 100644 --- a/freedata_server/event_manager.py +++ b/freedata_server/event_manager.py @@ -44,7 +44,7 @@ class EventManager: } self.broadcast(event) - def send_arq_session_progress(self, outbound: bool, session_id, dxcall, received_bytes, total_bytes, state, statistics=None): + def send_arq_session_progress(self, outbound: bool, session_id, dxcall, received_bytes, total_bytes, state, speed_level, statistics=None): if statistics is None: statistics = {} @@ -57,6 +57,7 @@ class EventManager: 'received_bytes': received_bytes, 'total_bytes': total_bytes, 'state': state, + 'speed_level': speed_level, 'statistics': statistics, } }