• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NLogEx.LoggerEx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NLogEx.LoggerEx的典型用法代码示例。如果您正苦于以下问题:C# NLogEx.LoggerEx类的具体用法?C# NLogEx.LoggerEx怎么用?C# NLogEx.LoggerEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NLogEx.LoggerEx类属于命名空间,在下文中一共展示了NLogEx.LoggerEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AssignMonitorChannel

        /// <summary>
        /// 分配监控通道
        /// </summary>
        public SmcErr AssignMonitorChannel(List<ChannelInfo> ChannelInfoList)
        {
            SmcErr err = new CgwError();
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            err = CheckSession();
            if (err.IsSuccess())
            {
                if (ChannelInfoList != null)
                {
                    err = MonitorChannelBll.Instance().AssignMonitorChannel(ChannelInfoList);

                }
                else
                {
                    err.SetErrorNo(CgwError.ERR_CGW_BUSINESS_CHANNELLIST_NULL);
                }

            }
            if (err.IsSuccess())
            {
                logEx.Trace("AssignMonitorChannel Successful");
            }
            else
            {
                logEx.Error("AssignMonitorChannel failed,ErrNo :{0}", err.ErrNo);
            }
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:31,代码来源:GatewayExternal.cs


示例2: ESDK_RTP_Init

        /// <summary>
        /// 初始化rtp模块
        /// </summary>
        public void ESDK_RTP_Init()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: RtpAdapter.ESDK_RTP_Init().");

            try
            {
                int iRet = 0;
                if (!isInited)
                {
                    iRet = SdkRtpInterface.ESDK_RTP_Init();
                    logEx.Trace("Enter: RtpAdapter.ESDK_RTP_Init(). This is first init!");
                }
                if (iRet != 0)
                {
                    logEx.Error("RtpAdapter.ESDK_RTP_Init ,error:{0}", iRet);
                    isInited = false;
                }
                else
                {
                    logEx.Trace("Enter: RtpAdapter.ESDK_RTP_Init().Success");
                    isInited = true;
                }
                logEx.Trace("Enter: RtpAdapter.ESDK_RTP_Init(). inited is {0}!", isInited);
            }
            catch (System.Exception ex)
            {
                logEx.Error("RtpAdapter.ESDK_RTP_Init ,Exception:{0}", ex.ToString());
                isInited = false;
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:34,代码来源:RtpAdapter.cs


示例3: StopService

        /// <summary>
        /// 停止服务
        /// </summary>
        public override void StopService()
        {
            if (serviceHost != null)
            {
                NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
                NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);

                CgwService.Instance().StopAllStream();//stop all stream.
                SmcErr err = CgwService.Instance().DisconnectMonitor();
                logEx.Info("CGW service.StopService DisconnectMonitor.ErrNo ={0}!", err.ErrNo);

                serviceHost.Close();
                logEx.Info("CGW service.StopService Close Success.");
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:18,代码来源:Program.cs


示例4: ESDK_RTP_CloseChannel

        /// <summary>
        /// 关闭通道
        /// </summary>
        /// <param name="uiChannel"></param>
        public void ESDK_RTP_CloseChannel(uint uiChannel)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: RtpAdapter.ESDK_RTP_CloseChannel().");

            try
            {
                int iRet = SdkRtpInterface.ESDK_RTP_CloseChannel(uiChannel);

                if (iRet != 0)
                {
                    logEx.Error("RtpAdapter.ESDK_RTP_CloseChannel ,error:{0}", iRet);
                }
            }
            catch (System.Exception ex)
            {
                logEx.Error("RtpAdapter.ESDK_RTP_CloseChannel ,Exception:{0}", ex.ToString());
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:23,代码来源:RtpAdapter.cs


示例5: LoadMonitorTimer_Elapsed

        /// <summary>
        /// 线程加载监控平台
        /// </summary>
        private static void LoadMonitorTimer_Elapsed()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            System.Threading.Thread.Sleep(CgwConst.Thread_Sleep_Time);
            SmcErr smcErr = new SmcErr();
            try
            {

                smcErr = MonitorManageService.Instance().Load();
                if (false == smcErr.IsSuccess())
                {
                    logEx.Error("MonitorManageService Start failed! Errno :{0}", smcErr.ErrNo);
                    NLog.LogManager.Flush();
                    System.Diagnostics.Process.GetCurrentProcess().Kill();
                }
            }
            catch (Exception ex)
            {
                logEx.Fatal(ex, "MonitorManageService LoadMonitor Failed!");
                NLog.LogManager.Flush();
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:25,代码来源:Program.cs


示例6: GetCustomTree

        /// <summary>
        /// 获取自定义设备列表
        /// </summary>
        /// <returns>成功返回对象列表,失败返回null</returns>
        public List<Resource> GetCustomTree()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyHttpClient.GetCustomTree().");

            //设置访问天地伟业登陆接口的uri
            string requestUrl = string.Format(
                                "{0}/GetCustomTree.jsp?CurrentUserId={1}&UserId={2}&Password={3}",
                                this.serverUrl,
                                this.user,
                                this.user,
                                pwd);
            //日志不能记密码,单独处理
            string logString = string.Format(
                                "{0}/GetCustomTree.jsp?CurrentUserId={1}&UserId={2}&Password=******",
                                this.serverUrl,
                                this.user,
                                this.user);

            logEx.Trace("Call function TiandyHttpClient.GetResourceTree({0}).", logString);
            List<Resource> resources = GetResourceTree(requestUrl);

            return resources;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:28,代码来源:TiandyHttpClient.cs


示例7: GetAllCamerasTimer

        /// <summary>
        /// 获取摄像头列表及分组信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetAllCamerasTimer(object sender, System.Timers.ElapsedEventArgs e)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.GetAllCamerasTimer().");

            if (refreshMonitorCameraOperateLock.TryEnterWriteLock(CgwConst.EFRESH_MONITOR_CAMERA_WAIT_TIME))
            {
                try
                {
                    GetAllCamerasMethod();
                }
                finally
                {
                    refreshMonitorCameraOperateLock.ExitWriteLock();
                }
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:22,代码来源:TiandyVideoMonitor.cs


示例8: ClearCamera

        /// <summary>
        /// 清除缓存数据
        /// </summary>
        private void ClearCamera()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.ClearCamera().");
            if (this.cameraOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    this.tiandyCameraDictionary = new Dictionary<string, TiandyCamera>();
                    this.hostDictionary = new Dictionary<string, Host>();
                    this.mediaServerDictionary = new Dictionary<string, MediaServer>();

                    this.groupDic = new Dictionary<string, CameraGroup>();
                    this.nodeRelationList = new List<NodeRelation>();
                }
                finally
                {
                    this.cameraOperateLock.ExitWriteLock();
                }
            }
            logEx.Trace("Clear Camera which in the cache success.");
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:25,代码来源:TiandyVideoMonitor.cs


示例9: StopReceiveVideo

        /// <summary>
        /// 停止预览
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <returns>成功返回0,失败返回错误码</returns>
        public SmcErr StopReceiveVideo(string cameraNo)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.StopReceiveVideo({0}).", cameraNo);
            SmcErr err = new CgwError();

            //需要停止的预览句柄
            int needToStopHandel = CgwConst.START_RECEIVE_VIDEO_DATA_FAILED;
            if (this.handelOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    if (this.cameraVideoHandeDic.ContainsKey(cameraNo))
                    {
                        needToStopHandel = this.cameraVideoHandeDic[cameraNo];
                        this.videoHandleCameraDic.Remove(needToStopHandel);
                        this.cameraVideoHandeDic.Remove(cameraNo);
                    }
                    else
                    {
                        //不存在,表示已经删除,不返回错误
                        //err.SetErrorNo(CgwError.STOP_RECEIVE_VIDEO_FAILED);
                        logEx.Warn("Stop Receive camera video data failed. Don't need to end the preview.Camera No:{0}.", cameraNo);
                    }
                }
                finally
                {
                    this.handelOperateLock.ExitWriteLock();
                }
            }

            //调用sdk的停止方法,放在handelOperateLock外面,防止长时间占用锁
            if (needToStopHandel != CgwConst.START_RECEIVE_VIDEO_DATA_FAILED)
            {
                this.sdkClient.StopReceiveVideo(needToStopHandel);
            }

            logEx.Info("Stop Receive camera video data success.Camera No:{0},Handle:{1}.", cameraNo, needToStopHandel);
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:45,代码来源:TiandyVideoMonitor.cs


示例10: StartReceiveVideo

        /// <summary>
        /// 启动摄像头预览
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <returns></returns>
        public SmcErr StartReceiveVideo(string cameraNo)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.StartReceiveVideo({0}).", cameraNo);
            SmcErr err = new CgwError();

            TiandyCamera camera = null;
            Host host = null;

            //摄像头所连接的流媒体服务器
            MediaServer cameraMediaServer = null;
            if (this.cameraOperateLock.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    if (!this.tiandyCameraDictionary.ContainsKey(cameraNo))
                    {
                        err.SetErrorNo(CgwError.CAMERA_NOT_FOUND);
                        logEx.Error("Start Receive camera video data failed.Camera No is not found.Camera No:{0}", cameraNo);
                        return err;
                    }
                    camera = this.tiandyCameraDictionary[cameraNo];
                    host = this.hostDictionary[camera.HostNo];
                    cameraMediaServer = this.mediaServerDictionary[host.MediaServerNo];
                }
                catch (Exception e)
                {
                    err.SetErrorNo(CgwError.START_RECEIVE_VIDEO_FAILED);
                    logEx.Error("Start Receive camera video data failed.Camera No:{0},Execption message:{1}", cameraNo, e.Message);
                    return err;
                }
                finally
                {
                    this.cameraOperateLock.ExitReadLock();
                }
            }

            if (camera == null)
            {
                err.SetErrorNo(CgwError.START_RECEIVE_VIDEO_FAILED);
                logEx.Error("Start Receive camera video data failed.Camera No is not found.Camera No:{0}", cameraNo);
                return err;
            }

            RealPlayInfo real = new RealPlayInfo();
            real.ch = camera.Channel;
            real.data_type = (int)TiandyDateType.PRIMARY;
            real.hPlayWnd = null;

            int result = this.sdkClient.StartReceiveVideo(host.No, cameraMediaServer, ref real);

            //如果为负数,表示预览失败
            if (result < 0)
            {
                err.SetErrorNo(CgwError.START_RECEIVE_VIDEO_FAILED);
                logEx.Error("Start Receive camera video data failed.Camera No:{0}.", cameraNo);
                return err;
            }
            else
            {
                //需要停止的预览句柄
                int needToStopHandel = CgwConst.START_RECEIVE_VIDEO_DATA_FAILED;
                if (this.handelOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
                {
                    try
                    {
                        //如果预览句柄已经存在,删除掉原来的句柄,用新的句柄替换
                        if (this.cameraVideoHandeDic.ContainsKey(cameraNo))
                        {
                            needToStopHandel = this.cameraVideoHandeDic[cameraNo];
                            this.videoHandleCameraDic.Remove(needToStopHandel);
                            this.cameraVideoHandeDic.Remove(cameraNo);
                        }
                        this.cameraVideoHandeDic.Add(cameraNo, result);
                        this.videoHandleCameraDic.Add(result, cameraNo);
                    }
                    finally
                    {
                        this.handelOperateLock.ExitWriteLock();
                    }
                }
                logEx.Info("Start Receive camera video data success.Camera No:{0},Handle:{1}.", cameraNo, result);
                //重新预览后,更新了预览句柄,需要将原来的预览停止,放在handelOperateLock外面,防止长时间占用锁
                if (needToStopHandel != CgwConst.START_RECEIVE_VIDEO_DATA_FAILED)
                {
                    this.sdkClient.StopReceiveVideo(needToStopHandel);
                }
            }

            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:96,代码来源:TiandyVideoMonitor.cs


示例11: SetDataCallBackFunc

 /// <summary>
 /// 指定码流回调函数
 /// </summary>
 /// <param name="videoDataCallBack"></param>
 /// <param name="sender"></param>
 public void SetDataCallBackFunc(DataCallBack dataCallBack, string sender)
 {
     NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
     logEx.Trace("Enter: TiandyVideoMonitor.SetDataCallBackFunc().");
     this.dataCallBack = dataCallBack;
     this.sender = sender;
 }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:12,代码来源:TiandyVideoMonitor.cs


示例12: Load

        /// <summary>
        /// 初始化天地伟业监控平台
        /// </summary>
        /// <param name="monitorConfigElement">监控平台配置节点</param>
        /// <returns></returns>
        public SmcErr Load(XmlElement monitorConfigElement)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.Load().");
            SmcErr err = new CgwError();

            string userLevel = "";
            //解析xml节点,获取所需参数
            try
            {
                #region Tiandy视频监控平台(Easy7)连接信息
                this.monitorId = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.ID_TAG);

                userLevel = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.PTZCONTROLLEVEL_TAG);

                string httpUser = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.PLATFORM_USER_TAG);

                string httpPassword = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.PLATFORM_PASSWORD_TAG);

                string httpUrl = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.PLATFORM_URL_TAG);

                string mediaServerId = CommonFunction.GetSingleNodeValue(monitorConfigElement, CgwConst.MEDIASERVER_SERVERID_TAG);
                #endregion
                this.httpClient = new TiandyHttpClient(httpUrl, httpUser, httpPassword);

                //使用线程轮询加载监控平台
                Thread loaderThread = new Thread(LoaderThread);
                loaderThread.Start(mediaServerId);

            }
            catch (Exception e)
            {
                err.SetErrorNo(CgwError.MONITOR_CONFIG_FILE_INVALID);
                logEx.Error("Load Tiandy monitor failed.Execption message:{0}.", e.Message);
                return err;
            }

            this.sdkClient = new TiandySdkClient();
            //如果控制级别配置错误,只记录错误日志,不向外报错
            try
            {
                this.sdkClient.PtzControlLevel = int.Parse(userLevel);
            }
            catch (Exception e)
            {
                logEx.Error("Ptz Control Level is invalid.Execption message:{0}.", e.Message);
                this.sdkClient.PtzControlLevel = CgwConst.PTZ_CONTROL_LEVEL;
            }
            logEx.Info("Load video monitor success.Monitor id:{0}.", this.monitorId);
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:56,代码来源:TiandyVideoMonitor.cs


