Esempio n. 1
0
        public async void Init()
        {
            ReadyContent = "初始化...";

            receiveSerial = new SerialDeviceID();
            var open = receiveSerial.Open(ConfigProfile.Current.ReceiveCom);
            if (open)
            {
                receiveSerial.OnReadCard += OnReadCard;
            }
            receiveSerial.Start();

            koala = new Koala();
            koala.Login();

            //将Nuc和摄像机Ip进行映射
            var url = "ws://" + ConfigProfile.Current.NucIp + ":8080/video" + "?name=" + ConfigProfile.Current.Name + "&url=" + ConfigProfile.Current.NucCameraAddress.UrlEncode();
            var task = ConnectNucWebSocket(url);
            await task;

            //获取识别推送结果
            url = "ws://" + ConfigProfile.Current.KoalaIp + ":9000?url=" + ConfigProfile.Current.KoalaCameraAddress.UrlEncode();
            task = ConnectKoalaWebSocket(url);
            await task;

            gate = new MegviiGate(ConfigProfile.Current.GateIp);
            alarm = new MegviiGate(ConfigProfile.Current.AlarmIp);

            StartCheckAsync();

            if (nucSocket.IsConnected)
                ReadyContent = WaitCard;
            else
                ReadyContent = "设备连接失败";
        }
Esempio n. 2
0
 public FrmAPITest()
 {
     InitializeComponent();
     koala = new Koala();
 }