Change scale according to UHF values

This commit is contained in:
phl0 2017-01-08 12:11:14 +01:00
parent 625e049bbe
commit 3b166819c3
No known key found for this signature in database
GPG key ID: 48EA1E640798CA9A

View file

@ -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 = "<img src=\"images/4.png\" \> S9+10dB";
else if ($rssiAvg > "-73") $rssi = "<img src=\"images/4.png\" \> S9";
else if ($rssiAvg > "-79") $rssi = "<img src=\"images/3.png\" \> S8";
else if ($rssiAvg > "-85") $rssi = "<img src=\"images/3.png\" \> S7";
else if ($rssiAvg > "-91") $rssi = "<img src=\"images/2.png\" \> S6";
else if ($rssiAvg > "-97") $rssi = "<img src=\"images/2.png\" \> S5";
else if ($rssiAvg > "-103") $rssi = "<img src=\"images/1.png\" \> S4";
else if ($rssiAvg > "-109") $rssi = "<img src=\"images/1.png\" \> S3";
else if ($rssiAvg > "-115") $rssi = "<img src=\"images/0.png\" \> S2";
else if ($rssiAvg > "-121") $rssi = "<img src=\"images/0.png\" \> S1";
if ($rssiAvg > "-53") $rssi = "<img src=\"images/4.png\" \> S9+40dB";
else if ($rssiAvg > "-63") $rssi = "<img src=\"images/4.png\" \> S9+30dB";
else if ($rssiAvg > "-73") $rssi = "<img src=\"images/4.png\" \> S9+20dB";
else if ($rssiAvg > "-83") $rssi = "<img src=\"images/4.png\" \> S9+10dB";
else if ($rssiAvg > "-93") $rssi = "<img src=\"images/4.png\" \> S9";
else if ($rssiAvg > "-99") $rssi = "<img src=\"images/3.png\" \> S8";
else if ($rssiAvg > "-105") $rssi = "<img src=\"images/3.png\" \> S7";
else if ($rssiAvg > "-111") $rssi = "<img src=\"images/2.png\" \> S6";
else if ($rssiAvg > "-117") $rssi = "<img src=\"images/2.png\" \> S5";
else if ($rssiAvg > "-123") $rssi = "<img src=\"images/1.png\" \> S4";
else if ($rssiAvg > "-129") $rssi = "<img src=\"images/1.png\" \> S3";
else if ($rssiAvg > "-135") $rssi = "<img src=\"images/0.png\" \> S2";
else if ($rssiAvg > "-141") $rssi = "<img src=\"images/0.png\" \> S1";
else $rssi = "<img src=\"images/0.png\" \> 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 = "<img src=\"images/4.png\" \> S9+10dB";
else if ($rssiAvg > "-73") $rssi = "<img src=\"images/4.png\" \> S9";
else if ($rssiAvg > "-79") $rssi = "<img src=\"images/3.png\" \> S8";
else if ($rssiAvg > "-85") $rssi = "<img src=\"images/3.png\" \> S7";
else if ($rssiAvg > "-91") $rssi = "<img src=\"images/2.png\" \> S6";
else if ($rssiAvg > "-97") $rssi = "<img src=\"images/2.png\" \> S5";
else if ($rssiAvg > "-103") $rssi = "<img src=\"images/1.png\" \> S4";
else if ($rssiAvg > "-109") $rssi = "<img src=\"images/1.png\" \> S3";
else if ($rssiAvg > "-115") $rssi = "<img src=\"images/0.png\" \> S2";
else if ($rssiAvg > "-121") $rssi = "<img src=\"images/0.png\" \> S1";
if ($rssiAvg > "-53") $rssi = "<img src=\"images/4.png\" \> S9+40dB";
else if ($rssiAvg > "-63") $rssi = "<img src=\"images/4.png\" \> S9+30dB";
else if ($rssiAvg > "-73") $rssi = "<img src=\"images/4.png\" \> S9+20dB";
else if ($rssiAvg > "-83") $rssi = "<img src=\"images/4.png\" \> S9+10dB";
else if ($rssiAvg > "-93") $rssi = "<img src=\"images/4.png\" \> S9";
else if ($rssiAvg > "-99") $rssi = "<img src=\"images/3.png\" \> S8";
else if ($rssiAvg > "-105") $rssi = "<img src=\"images/3.png\" \> S7";
else if ($rssiAvg > "-111") $rssi = "<img src=\"images/2.png\" \> S6";
else if ($rssiAvg > "-117") $rssi = "<img src=\"images/2.png\" \> S5";
else if ($rssiAvg > "-123") $rssi = "<img src=\"images/1.png\" \> S4";
else if ($rssiAvg > "-129") $rssi = "<img src=\"images/1.png\" \> S3";
else if ($rssiAvg > "-135") $rssi = "<img src=\"images/0.png\" \> S2";
else if ($rssiAvg > "-141") $rssi = "<img src=\"images/0.png\" \> S1";
else $rssi = "<img src=\"images/0.png\" \> S0";
}
}