From ddc949c7acccb9790210c22ac25ec2af70489f97 Mon Sep 17 00:00:00 2001 From: dj2ls Date: Mon, 27 Dec 2021 12:30:43 +0100 Subject: [PATCH] advanced hamlib settings added support for more settings --- gui/daemon.js | 6 ++---- gui/preload-main.js | 11 +++-------- gui/src/index.html | 4 ++++ tnc/daemon.py | 16 +++++++++++++--- tnc/main.py | 9 +++++++++ tnc/rig.py | 31 +++++++++++++++++++++++-------- tnc/static.py | 7 +++++-- 7 files changed, 59 insertions(+), 25 deletions(-) diff --git a/gui/daemon.js b/gui/daemon.js index feec94d2..7db230d8 100644 --- a/gui/daemon.js +++ b/gui/daemon.js @@ -140,7 +140,7 @@ exports.getDaemonState = function() { // START TNC // ` `== multi line string -exports.startTNC = function(rx_audio, tx_audio, devicename, deviceport, pttprotocol, pttport, serialspeed, pttspeed, data_bits, stop_bits, handshake) { +exports.startTNC = function(rx_audio, tx_audio, devicename, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake) { var json_command = JSON.stringify({ type: 'SET', command: 'STARTTNC', @@ -152,7 +152,6 @@ exports.startTNC = function(rx_audio, tx_audio, devicename, deviceport, pttproto pttprotocol: pttprotocol, pttport: pttport, serialspeed: serialspeed, - pttspeed: pttspeed, data_bits: data_bits, stop_bits: stop_bits, handshake: handshake @@ -172,7 +171,7 @@ exports.stopTNC = function() { } // TEST HAMLIB -exports.testHamlib = function(devicename, deviceport, serialspeed, pttprotocol, pttport, pttspeed, data_bits, stop_bits, handshake) { +exports.testHamlib = function(devicename, deviceport, serialspeed, pttprotocol, pttport, data_bits, stop_bits, handshake) { var json_command = JSON.stringify({ type: 'GET', @@ -183,7 +182,6 @@ exports.testHamlib = function(devicename, deviceport, serialspeed, pttprotocol, pttprotocol: pttprotocol, pttport: pttport, serialspeed: serialspeed, - pttspeed: pttspeed, data_bits: data_bits, stop_bits: stop_bits, handshake: handshake diff --git a/gui/preload-main.js b/gui/preload-main.js index adc7d274..d946954a 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -76,7 +76,6 @@ window.addEventListener('DOMContentLoaded', () => { document.getElementById('hamlib_deviceport_advanced').value = config.deviceport document.getElementById('hamlib_serialspeed_advanced').value = config.serialspeed document.getElementById('hamlib_ptt_protocol_advanced').value = config.pttprotocol - document.getElementById('hamlib_pttspeed_advanced').value = config.pttspeed document.getElementById('hamlib_ptt_port_advanced').value = config.pttport document.getElementById('hamlib_databits_advanced').value = config.data_bits document.getElementById('hamlib_stopbits_advanced').value = config.stop_bits @@ -300,7 +299,6 @@ advancedHamlibSettingsModal var serialspeed = document.getElementById("hamlib_serialspeed").value var pttprotocol = document.getElementById("hamlib_ptt_protocol").value var pttport = document.getElementById("hamlib_ptt_port_advanced").value - var pttspeed = document.getElementById('hamlib_pttspeed_advanced').value var data_bits = document.getElementById('hamlib_databits_advanced').value var stop_bits = document.getElementById('hamlib_stopbits_advanced').value var handshake = document.getElementById('hamlib_handshake_advanced').value @@ -310,7 +308,6 @@ advancedHamlibSettingsModal config.serialspeed = serialspeed config.pttprotocol = pttprotocol config.pttport = pttport - config.pttspeed = pttspeed config.data_bits = data_bits config.stop_bits = stop_bits config.handshake = handshake @@ -328,7 +325,7 @@ advancedHamlibSettingsModal var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false}) collapseFourthRow.show() - daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, pttprotocol, pttport, serialspeed, pttspeed, data_bits, stop_bits, handshake) + daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake) @@ -389,14 +386,13 @@ advancedHamlibSettingsModal var pttprotocol = document.getElementById("hamlib_ptt_protocol").value var pttport = deviceport - var pttspeed = serialspeed var data_bits = "8" var stop_bits = "1" var handshake = "None" - daemon.testHamlib(deviceid, deviceport, serialspeed, pttprotocol, pttport, pttspeed, data_bits, stop_bits, handshake) + daemon.testHamlib(deviceid, deviceport, serialspeed, pttprotocol, pttport, data_bits, stop_bits, handshake) }) // TEST HAMLIB ADVANCED @@ -414,12 +410,11 @@ advancedHamlibSettingsModal var pttport = document.getElementById("hamlib_deviceport").value - var pttspeed = document.getElementById("hamlib_serialspeed_advanced").value var data_bits = document.getElementById("hamlib_databits_advanced").value var stop_bits = document.getElementById("hamlib_stopbits_advanced").value var handshake = document.getElementById("hamlib_handshake_advanced").value - daemon.testHamlib(deviceid, deviceport, serialspeed, pttprotocol, pttport, pttspeed, data_bits, stop_bits, handshake) + daemon.testHamlib(deviceid, deviceport, serialspeed, pttprotocol, pttport, data_bits, stop_bits, handshake) }) diff --git a/gui/src/index.html b/gui/src/index.html index d2da0044..cbced8d5 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -529,6 +529,7 @@ + @@ -1066,6 +1068,7 @@