Add an option to display all RSSI values

This commit is contained in:
phl0 2017-04-12 09:20:02 +02:00
parent 6e9620a043
commit 0244384a37
No known key found for this signature in database
GPG key ID: 48EA1E640798CA9A
3 changed files with 38 additions and 26 deletions

View file

@ -306,7 +306,9 @@ function getHeardList($logLines, $onlyLast) {
if (constant("RSSI") == "min") $rssiVal = preg_replace('/(-\d+)\/-\d+\/-\d+ dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "max") $rssiVal = preg_replace('/-\d+\/(-\d+)\/-\d+ dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "avg") $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "all") $rssiVal = $rssiString;
else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
if (constant("RSSI") != "all") {
if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
@ -320,6 +322,9 @@ function getHeardList($logLines, $onlyLast) {
else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
} else {
$rssi = $rssiVal;
}
}
$ber = substr($loss, 5);
$loss = "";
@ -333,7 +338,9 @@ function getHeardList($logLines, $onlyLast) {
if (constant("RSSI") == "min") $rssiVal = preg_replace('/(-\d+)\/-\d+\/-\d+ dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "max") $rssiVal = preg_replace('/-\d+\/(-\d+)\/-\d+ dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "avg") $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
else if (constant("RSSI") == "all") $rssiVal = $rssiString;
else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
if (constant("RSSI") != "all") {
if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
@ -347,6 +354,9 @@ function getHeardList($logLines, $onlyLast) {
else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
} else {
$rssi = $rssiVal;
}
}
}

View file

@ -30,6 +30,7 @@ $totalLH = count($lastHeard);
if (constant("RSSI") == "min") echo "<th>"._("RSSI (min)")."</th>";
else if (constant("RSSI") == "max") echo "<th>"._("RSSI (max)")."</th>";
else if (constant("RSSI") == "avg") echo "<th>"._("RSSI (avg)")."</th>";
else if (constant("RSSI") == "all") echo "<th>"._("RSSI (min/max/avg)")."</th>";
else echo "<th>"._("RSSI (avg)")."</th>";
?>
</tr>

View file

@ -344,6 +344,7 @@ get_tz_options(constant("TIMEZONE"), "Timezone", '');
<option <?php if (constant("RSSI") == "min") echo "selected=\"selected\" "?>value="min"><?php echo _("minimal"); ?></option>
<option <?php if (constant("RSSI") == "max") echo "selected=\"selected\" "?>value="max"><?php echo _("maximal"); ?></option>
<option <?php if (constant("RSSI") == "avg" or (!defined("RSSI"))) echo "selected=\"selected\" "?>value="avg"><?php echo _("average"); ?></option>
<option <?php if (constant("RSSI") == "all") echo "selected=\"selected\" "?>value="all"><?php echo _("all"); ?></option>
</select>
</div>
</div>