Esempio n. 1
0
        private void btndynamicDetect_Click(object sender, RoutedEventArgs e)
        {
            var sb = new StringBuilder();

            sb.Append("threshold".ElementText("0.5"));
            sb.Append("rtspId".ElementText("1"));
            sb.Append("rtspPath".ElementText("rtsp://*****:*****@192.0.0.64:554/h264/ch1/main/av_stream"));
            sb.Append("responseType".ElementBegin());
            if (ckbCallback.IsChecked.Value)
            {
                sb.Append("type".ElementText("callback"));
            }
            else
            {
                sb.Append("type".ElementText("messageQueue"));
            }

            sb.Append("size".ElementText("10"));
            sb.Append("responseType".ElementEnd());
            sb.Append("maxImageCount".ElementText("3"));
            sb.Append("frames".ElementText("5"));
            var data = sb.ToString();
            var xml  = GetXml("dynamicDetect", data);

            var content = facePxy.send(xml);

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(content);

            var code = doc.GetNodeText("code");

            Item("code->" + code);

            if (ckbCallback.IsChecked.Value)
            {
                callbackAdapter = ic.createObjectAdapterWithEndpoints("callback-receiver", "default");
                Ice.Object callbackServant = new ConnectorDisp(Item);

                callbackAdapter.add(callbackServant, ic.stringToIdentity("callbackReceiver"));
                callbackAdapter.activate();

                ConnectionListenerPrx listenerPxy = null;

                var objectPxy = callbackAdapter.createProxy(ic.stringToIdentity("callbackReceiver"));
                listenerPxy = ConnectionListenerPrxHelper.checkedCast(objectPxy);

                facePxy.initConnectionListener(listenerPxy);

                Item("set callback ok");
            }
        }
Esempio n. 2
0
        private void Setcallback()
        {
            callbackAdapter = FaceServices.FaceProxy.Ic.createObjectAdapterWithEndpoints("callback-receiver", "default");
            Ice.Object callbackServant = new ConnectorDisp(FaceBack);

            callbackAdapter.add(callbackServant, FaceServices.FaceProxy.Ic.stringToIdentity("callbackReceiver"));
            callbackAdapter.activate();

            ConnectionListenerPrx listenerPxy = null;

            var objectPxy = callbackAdapter.createProxy(FaceServices.FaceProxy.Ic.stringToIdentity("callbackReceiver"));

            listenerPxy = ConnectionListenerPrxHelper.checkedCast(objectPxy);

            FaceServices.FaceProxy.initConnectionListener(listenerPxy);

            Item("set callback ok");
        }