From 539263381e9bb8d1799e45566ce3909016bfcc33 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Tue, 12 Jul 2016 17:34:21 +0000 Subject: [PATCH] adding further error-messages to ignore, relocate function into tools. --- include/functions.php | 20 ++++---------------- include/tools.php | 11 +++++++++++ version.php | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/include/functions.php b/include/functions.php index f4f76a0..50073be 100644 --- a/include/functions.php +++ b/include/functions.php @@ -99,7 +99,7 @@ function getMMDVMLog() { $logLines = array(); if ($log = fopen(MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log", 'r')) { while ($logLine = fgets($log)) { - if (!strpos($logLine, "Debug") && !strpos($logLine,"Received a NAK") && !startsWith($logLine,"I:")) { + if (!strpos($logLine, "Debug") && !strpos($logLine,"Received a NAK") && !startsWith($logLine,"I:") && !startsWith($logLine,"E:")) { array_push($logLines, $logLine); } } @@ -155,7 +155,10 @@ function getHeardList($logLines) { continue; } else if(strpos($logLine,"unable to decode the network CSBK")) { continue; + } else if(strpos($logLine,"overflow in the DMR slot RF queue")) { + continue; } + if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired") || strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { $lineTokens = explode(", ",$logLine); @@ -475,21 +478,6 @@ function getActiveYSFReflectors($logLines) { return $reflectorlist; } - - function getSize($filesize, $precision = 2) - { - $units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'); - - foreach ($units as $idUnit => $unit) - { - if ($filesize > 1024) - $filesize /= 1024; - else - break; - } - - return round($filesize, $precision).' '.$units[$idUnit].'B'; - } //Some basic inits $mmdvmconfigs = getMMDVMConfig(); $logLinesMMDVM = getMMDVMLog(); diff --git a/include/tools.php b/include/tools.php index b114863..7df5ae4 100644 --- a/include/tools.php +++ b/include/tools.php @@ -54,6 +54,17 @@ function createConfigLines() { return $out; } +function getSize($filesize, $precision = 2) { + $units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'); + foreach ($units as $idUnit => $unit) { + if ($filesize > 1024) + $filesize /= 1024; + else + break; + } + return round($filesize, $precision).' '.$units[$idUnit].'B'; +} + function checkSetup() { $el = error_reporting(); error_reporting(E_ERROR | E_WARNING | E_PARSE); diff --git a/version.php b/version.php index 44f0780..4bdaed2 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@ \ No newline at end of file