mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
PTT updates
This commit is contained in:
parent
ab43314619
commit
b7b51ad469
3 changed files with 8 additions and 4 deletions
|
@ -18,8 +18,8 @@ const state = useStateStore(pinia);
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm btn-secondary me-1"
|
class="btn btn-sm btn-secondary me-1"
|
||||||
v-bind:class="{
|
v-bind:class="{
|
||||||
'btn-danger': state.ptt_state === 'True',
|
'btn-danger': state.ptt_state == true,
|
||||||
'btn-secondary': state.ptt_state === 'False',
|
'btn-secondary': state.ptt_state == false,
|
||||||
}"
|
}"
|
||||||
id="ptt_state"
|
id="ptt_state"
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const useStateStore = defineStore("stateStore", () => {
|
||||||
var dbfs_level = ref(0);
|
var dbfs_level = ref(0);
|
||||||
var radio_status = ref(false);
|
var radio_status = ref(false);
|
||||||
|
|
||||||
var ptt_state = ref("False");
|
var ptt_state = ref(false);
|
||||||
|
|
||||||
var speed_level = ref(0);
|
var speed_level = ref(0);
|
||||||
var fft = ref();
|
var fft = ref();
|
||||||
|
|
|
@ -6,6 +6,7 @@ class EventManager:
|
||||||
def __init__(self, queues):
|
def __init__(self, queues):
|
||||||
self.queues = queues
|
self.queues = queues
|
||||||
self.log = structlog.get_logger('Event Manager')
|
self.log = structlog.get_logger('Event Manager')
|
||||||
|
self.lastpttstate = False
|
||||||
|
|
||||||
def broadcast(self, data):
|
def broadcast(self, data):
|
||||||
self.log.debug(f"Broadcasting event: {data}")
|
self.log.debug(f"Broadcasting event: {data}")
|
||||||
|
@ -13,7 +14,10 @@ class EventManager:
|
||||||
q.put(data)
|
q.put(data)
|
||||||
|
|
||||||
def send_ptt_change(self, on:bool = False):
|
def send_ptt_change(self, on:bool = False):
|
||||||
self.broadcast({"ptt": str(on)})
|
if (on == self.lastpttstate):
|
||||||
|
return
|
||||||
|
self.lastpttstate= on
|
||||||
|
self.broadcast({"ptt": bool(on)})
|
||||||
|
|
||||||
def send_scatter_change(self, data):
|
def send_scatter_change(self, data):
|
||||||
self.broadcast({"scatter": str(data)})
|
self.broadcast({"scatter": str(data)})
|
||||||
|
|
Loading…
Reference in a new issue