From 770da0e3e04da28d58a96526226ceece4e1a771e Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期二, 26 十一月 2019 17:37:54 +0800
Subject: [PATCH] 加入车牌过滤

---
 ruleserver/timeTicker.go |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ruleserver/timeTicker.go b/ruleserver/timeTicker.go
index f42f3a2..c0c0037 100644
--- a/ruleserver/timeTicker.go
+++ b/ruleserver/timeTicker.go
@@ -2,7 +2,7 @@
 
 import (
 	"fmt"
-	"ruleprocess/logger"
+	"basic.com/valib/logger.git"
 	"ruleprocess/structure"
 	"strings"
 	"time"
@@ -42,11 +42,12 @@
 			logger.Info("瀹氭椂鍣ㄦ墽琛屽崟鍏�", time.Now().Unix())
 			fmt.Println("瀹氭椂鍣ㄦ墽琛屽崟鍏�", time.Now().Unix())
 			// 姣忕閽熻鏁板櫒姹犲瓙閲屾墍鏈夌殑璁℃暟鍣ㄥ厓绱犻兘鍑忎竴锛屽噺鍒�0鐨勬槸璇ユ姤璀︾殑
+			// 鍥剧墖瀹氭椂鍣ㄧ郴鍒�
 			rw.Lock()
 			for k, timeEle := range TimeEleList {
 				if timeEle.N > 0 {
 					timeEle.N = timeEle.N - 1
-					logger.Error("-------------------------------------鎵撳嵃瀹氭椂鍣ㄨ鏁板厓绱犲綋鍓嶅��-----------------------------------------锛�", timeEle.N)
+					logger.Debug("-------------------------------------鎵撳嵃瀹氭椂鍣ㄨ鏁板厓绱犲綋鍓嶅��-----------------------------------------锛�", timeEle.N)
 				}
 				if timeEle.GroupId != "" && timeEle.N == 0 {
 					// 璇存槑鏄仈鍔ㄤ换鍔$殑鏃堕棿绐楀彛 鍒扮偣鍎夸簡璇ラ攢姣佷簡,鍐嶆潵浜嗗啀鍒涘缓
@@ -54,6 +55,14 @@
 				}
 			}
 			rw.Unlock()
+			// 鐩爣瀹氭椂鍣ㄧ郴鍒�
+			for _,cameraArea := range structure.StaticMap {
+				for _,obj := range cameraArea.Targets {
+					if obj.N > 0 {
+						obj.N = obj.N - 1
+					}
+				}
+			}
 		case stop := <-stopChan:
 			if stop {
 				logger.Info("瀹氭椂鍣ㄧ粨鏉�")
@@ -148,8 +157,8 @@
 func (p SubList) Less(i, j int) bool { return p[i].Sort < p[j].Sort }
 
 // 缁撴瀯浣撴牴鎹煇瀛楁鎺掑簭
-type resultList []*structure.LittleRuleResult
+type ResultList []*structure.LittleRuleResult
 
-func (p resultList) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
-func (p resultList) Len() int           { return len(p) }
-func (p resultList) Less(i, j int) bool { return p[i].Sort < p[j].Sort }
+func (p ResultList) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
+func (p ResultList) Len() int           { return len(p) }
+func (p ResultList) Less(i, j int) bool { return p[i].Sort < p[j].Sort }

--
Gitblit v1.8.0