panlei
2019-11-07 59dcc2bba3b294b2679beb4f177b835552798ed5
ruleserver/ruleToformula.go
@@ -224,14 +224,17 @@
               if ipcId == sdkData.IpcId {
                  for _, areaMap := range sdkData.AreaMapList {
                     // 去开启一个定时器
                     cacheId = duration(groupRule.Rules[j], groupRule.GroupId, areaMap, args, message)
                     cacheid := duration(groupRule.Rules[j], groupRule.GroupId, areaMap, args, message)
                     if cacheid != "" {
                        cacheId = cacheid
                     }
                  }
               }
            }
         }
         // 进行定时器的处理和判断
         timeFlag := TimerAlarm(&label, groupRule.GroupId, result.(bool))
         if timeFlag == "01" || timeFlag == "10" || timeFlag == "11" { // 没有定时器或者满足定时器条件
         if timeFlag == "01" || timeFlag == "10" || timeFlag == "11" || cacheId != ""{ // 没有定时器或者满足定时器条件
            // 打人脸标签和yolo标签
            // 最后成功报警才把符合条件的人脸数据塞进结果标签里
            // 配了人脸的算法才把人脸的数据甩出来打标签
@@ -287,10 +290,8 @@
            }
            // 给持续时间的第一张赋予缓存数据(遍历复制)
            if cacheId != "" { // 有这帧数据的缓存
               logger.Info("缓存id为:",cacheId)
               tempMap := make(map[string]interface{})
               for k, result := range args.RuleResult {
                  logger.Info("缓存key为:",k)
                  if k == "yolo" {
                     tempMap[k] = []structure.Result{}
                     for _, res := range result.([]structure.Result) {
@@ -304,7 +305,6 @@
                     }
                  }
               }
               logger.Info("缓存规则为:",tempMap)
               rw.Lock()
               TimeEleList[cacheId].CacheSdkData.RuleResult = tempMap
               rw.Unlock()