예제 #1
0
        /// <summary>
        /// 同步通道信息
        /// </summary>
        /// <param name="ChannelInfoList">通道列表</param>
        /// <returns></returns>
        public SmcErr SyncMonitorChannel(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().SyncMonitorChannel(ChannelInfoList);
                }
                else
                {
                    err.SetErrorNo(CgwError.ERR_CGW_BUSINESS_CHANNELLIST_NULL);
                }
            }
            if (err.IsSuccess())
            {
                logEx.Trace("SyncMonitorChannel Successful");
            }
            else
            {
                logEx.Error("SyncMonitorChannel failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }
예제 #2
0
        /// <summary>
        /// 初始化融合网管服务
        /// </summary>
        public void InitService()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            //初始化监控平台
            SmcErr err = new SmcErr();

            err = MonitorChannelBll.Instance().LoadMonitor();
            if (err.IsSuccess())
            {
                logEx.Trace("Load VideoMonitor Successful !");
            }
            else
            {
                logEx.Fatal("Load VideoMonitor Failed, ErrNo : {0}!", err.ErrNo);
            }
        }
예제 #3
0
        /// <summary>
        /// 关闭PTZ操作
        /// </summary>
        /// <param name="Camerano">摄像头</param>
        /// <returns></returns>
        public SmcErr StopPTZ(string Camerano)
        {
            SmcErr err = new CgwError();

            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            err = CheckSession();
            if (err.IsSuccess())
            {
                err = MonitorChannelBll.Instance().StopPTZ(Camerano);
            }
            if (err.IsSuccess())
            {
                logEx.Trace("StopPTZ Successful");
            }
            else
            {
                logEx.Error("StopPTZ failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }
예제 #4
0
        /// <summary>
        /// 开始PTZ操作
        /// </summary>
        /// <param name="cameraNo">摄像头NO</param>
        /// <param name="ptzCommand">操作类型</param>
        /// <param name="param">命令参数</param>
        /// <returns></returns>
        public SmcErr StartControlPtz(string cameraNo, PtzCommandType ptzCommand, int param)
        {
            SmcErr err = new CgwError();

            err = CheckSession();
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            if (err.IsSuccess())
            {
                err = MonitorChannelBll.Instance().StartControlPtz(cameraNo, ptzCommand, param);
            }
            if (err.IsSuccess())
            {
                logEx.Trace("StartControlPtz Successful");
            }
            else
            {
                logEx.Error("StartControlPtz failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }
예제 #5
0
        /// <summary>
        /// 设置监控通道视频源
        /// </summary>
        /// <param name="channelLabel">通道label</param>
        /// <param name="cameraNo">摄像头NO</param>
        /// <returns></returns>
        public SmcErr SwitchChannelVideoSource(string channelLabel, string cameraNo)
        {
            SmcErr err = new CgwError();

            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            err = CheckSession();
            if (err.IsSuccess())
            {
                err = MonitorChannelBll.Instance().SwitchChannelVideoSource(channelLabel, cameraNo);
            }
            if (err.IsSuccess())
            {
                logEx.Trace("SwitchChannelVideoSource Successful");
            }
            else
            {
                logEx.Error("SwitchChannelVideoSource failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }
예제 #6
0
        /// <summary>
        /// 获取监控设备列表
        /// </summary>
        /// <param name="CameraInfoList">摄像头基本信息</param>
        /// <param name="CameraGroupList">组基本信息</param>
        /// <param name="nodeRelationList">所属分组关系信息</param>
        /// <returns></returns>
        public SmcErr QueryMonitorCamera(out List <Camera> CameraInfoList, out List <CameraGroup> CameraGroupList, out List <NodeRelation> nodeRelationList)
        {
            SmcErr err = new CgwError();

            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            CameraInfoList   = null;
            CameraGroupList  = null;
            nodeRelationList = null;
            err = CheckSession();
            if (err.IsSuccess())
            {
                err = MonitorChannelBll.Instance().QueryMonitorCamera(out CameraInfoList, out CameraGroupList, out nodeRelationList);
            }
            if (err.IsSuccess())
            {
                logEx.Trace("SyncMonitorChannel Successful");
            }
            else
            {
                logEx.Error("SyncMonitorChannel failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }