diff --git a/gui/daemon.js b/gui/daemon.js index 99a71ce8..84bb49e9 100644 --- a/gui/daemon.js +++ b/gui/daemon.js @@ -131,7 +131,7 @@ exports.getDaemonState = function() { // ` `== multi line string -exports.startTNC = function(rx_audio, tx_audio, deviceid, deviceport, ptt) { +exports.startTNC = function(rx_audio, tx_audio, deviceid, deviceport, ptt, serialspeed) { var json_command = JSON.stringify({ type: 'SET', command: 'STARTTNC', @@ -140,7 +140,9 @@ exports.startTNC = function(rx_audio, tx_audio, deviceid, deviceport, ptt) { tx_audio: tx_audio, deviceid: deviceid, deviceport: deviceport, - ptt: ptt + ptt: ptt, + serialspeed: serialspeed + }] }) diff --git a/gui/main.js b/gui/main.js index e4bb797c..9ce91d33 100644 --- a/gui/main.js +++ b/gui/main.js @@ -102,7 +102,7 @@ ipcMain.on('request-update-data-state', (event, arg) => { }); ipcMain.on('request-update-heard-stations', (event, arg) => { - //win.webContents.send('action-update-heard-stations', arg); + win.webContents.send('action-update-heard-stations', arg); }); ipcMain.on('request-update-daemon-state', (event, arg) => { diff --git a/gui/preload-main.js b/gui/preload-main.js index af522992..7d6e514c 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -91,9 +91,10 @@ window.addEventListener('DOMContentLoaded', () => { var tx_audio = document.getElementById("audio_output_selectbox").value var deviceid = document.getElementById("hamlib_deviceid").value var deviceport = document.getElementById("hamlib_deviceport").value + var serialspeed = document.getElementById("hamlib_serialspeed").value var ptt = document.getElementById("hamlib_ptt").value - daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, ptt) + daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, ptt, serialspeed) setTimeout(function() { sock.saveMyCall(config.mycall); }, 5000); @@ -193,20 +194,14 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => { document.getElementById("progressbar_ram").setAttribute("aria-valuenow", arg.ram_usage) document.getElementById("progressbar_ram").setAttribute("style", "width:" + arg.ram_usage + "%;") document.getElementById("progressbar_ram_value").innerHTML = arg.ram_usage + "%" - - console.log("RAM: " + arg.ram_usage) - - // CPU document.getElementById("progressbar_cpu").setAttribute("aria-valuenow", arg.cpu_usage) document.getElementById("progressbar_cpu").setAttribute("style", "width:" + arg.cpu_usage + "%;") document.getElementById("progressbar_cpu_value").innerHTML = arg.cpu_usage + "%" - console.log("CPU: " +arg.cpu_usage) // VERSION document.getElementById("tncversion").innerHTML = arg.version - console.log("VERSION: " + arg.version) // UPDATE AUDIO INPUT @@ -246,6 +241,7 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => { document.getElementById('saveMyCall').disabled = false document.getElementById('myGrid').disabled = false document.getElementById('saveMyGrid').disabled = false + document.getElementById("hamlib_serialspeed").disabled = false } else { document.getElementById('hamlib_deviceid').disabled = false @@ -259,6 +255,8 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => { document.getElementById('saveMyCall').disabled = true document.getElementById('myGrid').disabled = true document.getElementById('saveMyGrid').disabled = true + document.getElementById("hamlib_serialspeed").disabled = true + } }); diff --git a/gui/sock.js b/gui/sock.js index e0cd9212..9a0d8a1a 100644 --- a/gui/sock.js +++ b/gui/sock.js @@ -115,7 +115,7 @@ client.on('data', function(data) { frequency: data['FREQUENCY'], mode: data['MODE'], bandwith: data['BANDWITH'], - rms_level: (data['AUDIO_RMS'] / 1000) * 100 + rms_level: (data['AUDIO_RMS'] / 1000) * 100, }; console.log(Data) ipcRenderer.send('request-update-tnc-state', Data); @@ -179,22 +179,22 @@ exports.saveMyGrid = function(grid) { //Get TNC State exports.getTncState = function() { - command = '{"type" : "GET", "command": "TNC_STATE"}'; + command = '{"type" : "GET", "command" : "TNC_STATE"}'; writeTncCommand(command) } //Get DATA State exports.getDataState = function() { - command = '{"type" : "GET", "command": "DATA_STATE"}'; + command = '{"type" : "GET", "command" : "DATA_STATE"}'; writeTncCommand(command) } //Get Heard Stations exports.getHeardStations = function() { - command = '{"type" : "GET", "command": "HEARD_STATIONS"}'; + command = '{"type" : "GET", "command" : "HEARD_STATIONS"}'; writeTncCommand(command) } - + // Send Ping exports.sendPing = function(dxcallsign) {