示例13: StopReceiveVideo

        /// <summary>
        /// 停止预览
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <returns>成功返回0,失败返回错误码</returns>
        public SmcErr StopReceiveVideo(string cameraNo)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: IvsVideoMonitor.StopReceiveVideo({0}).", cameraNo);
            SmcErr err = new CgwError();
            //需要停止的预览句柄
            int needToStopHandel = CgwConst.START_RECEIVE_VIDEO_DATA_FAILED;
            if (this.handelOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    if (this.cameraVideoHandeDic.ContainsKey(cameraNo))
                    {
                        needToStopHandel = this.cameraVideoHandeDic[cameraNo];
                        this.videoHandleCameraDic.Remove(needToStopHandel);
                        this.cameraVideoHandeDic.Remove(cameraNo);
                    }
                    else
                    {
                        logEx.Warn("Stop Receive camera video data failed. Don't need to end the preview.Camera No:{0}.", cameraNo);
                        //如果预览句柄不存在,不需要处理,直接返回
                        return err;
                    }
                }
                catch (Exception ex)
                {
                    err.SetErrorNo(CgwError.STOP_RECEIVE_VIDEO_FAILED);
                    logEx.Error("Stop Receive camera video data failed.Execption message:{0}", ex.Message);
                    return err;
                }
                finally
                {
                    this.handelOperateLock.ExitWriteLock();
                }
            }

            //调用sdk的停止方法,放在handelOperateLock外面,防止长时间占用锁
            if (needToStopHandel != CgwConst.START_RECEIVE_VIDEO_DATA_FAILED)
            {
                int result = this.ivsSdkClient.StopRealPlay(needToStopHandel);
                //如果不为0,表示预览失败
                if (result != CgwConst.IVS_SDK_SUCCESS_TAG)
                {
                    err.SetErrorNo(CgwError.STOP_RECEIVE_VIDEO_FAILED);
                    logEx.Error("Stop Receive camera video data failed.Ivs sdk error code:{0}", result);
                    return err;
                }
                logEx.Info("Stop Receive camera video data success.Camera No:{0},Handle:{1}.", cameraNo, needToStopHandel);
            }

            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:57,代码来源:IvsVideoMonitor.cs


