diff --git a/ajax.php b/ajax.php index 199a61d..a79c01b 100644 --- a/ajax.php +++ b/ajax.php @@ -111,7 +111,7 @@ if ($_GET['section'] == "localTx") { $call_canon = substr($call_canon, 0, strpos($call_canon, "-")); } if (defined("ENABLEXTDLOOKUP")) { - $listElem[11] =""; + //$listElem[11] =""; if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25" || $listElem[1]=="NXDN")) { $listElem[3] = getName($call_canon); if ($listElem[2] !== "??????????") { @@ -126,9 +126,10 @@ if ($_GET['section'] == "localTx") { } } array_push($lastHeard, $listElem); + $oldListElem = $listElem; } } else { - $listElem[10] =""; + //$listElem[10] =""; if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25" || $listElem[1]=="NXDN")) { if ($listElem[2] !== "??????????") { if (!is_numeric($listElem[2])) { diff --git a/include/functions.php b/include/functions.php index 2600930..7d10a73 100644 --- a/include/functions.php +++ b/include/functions.php @@ -246,7 +246,8 @@ function showMode($mode, $mmdvmconfigs) { function getMMDVMLog() { // Open Logfile and copy loglines into LogLines-Array() $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; - $logLines = explode("\n", `egrep -h "from|end|watchdog|lost|POCSAG" $logPath`); + //$logLines = explode("\n", `egrep -h "from|end|watchdog|lost|POCSAG" $logPath`); + $logLines = explode("\n", `egrep -h "from|watchdog|lost|POCSAG" $logPath`); return $logLines; } @@ -387,65 +388,65 @@ function getHeardList($logLines, $onlyLast) { $rssi = $rssiVal; } } - $ber = substr($loss, 5); - $loss = ""; - } else if (startsWith($loss,"RSSI:")) { //for short RF packets and "X" button requests, BER sometimes in not showed. RSSI is in BER position - $loss=""; - $ber = ""; - $rssiString = substr($lineTokens[3], 6); - 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 = "
S9 +40dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-63") $rssi = "
S9 +30dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-73") $rssi = "
S9 +20dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-83") $rssi = "
S9 +10dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-93") $rssi = "
S9 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-99") $rssi = "
S8 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-105") $rssi = "
S7 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-111") $rssi = "
S6 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-117") $rssi = "
S5 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-123") $rssi = "
S4 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-129") $rssi = "
S3 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-135") $rssi = "
S2 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-141") $rssi = "
S1 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - } else { - $rssi = $rssiVal; - } - } else { - $loss = strtok($loss, " "); - if (array_key_exists(4,$lineTokens)) { - $ber = substr($lineTokens[4], 5); - } - if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { - $rssiString = substr($lineTokens[5], 6); - 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 = "
S9 +40dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-63") $rssi = "
S9 +30dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-73") $rssi = "
S9 +20dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-83") $rssi = "
S9 +10dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-93") $rssi = "
S9 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-99") $rssi = "
S8 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-105") $rssi = "
S7 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-111") $rssi = "
S6 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-117") $rssi = "
S5 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-123") $rssi = "
S4 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-129") $rssi = "
S3 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-135") $rssi = "
S2 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - else if ($rssiVal > "-141") $rssi = "
S1 ($rssiVal dBm)(min/max/avg)
$rssiString
"; - } else { - $rssi = $rssiVal; - } - } - } + $ber = substr($loss, 5); + $loss = ""; + } else if (startsWith($loss,"RSSI:")) { //for short RF packets and "X" button requests, BER sometimes in not showed. RSSI is in BER position + $loss=""; + $ber = ""; + $rssiString = substr($lineTokens[3], 6); + 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 = "
S9 +40dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-63") $rssi = "
S9 +30dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-73") $rssi = "
S9 +20dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-83") $rssi = "
S9 +10dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-93") $rssi = "
S9 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-99") $rssi = "
S8 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-105") $rssi = "
S7 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-111") $rssi = "
S6 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-117") $rssi = "
S5 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-123") $rssi = "
S4 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-129") $rssi = "
S3 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-135") $rssi = "
S2 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-141") $rssi = "
S1 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + } else { + $rssi = $rssiVal; + } + } else { + $loss = strtok($loss, " "); + if (array_key_exists(4,$lineTokens)) { + $ber = substr($lineTokens[4], 5); + } + if (array_key_exists(5,$lineTokens) && substr($lineTokens[5], 6) != "-0/-0/-0 dBm") { + $rssiString = substr($lineTokens[5], 6); + 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 = "
S9 +40dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-63") $rssi = "
S9 +30dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-73") $rssi = "
S9 +20dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-83") $rssi = "
S9 +10dB ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-93") $rssi = "
S9 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-99") $rssi = "
S8 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-105") $rssi = "
S7 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-111") $rssi = "
S6 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-117") $rssi = "
S5 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-123") $rssi = "
S4 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-129") $rssi = "
S3 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-135") $rssi = "
S2 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + else if ($rssiVal > "-141") $rssi = "
S1 ($rssiVal dBm)(min/max/avg)
$rssiString
"; + } else { + $rssi = $rssiVal; + } + } + } if (strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { switch (substr($logLine, 27, strpos($logLine,",") - 27)) { @@ -496,6 +497,9 @@ function getHeardList($logLines, $onlyLast) { break; } } + } else { + if (!$onlyLast) + continue; } $timestamp = substr($logLine, 3, 23); $mode = substr($logLine, 27, strpos($logLine,",") - 27); @@ -574,15 +578,15 @@ function getHeardList($logLines, $onlyLast) { break; case "POCSAG": $callsign = "POCSAG"; - $name = ""; - $id = ""; - $target = ""; - $source = ""; + $name = ""; + $id = ""; + $target = ""; + $source = ""; $duration = ""; $loss = ""; $ber = ""; $rssi = ""; - $alias = ""; + $alias = ""; break; } // Callsign or ID should be less than 11 chars long, otherwise it could be errorneous @@ -594,17 +598,23 @@ function getHeardList($logLines, $onlyLast) { } else { array_push($heardList, array(convertTimezone($timestamp), $mode, $callsign, $id, $target, $source, $duration, $loss, $ber, $rssi, $alias)); $alias = ""; - } + }/* $duration = ""; $loss = ""; $ber = ""; $rssi = ""; $ts1alias = "---"; - $ts2alias = "---"; + $ts2alias = "---";*/ if ($onlyLast && count($heardList )> 20) { return $heardList; } } + $duration = ""; + $loss = ""; + $ber = ""; + $rssi = ""; + $ts1alias = "---"; + $ts2alias = "---"; } return $heardList; } diff --git a/version.php b/version.php index 3051a15..f7c4466 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@