From 1ba9386167b3a836b054afa196173d959962ddb9 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Fri, 26 Apr 2024 15:20:37 +0200 Subject: [PATCH] work on swr/tuner --- freedata_gui/src/js/eventHandler.js | 4 ++-- freedata_server/state_manager.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/freedata_gui/src/js/eventHandler.js b/freedata_gui/src/js/eventHandler.js index d11ebca6..b5d8a212 100644 --- a/freedata_gui/src/js/eventHandler.js +++ b/freedata_gui/src/js/eventHandler.js @@ -51,7 +51,7 @@ export function stateDispatcher(data) { data = JSON.parse(data); //Leave commented when not needed, otherwise can lead to heap overflows due to the amount of data logged //console.debug(data); - if (data["type"] == "state-change" && data["type"] == "state") { + if (data["type"] == "state-change" || data["type"] == "state") { stateStore.modem_connection = "connected"; stateStore.busy_state = data["is_modem_busy"]; stateStore.channel_busy = data["channel_busy"]; @@ -73,7 +73,7 @@ export function stateDispatcher(data) { build_HSL(); } - if (data["type"] == "state-change" && data["type"] == "radio") { + if (data["type"] == "radio-change" || data["type"] == "radio") { stateStore.s_meter_strength_raw = Math.round(data["s_meter_strength"]); stateStore.s_meter_strength_percent = Math.round( diff --git a/freedata_server/state_manager.py b/freedata_server/state_manager.py index d1aeae0e..44d195d1 100644 --- a/freedata_server/state_manager.py +++ b/freedata_server/state_manager.py @@ -107,7 +107,7 @@ class StateManager: } def get_radio_event(self, isChangedState): - msgtype = "state-change" + msgtype = "radio-change" if (not isChangedState): msgtype = "radio" @@ -117,6 +117,8 @@ class StateManager: "radio_frequency": self.radio_frequency, "radio_mode": self.radio_mode, "s_meter_strength": self.s_meter_strength, + "radio_swr" : self.radio_swr, + "radio_tuner": self.radio_tuner, } # .wait() blocks until the event is set