示例14: StopControlPtz

 /// <summary>
 /// 停止云台控制,摄像头控制
 /// </summary>
 /// <param name="cameraNo">摄像头编号</param>
 /// <param name="ptzCommand">命令类型</param>
 /// <returns></returns>
 public SmcErr StopControlPtz(string cameraNo, PtzCommandType ptzCommand)
 {
     NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
     logEx.Trace("Enter: IvsVideoMonitor.StopControlPtz({0}).", cameraNo);
     SmcErr err = new CgwError();
     logEx.Trace("Call ivsSdkClient.StopPtzControl({0}).", cameraNo);
     int result = this.ivsSdkClient.StopPtzControl(cameraNo);
     //如果为0,表示成功
     if (result == CgwConst.IVS_SDK_SUCCESS_TAG)
     {
         logEx.Info("Stop control ptz success.Camera No:{0}.", cameraNo);
     }
     else
     {
         //直接将IVS的错误码返回
         err.SetErrorNo(CgwError.STOP_CONTROL_PTZ_FAILED);
         logEx.Error("Stop control ptz failed.Camera No:{0}.Ivs sdk error code:{1}.", cameraNo, result);
         return err;
     }
     return err;
 }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:27,代码来源:IvsVideoMonitor.cs


示例15: StartReceiveVideo

        /// <summary>
        /// 启动摄像头预览
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <returns></returns>
        public SmcErr StartReceiveVideo(string cameraNo)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: IvsVideoMonitor.StartReceiveVideo({0}).", cameraNo);
            SmcErr err = new CgwError();
            int handle;
            logEx.Trace("Call ivsSdkClient.StartRealPlayCBRaw({0}).", cameraNo);
            int result = this.ivsSdkClient.StartRealPlayCBRaw(cameraNo, out handle);

            //如果不为0,表示预览失败
            if (result != CgwConst.IVS_SDK_SUCCESS_TAG)
            {
                err.SetErrorNo(CgwError.START_RECEIVE_VIDEO_FAILED);
                logEx.Error("Start Receive camera video data failed.Camera No:{0}.Ivs sdk error code:{1}", cameraNo, result);
                return err;
            }
            else
            {
                logEx.Info("Start Receive camera video data success.Camera No:{0},Handle:{1}.", cameraNo, handle);
            }

            //预览成功,需要停止原来的预览,并将预览句柄添加到缓存
            //需要停止的预览句柄
            int needToStopHandel = CgwConst.START_RECEIVE_VIDEO_DATA_FAILED;
            if (this.handelOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    //如果预览句柄已经存在,删除掉原来的句柄,用新的句柄替换
                    if (this.cameraVideoHandeDic.ContainsKey(cameraNo))
                    {
                        needToStopHandel = this.cameraVideoHandeDic[cameraNo];
                        this.videoHandleCameraDic.Remove(needToStopHandel);
                        this.cameraVideoHandeDic.Remove(cameraNo);
                    }
                    this.cameraVideoHandeDic.Add(cameraNo, handle);
                    MediaDataSender mediaDataSender = new MediaDataSender(cameraNo, this.dataCallBack);
                    this.videoHandleCameraDic.Add(handle, mediaDataSender);
                }
                finally
                {
                    this.handelOperateLock.ExitWriteLock();
                }
            }

            //重新预览后,更新了预览句柄,需要将原来的预览停止,放在handelOperateLock外面,防止长时间占用锁
            if (needToStopHandel != CgwConst.START_RECEIVE_VIDEO_DATA_FAILED)
            {
                result = this.ivsSdkClient.StopRealPlay(needToStopHandel);
                //如果不为0,表示停止原来的预览失败,只记录日志,不返回错误,不设置错误码
                if (result != CgwConst.IVS_SDK_SUCCESS_TAG)
                {
                    logEx.Error("Get a new preview success. But stop old preview failed.CameraNo:{0},Ivs sdk error code:{0}", cameraNo, result);
                    return err;
                }
            }

            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:64,代码来源:IvsVideoMonitor.cs


