| | |
| | | } |
| | | |
| | | // 对单帧图像的判断 是舍弃(或者说对于某些需求可以放ES数据库一份)还是返回 |
| | | func Judge(args SdkDatas) { |
| | | func Judge(args *SdkDatas) { |
| | | if len(args.Sdkdata) > 0 { |
| | | // 拿到本摄像机的区域 |
| | | cameraPolygons := GetPolygons(args.CameraId) |
| | |
| | | } |
| | | } |
| | | } |
| | | func RunRule(args SdkDatas, groupRule *protomsg.GroupRule, taskId string) bool { |
| | | func RunRule(args *SdkDatas, groupRule *protomsg.GroupRule, taskId string) bool { |
| | | resultSplice := []*LittleRuleResult{} |
| | | // 先过完条件规则 |
| | | for j := 0; j < len(groupRule.Rules); j++ { |
| | |
| | | } |
| | | // 过完规则后打个标签,告诉调用者本帧数据针对哪个任务哪组规则报警了 后加:可能还不够,还需要区分触发报警的对象,后面往es数据库插数据时要用 |
| | | args.RuleResult["yolo"] = append(args.RuleResult["yolo"].([]Result), Result{taskId, sdkName, groupRule.GroupId, groupRule.AlarmLevel, groupRule.GroupText}) |
| | | log.Println("-------------------结果标签",args.RuleResult["yolo"].([]Result)) |
| | | return true |
| | | } else { |
| | | return false |
| | |
| | | } |
| | | |
| | | // 联动任务的处理 |
| | | func linkTask(args SdkDatas, groupRule *protomsg.GroupRule, taskId string) { |
| | | func linkTask(args *SdkDatas, groupRule *protomsg.GroupRule, taskId string) { |
| | | // new一个定时器,如果以此groupId为标志的定时器不存在的话 |
| | | var flag bool = true |
| | | var timeEle = TimeElement{N: 3, InitN: 3, GroupId: groupRule.GroupId} |