From 78592c305ecd3471ba155de84dc391b1c9b12384 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期二, 02 七月 2019 09:49:05 +0800
Subject: [PATCH] Merge branch 'master' of https://192.168.1.14/r/ruleprocess 合并把
---
main.go | 38 +++++++++++++++++++++++++-------------
1 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/main.go b/main.go
index 9314e09..c8545c9 100644
--- a/main.go
+++ b/main.go
@@ -1,33 +1,46 @@
package main
import (
+ "basic.com/dbapi.git"
"basic.com/pubsub/protomsg.git"
"basic.com/valib/deliver.git"
"bufio"
"bytes"
+ "flag"
"fmt"
"github.com/golang/protobuf/proto"
"gocv.io/x/gocv"
"image"
"image/color"
- "log"
"os"
+ "ruleprocess/cache"
"ruleprocess/insertdata"
"ruleprocess/ruleserver"
"ruleprocess/util"
+ "sync"
)
-
+var dbIp = flag.String("dbIp","127.0.0.1","dbserver ip")
+var dbPort = flag.Int("dbPort",8001,"default dbPort=8001")
+var surveyPort = flag.Int("surveyPort",40007,"survey port") //蹇冭烦
+var pubPort = flag.Int("pubPort",50007,"pubsub port") //鏁版嵁鏇存柊
+var initchan = make(chan bool)
func main() {
- //wg := sync.WaitGroup{}
- //wg.Add(1)
- //go ruleserver.TimeTicker()
- //nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1)
- //wg.Wait()
- resp,err := DrawPolygonOnImage()
- if err != nil {
- log.Println("鐢绘鎴栬�呬笂浼犳湁闂")
- }
- log.Println(resp["fileUrl"].(string))
+ flag.Parse()
+ wg := sync.WaitGroup{}
+ wg.Add(1)
+
+ dbapi.Init(*dbIp,*dbPort)
+ go cache.Init(initchan,*dbIp,*surveyPort,*pubPort)
+ fmt.Println("cache init completed!!!",<- initchan)//dbserver鍒濆鍖栧畬姣�
+
+ go ruleserver.TimeTicker()
+ nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1)
+ wg.Wait()
+ //resp,err := DrawPolygonOnImage()
+ //if err != nil {
+ // log.Println("鐢绘鎴栬�呬笂浼犳湁闂")
+ //}
+ //log.Println(resp["fileUrl"].(string))
}
func nReciever(url string, m deliver.Mode, count int) {
c := deliver.NewServer(m, url)
@@ -117,7 +130,6 @@
arg.IsStatic = false
if len(sdkinfo.Sdkdata) > 1 {
// 澶т簬1鎵嶆湁鏁版嵁
- fmt.Println("----------------------------------------------------",m.Cid)
yoloParam := protomsg.ParamYoloObj{}
err = proto.Unmarshal(sdkinfo.Sdkdata, &yoloParam)
if err != nil {
--
Gitblit v1.8.0