hamlib changes and alsalib error handling #22

closes #22
This commit is contained in:
DJ2LS 2021-11-07 12:17:23 +01:00
parent bf49117ee4
commit ebbe0715e6
8 changed files with 484 additions and 368 deletions

View file

@ -68,7 +68,7 @@ var daemonProcess = null;
function createWindow() {
win = new BrowserWindow({
width: 1000,
height: 600,
height: 430,
autoHideMenuBar: true,
icon: __dirname + '/src/app-icon.png',
webPreferences: {

103
gui/package-lock.json generated
View file

@ -41,9 +41,9 @@
}
},
"node_modules/@electron/get": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.13.0.tgz",
"integrity": "sha512-+SjZhRuRo+STTO1Fdhzqnv9D2ZhjxXP6egsJ9kiO8dtP68cDx7dFCwWi64dlMQV7sWcfW1OYCW4wviEBzmRsfQ==",
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.13.1.tgz",
"integrity": "sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA==",
"dev": true,
"dependencies": {
"debug": "^4.1.1",
@ -58,7 +58,7 @@
"node": ">=8.6"
},
"optionalDependencies": {
"global-agent": "^2.0.2",
"global-agent": "^3.0.0",
"global-tunnel-ng": "^2.7.1"
}
},
@ -285,9 +285,9 @@
"optional": true
},
"node_modules/@types/yargs": {
"version": "17.0.4",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.4.tgz",
"integrity": "sha512-D/wihO9WFYqwsmJI0e0qS+U09wIQtYRSBJlXWjTFGjouEuOCy0BU4N/ZK5utb00S5lW/9LO7vOpvGDd8M06NvQ==",
"version": "17.0.5",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.5.tgz",
"integrity": "sha512-4HNq144yhaVjJs+ON6A07NEoi9Hh0Rhl/jI9Nt/l/YRjt+T6St/QK3meFARWZ8IgkzoD1LC0PdTdJenlQQi2WQ==",
"dev": true,
"dependencies": {
"@types/yargs-parser": "*"
@ -1129,18 +1129,6 @@
"node": ">=8"
}
},
"node_modules/core-js": {
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.0.tgz",
"integrity": "sha512-L1TpFRWXZ76vH1yLM+z6KssLZrP8Z6GxxW4auoCj+XiViOzNPJCAuTIkn03BGdFe6Z5clX5t64wRIRypsZQrUg==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@ -1679,9 +1667,9 @@
"dev": true
},
"node_modules/extsprintf": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
"integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz",
"integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==",
"dev": true,
"engines": [
"node >=0.6.0"
@ -1780,14 +1768,13 @@
}
},
"node_modules/global-agent": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.2.0.tgz",
"integrity": "sha512-+20KpaW6DDLqhG7JDiJpD1JvNvb8ts+TNl7BPOYcURqCrXqnN1Vf+XVOrkKJAFPqfX+oEhsdzOj1hLWkBTdNJg==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
"integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==",
"dev": true,
"optional": true,
"dependencies": {
"boolean": "^3.0.1",
"core-js": "^3.6.5",
"es6-error": "^4.1.1",
"matcher": "^3.0.0",
"roarr": "^2.15.3",
@ -2361,9 +2348,9 @@
}
},
"node_modules/mime": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz",
"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
"dev": true,
"bin": {
"mime": "cli.js"
@ -3198,18 +3185,18 @@
"dev": true
},
"node_modules/verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz",
"integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==",
"dev": true,
"engines": [
"node >=0.6.0"
],
"optional": true,
"dependencies": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
},
"engines": {
"node": ">=0.6.0"
}
},
"node_modules/verror/node_modules/core-util-is": {
@ -3497,15 +3484,15 @@
}
},
"@electron/get": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.13.0.tgz",
"integrity": "sha512-+SjZhRuRo+STTO1Fdhzqnv9D2ZhjxXP6egsJ9kiO8dtP68cDx7dFCwWi64dlMQV7sWcfW1OYCW4wviEBzmRsfQ==",
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.13.1.tgz",
"integrity": "sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"env-paths": "^2.2.0",
"fs-extra": "^8.1.0",
"global-agent": "^2.0.2",
"global-agent": "^3.0.0",
"global-tunnel-ng": "^2.7.1",
"got": "^9.6.0",
"progress": "^2.0.3",
@ -3695,9 +3682,9 @@
"optional": true
},
"@types/yargs": {
"version": "17.0.4",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.4.tgz",
"integrity": "sha512-D/wihO9WFYqwsmJI0e0qS+U09wIQtYRSBJlXWjTFGjouEuOCy0BU4N/ZK5utb00S5lW/9LO7vOpvGDd8M06NvQ==",
"version": "17.0.5",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.5.tgz",
"integrity": "sha512-4HNq144yhaVjJs+ON6A07NEoi9Hh0Rhl/jI9Nt/l/YRjt+T6St/QK3meFARWZ8IgkzoD1LC0PdTdJenlQQi2WQ==",
"dev": true,
"requires": {
"@types/yargs-parser": "*"
@ -4350,13 +4337,6 @@
"xdg-basedir": "^4.0.0"
}
},
"core-js": {
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.0.tgz",
"integrity": "sha512-L1TpFRWXZ76vH1yLM+z6KssLZrP8Z6GxxW4auoCj+XiViOzNPJCAuTIkn03BGdFe6Z5clX5t64wRIRypsZQrUg==",
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@ -4786,9 +4766,9 @@
}
},
"extsprintf": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
"integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz",
"integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==",
"dev": true,
"optional": true
},
@ -4869,14 +4849,13 @@
}
},
"global-agent": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.2.0.tgz",
"integrity": "sha512-+20KpaW6DDLqhG7JDiJpD1JvNvb8ts+TNl7BPOYcURqCrXqnN1Vf+XVOrkKJAFPqfX+oEhsdzOj1hLWkBTdNJg==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
"integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==",
"dev": true,
"optional": true,
"requires": {
"boolean": "^3.0.1",
"core-js": "^3.6.5",
"es6-error": "^4.1.1",
"matcher": "^3.0.0",
"roarr": "^2.15.3",
@ -5310,9 +5289,9 @@
}
},
"mime": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz",
"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
"dev": true
},
"mimic-response": {
@ -5979,9 +5958,9 @@
"dev": true
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz",
"integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==",
"dev": true,
"optional": true,
"requires": {

View file

@ -36,8 +36,22 @@ updateFFT = function(fft) {
setInterval(updateFFT, 250)
*/
// WINDOW LISTENER
window.addEventListener('DOMContentLoaded', () => {
/*
// ENABLE BOOTSTRAP POPOVERS EVERYWHERE
// https://getbootstrap.com/docs/5.0/components/popovers/#example-enable-popovers-everywhere
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
*/
// LOAD SETTINGS
document.getElementById("tnc_adress").value = config.tnc_host
document.getElementById("tnc_port").value = config.tnc_port
@ -91,6 +105,10 @@ window.addEventListener('DOMContentLoaded', () => {
spectrumPercent: 0
});
// SETUP OF SCATTER DIAGRAM
/*
global.data = {
@ -270,7 +288,23 @@ advancedHamlibSettingsModal
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.hide()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.show()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.show()
daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, pttprotocol, pttport, serialspeed, pttspeed, data_bits, stop_bits, handshake)
setTimeout(function() {
sock.saveMyCall(config.mycall);
}, 3000);
@ -282,25 +316,34 @@ advancedHamlibSettingsModal
// stopTNC button clicked
document.getElementById("stopTNC").addEventListener("click", () => {
daemon.stopTNC()
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.show()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.hide()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.hide()
})
// openDataModule button clicked
document.getElementById("openDataModule").addEventListener("click", () => {
if (document.getElementById("transmitFileSidebar").style.width == "40%") {
document.getElementById("transmitFileSidebar").style.width = "0px";
} else {
document.getElementById("transmitFileSidebar").style.width = "40%";
}
})
// not necessesary at this time beacuse bootstrap handles this
// document.getElementById("openDataModule").addEventListener("click", () => {
// var transmitFileSidebar = document.getElementById('transmitFileSidebar')
// var bstransmitFileSidebar = new bootstrap.Offcanvas(transmitFileSidebar)
// bstransmitFileSidebar.show()
//})
// openReceivedFiles button clicked
document.getElementById("openReceivedFiles").addEventListener("click", () => {
if (document.getElementById("receivedFilesSidebar").style.width == "40%") {
document.getElementById("receivedFilesSidebar").style.width = "0px";
} else {
document.getElementById("receivedFilesSidebar").style.width = "40%";
}
})
// not necessesary at this time beacuse bootstrap handles this
//document.getElementById("openReceivedFiles").addEventListener("click", () => {
// var transmitFileSidebar = document.getElementById('transmitFileSidebar')
// var bstransmitFileSidebar = new bootstrap.Offcanvas(transmitFileSidebar)
// bstransmitFileSidebar.show()
//})
// TEST HAMLIB
@ -349,7 +392,13 @@ advancedHamlibSettingsModal
// START TRANSMISSION
document.getElementById("startTransmission").addEventListener("click", () => {
document.getElementById("transmitFileSidebar").style.width = "0px";
//document.getElementById("transmitFileSidebar").style.width = "0px";
/* not neccessary at this time because handled by bootstap inside html
var transmitFileSidebar = document.getElementById('transmitFileSidebar')
var bstransmitFileSidebar = new bootstrap.Offcanvas(transmitFileSidebar)
bstransmitFileSidebar.show()
*/
var fileList = document.getElementById("dataModalFile").files;
var reader = new FileReader();
@ -403,13 +452,17 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
// TOE TIME OF EXECUTION --> How many time needs a command to be executed until data arrives
// deactivated this feature, beacuse its useless at this time. maybe it is getting more interesting, if we are working via network
// but for this we need to find a nice place for this on the screen
/*
if (typeof(arg.toe) == 'undefined') {
var toe = 0
} else {
var toe = arg.toe
}
document.getElementById("toe").innerHTML = toe + ' ms'
*/
// DATA STATE
global.rxBufferLengthTnc = arg.rx_buffer_length
@ -835,7 +888,8 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
});
ipcRenderer.on('action-update-daemon-state', (event, arg) => {
/*
// deactivetd RAM und CPU view so we dont get errors. We need to find a new place for this feature
// RAM
document.getElementById("progressbar_ram").setAttribute("aria-valuenow", arg.ram_usage)
document.getElementById("progressbar_ram").setAttribute("style", "width:" + arg.ram_usage + "%;")
@ -845,7 +899,7 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
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 + "%"
*/
// UPDATE AUDIO INPUT
if (arg.tnc_running_state == "stopped") {
if (document.getElementById("audio_input_selectbox").length != arg.input_devices.length) {
@ -909,7 +963,7 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
// TNC RUNNING STATE
document.getElementById("tnc_running_state").innerHTML = arg.tnc_running_state;
//document.getElementById("tnc_running_state").innerHTML = arg.tnc_running_state;
if (arg.tnc_running_state == "running") {
document.getElementById('hamlib_deviceid').disabled = true
document.getElementById('hamlib_deviceport').disabled = true
@ -928,8 +982,15 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
document.getElementById("hamlib_serialspeed").disabled = true
//document.getElementById("startTransmission").disabled = false
document.getElementById("openDataModule").disabled = false
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.hide()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.show()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.show()
} else {
document.getElementById('hamlib_deviceid').disabled = false
document.getElementById('hamlib_deviceport').disabled = false
@ -948,6 +1009,15 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
document.getElementById("hamlib_serialspeed").disabled = false
//document.getElementById("startTransmission").disabled = true
document.getElementById("openDataModule").disabled = true
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.show()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.hide()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.hide()
}
});

View file

@ -23,11 +23,19 @@
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group btn-group-sm me-2" role="group" aria-label="local-remote-switch toggle button group">
<input type="radio" class="btn-check" name="local-remote-switch" id="local-remote-switch1" autocomplete="off" checked>
<label class="btn btn-outline-secondary" for="local-remote-switch1">local TNC</label>
<label class="btn btn-outline-secondary" for="local-remote-switch1">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pc-display-horizontal" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1.5 0A1.5 1.5 0 0 0 0 1.5v7A1.5 1.5 0 0 0 1.5 10H6v1H1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-5v-1h4.5A1.5 1.5 0 0 0 16 8.5v-7A1.5 1.5 0 0 0 14.5 0h-13Zm0 1a.5.5 0 0 0-.5.5v7a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-13ZM12 12.5a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0Zm2 0a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0ZM1.5 12a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5ZM1 14.25a.25.25 0 0 1 .25-.25h5.5a.25.25 0 1 1 0 .5h-5.5a.25.25 0 0 1-.25-.25Z"/>
</svg>
</label>
<input type="radio" class="btn-check" name="local-remote-switch" id="local-remote-switch2" autocomplete="off">
<label class="btn btn-outline-secondary" for="local-remote-switch2">remote TNC</label>
<label class="btn btn-outline-secondary" for="local-remote-switch2">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-ethernet" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2ZM1 2a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2Zm13 11.5v-7a.5.5 0 0 0-.5-.5H12V4.5a.5.5 0 0 0-.5-.5h-1v-.5A.5.5 0 0 0 10 3H6a.5.5 0 0 0-.5.5V4h-1a.5.5 0 0 0-.5.5V6H2.5a.5.5 0 0 0-.5.5v7a.5.5 0 0 0 .5.5h11a.5.5 0 0 0 .5-.5ZM3.75 11a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25h-.5Zm2 0a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25h-.5Zm1.75.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-1.5ZM9.75 11a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25h-.5Zm1.75.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-1.5Z"/>
</svg>
</label>
</div>
<div class="input-group input-group-sm" id="remote-tnc-field">
<div class="input-group input-group-sm me-2" id="remote-tnc-field">
<span class="input-group-text" id="basic-addon1">IP</span>
<input type="text" class="form-control" placeholder="ip adress" id="tnc_adress" value="192.168.178.163" maxlength="17" style="width: 8rem" aria-label="Username" aria-describedby="basic-addon1" >
<span class="input-group-text" id="basic-addon1">:</span>
@ -38,6 +46,21 @@
</svg>
</button>
</div>
<div class="input-group input-group-sm">
<button type="button" id="startTNC"class="btn btn-success">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/>
<path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/>
</svg>
</button>
<div class="input-group-text">TNC</div>
<!-- <span class="input-group-text" id="tnc_running_state" style="width: 5rem">---</span>-->
<button type="button" data-bs-toggle="collapse" data-bs-target=".multi-collapse" id="stopTNC"class="btn btn-sm btn-danger">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-octagon-fill" viewBox="0 0 16 16">
<path d="M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353L11.46.146zm-6.106 4.5L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 1 1 .708-.708z"/>
</svg>
</button>
</div>
</div>
<div class="btn-toolbar" role="toolbar">
<button class="btn btn-sm btn-primary me-2" id="openRFChat" type="button" disabled>
@ -46,14 +69,13 @@
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4.414a1 1 0 0 0-.707.293L.854 15.146A.5.5 0 0 1 0 14.793V2zm3.5 1a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5z"/>
</svg>
</button>
<button class="btn btn-sm btn-primary me-2" id="openReceivedFiles" type="button">
<button class="btn btn-sm btn-primary me-2" data-bs-toggle="offcanvas" data-bs-target="#receivedFilesSidebar" id="openReceivedFiles" type="button">
<strong>Received Files </strong>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-arrow-down-fill" viewBox="0 0 16 16">
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zm-1 4v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 11.293V7.5a.5.5 0 0 1 1 0z"/>
</svg>
</button>
<button class="btn btn-sm btn-primary me-2" id="openDataModule" type="button">
<button class="btn btn-sm btn-primary me-2" id="openDataModule" data-bs-toggle="offcanvas" data-bs-target="#transmitFileSidebar" type="button">
<strong>Transmit File </strong>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-arrow-up-fill" viewBox="0 0 16 16">
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM6.354 9.854a.5.5 0 0 1-.708-.708l2-2a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 8.707V12.5a.5.5 0 0 1-1 0V8.707L6.354 9.854z"/>
@ -207,21 +229,37 @@
</div>
<!------------------------------------------------------------------------------------------>
<div class="container mt-5 p-0">
<div class="row">
<div class="col-4">
<div class="row collapse multi-collapse show" id="collapseFirstRow">
<div class="col">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-1">
<strong>Step 1: AUDIO SETTINGS</strong>
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-volume-up" viewBox="0 0 16 16">
<path d="M11.536 14.01A8.473 8.473 0 0 0 14.026 8a8.473 8.473 0 0 0-2.49-6.01l-.708.707A7.476 7.476 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303l.708.707z"/>
<path d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.483 5.483 0 0 1 11.025 8a5.483 5.483 0 0 1-1.61 3.89l.706.706z"/>
<path d="M10.025 8a4.486 4.486 0 0 1-1.318 3.182L8 10.475A3.489 3.489 0 0 0 9.025 8c0-.966-.392-1.841-1.025-2.475l.707-.707A4.486 4.486 0 0 1 10.025 8zM7 4a.5.5 0 0 0-.812-.39L3.825 5.5H1.5A.5.5 0 0 0 1 6v4a.5.5 0 0 0 .5.5h2.325l2.363 1.89A.5.5 0 0 0 7 12V4zM4.312 6.39 6 5.04v5.92L4.312 9.61A.5.5 0 0 0 4 9.5H2v-3h2a.5.5 0 0 0 .312-.11z"/>
</svg>
<strong>AUDIO SETTINGS</strong>
</div>
<div class="card-body p-2 mb-1">
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">RX</span>
<span class="input-group-text" id="basic-addon1">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-mic-fill" viewBox="0 0 16 16">
<path d="M5 3a3 3 0 0 1 6 0v5a3 3 0 0 1-6 0V3z"/>
<path d="M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5z"/>
</svg>
</span>
<select class="form-select form-select-sm" id="audio_input_selectbox" aria-label=".form-select-sm">
<!-- <option selected value="3011">USB Interface</option>-->
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">TX</span>
<span class="input-group-text" id="basic-addon1">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-volume-up-fill" viewBox="0 0 16 16">
<path d="M11.536 14.01A8.473 8.473 0 0 0 14.026 8a8.473 8.473 0 0 0-2.49-6.01l-.708.707A7.476 7.476 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303l.708.707z"/>
<path d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.483 5.483 0 0 1 11.025 8a5.483 5.483 0 0 1-1.61 3.89l.706.706z"/>
<path d="M8.707 11.182A4.486 4.486 0 0 0 10.025 8a4.486 4.486 0 0 0-1.318-3.182L8 5.525A3.489 3.489 0 0 1 9.025 8 3.49 3.49 0 0 1 8 10.475l.707.707zM6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06z"/>
</svg>
</span>
<select class="form-select form-select-sm" id="audio_output_selectbox" aria-label=".form-select-sm">
</select>
</div>
@ -230,17 +268,19 @@
<p class="justify-content-center d-flex position-absolute w-100">RX AUDIO LEVEL</p>
</div>
</div>
<!--
<div class="card-footer text-muted small">
Select audio device for RX and TX
</div>
-->
Please select audio device for RX and TX
</div>
</div>
</div>
<div class="col-5">
<div class="col">
<div class="card text-dark bg-light mb-0">
<div class="card-header p-1">
<strong>Step 2: RADIO SETTINGS</strong>
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-projector" viewBox="0 0 16 16">
<path d="M14 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM2.5 6a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4Zm0 2a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4Z"/>
<path fill-rule="evenodd" d="M0 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1H5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1 2 2 0 0 1-2-2V6Zm2-1h12a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z"/>
</svg>
<strong>RADIO SETTINGS</strong>
</div>
<div class="card-body p-2">
<div class="input-group input-group-sm mb-1">
@ -548,77 +588,66 @@
<button type="button" id="testHamlib"class="btn btn-sm btn-outline-secondary">Test settings</button>
</div>
</div>
<!--
<div class="card-footer text-muted small">
Select radio model and PTT type
Please select your radio settings. Starting the TNC saves them.
</div>
-->
</div>
</div>
<div class="col-3">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-1"><strong>Step 3: TNC STATUS</strong></div>
<div class="card-body p-1 mb-1">
<!--
<div class="input-group input-group-sm mb-1">
<button type="button" id="startTNC"class="btn btn-success">Start</button>
<span class="input-group-text" id="tnc_running_state">---</span>
<button type="button" id="stopTNC"class="btn btn-danger">STOP</button>
</div>
-->
<div class="container p-1">
<div class="input-group input-group-sm mb-1">
<button type="button" id="startTNC"class="btn btn-success">Start</button>
<span class="input-group-text" id="tnc_running_state" style="width: 5rem">---</span>
<button type="button" id="stopTNC"class="btn btn-danger">STOP</button>
<!--
<div class="col-3">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-1"><strong>TNC STATUS</strong></div>
<div class="card-body p-1 mb-1">
<div class="container p-1">
<div class="input-group input-group-sm mb-1">
<button type="button" id="startTNC"class="btn btn-success">Start</button>
<span class="input-group-text" id="tnc_running_state" style="width: 5rem">---</span>
<button type="button" id="stopTNC"class="btn btn-danger">STOP</button>
</div>
<div class="row">
<div class="col-md-auto">
CPU
</div>
<div class="row">
<div class="col-md-auto">
CPU
</div>
<div class="col-8">
<div class="progress" style="height: 20px;" >
<div class="progress-bar progress-bar-striped bg-primary" id="progressbar_cpu" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
<p class="justify-content-center d-flex position-absolute w-100" id="progressbar_cpu_value"></p>
<div class="col-8">
<div class="progress" style="height: 20px;" >
<div class="progress-bar progress-bar-striped bg-primary" id="progressbar_cpu" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
<p class="justify-content-center d-flex position-absolute w-100" id="progressbar_cpu_value"></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-auto">
RAM
</div>
<div class="col-8">
<div class="progress" style="height: 20px;" >
<div class="progress-bar progress-bar-striped bg-primary" id="progressbar_ram" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
<p class="justify-content-center d-flex position-absolute w-100" id="progressbar_ram_value"></p>
<div class="row">
<div class="col-md-auto">
RAM
</div>
<div class="col-8">
<div class="progress" style="height: 20px;" >
<div class="progress-bar progress-bar-striped bg-primary" id="progressbar_ram" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
<p class="justify-content-center d-flex position-absolute w-100" id="progressbar_ram_value"></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-auto">
TOE
</div>
<div class="col-md-auto">
<p class="text-start mb-0" id="toe"></p>
<div class="row">
<div class="col-md-auto">
TOE
</div>
<div class="col-md-auto">
<p class="text-start mb-0" id="toe"></p>
</div>
</div>
</div>
</div>
</div>
<!--
<div class="card-footer text-muted small">
TNC STATUS
</div>
-->
</div>
</div>
-->
</div>
</div>
<!--<hr class="m-1">-->
<div class="container mt-2 p-0">
<div class="row">
<div class="row collapse multi-collapse" id="collapseSecondRow">
<div class="col-5">
<div class="card text-dark bg-light mb-1">
<div class="card-header p-1"><strong>MY STATION</strong></div>
@ -679,7 +708,7 @@
</div>
</div>
</div>
<div class="row">
<div class="row collapse multi-collapse" id="collapseThirdRow">
<div class="col-5">
<div class="card text-dark bg-light mb-1" >
<div class="card-header p-1">
@ -690,14 +719,16 @@
<label class="btn btn-sm btn-outline-secondary" for="waterfall-scatter-switch2"><strong>SCATTER</strong></label>
</div>
</div>
<div class="card-body p-1" style="height: 200px"> <!--278px-->
<div class="card-body p-1" style="height: 200px">
<!--278px-->
<canvas id="waterfall" style="position: relative; z-index: 2;"></canvas>
<canvas id="scatter" style="position: relative; z-index: 1;"></canvas>
</div>
</div>
</div>
<div class="col">
<div class="card text-dark bg-light mb-1" style="height: 240px"> <!--325px-->
<div class="card text-dark bg-light mb-1" style="height: 240px">
<!--325px-->
<div class="card-header p-1"><strong>HEARD STATIONS</strong></div>
<div class="card-body p-0">
<!-- START OF TABLE FOR HEARD STATIONS -->
@ -733,107 +764,70 @@
</div>
</div>
<!------------------------------- RECEIVED FILES SIDEBAR ----------------------->
<div id="receivedFilesSidebar" class="sidebar shadow-lg rounded">
<h4 class="p-1">Received Files</h4>
<!-- START OF TABLE FOR RECEIVED FILES-->
<table class="table">
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">DXCall</th>
<!--<th scope="col">DXGrid</th>
<th scope="col">Distance</th>-->
<th scope="col">Filename</th>
<!--<th scope="col">SNR</th>-->
</tr>
</thead>
<tbody id="rx-data">
<!--
<div class="offcanvas offcanvas-end" tabindex="-1" id="receivedFilesSidebar" aria-labelledby="receivedFilesSidebarLabel">
<div class="offcanvas-header p-2">
<h5 id="receivedFilesSidebarLabel">
Received Files
</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body p-0">
<!-- START OF TABLE FOR RECEIVED FILES-->
<table class="table">
<thead>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
<th scope="col">Time</th>
<th scope="col">DXCall</th>
<!--<th scope="col">DXGrid</th>
<th scope="col">Distance</th>-->
<th scope="col">Filename</th>
<!--<th scope="col">SNR</th>-->
</tr>
-->
</tbody>
</table>
<!-- END OF RECEIVED FILES-->
</thead>
<tbody id="rx-data">
<!--
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
-->
</tbody>
</table>
<!-- END OF RECEIVED FILES-->
</div>
</div>
<!------------------------------- DATA SIDEBAR ----------------------->
<div id="transmitFileSidebar" class="sidebar shadow-lg rounded">
<div class="container-fluid">
<div class="container mt-1">
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0 " >
<div class="card-header p-1">
<strong>DX Station</strong>
</div>
<div class="card-body p-2">
<div class="row">
<div class="col-auto">
<div class="input-group input-group-sm mb-0">
<input type="text" class="form-control" style="max-width: 6rem; text-transform:uppercase" pattern="[A-Z]" placeholder="DXcall" id="dataModalDxCall" maxlength="6" aria-label="Input group" aria-describedby="btnGroupAddon">
</div>
</div>
<div class="col-auto">
<div class="input-group input-group-sm mb-0">
<button class="btn btn-success" id="dataModalSendPing" type="button">Ping</button>
<span class="input-group-text text-secondary" id="dataModalPingACK">ACK</span>
<span class="input-group-text" id="dataModalPingDistance">0000 km</span>
<span class="input-group-text" id="dataModalPingDB">0 dB</span>
</div>
</div>
<div class="offcanvas offcanvas-end" tabindex="-1" id="transmitFileSidebar" aria-labelledby="transmitFileSidebarLabel">
<div class="offcanvas-header p-2">
<h5 id="transmitFileSidebarLabel">Transmit Files</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body p-0">
<!--<div id="transmitFileSidebar" class="sidebar shadow-lg rounded">-->
<div class="container-fluid">
<div class="container mt-1">
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0 " >
<div class="card-header p-1">
<strong>DX Station</strong>
</div>
</div>
</div>
</div>
<!--col-->
</div>
<!--row-->
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0 " >
<div class="card-header p-1">
<strong>Data</strong>
</div>
<div class="card-body p-2">
<div class="input-group input-group-sm mb-0">
<input type="file" class="form-control" id="dataModalFile">
<label class="input-group-text" for="inputGroupFile02">kB</label>
</div>
</div>
</div>
</div>
<!--col-->
</div>
<!--row-->
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-1">
<strong>Mode</strong>
</div>
<div class="card-body p-2">
<div class="row">
<div class="col">
<div class="input-group input-group-sm">
<span class="input-group-text" id="basic-addon1">Mode</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="datamode">
<option value="14">low SNR (DC0)</option>
<option selected value="10">high SNR (DC1)</option>
<option value="12">med SNR (DC3)</option>
</select>
<div class="card-body p-2">
<div class="row">
<div class="col-auto">
<div class="input-group input-group-sm mb-0">
<input type="text" class="form-control" style="max-width: 6rem; text-transform:uppercase" pattern="[A-Z]" placeholder="DXcall" id="dataModalDxCall" maxlength="6" aria-label="Input group" aria-describedby="btnGroupAddon">
</div>
</div>
</div>
<div class="col-auto">
<div class="input-group input-group-sm">
<span class="input-group-text" id="basic-addon1">Frames</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="framesperburst">
<option selected value="1">1</option>
<option value="2">2</option>
</select>
<div class="col-auto">
<div class="input-group input-group-sm mb-0">
<button class="btn btn-success" id="dataModalSendPing" type="button">Ping</button>
<span class="input-group-text text-secondary" id="dataModalPingACK">ACK</span>
<span class="input-group-text" id="dataModalPingDistance">0000 km</span>
<span class="input-group-text" id="dataModalPingDB">0 dB</span>
</div>
</div>
</div>
</div>
@ -842,34 +836,86 @@
<!--col-->
</div>
<!--row-->
</div>
<div class="row mb-1">
<div class="col">
<button type="button" id="startTransmission" class="btn btn-success" style="width:100%" disabled>START TRANSMISSION</button>
</div>
<div class="col-md-auto">
<button type="button" id="stopTransmission" class="btn btn-danger" style="width:100%" disabled>STOP</button>
</div>
</div>
<!--
<div class="row">
<div class="col">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-2">Info </div>
<div class="card-body p-2">
123
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0 " >
<div class="card-header p-1">
<strong>Data</strong>
</div>
<div class="card-body p-2">
<div class="input-group input-group-sm mb-0">
<input type="file" class="form-control" id="dataModalFile">
<label class="input-group-text" for="inputGroupFile02">kB</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!--col-->
</div>
-->
<div class="row">
<div class="col">
<!--row-->
<div class="row mb-1">
<div class="col">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-1">
<strong>Mode</strong>
</div>
<div class="card-body p-2">
<div class="row">
<div class="col">
<div class="input-group input-group-sm">
<span class="input-group-text" id="basic-addon1">Mode</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="datamode">
<option value="14">low SNR (DC0)</option>
<option selected value="10">high SNR (DC1)</option>
<option value="12">med SNR (DC3)</option>
</select>
</div>
</div>
<div class="col-auto">
<div class="input-group input-group-sm">
<span class="input-group-text" id="basic-addon1">Frames</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="framesperburst">
<option selected value="1">1</option>
<option value="2">2</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!--col-->
</div>
<!--row-->
</div>
<div class="row mb-1">
<div class="col">
<button type="button" id="startTransmission" data-bs-dismiss="offcanvas" class="btn btn-success" style="width:100%" disabled>START TRANSMISSION</button>
</div>
<div class="col-md-auto">
<button type="button" id="stopTransmission" class="btn btn-danger" style="width:100%" disabled>STOP</button>
</div>
</div>
<!--
<div class="row">
<div class="col">
<div class="card text-dark bg-light mb-0" >
<div class="card-header p-2">Info </div>
<div class="card-body p-2">
123
</div>
</div>
</div>
</div>
-->
<div class="row">
<div class="col">
</div>
</div>
<!--row-->
</div>
<!--row-->
<!--container-->
<!--</div>-->
</div>
<!--container-->
</div>
</div>
</div> <!--end of blur div -->
@ -952,6 +998,7 @@
<script src="waterfall/spectrum.js"></script>
<script src="waterfall/spectrogram.js"></script>
<!--<script src="waterfall/script.js"></script>-->
<!-- HAMLIB ADVANCED SETTINGS MODAL -->
<div class="modal fade" data-bs-backdrop="static" tabindex="-1" id="advancedHamlibSettingsModal">
<div class="modal-dialog">
<div class="modal-content">
@ -966,20 +1013,6 @@
<!--<option selected value="/dev/ttyUSB0">/dev/ttyUSB0</option>
<option value="/dev/ttyUSB1">/dev/ttyUSB1</option>-->
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">PTT</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_ptt_protocol_advanced" style="width: 0.5rem">
<option value="RIG">RIG</option>
<option value="RTS">Serial RTS</option>
<option value="DTR-H">Serial DTR-High</option>
<option value="DTR-H">Serial DTR-Low</option>
<option value="PARALLEL">Rig PARALLEL</option>
<option value="MICDATA">Rig MICDATA</option>
<option value="CM108">Rig CM108</option>
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">Speed</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_serialspeed_advanced">
<option value="1200">1200</option>
@ -994,6 +1027,18 @@
<option value="115200">115200</option>
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">PTT</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_ptt_protocol_advanced" style="width: 0.5rem">
<option value="RIG">RIG</option>
<option value="RTS">Serial RTS</option>
<option value="DTR-H">Serial DTR-High</option>
<option value="DTR-H">Serial DTR-Low</option>
<option value="PARALLEL">Rig PARALLEL</option>
<option value="MICDATA">Rig MICDATA</option>
<option value="CM108">Rig CM108</option>
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">Data bits</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_databits_advanced">
@ -1010,7 +1055,7 @@
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">Handshake</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_handshake_advanced">
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_handshake_advanced">
<option value="None">None (Default)</option>
</select>
</div>
@ -1020,8 +1065,6 @@
<!--<option selected value="/dev/ttyUSB0">/dev/ttyUSB0</option>
<option value="/dev/ttyUSB1">/dev/ttyUSB1</option>-->
</select>
</div>
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">PTT Speed</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_pttspeed_advanced">
<option value="1200">1200</option>
@ -1046,5 +1089,3 @@
</div>
</body>
</html>

View file

@ -1,37 +1,17 @@
/**
* disable scrolling in main window
*/
body {
padding-right: 0px !important;
overflow-y: hidden !important;
}
/**
* Progress bars with centered text
*/
.progress {
position: relative;
}
.progress span {
position: absolute;
display: block;
width: 100%;
color: black;
}
/* The sidebar menu */
/* https://www.w3schools.com/howto/howto_js_collapse_sidebar.asp*/
.sidebar {
height: 100%; /* 100% Full-height */
width: 0; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */
z-index: 100; /* Stay on top */
top: 0;
/*left: 1220px;*/
right: 0;
background-color: #fff; /* White*/
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
/* disable scrolling in main window */
body {
padding-right: 0px !important;
overflow-y: hidden !important;
}
/*Progress bars with centered text*/
.progress {
position: relative;
}
.progress span {
position: absolute;
display: block;
width: 100%;
color: black;
}

View file

@ -17,24 +17,53 @@ import subprocess
import ujson as json
import psutil
import serial.tools.list_ports
import pyaudio
import static
import crcengine
####################################################
# https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time
# https://github.com/DJ2LS/FreeDATA/issues/22
# we need to have a look at this if we want to run this on Windows and MacOS !
# Currently it seems, this is a Linux-only problem
from ctypes import *
from contextlib import contextmanager
import pyaudio
ERROR_HANDLER_FUNC = CFUNCTYPE(None, c_char_p, c_int, c_char_p, c_int, c_char_p)
def py_error_handler(filename, line, function, err, fmt):
pass
c_error_handler = ERROR_HANDLER_FUNC(py_error_handler)
@contextmanager
def noalsaerr():
asound = cdll.LoadLibrary('libasound.so')
asound.snd_lib_error_set_handler(c_error_handler)
yield
asound.snd_lib_error_set_handler(None)
# with noalsaerr():
# p = pyaudio.PyAudio()
######################################################
# sys.path.append("hamlib/linux")
try:
import Hamlib
print("running Hamlib {0} from Sys Path".format(Hamlib.cvar.hamlib_version))
from hamlib.linux import Hamlib
print("running Hamlib Version - {0} - from precompiled bundle".format(Hamlib.cvar.hamlib_version))
except ImportError:
from hamlib.linux import Hamlib
print("running Hamlib {0} from precompiled bundle".format(Hamlib.cvar.hamlib_version))
import Hamlib
print("running Hamlib Version - {0} - from Sys Path".format(Hamlib.cvar.hamlib_version))
else:
# place for rigctld
pass
crc_algorithm = crcengine.new('crc16-ccitt-false') # load crc8 library
@ -153,7 +182,6 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
p = subprocess.Popen(command)
print("running TNC from binary...")
except Exception as e:
print(e)
command = []
command.append('python3')
command.append('main.py')
@ -180,8 +208,9 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
else:
data["DAEMON_STATE"].append({"STATUS": "stopped"})
# UPDATE LIST OF AUDIO DEVICES
p = pyaudio.PyAudio()
# UPDATE LIST OF AUDIO DEVICES
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
p = pyaudio.PyAudio()
for i in range(0, p.get_device_count()):
maxInputChannels = p.get_device_info_by_host_api_device_index(
@ -231,17 +260,6 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
data_bits = str(received_json["parameter"][0]["data_bits"])
stop_bits = str(received_json["parameter"][0]["stop_bits"])
handshake = str(received_json["parameter"][0]["handshake"])
print(deviceid)
print(deviceport)
print(serialspeed)
print(pttprotocol)
print(pttport)
print(pttspeed)
print(data_bits)
print(stop_bits)
print(handshake)
# try to init hamlib
try:
@ -310,10 +328,6 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
print("can't open rig")
#sys.exit("hamlib error")
# exception, if JSON cant be decoded
# except Exception as e:
except ValueError as e:
@ -327,6 +341,11 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
print(exc_type, fname, exc_tb.tb_lineno)
print("############ END OF ERROR #######################")
# exception for any other errors
# in case of index error for example which is caused by a hard network interruption
except:
print("other network error...")
print("Client disconnected...")

View file

@ -90,7 +90,7 @@ def setup_logging():
"""
logging.basicConfig(level=logging.INFO,encoding='utf-8',format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s',datefmt='%H:%M:%S',handlers=[logging.FileHandler("codec2-FreeDATA-TNC.log"), logging.StreamHandler()])
logging.basicConfig(level=logging.INFO,encoding='utf-8',format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s',datefmt='%H:%M:%S',handlers=[logging.FileHandler("FreeDATA-TNC.log"), logging.StreamHandler()])
logging.addLevelName(logging.DEBUG, "\033[1;36m%s\033[1;0m" % logging.getLevelName(logging.DEBUG))
logging.addLevelName(logging.INFO, "\033[1;37m%s\033[1;0m" % logging.getLevelName(logging.INFO))

View file

@ -16,20 +16,47 @@ import time
import threading
import atexit
import numpy as np
import pyaudio
import helpers
import static
import data_handler
####################################################
# https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time
# https://github.com/DJ2LS/FreeDATA/issues/22
# we need to have a look at this if we want to run this on Windows and MacOS !
# Currently it seems, this is a Linux-only problem
from ctypes import *
from contextlib import contextmanager
import pyaudio
ERROR_HANDLER_FUNC = CFUNCTYPE(None, c_char_p, c_int, c_char_p, c_int, c_char_p)
def py_error_handler(filename, line, function, err, fmt):
pass
c_error_handler = ERROR_HANDLER_FUNC(py_error_handler)
@contextmanager
def noalsaerr():
asound = cdll.LoadLibrary('libasound.so')
asound.snd_lib_error_set_handler(c_error_handler)
yield
asound.snd_lib_error_set_handler(None)
# with noalsaerr():
# p = pyaudio.PyAudio()
######################################################
# sys.path.append("hamlib/linux")
try:
import Hamlib
print("running Hamlib from Sys Path")
except ImportError:
from hamlib.linux import Hamlib
print("running Hamlib from precompiled bundle")
print("running Hamlib Version - {0} - from precompiled bundle".format(Hamlib.cvar.hamlib_version))
except ImportError:
import Hamlib
print("running Hamlib Version - {0} - from Sys Path".format(Hamlib.cvar.hamlib_version))
else:
# place for rigctld
pass
@ -79,12 +106,14 @@ class RF():
print("running libcodec from INTERNAL library")
except:
# if we cant load libcodec from root, we check for subdirectory
# this is, if we want to run it without beeing build in a dev environment
# this happens, if we want to run it beeing build in a dev environment
libname = pathlib.Path().absolute() / "codec2/build_linux/src/libcodec2.so.1.0"
self.c_lib = ctypes.CDLL(libname)
print("running libcodec from EXTERNAL library")
# --------------------------------------------CREATE PYAUDIO INSTANCE
self.p = pyaudio.PyAudio()
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
self.p = pyaudio.PyAudio()
atexit.register(self.p.terminate)
# --------------------------------------------OPEN AUDIO CHANNEL RX
self.stream_rx = self.p.open(format=pyaudio.paInt16,
@ -174,8 +203,7 @@ class RF():
self.my_rig.set_mode(Hamlib.RIG_MODE_USB)
# start thread for getting hamlib data
HAMLIB_THREAD = threading.Thread(
target=self.get_radio_stats, name="HAMLIB_THREAD")
HAMLIB_THREAD = threading.Thread(target=self.get_radio_stats, name="HAMLIB_THREAD")
HAMLIB_THREAD.start()
except:
@ -487,7 +515,6 @@ class RF():
if len(self.fft_data) < 1024:
self.fft_data += data_in
# DECODING DATAC0
if len(datac0_buffer) >= (datac0_nin):
@ -755,8 +782,8 @@ class RF():
# send fft only if receiving
if static.CHANNEL_STATE == 'RECEIVING_SIGNALLING' or static.CHANNEL_STATE == 'RECEIVING_DATA':
#static.FFT = dfftlist[10:200]
static.FFT = dfftlist
static.FFT = dfftlist[10:180] #200 --> bandwith 3000
#static.FFT = dfftlist