more execution time improvement

This commit is contained in:
dg9vh 2016-06-03 19:27:16 +00:00
parent b544a50718
commit 3640bbd8ac
3 changed files with 11 additions and 9 deletions

View file

@ -102,7 +102,7 @@ function getLog() {
// M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9 // M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9
// M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000 // M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000
function getHeardList($logLines) { function getHeardList($logLines) {
array_multisort($logLines,SORT_DESC); //array_multisort($logLines,SORT_DESC);
$heardList = array(); $heardList = array();
$ts1duration = ""; $ts1duration = "";
$ts1loss = ""; $ts1loss = "";
@ -340,7 +340,7 @@ function getActualLink($logLines, $mode) {
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
//M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094
array_multisort($logLines,SORT_DESC); //array_multisort($logLines,SORT_DESC);
switch ($mode) { switch ($mode) {
case "D-Star": case "D-Star":
if (isProcessRunning(IRCDDBGATEWAY)) { if (isProcessRunning(IRCDDBGATEWAY)) {
@ -386,7 +386,7 @@ function getActualReflector($logLines, $mode) {
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
//M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094
array_multisort($logLines,SORT_DESC); //array_multisort($logLines,SORT_DESC);
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") {
@ -407,5 +407,7 @@ function getActualReflector($logLines, $mode) {
//Some basic inits //Some basic inits
$mmdvmconfigs = getMMDVMConfig(); $mmdvmconfigs = getMMDVMConfig();
$logLines = getLog(); $logLines = getLog();
$lastHeard = getLastHeard($logLines); $reverseLogLines = $logLines;
array_multisort($reverseLogLines,SORT_DESC);
$lastHeard = getLastHeard($reverseLogLines);
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
$localTXList = getHeardList($logLines); $localTXList = getHeardList($reverseLogLines);
array_multisort($localTXList,SORT_DESC); //array_multisort($localTXList,SORT_DESC);
?> ?>
<div class="panel panel-default"> <div class="panel panel-default">

View file

@ -13,9 +13,9 @@
<?php <?php
echo"<tr>"; echo"<tr>";
echo"<td>".getActualMode($lastHeard, $mmdvmconfigs)."</td>"; echo"<td>".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
echo"<td>".getActualLink($logLines, "D-Star")."</td>"; echo"<td>".getActualLink($reverseLogLines, "D-Star")."</td>";
echo"<td>".getActualLink($logLines, "DMR Slot 1")."</td>"; echo"<td>".getActualLink($reverseLogLines, "DMR Slot 1")."</td>";
echo"<td>".getActualLink($logLines, "DMR Slot 2")."/". getActualReflector($logLines, "DMR Slot 2") ."</td>"; echo"<td>".getActualLink($reverseLogLines, "DMR Slot 2")."/". getActualReflector($logLines, "DMR Slot 2") ."</td>";
echo"</tr>\n"; echo"</tr>\n";
?> ?>
<tr> <tr>