mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
introduced radioHandler.ts
This commit is contained in:
parent
5c232a2165
commit
ba5fbd3a71
|
@ -14,9 +14,9 @@ import {
|
|||
getAudioDevices,
|
||||
getSerialDevices,
|
||||
getModemState,
|
||||
getRadioStatus,
|
||||
} from "./api";
|
||||
import { processFreedataMessages } from "./messagesHandler.ts";
|
||||
import { processRadioStatus } from "./radioHandler.ts";
|
||||
|
||||
// ----------------- init pinia stores -------------
|
||||
import { setActivePinia } from "pinia";
|
||||
|
@ -100,7 +100,7 @@ export function eventDispatcher(data) {
|
|||
getAudioDevices();
|
||||
getSerialDevices();
|
||||
getFreedataMessages();
|
||||
getRadioStatus();
|
||||
processRadioStatus();
|
||||
return;
|
||||
|
||||
case "stopped":
|
||||
|
@ -114,7 +114,7 @@ export function eventDispatcher(data) {
|
|||
getAudioDevices();
|
||||
getSerialDevices();
|
||||
getFreedataMessages();
|
||||
getRadioStatus();
|
||||
processRadioStatus();
|
||||
return;
|
||||
|
||||
case "failed":
|
||||
|
@ -147,7 +147,7 @@ export function eventDispatcher(data) {
|
|||
getSerialDevices();
|
||||
getFreedataMessages();
|
||||
processFreedataMessages();
|
||||
getRadioStatus();
|
||||
processRadioStatus();
|
||||
|
||||
return;
|
||||
|
||||
|
|
20
gui/src/js/radioHandler.ts
Normal file
20
gui/src/js/radioHandler.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
// pinia store setup
|
||||
import { setActivePinia } from "pinia";
|
||||
import pinia from "../store/index";
|
||||
setActivePinia(pinia);
|
||||
|
||||
import { settingsStore as settings, onChange } from "../store/settingsStore.js";
|
||||
|
||||
import { useStateStore } from "../store/stateStore";
|
||||
const stateStore = useStateStore(pinia);
|
||||
|
||||
import {
|
||||
getRadioStatus,
|
||||
} from "./api";
|
||||
|
||||
export async function processRadioStatus(){
|
||||
let result = await getRadioStatus()
|
||||
stateStore.mode = result.radio_mode
|
||||
stateStore.frequency = result.radio_frequency
|
||||
stateStore.rf_level = result.radio_rf_level
|
||||
}
|
Loading…
Reference in a new issue