From 0831517b4058b7b493e8f2ceaf534f5f53361c48 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Fri, 11 Nov 2022 13:24:12 +0100 Subject: [PATCH] first irs snr test --- gui/preload-main.js | 27 +++++++++++++++++++++------ gui/src/index.html | 9 +++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/gui/preload-main.js b/gui/preload-main.js index b2612826..98c0fed0 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -2223,19 +2223,34 @@ ipcRenderer.on('action-show-arq-toast-transmission-transmitted', (event, data) = // ARQ TRANSMISSION TRANSMITTING ipcRenderer.on('action-show-arq-toast-transmission-transmitting', (event, data) => { - console.log(data) - var irs_snr = data["irs_snr"]; - console.log(data.irs_snr); + + //document.getElementById("toastARQtransmittingSNR").className = "progress-bar progress-bar-striped progress-bar-animated bg-primary"; + var toastARQtransmittingSNR = document.getElementById('toastARQtransmittingSNR'); + var toast = bootstrap.Toast.getOrCreateInstance(toastARQtransmittingSNR); // Returns a Bootstrap toast instance + + var irs_snr = data["data"][0].irs_snr; if(irs_snr <= 0){ - console.log("low snr warning"); + document.getElementById("toastARQtransmittingSNR").className = "toast align-items-center text-white bg-danger border-0"; + document.getElementById('toastARQtransmittingSNRValue').innerHTML = " low " + irs_snr; + toast.show(); + } else if(irs_snr > 0 && irs_snr <= 5){ - console.log("snr okay"); + document.getElementById("toastARQtransmittingSNR").className = "toast align-items-center text-white bg-warning border-0"; + document.getElementById('toastARQtransmittingSNRValue').innerHTML = " okay " + irs_snr; + toast.show(); + } else if(data.irs_snr > 5){ - console.log("good snr "); + document.getElementById("toastARQtransmittingSNR").className = "toast align-items-center text-white bg-success border-0"; + document.getElementById('toastARQtransmittingSNRValue').innerHTML = " good " + irs_snr; + toast.show(); + } else { console.log("no snr info available") + toast.show(); + } + document.getElementById("transmission_progress").className = "progress-bar progress-bar-striped progress-bar-animated bg-primary"; var toastARQtransmitting = document.getElementById('toastARQtransmitting'); var toast = bootstrap.Toast.getOrCreateInstance(toastARQtransmitting); // Returns a Bootstrap toast instance diff --git a/gui/src/index.html b/gui/src/index.html index 7555f8fd..9067b84f 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -185,6 +185,15 @@ + + + +