示例16: GetAllCameras

        /// <summary>
        /// 获取摄像头列表及分组信息
        /// </summary>
        /// <param name="fromMonitorSys">如果该值为true,则实时从监控平台获取,否则从融合网关缓存获取</param>
        /// <param name="cameraList">摄像头列表</param>
        /// <param name="groupList">组信息</param>
        /// <param name="nodeRelationListT">分组关系</param>
        /// <returns></returns>
        public SmcErr GetAllCameras(out List<Camera> cameraList, out List<CameraGroup> groupList, out List<NodeRelation> nodeRelationListT)
        {
            monitorManageServiceGetCameraList.Stop();
            isGetDevicesFinish = false;

            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.GetAllCameras().");
            SmcErr err = new CgwError();
            cameraList = new List<Camera>();
            groupList = new List<CameraGroup>();
            nodeRelationListT = new List<NodeRelation>();

            if (this.cameraOperateLock.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    #region 深度克隆数据
                    foreach (KeyValuePair<string, TiandyCamera> tiandyCameraKeyValue in this.tiandyCameraDictionary)
                    {
                        TiandyCamera tiandyCamera = tiandyCameraKeyValue.Value;
                        //从缓存获取
                        Camera camera = new Camera(tiandyCamera.No, tiandyCamera.Name);
                        cameraList.Add(camera);
                    }
                    foreach (KeyValuePair<string, CameraGroup> groupDicKeyValue in this.groupDic)
                    {
                        CameraGroup cameraGroupTemp = new CameraGroup(groupDicKeyValue.Value.No, groupDicKeyValue.Value.Name);
                        groupList.Add(cameraGroupTemp);
                    }

                    foreach (NodeRelation nodeRelation in this.nodeRelationList)
                    {
                        NodeRelation nodeRelationTemp = new NodeRelation(nodeRelation.No,
                                                                          nodeRelation.Path,
                                                                          nodeRelation.Type);
                        nodeRelationListT.Add(nodeRelationTemp);
                    }
                    #endregion
                }
                catch (Exception e)
                {
                    err.SetErrorNo(CgwError.GET_ALL_CAMERAS_FAILED);
                    logEx.Error("Get all cameras failed.Execption message:{0}", e.Message);
                    return err;
                }
                finally
                {
                    this.cameraOperateLock.ExitReadLock();
                }
            }
            monitorManageServiceGetCameraList.Start();
            logEx.Info("Get all cameras success.");
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:62,代码来源:TiandyVideoMonitor.cs


