changed some gui settings....broken settings now I think..

This commit is contained in:
DJ2LS 2023-11-11 20:27:54 +01:00
parent a009f6dd3c
commit 8b777a3ad2
2 changed files with 28 additions and 5 deletions

View file

@ -116,7 +116,28 @@ export function processModemConfig(data) {
// For now its a hardcoded structure until we found a better way
console.log(data);
// chatGPT function for iterating through all items and asserting them to a function
for (const category in data) {
if (data.hasOwnProperty(category)) {
for (const setting in data[category]) {
if (data[category].hasOwnProperty(setting)) {
// Create a variable name combining the category and setting name
const variableName = setting;
// Assign the value to the variable
settings[variableName] = data[category][setting];
console.log(variableName + ': ' + settings[variableName]);
}
}
}
}
/*
// STATION SETTINGS
// Extract the callsign and SSID
if (data.STATION.mycall.includes("-")) {
@ -162,6 +183,8 @@ export function processModemConfig(data) {
// MESH SETTINGS
settings.enable_mesh_features = data.MESH.enable_protocol;
*/
}
export function processModemAudioDevices(data) {
@ -181,7 +204,7 @@ export function getModemConfigAsJSON() {
const configData = {
AUDIO: {
auto_tune: settings.auto_tune,
enable_auto_tune: settings.auto_tune,
input_device: settings.rx_audio,
rxaudiolevel: settings.rx_audio_level,
output_device: settings.tx_audio,
@ -219,8 +242,8 @@ export function getModemConfigAsJSON() {
ssid_list: [],
},
TCI: {
ip: settings.tci_ip,
port: settings.tci_port,
tci_ip: settings.tci_ip,
tci_port: settings.tci_port,
},
};

View file

@ -148,7 +148,7 @@ def test_audio_devices(input_id: str, output_id: str) -> list:
)
test_result[0] = True
except (sd.PortAudioError, ValueError) as e:
log.warning(f"[Audio-Test] Input device error ({input_id}) [{str(in_dev_index)}] [{in_dev_name}]:", e=e)
log.warning(f"[Audio-Test] Input device error ({input_id}):", e=e)
test_result[0] = False
try:
result = get_device_index_from_crc(output_id, False)
@ -167,7 +167,7 @@ def test_audio_devices(input_id: str, output_id: str) -> list:
except (sd.PortAudioError, ValueError) as e:
log.warning(f"[Audio-Test] Output device error ({output_id}) [{str(out_dev_index)}] [{out_dev_name}]:", e=e)
log.warning(f"[Audio-Test] Output device error ({output_id}):", e=e)
test_result[1] = False
sd._terminate()