panlei
2019-12-16 e583c3d63a64553efb95d46850fc6ee910805bc0
algorithm/static/static.go
@@ -2,7 +2,7 @@
import (
   "basic.com/pubsub/protomsg.git"
   logger "github.com/alecthomas/log4go"
   "basic.com/valib/logger.git"
   "github.com/knetic/govaluate"
   "ruleprocess/ruleserver"
   "ruleprocess/structure"
@@ -218,10 +218,10 @@
   rw.Lock()
      if result { // 结果为真
         for k, tar := range structure.StaticMap[areaId].Targets {
         for _, tar := range structure.StaticMap[areaId].Targets {
            if tar.Id == person.Id {
               if tar.N == 0 && tar.AlarmFlag {
                  logger.Debug("-------------------------符合持续时间规则但并不是首次,不报警")
                  //logger.Debug("-------------------------符合持续时间规则但并不是首次,不报警")
                  flagTime = "11"
                  o.TimeLable = flagTime
                  o.CacheData = tar.CacheSdkData
@@ -237,7 +237,7 @@
                  flagTime = "00"
                  // 有定时器但不为0把已打的标签删除
                  // args.RuleResult = nil
                  logger.Debug("------------------------结果为真但计数器不到0,不报警,此时的计数器", k, "的值为:", tar.N)
                  //logger.Debug("------------------------结果为真但计数器不到0,不报警,此时的计数器", k, "的值为:", tar.N)
               }
            }
         }
@@ -246,7 +246,7 @@
            if tar.Id == person.Id {
               if tar.AlarmFlag {
                  if tar.BufferFlag == 0 {
                     logger.Debug("------------------------------杀死计数器,报警此帧状态改变的数据,此时的计数器的值为", tar.N)
                     //logger.Debug("------------------------------杀死计数器,报警此帧状态改变的数据,此时的计数器的值为", tar.N)
                     flagTime = "12"
                     structure.StaticMap[areaId].Targets = append(structure.StaticMap[areaId].Targets[:index],structure.StaticMap[areaId].Targets[index+1:]...)
                  } else {
@@ -256,7 +256,7 @@
                     }
                  }
               } else {
                  logger.Debug("-----------结果为假且不到0,杀死定时器")
                  //logger.Debug("-----------结果为假且不到0,杀死定时器")
                  structure.StaticMap[areaId].Targets = append(structure.StaticMap[areaId].Targets[:index],structure.StaticMap[areaId].Targets[index+1:]...)
               }
            }