/// <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: CgwService.GetRefreshStatus"); refreshStatus = new SmcErr(); refreshStatus.ErrNo = CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_END; SmcErr err = new CgwError(); err = CheckSession(); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().GetRefreshStatus(out refreshStatus); } else { refreshStatus.ErrNo = CgwError.ERR_DEVICE_LIST_REFRESH_STATUS_FAILED; } if (err.IsSuccess()) { logEx.Info("SMC GetRefreshStatus Success,Current SMC IP is : {0}, refreshStatus : {1}", CgwConst.SmcIp, refreshStatus.ErrNo); } else { logEx.Error("SMC GetRefreshStatus Failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// 同步通道信息 /// </summary> /// <param name="ChannelInfoList">通道列表</param> /// <returns></returns> public SmcErr SyncMonitorChannel(ref 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(ref channelInfoList); } else { err.SetErrorNo(CgwError.ERR_CGW_BUSINESS_CHANNELLIST_NULL); } } if (err.IsSuccess()) { logEx.Info("SMC SyncMonitorChannel Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC SyncMonitorChannel failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// Disconnect monitorPlat /// </summary> /// <returns></returns> public Cgw.SmcError.SmcErr DisconnectMonitor() { NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); SmcErr err = new SmcErr(); err = MonitorChannelBll.Instance().Disconnect(); if (err.IsSuccess()) { logEx.Info("CgwService.Disconnect Successful !"); } return(err); }
/// <summary> /// 线程Unload cgw /// </summary> /// <returns></returns> public SmcErr StopAllStream() { SmcErr err = new SmcErr(); NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); //Stop VideoData err = MonitorChannelBll.Instance().StopAllStream(); if (err.IsSuccess()) { logEx.Info("UnLoad CgwService Successful !"); } else { logEx.Fatal("UnLoad CgwService Failed, ErrNo : {0}!", err.ErrNo); } return(err); }
/// <summary> /// 线程加载cgw /// </summary> /// <returns></returns> public SmcErr Load() { SmcErr err = new SmcErr(); NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); //初始化监控平台 err = MonitorChannelBll.Instance().Load(); if (err.IsSuccess()) { logEx.Trace("Load CgwService Successful !"); isLoadSuccess = true; } else { logEx.Fatal("Load CgwService Failed, ErrNo : {0}!", err.ErrNo); } return(err); }
/// <summary> /// 设置扬声器 /// </summary> /// <param name="cameraNo"></param> /// <param name="isOn"></param> /// <returns></returns> public SmcErr SetSpeaker(string channelLabel, string cameraNo, bool isOn) { SmcErr err = new CgwError(); err = CheckSession(); NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().SetSpeaker(channelLabel, cameraNo, isOn); } if (err.IsSuccess()) { logEx.Info("SMC StartControlPtz Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC StartControlPtz failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// 关闭PTZ操作 /// </summary> /// <param name="Camerano">摄像头</param> /// <returns></returns> public SmcErr StopControlPtz(string cameraNo, PtzCommandType ptzCommandType) { SmcErr err = new CgwError(); NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); err = CheckSession(); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().StopControlPtz(cameraNo, ptzCommandType); } if (err.IsSuccess()) { logEx.Info("SMC StopPTZ Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC StopPTZ failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <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.Info("SMC SwitchChannelVideoSource Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC SwitchChannelVideoSource failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// 导入网关license文件 /// </summary> /// <param name="license"></param> /// <returns></returns> public SmcErr ImportCGWLicense(string license) { NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); logEx.Trace("Enter: CgwService.ImportCGWLicense"); SmcErr err = new CgwError(); err = CheckSession(); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().ImportCGWLicense(license); } if (err.IsSuccess()) { logEx.Info("SMC ImportCGWLicense Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC ImportCGWLicense failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// 刷新监控摄像头列表 /// </summary> /// <returns></returns> public SmcErr RefreshMonitorCamera() { NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); logEx.Trace("Enter: CgwService.RefreshMonitorCamera"); SmcErr err = new CgwError(); err = CheckSession(); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().RefreshMonitorCamera(); } if (err.IsSuccess()) { logEx.Info("SMC RefreshMonitorCamera Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC RefreshMonitorCamera failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// 获取监控设备列表 /// </summary> /// <param name="CameraInfoList">摄像头基本信息</param> /// <param name="CameraGroupList">组基本信息</param> /// <param name="nodeRelationList">所属分组关系信息</param> /// <returns></returns> public SmcErr QueryMonitorCamera(PlatformType platformType, PageParam pageParam, out List <Camera> cameraInfoList, out List <CameraGroup> cameraGroupList, out List <NodeRelation> nodeRelationList, out PagesInfo pagesInfo) { SmcErr err = new CgwError(); NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log); cameraInfoList = null; cameraGroupList = null; nodeRelationList = null; pagesInfo = null; err = CheckSession(); if (err.IsSuccess()) { err = MonitorChannelBll.Instance().QueryMonitorCamera(platformType, pageParam, out cameraInfoList, out cameraGroupList, out nodeRelationList, out pagesInfo); } if (err.IsSuccess()) { logEx.Info("SMC QueryMonitorCamera Successful,Current SMC IP is : {0}", CgwConst.SmcIp); } else { logEx.Error("SMC QueryMonitorCamera failed,ErrNo :{0}", err.ErrNo); } return(err); }
/// <summary> /// LicenseInit /// </summary> public void LicenseInit() { MonitorChannelBll.Instance().LicenseInit(); }