2023-10-03 13:15:17 +00:00
|
|
|
import { defineStore } from "pinia";
|
2023-10-22 13:24:02 +00:00
|
|
|
import { ref } from "vue";
|
2023-10-03 13:15:17 +00:00
|
|
|
import * as bootstrap from "bootstrap";
|
|
|
|
|
|
|
|
export const useStateStore = defineStore("stateStore", () => {
|
|
|
|
var busy_state = ref("-");
|
|
|
|
var arq_state = ref("-");
|
2023-12-16 16:11:16 +00:00
|
|
|
var frequency = ref(0);
|
|
|
|
var new_frequency = ref(14093000);
|
2023-10-03 13:15:17 +00:00
|
|
|
var mode = ref("-");
|
|
|
|
var rf_level = ref("10");
|
|
|
|
var bandwidth = ref("-");
|
|
|
|
var dbfs_level_percent = ref(0);
|
2023-10-06 02:32:34 +00:00
|
|
|
var dbfs_level = ref(0);
|
2023-11-18 22:50:40 +00:00
|
|
|
var radio_status = ref(false);
|
2023-10-03 13:15:17 +00:00
|
|
|
|
2023-11-30 21:50:10 +00:00
|
|
|
var ptt_state = ref(false);
|
2023-10-03 13:15:17 +00:00
|
|
|
|
|
|
|
var speed_level = ref(0);
|
|
|
|
var fft = ref();
|
2023-11-18 22:50:40 +00:00
|
|
|
var channel_busy = ref(false);
|
2023-11-28 22:29:27 +00:00
|
|
|
var channel_busy_slot = ref([false, false, false, false, false]);
|
2023-12-01 02:12:04 +00:00
|
|
|
var scatter = ref([]);
|
2023-10-03 13:15:17 +00:00
|
|
|
var s_meter_strength_percent = ref(0);
|
|
|
|
var s_meter_strength_raw = ref(0);
|
|
|
|
|
2023-10-20 11:47:42 +00:00
|
|
|
var modem_connection = ref("disconnected");
|
|
|
|
var modemStartCount = ref(0);
|
2023-11-12 18:56:15 +00:00
|
|
|
var is_modem_running = ref();
|
2023-10-03 13:15:17 +00:00
|
|
|
|
|
|
|
var arq_total_bytes = ref(0);
|
|
|
|
var arq_transmission_percent = ref(0);
|
|
|
|
|
2023-12-03 16:49:56 +00:00
|
|
|
var activities = ref([]);
|
2023-12-05 03:25:24 +00:00
|
|
|
var heard_stations = ref([]);
|
2023-10-03 13:15:17 +00:00
|
|
|
var dxcallsign = ref("");
|
|
|
|
|
|
|
|
var arq_session_state = ref("");
|
|
|
|
var arq_state = ref("");
|
2023-12-03 23:39:06 +00:00
|
|
|
var beacon_state = ref(false);
|
2023-10-03 13:15:17 +00:00
|
|
|
|
2023-11-26 19:14:06 +00:00
|
|
|
var audio_recording = ref(false);
|
2023-10-03 13:15:17 +00:00
|
|
|
|
|
|
|
var hamlib_status = ref("");
|
2023-10-26 09:19:21 +00:00
|
|
|
var tx_audio_level = ref("");
|
2023-10-31 14:29:33 +00:00
|
|
|
var rx_audio_level = ref("");
|
|
|
|
|
2023-10-03 13:15:17 +00:00
|
|
|
var alc = ref("");
|
|
|
|
|
|
|
|
var is_codec2_traffic = ref("");
|
|
|
|
|
|
|
|
var arq_speed_list_timestamp = ref([]);
|
|
|
|
var arq_speed_list_bpm = ref([]);
|
|
|
|
var arq_speed_list_snr = ref([]);
|
|
|
|
|
|
|
|
var arq_seconds_until_finish = ref();
|
|
|
|
var arq_seconds_until_timeout = ref();
|
|
|
|
var arq_seconds_until_timeout_percent = ref();
|
|
|
|
|
2023-10-08 20:09:09 +00:00
|
|
|
var rigctld_started = ref();
|
|
|
|
var rigctld_process = ref();
|
|
|
|
|
2023-10-17 10:11:27 +00:00
|
|
|
var python_version = ref();
|
2023-10-20 11:47:42 +00:00
|
|
|
var modem_version = ref();
|
2023-10-08 20:09:09 +00:00
|
|
|
|
2023-10-22 10:54:11 +00:00
|
|
|
var rx_buffer_length = ref();
|
|
|
|
|
2023-10-03 13:15:17 +00:00
|
|
|
function updateTncState(state) {
|
2023-10-20 11:47:42 +00:00
|
|
|
modem_connection.value = state;
|
2023-09-05 18:20:24 +00:00
|
|
|
|
2023-10-20 11:47:42 +00:00
|
|
|
if (modem_connection.value == "open") {
|
2023-10-03 13:15:17 +00:00
|
|
|
//GUI will auto connect to TNC if already running, if that is the case increment start count if 0
|
2023-10-20 11:47:42 +00:00
|
|
|
if (modemStartCount.value == 0) modemStartCount.value++;
|
2023-10-03 13:15:17 +00:00
|
|
|
}
|
2023-09-05 18:20:24 +00:00
|
|
|
}
|
|
|
|
|
2023-10-03 13:15:17 +00:00
|
|
|
return {
|
|
|
|
dxcallsign,
|
|
|
|
busy_state,
|
|
|
|
arq_state,
|
|
|
|
new_frequency,
|
|
|
|
frequency,
|
|
|
|
mode,
|
|
|
|
bandwidth,
|
2023-10-06 02:32:34 +00:00
|
|
|
dbfs_level,
|
2023-10-03 13:15:17 +00:00
|
|
|
dbfs_level_percent,
|
|
|
|
speed_level,
|
|
|
|
fft,
|
|
|
|
channel_busy,
|
|
|
|
channel_busy_slot,
|
|
|
|
scatter,
|
|
|
|
ptt_state,
|
|
|
|
s_meter_strength_percent,
|
|
|
|
s_meter_strength_raw,
|
|
|
|
arq_total_bytes,
|
|
|
|
audio_recording,
|
|
|
|
hamlib_status,
|
2023-10-26 09:19:21 +00:00
|
|
|
tx_audio_level,
|
2023-10-31 14:29:33 +00:00
|
|
|
rx_audio_level,
|
2023-10-03 13:15:17 +00:00
|
|
|
alc,
|
|
|
|
updateTncState,
|
|
|
|
arq_transmission_percent,
|
|
|
|
arq_speed_list_bpm,
|
|
|
|
arq_speed_list_timestamp,
|
|
|
|
arq_speed_list_snr,
|
|
|
|
arq_seconds_until_finish,
|
|
|
|
arq_seconds_until_timeout,
|
|
|
|
arq_seconds_until_timeout_percent,
|
2023-11-03 14:38:41 +00:00
|
|
|
modem_connection,
|
2023-11-12 18:56:15 +00:00
|
|
|
is_modem_running,
|
2023-10-03 19:04:37 +00:00
|
|
|
arq_session_state,
|
|
|
|
is_codec2_traffic,
|
|
|
|
rf_level,
|
2023-12-03 16:49:56 +00:00
|
|
|
activities,
|
2023-12-05 03:25:24 +00:00
|
|
|
heard_stations,
|
2023-10-08 20:09:09 +00:00
|
|
|
beacon_state,
|
|
|
|
rigctld_started,
|
2023-10-17 10:11:27 +00:00
|
|
|
rigctld_process,
|
|
|
|
python_version,
|
2023-10-22 08:12:00 +00:00
|
|
|
modem_version,
|
2023-10-22 10:54:11 +00:00
|
|
|
rx_buffer_length,
|
2023-11-18 22:50:40 +00:00
|
|
|
radio_status,
|
2023-10-03 13:15:17 +00:00
|
|
|
};
|
2023-09-05 18:20:24 +00:00
|
|
|
});
|