From 837c13a3474ceb22050981ce371d80e14560bbc0 Mon Sep 17 00:00:00 2001 From: Michael Clemens // DK1MI Date: Wed, 24 May 2023 09:14:14 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Eindex.h=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.h b/index.h index f5c86fe..87e81fa 100644 --- a/index.h +++ b/index.h @@ -341,7 +341,12 @@ function getDATA() { // display VSWR bar graph if enabled via backend configuration if (data[19] == "true") { document.getElementById("vswr_led_box").style.display = 'inline-block'; - swr_vu_meter.setAttribute('data-val', strtoint(data[6]-1)); + // if SWR value is invalid -> set to 0 + if (data[6] == "-1" || data[6] == "inf" || data[15] == "1" || data[16] == "1") { + swr_vu_meter.setAttribute('data-val', 0); + } else { + swr_vu_meter.setAttribute('data-val', strtoint(data[6]-1)); + } } else { document.getElementById("vswr_led_box").style.display = 'none'; }