|
@@ -372,7 +372,9 @@ class dispose
|
|
|
* 解析日志
|
|
|
*/
|
|
|
public function analysisLog(){
|
|
|
- $path="D:\公司项目\测试基站\station-test-api\runtime\log\2023-05-15\label_log.log";
|
|
|
+ $path=app()->getRootPath()."runtime/log/2023-05-15/label_log.log";
|
|
|
+ var_dump($path);
|
|
|
+ var_dump(is_file($path));
|
|
|
$file = fopen($path, "rb");
|
|
|
debug_log("in_label","开始解析标签");
|
|
|
$array=[];
|
|
@@ -386,12 +388,14 @@ class dispose
|
|
|
};
|
|
|
debug_log("in_label","解析运行中");
|
|
|
|
|
|
- foreach ($readCvs($file) as $key=>$data) {
|
|
|
- debug_log("in_label",$data);
|
|
|
+ foreach ($readCvs($file) as $data) {
|
|
|
+
|
|
|
if(strstr($data,"xsj")){
|
|
|
- $arr= explode("xsj:",$data);
|
|
|
- $data= json_decode(trim($arr[1]),true);
|
|
|
- debug_log("in_label",trim($arr[1]));
|
|
|
+
|
|
|
+ $arr= explode("{",$data);
|
|
|
+
|
|
|
+ $data= json_decode("{".trim($arr[1]),true);
|
|
|
+ debug_log("in_label",$data);
|
|
|
if(!in_array($data['label'],$array)&&$data["rssi1"]>$data["rssi2"]){
|
|
|
array_push($array,$data['label']);
|
|
|
}
|