Merge branch 'main' into dr-resampler

This commit is contained in:
DJ2LS 2021-12-23 10:16:49 +01:00 committed by GitHub
commit de979506f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 29 deletions

View file

@ -100,6 +100,8 @@ daemon.on('data', function(data) {
let Data = {
input_devices: data['INPUT_DEVICES'],
output_devices: data['OUTPUT_DEVICES'],
python_version: data['PYTHON_VERSION'],
hamlib_version: data['HAMLIB_VERSION'],
serial_devices: data['SERIAL_DEVICES'],
tnc_running_state: data['DAEMON_STATE'][0]['STATUS'],
ram_usage: data['RAM'],

View file

@ -155,14 +155,20 @@ app.whenReady().then(() => {
// start daemon
// https://stackoverflow.com/a/5775120
console.log("Starting Daemon")
daemonProcess = exec('./daemon', function callback(error, stdout, stderr) {
// result
console.log(stdout)
console.log(error)
console.log(stderr)
console.log("Trying to start daemon binary")
daemonProcess = exec('./daemon', function callback(err, stdout, stderr) {
if (err) {
console.error("Can't start daemon binary");
console.error("--> this is only working with the app bundle and a precompiled binaries");
return;
}
console.log(stdout);
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()

10
gui/package-lock.json generated
View file

@ -384,16 +384,6 @@
"node": ">=8"
}
},
"node_modules/ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true,
"optional": true,
"engines": {
"node": ">=4"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",

View file

@ -11,6 +11,7 @@ const {
bearingDistance,
latLngToLocator
} = require('qth-locator');
const os = require('os');
// https://stackoverflow.com/a/26227660
var appDataFolder = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME + "/.config")
@ -321,10 +322,11 @@ advancedHamlibSettingsModal
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.hide()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.show()
collapseSecondRow.hide()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.show()
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)
@ -350,10 +352,17 @@ advancedHamlibSettingsModal
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()
collapseSecondRow.show()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.hide()
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
collapseFourthRow.hide()
})
@ -967,6 +976,27 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
document.getElementById("progressbar_cpu").setAttribute("style", "width:" + arg.cpu_usage + "%;")
document.getElementById("progressbar_cpu_value").innerHTML = arg.cpu_usage + "%"
*/
document.getElementById("ram_load").innerHTML = "RAM " + arg.ram_usage + "%"
document.getElementById("cpu_load").innerHTML = "CPU " + arg.cpu_usage + "%"
// OPERATING SYSTEM
document.getElementById("operating_system").innerHTML = "OS " + os.type()
// PYTHON VERSION
document.getElementById("python_version").innerHTML = "Python " + arg.python_version
document.getElementById("python_version").className = "btn btn-sm btn-success";
// HAMLIB VERSION
document.getElementById("hamlib_version").innerHTML = "Hamlib " + arg.hamlib_version
document.getElementById("hamlib_version").className = "btn btn-sm btn-success";
// NODE VERSION
document.getElementById("node_version").innerHTML = "Node " + process.version
document.getElementById("node_version").className = "btn btn-sm btn-success";
// UPDATE AUDIO INPUT
if (arg.tnc_running_state == "stopped") {
if (document.getElementById("audio_input_selectbox").length != arg.input_devices.length) {
@ -1054,10 +1084,11 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.hide()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.show()
collapseSecondRow.hide()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.show()
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
collapseFourthRow.show()
} else {
document.getElementById('hamlib_deviceid').disabled = false
document.getElementById('hamlib_deviceport').disabled = false
@ -1081,10 +1112,11 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
collapseFirstRow.show()
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
collapseSecondRow.hide()
collapseSecondRow.show()
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
collapseThirdRow.hide()
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
collapseFourthRow.hide()
}
});

View file

@ -622,10 +622,30 @@
</div>
</div>
--></div>
<div class="row collapse multi-collapse show mt-2" id="collapseSecondRow">
<div class="col">
<div class="card text-dark bg-light mb-0">
<div class="card-header p-1">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-motherboard" viewBox="0 0 16 16">
<path d="M11.5 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5Zm2 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5Zm-10 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Zm0 2a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6ZM5 3a1 1 0 0 0-1 1h-.5a.5.5 0 0 0 0 1H4v1h-.5a.5.5 0 0 0 0 1H4a1 1 0 0 0 1 1v.5a.5.5 0 0 0 1 0V8h1v.5a.5.5 0 0 0 1 0V8a1 1 0 0 0 1-1h.5a.5.5 0 0 0 0-1H9V5h.5a.5.5 0 0 0 0-1H9a1 1 0 0 0-1-1v-.5a.5.5 0 0 0-1 0V3H6v-.5a.5.5 0 0 0-1 0V3Zm0 1h3v3H5V4Zm6.5 7a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-2Z" />
<path d="M1 2a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-2H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 9H1V8H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 6H1V5H.5a.5.5 0 0 1-.5-.5v-2A.5.5 0 0 1 .5 2H1Zm1 11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v11Z" />
</svg> <strong>SYSTEM STATUS</strong>
</div>
<div class="card-body p-2 mb-1">
<button class="btn btn-secondary btn-sm" id="python_version" type="button" disabled>Python</button>
<button class="btn btn-secondary btn-sm" id="node_version" type="button" disabled>Node</button>
<button class="btn btn-secondary btn-sm" id="hamlib_version" type="button" disabled>Hamlib</button>
<button class="btn btn-secondary btn-sm" id="operating_system" type="button" disabled>OS</button>
<button class="btn btn-secondary btn-sm" id="cpu_load" type="button" disabled>CPU</button>
<button class="btn btn-secondary btn-sm" id="ram_load" type="button" disabled>RAM</button>
</div>
</div>
</div>
</div>
</div>
<!--<hr class="m-1">-->
<div class="container mt-2 p-0">
<div class="row collapse multi-collapse" id="collapseSecondRow">
<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"><strong>MY STATION</strong>
@ -717,7 +737,7 @@
</div>
</div>
</div>
<div class="row collapse multi-collapse" id="collapseThirdRow">
<div class="row collapse multi-collapse" id="collapseFourthRow">
<div class="col-5">
<div class="card text-dark bg-light mb-1">
<div class="card-header p-1">

View file

@ -214,7 +214,14 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
if received_json["type"] == 'GET' and received_json["command"] == 'DAEMON_STATE':
data = {'COMMAND': 'DAEMON_STATE', 'DAEMON_STATE': [], 'INPUT_DEVICES': [], 'OUTPUT_DEVICES': [], 'SERIAL_DEVICES': [
data = {
'COMMAND': 'DAEMON_STATE',
'DAEMON_STATE': [],
'PYTHON_VERSION': str(python_version),
'HAMLIB_VERSION': str(hamlib_version),
'INPUT_DEVICES': [],
'OUTPUT_DEVICES': [],
'SERIAL_DEVICES': [
], "CPU": str(psutil.cpu_percent()), "RAM": str(psutil.virtual_memory().percent), "VERSION": "0.1-prototype"}
if static.TNCSTARTED:

View file

@ -811,4 +811,3 @@ class RF():
static.FFT = [0] * 400
else:
pass