2023-11-18 15:53:54 +00:00
|
|
|
import { reactive } from "vue";
|
2023-10-03 13:15:17 +00:00
|
|
|
|
2023-11-18 09:44:17 +00:00
|
|
|
import { getConfig, setConfig } from "../js/api";
|
2023-10-04 17:54:50 +00:00
|
|
|
|
2023-11-18 15:53:54 +00:00
|
|
|
export const settingsStore = reactive({
|
|
|
|
local: {
|
|
|
|
host: "127.0.0.1",
|
|
|
|
port: "5000",
|
|
|
|
},
|
2023-11-18 09:44:17 +00:00
|
|
|
remote: {
|
|
|
|
AUDIO: {
|
|
|
|
enable_auto_tune: false,
|
|
|
|
input_device: "",
|
|
|
|
output_device: "",
|
|
|
|
rx_audio_level: 0,
|
|
|
|
tx_audio_level: 0,
|
|
|
|
},
|
|
|
|
MESH: {
|
|
|
|
enable_protocol: false,
|
|
|
|
},
|
|
|
|
MODEM: {
|
|
|
|
enable_fft: false,
|
|
|
|
enable_fsk: false,
|
|
|
|
enable_low_bandwidth_mode: false,
|
|
|
|
enable_scatter: false,
|
|
|
|
respond_to_cq: false,
|
|
|
|
rx_buffer_size: 0,
|
|
|
|
tuning_range_fmax: 0,
|
|
|
|
tuning_range_fmin: 0,
|
|
|
|
tx_delay: 0,
|
|
|
|
},
|
|
|
|
NETWORK: {
|
|
|
|
modemport: 0,
|
|
|
|
},
|
|
|
|
RADIO: {
|
|
|
|
radiocontrol: "disabled",
|
|
|
|
radioport: "None",
|
|
|
|
rigctld_ip: "127.0.0.1",
|
|
|
|
rigctld_port: 0,
|
|
|
|
},
|
|
|
|
STATION: {
|
|
|
|
enable_explorer: false,
|
|
|
|
enable_stats: false,
|
|
|
|
mycall: "",
|
|
|
|
mygrid: "",
|
|
|
|
ssid_list: [],
|
|
|
|
},
|
|
|
|
TCI: {
|
|
|
|
tci_ip: "127.0.0.1",
|
|
|
|
tci_port: 0,
|
|
|
|
},
|
|
|
|
},
|
2023-11-18 15:53:54 +00:00
|
|
|
});
|
2023-10-03 13:15:17 +00:00
|
|
|
|
2023-11-18 09:44:17 +00:00
|
|
|
export function onChange() {
|
|
|
|
setConfig(settingsStore.remote).then((conf) => {
|
|
|
|
settingsStore.remote = conf;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-11-18 15:53:54 +00:00
|
|
|
export function getRemote() {
|
|
|
|
getConfig().then((conf) => {
|
|
|
|
settingsStore.remote = conf;
|
|
|
|
});
|
|
|
|
}
|
2023-09-05 17:35:54 +00:00
|
|
|
|
2023-11-18 09:44:17 +00:00
|
|
|
if (settingsStore.remote.STATION.mycall === "") {
|
2023-11-18 15:58:17 +00:00
|
|
|
getRemote();
|
|
|
|
}
|