示例#1
0
   public int UpdateRealtimeCmp(RealtimeCmpInfo info, string channelname)
   {
 #if !SILVERLIGHT
       send_UpdateRealtimeCmp(info, channelname);
       return(recv_UpdateRealtimeCmp());
 #else
       var asyncResult = Begin_UpdateRealtimeCmp(null, null, info, channelname);
       return(End_UpdateRealtimeCmp(asyncResult));
 #endif
   }
    public void Read(TProtocol iprot)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        Cfg = new RealtimeCmpInfo();
                        Cfg.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        ChannelName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
示例#3
0
        public void send_UpdateRealtimeCmp(RealtimeCmpInfo info, string channelname)
    #endif
        {
            oprot_.WriteMessageBegin(new TMessage("UpdateRealtimeCmp", TMessageType.Call, seqid_));
            UpdateRealtimeCmp_args args = new UpdateRealtimeCmp_args();

            args.Info        = info;
            args.Channelname = channelname;
            args.Write(oprot_);
            oprot_.WriteMessageEnd();
      #if SILVERLIGHT
            return(oprot_.Transport.BeginFlush(callback, state));
      #else
            oprot_.Transport.Flush();
      #endif
        }
示例#4
0
 /// <summary>
 /// 设置报警弹窗信息
 /// </summary>
 /// <param name="name"></param>
 /// <param name="channelName"></param>
 /// <param name="time"></param>
 /// <param name="type"></param>
 /// <param name="socre"></param>
 /// <param name="capImg"></param>
 /// <param name="regImg"></param>
 /// <param name="realtimeCmpInfo"></param>
 internal void SetWarningInfo(string name, string channelName, long time, string type, string socre, ImageSource capImg, ImageSource regImg, RealtimeCmpInfo realtimeCmpInfo)
 {
     try
     {
         label_Socre.Text        = label_Socre.Text.ToString().Replace("Socre", socre);
         label_TemplateName.Text = label_TemplateName.Text.ToString().Replace("TemplateName", name);
         label_TemplateType.Text = label_TemplateType.Text.ToString().Replace("TemplateType", type);
         long     _longtime = time;
         DateTime s         = new DateTime(1970, 1, 1);
         s = s.AddSeconds(_longtime);
         label_CapTime.Text    = label_CapTime.Text.ToString().Replace("CapTime", s.ToString());
         label_CapChannel.Text = label_CapChannel.Text.ToString().Replace("CapChannel", channelName);
         image_CapImage.Source = capImg;
         image_RegImage.Source = regImg;
         info        = realtimeCmpInfo;
         ChannelName = channelName;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 /// <summary>
 /// 推送比对记录
 /// </summary>
 /// <param name="info"></param>
 /// <param name="IP"></param>
 /// <returns></returns>
 public int UpdateCmp(RealtimeCmpInfo info, string IP)
 {
     try
     {
         // 生成socket套接字;
         Thrift.Transport.TSocket tsocket = new Thrift.Transport.TSocket(IP, 6000);
         //设置连接超时为100;
         tsocket.Timeout = 3000;
         //生成客户端对象
         Thrift.Transport.TTransport transport             = tsocket;
         Thrift.Protocol.TProtocol   protocol              = new Thrift.Protocol.TBinaryProtocol(transport);
         UIServer.Client             _BusinessServerClient = new UIServer.Client(protocol);
         transport.Open();
         _BusinessServerClient.UpdateRealtimeCmp(info, "##@" + info.Channel);
         transport.Close();
         return(0);
     }
     catch (Exception ex)
     {
         _WriteLog.WriteToLog("UpdateCmp", ex);
         return(-1);
     }
 }
示例#6
0
        public int UpdateRealtimeCmp(RealtimeCmpInfo info, string channelName)
        {
            //return 1;
            try
            {
                if (Login.ClientType == "1")
                {
                    if (!channelName.StartsWith("##"))
                    {
                        return(-1);
                    }
                }
                //显示在界面上的结果
                if (_IdentifyResults != null)
                {
                    _IdentifyResults = null;
                }
                _IdentifyResults    = new IdentifyResults();
                _IdentifyResults.ID = info.CapID;
                if (info.CapID == null || info.CapID == "")
                {
                    MyMessage.showYes("抓拍照片ID为空");
                }
                _IdentifyResults.RegID = info.ObjID;
                if (info.ObjID == null || info.ObjID == "")
                {
                    //MyMessage.showYes("抓拍照片ID为空");
                    MyMessage.showYes("抓拍照片ID为空");
                }
                long     _longtime = info.Time;
                DateTime s         = new DateTime(1970, 1, 1);
                s = s.AddSeconds(_longtime);
                // 抓拍照片
                ChannelManage.CapimageByteRealtimeCmpInfo = info.CapImg;
                //得到主照片
                ChannelManage.CmpimageByteRealtimeCmpInfo = info.ObjImg;
                //获得主照片这侧信息
                StringBuilder strRegster = new StringBuilder();
                //注册名称
                strRegster.Append(info.Name + "\r\n");
                //获得通道名称
                string ChannelName = channelName;
                _IdentifyResults.ChannelName = channelName;
                strRegster.Append(ChannelName.Replace("##", "").Replace("@", "") + "\r\n");
                //抓拍时间
                int nIndexS = s.ToString().IndexOf(" ");
                strRegster.Append(s.ToString().Substring(0, nIndexS) + "\r\n");
                int nIndexS1 = s.ToString().Length - nIndexS;
                strRegster.Append(s.ToString().Substring(nIndexS + 1, nIndexS1 - 1) + "\r\n");
                //注册类型
                string type = "";
                foreach (var basicinfo in AppConfigs.DefFaceObjType)
                {
                    if (basicinfo.Type == info.Type)
                    {
                        type = basicinfo.Description; // 类型
                    }
                }
                strRegster.Append(type + "\r\n");
                _IdentifyResults.TemplateType = type;
                //相似度。
                strRegster.Append(info.Score + "\r\n");
                _IdentifyResults.RegInfo = strRegster.ToString();
                _IdentifyResults.Info    = info;
                //MainWindow.nInfoType = info.Type;
                Console.WriteLine("推送了一条比对记录");
                ChannelManage._IdentifyResults = _IdentifyResults;
                ChannelManage.ResetServerRealtimeCmpInfo.Set();

                ////弹出报警框
                //AlarmWindow _AlarmWindow = new AlarmWindow();
                //_AlarmWindow.CapimageByteRealtimeCmpInfo = info.CapImg;
                //_AlarmWindow.CmpimageByteRealtimeCmpInfo = info.CapImg;
                //_AlarmWindow.RegInfo = strRegster.ToString();
                //_AlarmWindow.nInfoType = info.Type;

                //_AlarmWindow.Show();

                info = null;
                return(0);
            }
            catch (Exception ex)
            {
                _WriteLog.WriteToLog("UpdateRealtimeCmp", ex);
                return(-1);
            }
        }
        public int UpdateRealtimeCmp(RealtimeCmpInfo info, string channelName)
        {
            try
            {
                if (GlobalCache.AppType == 1)
                {
                    if (!channelName.StartsWith("##"))
                    {
                        return(-1);
                    }
                }
                //显示在界面上的结果
                if (_IdentifyResults != null)
                {
                    _IdentifyResults = null;
                }
                _IdentifyResults    = new IdentifyResults();
                _IdentifyResults.ID = info.CapID;
                if (info.CapID == null || info.CapID == "")
                {
                    MB_MODULES.Views.MyMessage.showYes("抓拍照片ID为空");
                }
                _IdentifyResults.RegID = info.ObjID;
                if (info.ObjID == null || info.ObjID == "")
                {
                    MB_MODULES.Views.MyMessage.showYes("抓拍照片ID为空");
                }
                long     _longtime = info.Time;
                DateTime s         = new DateTime(1970, 1, 1);
                s = s.AddSeconds(_longtime);
                // 抓拍照片
                ChannelManage.snapStream = info.CapImg;
                //得到主照片
                ChannelManage.campareStream = info.ObjImg;
                //获得主照片这侧信息
                StringBuilder strRegster = new StringBuilder();
                //注册名称
                strRegster.Append(info.Name + "\r\n");
                //获得通道名称
                string ChannelName = channelName;
                _IdentifyResults.ChannelName = channelName;
                strRegster.Append(ChannelName.Replace("##", "").Replace("@", "") + "\r\n");
                //抓拍时间
                int nIndexS = s.ToString().IndexOf(" ");
                strRegster.Append(s.ToString().Substring(0, nIndexS) + "\r\n");
                int nIndexS1 = s.ToString().Length - nIndexS;
                strRegster.Append(s.ToString().Substring(nIndexS + 1, nIndexS1 - 1) + "\r\n");
                //注册类型
                var    typeObj = GlobalCache.FaceTypeList.Cast <STypeInfo>().FirstOrDefault(x => x.Type == info.Type) ?? new STypeInfo();
                string type    = typeObj.Description;

                strRegster.Append(type + "\r\n");
                _IdentifyResults.TemplateType = type;
                //相似度。
                strRegster.Append(info.Score + "\r\n");
                _IdentifyResults.RegInfo = strRegster.ToString();
                _IdentifyResults.Info    = info;
                //MainWindow.nInfoType = info.Type;
                Console.WriteLine("推送了一条比对记录");
                ChannelManage._IdentifyResults = _IdentifyResults;
                ChannelManage.ResetServerRealtimeCmpInfo.Set();

                ////弹出报警框
                //AlarmWindow _AlarmWindow = new AlarmWindow();
                //_AlarmWindow.CapimageByteRealtimeCmpInfo = info.CapImg;
                //_AlarmWindow.CmpimageByteRealtimeCmpInfo = info.CapImg;
                //_AlarmWindow.RegInfo = strRegster.ToString();
                //_AlarmWindow.nInfoType = info.Type;

                //_AlarmWindow.Show();

                info = null;
                return(0);
            }
            catch (Exception ex)
            {
                Logger <OperaExcel> .Log.Error("UpdateRealtimeCmp", ex);

                return(-1);
            }
        }
示例#8
0
 public IAsyncResult send_UpdateRealtimeCmp(AsyncCallback callback, object state, RealtimeCmpInfo info, string channelname)
示例#9
0
 public IAsyncResult Begin_UpdateRealtimeCmp(AsyncCallback callback, object state, RealtimeCmpInfo info, string channelname)
 {
     return(send_UpdateRealtimeCmp(callback, state, info, channelname));
 }