CgwMonitorManage.T28181.T28181VideoMonitor.T28181VideoMonitor C# (CSharp) Method

T28181VideoMonitor() public method

构造函数,设置查询摄像机线程属性
public T28181VideoMonitor ( ) : System
return System
        public T28181VideoMonitor()
        {
            //初始话定时器
            this.updateCameraTimer.AutoReset = true;
            this.updateCameraTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllCamerasTimer);
            //摄像头变化不会太快,间隔时间暂定为1小时
            this.updateCameraTimer.Interval = CgwConst.REFRESH_CAMERA_LIST_WAIT_TIME;

            //定时刷新日志
            //this.flushLogTimer.AutoReset = true;
            //this.flushLogTimer.Elapsed += new System.Timers.ElapsedEventHandler((sender, args) => { NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); logEx.Flush(); });
            //this.updateCameraTimer.Interval = 1000;
            //获取配置文件中刷新设备列表超时时间(s)
            if (!uint.TryParse(ConfigSettings.RefrshDeviceListOverTime, out refreshDeviceListOverTime))
            {
                //缺省为180秒钟
                refreshDeviceListOverTime = 180;
            }

            //获取配置文件中设备列表未被使用超时时间(s)
            if (!uint.TryParse(ConfigSettings.DeviceListUnusedOverTime, out deviceListUnusedOverTime))
            {
                //缺省为5秒钟
                deviceListUnusedOverTime = 5;
            }

            monitorManageServiceGetCameraList.AutoReset = true;
            monitorManageServiceGetCameraList.Elapsed += new System.Timers.ElapsedEventHandler(monitorManageServiceGetCameraList_Elapsed);
            monitorManageServiceGetCameraList.Interval = deviceListUnusedOverTime * 1000;
            monitorManageServiceGetCameraList.Start();
        }