Example #1
0
        /// <summary>
        /// 获取监控设备列表,返回摄像头基本信息,组基本信息,所属分组关系信息
        /// </summary>
        public SmcErr QueryMonitorCamera(Cgw.Common.PlatformType platformType, Cgw.Common.PageParam pageParam, out List <Common.Camera> CameraInfoList, out List <Common.CameraGroup> CameraGroupList, out List <Common.NodeRelation> nodeRelationList, out Cgw.Common.PagesInfo pagesInfo)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            SmcErr          err   = new SmcErr();

            CameraInfoList   = null;
            CameraGroupList  = null;
            nodeRelationList = null;
            pagesInfo        = null;
            if (serviceControl.MonitorServiceRun())
            {
                try
                {
                    err = CgwMonitorManageAdapter.Instance().GetAllCameras(platformType, pageParam, out CameraInfoList, out CameraGroupList, out nodeRelationList, out pagesInfo, licenseInfo);
                }
                catch (Exception ex)
                {
                    logEx.Trace("QueryMonitorCamera.Exception = {0}", ex.ToString());
                }
            }
            else
            {
                err.SetErrorNo(Cgw.SmcError.CgwError.ERR_MONITOR_MANAGE_SERVICE_RESTARTING);
            }
            //日志记录
            if (err.IsSuccess())
            {
                logEx.Trace("QueryMonitorCamera Successful");
            }
            else
            {
                logEx.Error("QueryMonitorCamera failed,ErrNo :{0}", err.ErrNo);
            }
            return(err);
        }
Example #2
0
 /// <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;
 }