first irs snr test

This commit is contained in:
DJ2LS 2022-11-11 13:24:12 +01:00
parent 6db1c2fd33
commit 0831517b40
2 changed files with 30 additions and 6 deletions

View file

@ -2223,19 +2223,34 @@ ipcRenderer.on('action-show-arq-toast-transmission-transmitted', (event, data) =
// ARQ TRANSMISSION TRANSMITTING // ARQ TRANSMISSION TRANSMITTING
ipcRenderer.on('action-show-arq-toast-transmission-transmitting', (event, data) => { ipcRenderer.on('action-show-arq-toast-transmission-transmitting', (event, data) => {
console.log(data)
var irs_snr = data["irs_snr"]; //document.getElementById("toastARQtransmittingSNR").className = "progress-bar progress-bar-striped progress-bar-animated bg-primary";
console.log(data.irs_snr); 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){ 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){ } 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){ } 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 { } else {
console.log("no snr info available") console.log("no snr info available")
toast.show();
} }
document.getElementById("transmission_progress").className = "progress-bar progress-bar-striped progress-bar-animated bg-primary"; document.getElementById("transmission_progress").className = "progress-bar progress-bar-striped progress-bar-animated bg-primary";
var toastARQtransmitting = document.getElementById('toastARQtransmitting'); var toastARQtransmitting = document.getElementById('toastARQtransmitting');
var toast = bootstrap.Toast.getOrCreateInstance(toastARQtransmitting); // Returns a Bootstrap toast instance var toast = bootstrap.Toast.getOrCreateInstance(toastARQtransmitting); // Returns a Bootstrap toast instance

View file

@ -185,6 +185,15 @@
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div> </div>
</div> </div>
<!-- ARQ SNR INFORMATION -->
<div class="toast align-items-center text-white bg-secondary border-0" id="toastARQtransmittingSNR" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">IRS SNR:<span id="toastARQtransmittingSNRValue"></span></div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
<!-- ARQ TRANSMITTING FAILED --> <!-- ARQ TRANSMITTING FAILED -->
<div class="toast align-items-center text-white bg-danger border-0" id="toastARQtransmittingfailed" role="alert" aria-live="assertive" aria-atomic="true"> <div class="toast align-items-center text-white bg-danger border-0" id="toastARQtransmittingfailed" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex"> <div class="d-flex">