optimized scatter

removed scales and popups, code cleanup as well
This commit is contained in:
DJ2LS 2021-10-01 19:05:43 +02:00
parent aa27f1f8e1
commit 44ef586e4f
2 changed files with 29 additions and 17 deletions

View file

@ -83,7 +83,7 @@ window.addEventListener('DOMContentLoaded', () => {
}); });
// SETUP OF SCATTER DIAGRAM // SETUP OF SCATTER DIAGRAM
/*
global.data = { global.data = {
datasets: [{ datasets: [{
label: 'Scatter Dataset', label: 'Scatter Dataset',
@ -113,15 +113,20 @@ window.addEventListener('DOMContentLoaded', () => {
x: { x: {
type: 'linear', type: 'linear',
position: 'bottom', position: 'bottom',
display: false display: false,
min: -50,
max: 50
}, },
y: { y: {
display: false display: false,
min: -50,
max: 50
} }
} }
} }
}); });
*/
// on click waterfall scatter toggle view // on click waterfall scatter toggle view
// waterfall // waterfall
@ -335,24 +340,30 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
plugins: { plugins: {
legend: { legend: {
display: false, display: false,
},
tooltip: {
enabled: false
}, },
}, },
animations: false, animations: false,
tooltips: {
enabled: false,
},
scales: { scales: {
display: false,
grid: {
display: false
},
x: { x: {
type: 'linear', type: 'linear',
position: 'bottom', position: 'bottom',
display: false display: true,
min: -50,
max: 50,
ticks: {
display: false
}
}, },
y: { y: {
display: false display: true,
min: -50,
max: 50,
ticks: {
display: false
}
} }
} }
} }
@ -363,7 +374,7 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
var data = arg.scatter var data = arg.scatter
var newdata = { var newdata = {
datasets: [{ datasets: [{
label: 'constellation diagram', //label: 'constellation diagram',
data: data, data: data,
options: config, options: config,
backgroundColor: 'rgb(255, 99, 132)' backgroundColor: 'rgb(255, 99, 132)'

View file

@ -626,20 +626,21 @@ class RF():
for j in range(MODEM_STATS_NR_MAX): for j in range(MODEM_STATS_NR_MAX):
# check if odd or not to get every 2nd item for x # check if odd or not to get every 2nd item for x
if (j % 2) == 0: if (j % 2) == 0:
xsymbols = round(modemStats.rx_symbols[i][j]) xsymbols = round(modemStats.rx_symbols[i][j]/1000)
ysymbols = round(modemStats.rx_symbols[i][j+1]) ysymbols = round(modemStats.rx_symbols[i][j+1]/1000)
# check if value 0.0 or has real data # check if value 0.0 or has real data
if xsymbols != 0.0 and ysymbols != 0.0: if xsymbols != 0.0 and ysymbols != 0.0:
scatterdata.append({"x": xsymbols, "y": ysymbols}) scatterdata.append({"x": xsymbols, "y": ysymbols})
# only append scatter data if new data arrived # only append scatter data if new data arrived
if 150 > len(scatterdata) > 0: if 150 > len(scatterdata) > 0:
static.SCATTER = scatterdata static.SCATTER = scatterdata
else: else:
# only take every tenth data point
scatterdata_small = scatterdata[::10] scatterdata_small = scatterdata[::10]
static.SCATTER = scatterdata_small static.SCATTER = scatterdata_small
def calculate_ber(self, freedv): def calculate_ber(self, freedv):
Tbits = self.c_lib.freedv_get_total_bits(freedv) Tbits = self.c_lib.freedv_get_total_bits(freedv)
Terrs = self.c_lib.freedv_get_total_bit_errors(freedv) Terrs = self.c_lib.freedv_get_total_bit_errors(freedv)