CgwMonitorManage.eLTE.eLTEVideoMonitor.CallbackResStatusDelegateFun C# (CSharp) Méthode

CallbackResStatusDelegateFun() private méthode

通知资源状态信息,登录用户回调状态
private CallbackResStatusDelegateFun ( strResourceStatusIndicator &structResStaIndi ) : void
structResStaIndi strResourceStatusIndicator
Résultat void
        private void CallbackResStatusDelegateFun(ref strResourceStatusIndicator structResStaIndi)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: CallbackResStatusDelegateFun.status_type = {0},status_value = {1}", Enum.GetName(typeof(resource_status_t), structResStaIndi.status_type),
                         Enum.GetName(typeof(res_status_value_t), structResStaIndi.status_value));
            if (structResStaIndi.status_type == resource_status_t.RESREGSTATUS_PROXY && structResStaIndi.status_value == res_status_value_t.STATUS_REGOK)
            {
                logEx.Trace("{0} Login eLTE Success", structResStaIndi.ResId);

                ////休息2秒,等缓存回调上来后查设备,否则设备为0
                //Thread.Sleep(2000);

                //Thread th = new Thread(new ThreadStart(() =>
                //{
                //    //开始获取摄像机 
                //    this.GetAllCamerasTimer(null, null);

                //    //启动定时器
                //    this.updateCameraTimer.Start();
                //}));
                //th.Start();
            }
            else if (structResStaIndi.status_type == resource_status_t.RESREGSTATUS_PROXY && structResStaIndi.status_value == res_status_value_t.STATUS_NOT_FOUND)//密码不正确,不进行重连
            {
                logEx.Info("{0} Login eLTE Failed,STATUS_NOT_FOUND",structResStaIndi.ResId);
            }
            else if (structResStaIndi.status_type == resource_status_t.RESREGSTATUS_PROXY && structResStaIndi.status_value != res_status_value_t.STATUS_UNAUTHORIZED)
            {
                logEx.Trace("{0} Login eLTE Failed", structResStaIndi.ResId);
                if (IsNeedLogin)//判断是否需要登录
                {
                    eLTELoginInfo loginInfo = new eLTELoginInfo();
                    loginInfo.Ip = ip;
                    loginInfo.Port = iPort;
                    loginInfo.User = user;
                    //loginInfo.Pwd = password;
                    loginInfo.Pwd = CommonFunction.DecryptByte2Str(pwdByte, CgwConst.PASSWORD_TAG);
                    loginInfo.PTTUSER = bPttUser;
                    loginInfo.FIXEDCAMERA = bFixedCamera;
                    loginInfo.NotFirstLogin = true;

                    //使用线程轮询加载监控平台
                    Thread loaderThread = new Thread(LoginThread);
                    loaderThread.IsBackground = true;
                    loaderThread.Start(loginInfo);
                    loaderThread.Join(20000);
                }              
            }
        }