From 3e6f1ee52e077af70c9a8e4d1501063dc12a2ed1 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 8 Jan 2017 12:01:50 +0100 Subject: [PATCH 1/6] First PoC for s-meter display --- images/0.png | 0 images/1.png | 0 images/2.png | 0 images/3.png | 0 images/4.png | 0 include/functions.php | 28 ++++++++++++++++++++++++++-- 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 images/0.png create mode 100644 images/1.png create mode 100644 images/2.png create mode 100644 images/3.png create mode 100644 images/4.png diff --git a/images/0.png b/images/0.png new file mode 100644 index 0000000..e69de29 diff --git a/images/1.png b/images/1.png new file mode 100644 index 0000000..e69de29 diff --git a/images/2.png b/images/2.png new file mode 100644 index 0000000..e69de29 diff --git a/images/3.png b/images/3.png new file mode 100644 index 0000000..e69de29 diff --git a/images/4.png b/images/4.png new file mode 100644 index 0000000..e69de29 diff --git a/include/functions.php b/include/functions.php index 7280a58..c97e05c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -256,7 +256,19 @@ function getHeardList($logLines, $onlyLast) { // and RSSI in BER position if (startsWith($loss,"BER")) { if (substr($ber, 6) != "-0/-0/-0 dBm") { - $rssi = substr($ber, 6); + $rssiString = substr($ber, 6); + $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); + if ($rssiAvg > "-63") $rssi = " S9+10dB"; + else if ($rssiAvg > "-73") $rssi = " S9"; + else if ($rssiAvg > "-79") $rssi = " S8"; + else if ($rssiAvg > "-85") $rssi = " S7"; + else if ($rssiAvg > "-91") $rssi = " S6"; + else if ($rssiAvg > "-97") $rssi = " S5"; + else if ($rssiAvg > "-103") $rssi = " S4"; + else if ($rssiAvg > "-109") $rssi = " S3"; + else if ($rssiAvg > "-115") $rssi = " S2"; + else if ($rssiAvg > "-121") $rssi = " S1"; + else $rssi = " S0"; } $ber = substr($loss, 5); $loss = ""; @@ -266,7 +278,19 @@ function getHeardList($logLines, $onlyLast) { $ber = substr($lineTokens[4], 5); } if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { - $rssi = substr($lineTokens[5], 6); + $rssiString = substr($lineTokens[5], 6); + $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); + if ($rssiAvg > "-63") $rssi = " S9+10dB"; + else if ($rssiAvg > "-73") $rssi = " S9"; + else if ($rssiAvg > "-79") $rssi = " S8"; + else if ($rssiAvg > "-85") $rssi = " S7"; + else if ($rssiAvg > "-91") $rssi = " S6"; + else if ($rssiAvg > "-97") $rssi = " S5"; + else if ($rssiAvg > "-103") $rssi = " S4"; + else if ($rssiAvg > "-109") $rssi = " S3"; + else if ($rssiAvg > "-115") $rssi = " S2"; + else if ($rssiAvg > "-121") $rssi = " S1"; + else $rssi = " S0"; } } From 625e049bbef59db9a06636f23e0cee973e750fef Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 8 Jan 2017 12:04:41 +0100 Subject: [PATCH 2/6] Fix mistake with images --- images/0.png | Bin 0 -> 394 bytes images/1.png | Bin 0 -> 452 bytes images/2.png | Bin 0 -> 493 bytes images/3.png | Bin 0 -> 531 bytes images/4.png | Bin 0 -> 571 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/images/0.png b/images/0.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ba238270b0e6f3b686df3f949b7ec094189b1763 100644 GIT binary patch literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6n3BBRT^Rm-==h@v2>8 zUjt#r3Hg(Uq9HdwB{QuOw}u+SS(AYpBtbR==ckpF oCl;kLl$V$5W#(lUCnpx9>g5-u&wghk1ysb~>FVdQ&MBb@0H}0}!T2>8 zUjt#r3Hg(j5Bb6gGB z_*$o@?U>F+@0@=ji_az~zr4WM?2#eA_Lt}N#pM81s z#fIzhdu_DNOnDbrH9>l{%4N4#%in%JHoyJ7{f}IZeGGZc=KUrs#gl>lQY~?fC`m~y zNwrEYN(E93Mh1okx&{`yh6W*qW>zMaK%{M8WMyDr*PP>lq9HdwB{QuOw+8=vSH1u> wNP=t#&QB{TPb^AhC@(M9%goCzPEIUH)ypqRpZ(583aE&|)78&qol`;+06pfcYXATM literal 0 HcmV?d00001 diff --git a/images/2.png b/images/2.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cfcd1d53ac862c78c4c3d665aa8bb1c68138dc14 100644 GIT binary patch literal 493 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6n3BBRT^Rm-==h@v2>8 zUjt#r3Hg527^|M?INKH(ubH^rb&@_UjMgvl`~^d2HEUyr231-UkhN z9xpbf3Cr>DY!KP;fnS?x8;3#ww+4eyA={D_(+}<4+hKC;>&s_nnbP7pG`Nb&jjMLm z%;9q_Pi1IXz#*0J>EEK{>W>pwm@%_#7Y~1Yam{j_lTo5U>3ogfK7T!};;p{kLR0Ep z-@z$2zwM2<#kIUO(EhytC&stdo2|}SFI{tMU1;UAUuQo3OP(`ldGk+a^M7_TS2Oha z>sWGV98swWG2>8 zUjt#r3Hg(o<*RbeHeUQXadnZ!ioU#>`fC+Cbq{@fk=S@xNQ6UVg@NJ{zY`r+ z24~zq=SCjVtBd}_)+~{6b&gO=Dlp7cOI#yLQW8s2t&)pUffR$0fuVt}frYN2L5QK5 zm8pT1ftj{}k(Gf#q13ZL6b-rgDVb@NxHT}i$Grt=kObKfoS#-wo>-L1P+nfHmzkGc coSayYs+V7sKKq@G6i^X^r>mdKI;Vst04jCMIRF3v literal 0 HcmV?d00001 diff --git a/images/4.png b/images/4.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b9d8a492bb18e5e49e2d65a638c59700528f9b2e 100644 GIT binary patch literal 571 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6n3BBRT^Rm-==h@v2>8 zUjt#r3HgJve$<^A$9X}68P0-mB?Rly>TxRzCoxlGszwGub z_Ft65)VjiqtCK!=E{;w7a^Z$~{L%!wlg}02UUGGBuNF0Uv_Z?+r#gJC?)==6>tX&& zI;RA6YHpPk5K)s_QNHUC|Aqy|I#JtM()Jd`&aB{AsCPD~jdikjPuR`&1N$TPL}lI4 ziAn18b>mS}c6)hER4em|`MP&cBMPmKH=QfgnA^xCu|epoX|s!xK9|t>DzgH|C5z5I zQ9hJwcV>$E`}VBp#QUeOye;FHdVB4 Date: Sun, 8 Jan 2017 12:11:14 +0100 Subject: [PATCH 3/6] Change scale according to UHF values --- include/functions.php | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/include/functions.php b/include/functions.php index c97e05c..79374be 100644 --- a/include/functions.php +++ b/include/functions.php @@ -258,16 +258,19 @@ function getHeardList($logLines, $onlyLast) { if (substr($ber, 6) != "-0/-0/-0 dBm") { $rssiString = substr($ber, 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-63") $rssi = " S9+10dB"; - else if ($rssiAvg > "-73") $rssi = " S9"; - else if ($rssiAvg > "-79") $rssi = " S8"; - else if ($rssiAvg > "-85") $rssi = " S7"; - else if ($rssiAvg > "-91") $rssi = " S6"; - else if ($rssiAvg > "-97") $rssi = " S5"; - else if ($rssiAvg > "-103") $rssi = " S4"; - else if ($rssiAvg > "-109") $rssi = " S3"; - else if ($rssiAvg > "-115") $rssi = " S2"; - else if ($rssiAvg > "-121") $rssi = " S1"; + if ($rssiAvg > "-53") $rssi = " S9+40dB"; + else if ($rssiAvg > "-63") $rssi = " S9+30dB"; + else if ($rssiAvg > "-73") $rssi = " S9+20dB"; + else if ($rssiAvg > "-83") $rssi = " S9+10dB"; + else if ($rssiAvg > "-93") $rssi = " S9"; + else if ($rssiAvg > "-99") $rssi = " S8"; + else if ($rssiAvg > "-105") $rssi = " S7"; + else if ($rssiAvg > "-111") $rssi = " S6"; + else if ($rssiAvg > "-117") $rssi = " S5"; + else if ($rssiAvg > "-123") $rssi = " S4"; + else if ($rssiAvg > "-129") $rssi = " S3"; + else if ($rssiAvg > "-135") $rssi = " S2"; + else if ($rssiAvg > "-141") $rssi = " S1"; else $rssi = " S0"; } $ber = substr($loss, 5); @@ -280,16 +283,19 @@ function getHeardList($logLines, $onlyLast) { if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { $rssiString = substr($lineTokens[5], 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-63") $rssi = " S9+10dB"; - else if ($rssiAvg > "-73") $rssi = " S9"; - else if ($rssiAvg > "-79") $rssi = " S8"; - else if ($rssiAvg > "-85") $rssi = " S7"; - else if ($rssiAvg > "-91") $rssi = " S6"; - else if ($rssiAvg > "-97") $rssi = " S5"; - else if ($rssiAvg > "-103") $rssi = " S4"; - else if ($rssiAvg > "-109") $rssi = " S3"; - else if ($rssiAvg > "-115") $rssi = " S2"; - else if ($rssiAvg > "-121") $rssi = " S1"; + if ($rssiAvg > "-53") $rssi = " S9+40dB"; + else if ($rssiAvg > "-63") $rssi = " S9+30dB"; + else if ($rssiAvg > "-73") $rssi = " S9+20dB"; + else if ($rssiAvg > "-83") $rssi = " S9+10dB"; + else if ($rssiAvg > "-93") $rssi = " S9"; + else if ($rssiAvg > "-99") $rssi = " S8"; + else if ($rssiAvg > "-105") $rssi = " S7"; + else if ($rssiAvg > "-111") $rssi = " S6"; + else if ($rssiAvg > "-117") $rssi = " S5"; + else if ($rssiAvg > "-123") $rssi = " S4"; + else if ($rssiAvg > "-129") $rssi = " S3"; + else if ($rssiAvg > "-135") $rssi = " S2"; + else if ($rssiAvg > "-141") $rssi = " S1"; else $rssi = " S0"; } } From 6bf3cceb7c68b87823168897c6afe78552b8ec90 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 8 Jan 2017 12:23:27 +0100 Subject: [PATCH 4/6] Add average dBm value --- include/functions.php | 56 ++++++++++++++++++++-------------------- include/localtx.php | 2 +- include/localtx_ajax.php | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/functions.php b/include/functions.php index 79374be..a42d8e4 100644 --- a/include/functions.php +++ b/include/functions.php @@ -258,20 +258,20 @@ function getHeardList($logLines, $onlyLast) { if (substr($ber, 6) != "-0/-0/-0 dBm") { $rssiString = substr($ber, 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = " S9+40dB"; - else if ($rssiAvg > "-63") $rssi = " S9+30dB"; - else if ($rssiAvg > "-73") $rssi = " S9+20dB"; - else if ($rssiAvg > "-83") $rssi = " S9+10dB"; - else if ($rssiAvg > "-93") $rssi = " S9"; - else if ($rssiAvg > "-99") $rssi = " S8"; - else if ($rssiAvg > "-105") $rssi = " S7"; - else if ($rssiAvg > "-111") $rssi = " S6"; - else if ($rssiAvg > "-117") $rssi = " S5"; - else if ($rssiAvg > "-123") $rssi = " S4"; - else if ($rssiAvg > "-129") $rssi = " S3"; - else if ($rssiAvg > "-135") $rssi = " S2"; - else if ($rssiAvg > "-141") $rssi = " S1"; - else $rssi = " S0"; + if ($rssiAvg > "-53") $rssi = " S9+40dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-63") $rssi = " S9+30dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-73") $rssi = " S9+20dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-83") $rssi = " S9+10dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-93") $rssi = " S9 ($rssiAvg dBm)"; + else if ($rssiAvg > "-99") $rssi = " S8 ($rssiAvg dBm)"; + else if ($rssiAvg > "-105") $rssi = " S7 ($rssiAvg dBm)"; + else if ($rssiAvg > "-111") $rssi = " S6 ($rssiAvg dBm)"; + else if ($rssiAvg > "-117") $rssi = " S5 ($rssiAvg dBm)"; + else if ($rssiAvg > "-123") $rssi = " S4 ($rssiAvg dBm)"; + else if ($rssiAvg > "-129") $rssi = " S3 ($rssiAvg dBm)"; + else if ($rssiAvg > "-135") $rssi = " S2 ($rssiAvg dBm)"; + else if ($rssiAvg > "-141") $rssi = " S1 ($rssiAvg dBm)"; + else $rssi = " S0 ($rssiAvg dBm)"; } $ber = substr($loss, 5); $loss = ""; @@ -283,20 +283,20 @@ function getHeardList($logLines, $onlyLast) { if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { $rssiString = substr($lineTokens[5], 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = " S9+40dB"; - else if ($rssiAvg > "-63") $rssi = " S9+30dB"; - else if ($rssiAvg > "-73") $rssi = " S9+20dB"; - else if ($rssiAvg > "-83") $rssi = " S9+10dB"; - else if ($rssiAvg > "-93") $rssi = " S9"; - else if ($rssiAvg > "-99") $rssi = " S8"; - else if ($rssiAvg > "-105") $rssi = " S7"; - else if ($rssiAvg > "-111") $rssi = " S6"; - else if ($rssiAvg > "-117") $rssi = " S5"; - else if ($rssiAvg > "-123") $rssi = " S4"; - else if ($rssiAvg > "-129") $rssi = " S3"; - else if ($rssiAvg > "-135") $rssi = " S2"; - else if ($rssiAvg > "-141") $rssi = " S1"; - else $rssi = " S0"; + if ($rssiAvg > "-53") $rssi = " S9+40dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-63") $rssi = " S9+30dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-73") $rssi = " S9+20dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-83") $rssi = " S9+10dB ($rssiAvg dBm)"; + else if ($rssiAvg > "-93") $rssi = " S9 ($rssiAvg dBm)"; + else if ($rssiAvg > "-99") $rssi = " S8 ($rssiAvg dBm)"; + else if ($rssiAvg > "-105") $rssi = " S7 ($rssiAvg dBm)"; + else if ($rssiAvg > "-111") $rssi = " S6 ($rssiAvg dBm)"; + else if ($rssiAvg > "-117") $rssi = " S5 ($rssiAvg dBm)"; + else if ($rssiAvg > "-123") $rssi = " S4 ($rssiAvg dBm)"; + else if ($rssiAvg > "-129") $rssi = " S3 ($rssiAvg dBm)"; + else if ($rssiAvg > "-135") $rssi = " S2 ($rssiAvg dBm)"; + else if ($rssiAvg > "-141") $rssi = " S1 ($rssiAvg dBm)"; + else $rssi = " S0 ($rssiAvg dBm)"; } } diff --git a/include/localtx.php b/include/localtx.php index 92bcec9..2553e03 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -28,7 +28,7 @@ $localTXList = getHeardList($reverseLogLinesMMDVM, FALSE); Dur (s) Loss BER - RSSI (min/max/avg) + RSSI diff --git a/include/localtx_ajax.php b/include/localtx_ajax.php index c96761a..8ab6e36 100644 --- a/include/localtx_ajax.php +++ b/include/localtx_ajax.php @@ -25,7 +25,7 @@ $totalLH = count($lastHeard); Dur (s) Loss BER - RSSI (min/max/avg) + RSSI From 4e20431680980e8d0e1e2e3fb1fb42d7091111b4 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 8 Jan 2017 13:57:22 +0100 Subject: [PATCH 5/6] Add tooltip overlay for detailed RSSI values --- css/tooltip.css | 46 +++++++++++++++++++++++++++++++++++ include/functions.php | 56 +++++++++++++++++++++---------------------- index.php | 2 ++ 3 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 css/tooltip.css diff --git a/css/tooltip.css b/css/tooltip.css new file mode 100644 index 0000000..dd3c524 --- /dev/null +++ b/css/tooltip.css @@ -0,0 +1,46 @@ +/* Tooltip container */ +.tooltip2 { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip2 .tooltip2text { + visibility: hidden; + width: 120px; + background-color: #555; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text */ + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + + /* Fade in tooltip */ + opacity: 0; + transition: opacity 1s; +} + +/* Tooltip arrow */ +.tooltip2 .tooltip2text::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #555 transparent transparent transparent; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip2:hover .tooltip2text { + visibility: visible; + opacity: 1; +} diff --git a/include/functions.php b/include/functions.php index a42d8e4..85f8f54 100644 --- a/include/functions.php +++ b/include/functions.php @@ -258,20 +258,20 @@ function getHeardList($logLines, $onlyLast) { if (substr($ber, 6) != "-0/-0/-0 dBm") { $rssiString = substr($ber, 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = " S9+40dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-63") $rssi = " S9+30dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-73") $rssi = " S9+20dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-83") $rssi = " S9+10dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-93") $rssi = " S9 ($rssiAvg dBm)"; - else if ($rssiAvg > "-99") $rssi = " S8 ($rssiAvg dBm)"; - else if ($rssiAvg > "-105") $rssi = " S7 ($rssiAvg dBm)"; - else if ($rssiAvg > "-111") $rssi = " S6 ($rssiAvg dBm)"; - else if ($rssiAvg > "-117") $rssi = " S5 ($rssiAvg dBm)"; - else if ($rssiAvg > "-123") $rssi = " S4 ($rssiAvg dBm)"; - else if ($rssiAvg > "-129") $rssi = " S3 ($rssiAvg dBm)"; - else if ($rssiAvg > "-135") $rssi = " S2 ($rssiAvg dBm)"; - else if ($rssiAvg > "-141") $rssi = " S1 ($rssiAvg dBm)"; - else $rssi = " S0 ($rssiAvg dBm)"; + if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)$rssiString
"; + else $rssi = "
S0 ($rssiAvg dBm)$rssiString
"; } $ber = substr($loss, 5); $loss = ""; @@ -283,20 +283,20 @@ function getHeardList($logLines, $onlyLast) { if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { $rssiString = substr($lineTokens[5], 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = " S9+40dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-63") $rssi = " S9+30dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-73") $rssi = " S9+20dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-83") $rssi = " S9+10dB ($rssiAvg dBm)"; - else if ($rssiAvg > "-93") $rssi = " S9 ($rssiAvg dBm)"; - else if ($rssiAvg > "-99") $rssi = " S8 ($rssiAvg dBm)"; - else if ($rssiAvg > "-105") $rssi = " S7 ($rssiAvg dBm)"; - else if ($rssiAvg > "-111") $rssi = " S6 ($rssiAvg dBm)"; - else if ($rssiAvg > "-117") $rssi = " S5 ($rssiAvg dBm)"; - else if ($rssiAvg > "-123") $rssi = " S4 ($rssiAvg dBm)"; - else if ($rssiAvg > "-129") $rssi = " S3 ($rssiAvg dBm)"; - else if ($rssiAvg > "-135") $rssi = " S2 ($rssiAvg dBm)"; - else if ($rssiAvg > "-141") $rssi = " S1 ($rssiAvg dBm)"; - else $rssi = " S0 ($rssiAvg dBm)"; + if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)$rssiString
"; + else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)$rssiString
"; + else $rssi = "
S0 ($rssiAvg dBm)$rssiString
"; } } diff --git a/index.php b/index.php index 676095c..ee11922 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,8 @@ include "version.php"; + + From 5a42d82cfd3402a4fe04f0455a010b10066b0846 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 8 Jan 2017 18:12:59 +0100 Subject: [PATCH 6/6] Add legend to tooltips --- include/functions.php | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/include/functions.php b/include/functions.php index 85f8f54..43295f7 100644 --- a/include/functions.php +++ b/include/functions.php @@ -258,20 +258,20 @@ function getHeardList($logLines, $onlyLast) { if (substr($ber, 6) != "-0/-0/-0 dBm") { $rssiString = substr($ber, 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)$rssiString
"; - else $rssi = "
S0 ($rssiAvg dBm)$rssiString
"; + if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else $rssi = "
S0 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; } $ber = substr($loss, 5); $loss = ""; @@ -283,20 +283,20 @@ function getHeardList($logLines, $onlyLast) { if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { $rssiString = substr($lineTokens[5], 6); $rssiAvg = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); - if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)$rssiString
"; - else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)$rssiString
"; - else $rssi = "
S0 ($rssiAvg dBm)$rssiString
"; + if ($rssiAvg > "-53") $rssi = "
S9+40dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-63") $rssi = "
S9+30dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-73") $rssi = "
S9+20dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-83") $rssi = "
S9+10dB ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-93") $rssi = "
S9 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-99") $rssi = "
S8 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-105") $rssi = "
S7 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-111") $rssi = "
S6 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-117") $rssi = "
S5 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-123") $rssi = "
S4 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-129") $rssi = "
S3 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-135") $rssi = "
S2 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else if ($rssiAvg > "-141") $rssi = "
S1 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; + else $rssi = "
S0 ($rssiAvg dBm)(min/max/avg)
$rssiString
"; } }