---
panlei
2019-11-13 c4f4abbd7d40e75fef0eb1e1dadb78309c059d73
algorithm/middleware/middleware.go
@@ -14,7 +14,7 @@
   "time"
)
func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule,lable *structure.Others,message *protomsg.SdkMessage) (bool,[]*structure.Arg,string,string){
func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule,lable *structure.Others,message *protomsg.SdkMessage) (bool,string,string){
   resultSplice := []*structure.LittleRuleResult{}
   sdkNames := ""
   polygonId := ""
@@ -92,7 +92,7 @@
   }
   // 个体静止
   for j := 0; j < len(groupRule.Rules); j++ {
      if groupRule.Rules[j].SdkId == "个体静止" && groupRule.Rules[j].SdkArgAlias != "time_rule"{
      if groupRule.Rules[j].SdkId == "812b674b-2375-4589-919a-5c1c3278a977" && groupRule.Rules[j].SdkArgAlias != "time_rule"{
         for _, sdkData := range args.Sdkdata {
            // 根据规则的sdkId查出其对应的ipcId,用ipcId去找该比对的数据
            sdk, err := cache.GetSdkById(groupRule.Rules[j].SdkId)
@@ -214,9 +214,9 @@
         panic("规则有误,得到的数学公式不可解析")
      }
      result, _ := expression.Evaluate(nil) // 得到数学公式的结果
      return result.(bool),nil,sdkNames,polygonId
      return result.(bool),sdkNames,polygonId
   } else {
      return false,nil,sdkNames,polygonId
      return false,sdkNames,polygonId
   }
}
@@ -288,8 +288,10 @@
      soName = "personUnsual.so"
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a972" {
      soName = "faceCompare.so"
   } else if sdkId == "个体静止" {
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a977" {
      soName = "static.so"
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a978" {
      soName = "car.so"
   }
   //soInfo,errr := cache.GetSoInfoById(sdkId)
   //if errr != nil {
@@ -304,6 +306,7 @@
   if err1 != nil {
      panic("没有找到入口函数")
   }
   logger.Info("发给so的数据:",rule.SdkArgValue,rule.Operator,rule.SdkArgAlias)
   ruleResult := f.(func(rule *protomsg.Rule, am *structure.AreaMap,lable *structure.Others, args *structure.SdkDatas,message *protomsg.SdkMessage)structure.LittleRuleResult)(rule,am,lable,args,message)
   return ruleResult
}