示例17: GetRefreshStatus

        /// <summary>
        /// 获取监控摄像头列表刷新状态,返回结果为0是表示刷新完毕,为1是刷新操作中。当查询刷新状态为0时,可调用获取监控摄像头列表接口,获取刷新后监控摄像头列表
        /// </summary>
        /// <param name="refreshStatus">刷新状态</param>
        /// <returns></returns>
        public SmcErr GetRefreshStatus(out SmcErr refreshStatus)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.GetRefreshStatus");
            SmcErr err = new CgwError();
            refreshStatus = new SmcErr();
            refreshStatus.ErrNo = CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_END;

            if (refreshMonitorCameraOperateLock.TryEnterWriteLock(CgwConst.EFRESH_MONITOR_CAMERA_WAIT_TIME))
            {
                try
                {
                    refreshStatus.ErrNo = isRefreshSucess ? CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_END : CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_FAILED;
                }
                finally
                {
                    refreshMonitorCameraOperateLock.ExitWriteLock();
                }
            }
            else
            {
                refreshStatus.ErrNo = CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_EXECUTING;
            }
            logEx.Info("GetRefreshStatus success.");
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:31,代码来源:TiandyVideoMonitor.cs


示例18: Unload

        /// <summary>
        /// 注销IVS监控平台资源
        /// </summary>
        /// <returns></returns>
        public SmcErr Unload()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Info("Enter: IvsVideoMonitor.Unload().");
            SmcErr err = new CgwError();

            loadResult = true;
            //停止定时器
            this.updateCameraTimer.Stop();
            logEx.Trace("Call ivsSdkClient.Logout().");
            int result = this.ivsSdkClient.Logout();
            logEx.Trace("Call ivsSdkClient.Cleanup().");
            result = this.ivsSdkClient.Cleanup();

            if (result == CgwConst.IVS_SDK_SUCCESS_TAG)
            {
                logEx.Info("Unload video monitor success.Monitor id:{0}.", this.monitorId);
            }
            else
            {
                err.SetErrorNo(CgwError.MONITOR_UDLOAD_FAILED);
                logEx.Error("Unload video monitor failed.Monitor id:{0}.", this.monitorId);
            }
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:29,代码来源:IvsVideoMonitor.cs


