set serial speed

This commit is contained in:
DJ2LS 2021-07-25 16:35:50 +02:00 committed by GitHub
parent 60778fca2a
commit b9dfe6ffeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 15 deletions

View file

@ -131,7 +131,7 @@ exports.getDaemonState = function() {
// ` `== multi line string // ` `== 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({ var json_command = JSON.stringify({
type: 'SET', type: 'SET',
command: 'STARTTNC', command: 'STARTTNC',
@ -140,7 +140,9 @@ exports.startTNC = function(rx_audio, tx_audio, deviceid, deviceport, ptt) {
tx_audio: tx_audio, tx_audio: tx_audio,
deviceid: deviceid, deviceid: deviceid,
deviceport: deviceport, deviceport: deviceport,
ptt: ptt ptt: ptt,
serialspeed: serialspeed
}] }]
}) })

View file

@ -102,7 +102,7 @@ ipcMain.on('request-update-data-state', (event, arg) => {
}); });
ipcMain.on('request-update-heard-stations', (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) => { ipcMain.on('request-update-daemon-state', (event, arg) => {

View file

@ -91,9 +91,10 @@ window.addEventListener('DOMContentLoaded', () => {
var tx_audio = document.getElementById("audio_output_selectbox").value var tx_audio = document.getElementById("audio_output_selectbox").value
var deviceid = document.getElementById("hamlib_deviceid").value var deviceid = document.getElementById("hamlib_deviceid").value
var deviceport = document.getElementById("hamlib_deviceport").value var deviceport = document.getElementById("hamlib_deviceport").value
var serialspeed = document.getElementById("hamlib_serialspeed").value
var ptt = document.getElementById("hamlib_ptt").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() { setTimeout(function() {
sock.saveMyCall(config.mycall); sock.saveMyCall(config.mycall);
}, 5000); }, 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("aria-valuenow", arg.ram_usage)
document.getElementById("progressbar_ram").setAttribute("style", "width:" + arg.ram_usage + "%;") document.getElementById("progressbar_ram").setAttribute("style", "width:" + arg.ram_usage + "%;")
document.getElementById("progressbar_ram_value").innerHTML = arg.ram_usage + "%" document.getElementById("progressbar_ram_value").innerHTML = arg.ram_usage + "%"
console.log("RAM: " + arg.ram_usage)
// CPU // CPU
document.getElementById("progressbar_cpu").setAttribute("aria-valuenow", arg.cpu_usage) document.getElementById("progressbar_cpu").setAttribute("aria-valuenow", arg.cpu_usage)
document.getElementById("progressbar_cpu").setAttribute("style", "width:" + arg.cpu_usage + "%;") document.getElementById("progressbar_cpu").setAttribute("style", "width:" + arg.cpu_usage + "%;")
document.getElementById("progressbar_cpu_value").innerHTML = arg.cpu_usage + "%" document.getElementById("progressbar_cpu_value").innerHTML = arg.cpu_usage + "%"
console.log("CPU: " +arg.cpu_usage)
// VERSION // VERSION
document.getElementById("tncversion").innerHTML = arg.version document.getElementById("tncversion").innerHTML = arg.version
console.log("VERSION: " + arg.version)
// UPDATE AUDIO INPUT // UPDATE AUDIO INPUT
@ -246,6 +241,7 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
document.getElementById('saveMyCall').disabled = false document.getElementById('saveMyCall').disabled = false
document.getElementById('myGrid').disabled = false document.getElementById('myGrid').disabled = false
document.getElementById('saveMyGrid').disabled = false document.getElementById('saveMyGrid').disabled = false
document.getElementById("hamlib_serialspeed").disabled = false
} else { } else {
document.getElementById('hamlib_deviceid').disabled = false 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('saveMyCall').disabled = true
document.getElementById('myGrid').disabled = true document.getElementById('myGrid').disabled = true
document.getElementById('saveMyGrid').disabled = true document.getElementById('saveMyGrid').disabled = true
document.getElementById("hamlib_serialspeed").disabled = true
} }
}); });

View file

@ -115,7 +115,7 @@ client.on('data', function(data) {
frequency: data['FREQUENCY'], frequency: data['FREQUENCY'],
mode: data['MODE'], mode: data['MODE'],
bandwith: data['BANDWITH'], bandwith: data['BANDWITH'],
rms_level: (data['AUDIO_RMS'] / 1000) * 100 rms_level: (data['AUDIO_RMS'] / 1000) * 100,
}; };
console.log(Data) console.log(Data)
ipcRenderer.send('request-update-tnc-state', Data); ipcRenderer.send('request-update-tnc-state', Data);
@ -179,22 +179,22 @@ exports.saveMyGrid = function(grid) {
//Get TNC State //Get TNC State
exports.getTncState = function() { exports.getTncState = function() {
command = '{"type" : "GET", "command": "TNC_STATE"}'; command = '{"type" : "GET", "command" : "TNC_STATE"}';
writeTncCommand(command) writeTncCommand(command)
} }
//Get DATA State //Get DATA State
exports.getDataState = function() { exports.getDataState = function() {
command = '{"type" : "GET", "command": "DATA_STATE"}'; command = '{"type" : "GET", "command" : "DATA_STATE"}';
writeTncCommand(command) writeTncCommand(command)
} }
//Get Heard Stations //Get Heard Stations
exports.getHeardStations = function() { exports.getHeardStations = function() {
command = '{"type" : "GET", "command": "HEARD_STATIONS"}'; command = '{"type" : "GET", "command" : "HEARD_STATIONS"}';
writeTncCommand(command) writeTncCommand(command)
} }
// Send Ping // Send Ping
exports.sendPing = function(dxcallsign) { exports.sendPing = function(dxcallsign) {