示例19: RefreshMonitorCamera

        /// <summary>
        /// 刷新监控摄像头列表
        /// </summary>
        /// <returns></returns>
        public SmcErr RefreshMonitorCamera()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: TiandyVideoMonitor.RefreshMonitorCamera");
            SmcErr err = new CgwError();

            if (refreshMonitorCameraOperateLock.TryEnterWriteLock(CgwConst.EFRESH_MONITOR_CAMERA_WAIT_TIME))
            {
                try
                {
                    GetAllCamerasMethod();
                    //重新开始计时
                    updateCameraTimer.Stop();
                    updateCameraTimer.Start();
                }
                finally
                {
                    refreshMonitorCameraOperateLock.ExitWriteLock();
                }
            }
            logEx.Info("RefreshMonitorCamera success.");
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:27,代码来源:TiandyVideoMonitor.cs


示例20: ClearCamera

 /// <summary>
 /// 清除缓存数据
 /// </summary>
 private void ClearCamera()
 {
     NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
     logEx.Trace("Enter: IvsVideoMonitor.ClearCamera().");
     if (this.cameraOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
     {
         try
         {
             this.cameraList = new List<Camera>();
             this.groupList = new List<CameraGroup>();
             this.nodeRelationList = new List<NodeRelation>();
         }
         finally
         {
             this.cameraOperateLock.ExitWriteLock();
         }
     }
     logEx.Trace("Clear Camera which in the cache success.");
 }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:22,代码来源:IvsVideoMonitor.cs



注:本文中的NLogEx.LoggerEx类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NPC类代码示例发布时间:2022-05-24
下一篇:
C# NLog类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap