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

GetAllCameras() public method

获取摄像头列表及分组信息
public GetAllCameras ( List &cameraList, List &groupList, List &nodeRelationList ) : SmcErr
cameraList List 摄像头列表
groupList List 组信息
nodeRelationList List 分组关系
return CgwMonitorManage.SmcError.SmcErr
        public SmcErr GetAllCameras(out List<Camera> cameraList, out List<CameraGroup> groupList, out List<NodeRelation> nodeRelationList)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: T28181VideoMonitor.GetAllCameras().");

            SmcErr err = new CgwError();
            cameraList = new List<Camera>();
            groupList = new List<CameraGroup>();
            nodeRelationList = new List<NodeRelation>();

            if (this.cameraOperateLock.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    #region 深度克隆数据
                    foreach (Camera ivsCamera in this.cameraList)
                    {
                        //从缓存获取
                        Camera camera = new Camera(ivsCamera.No, ivsCamera.Name);
                        camera.Status = ivsCamera.Status;
                        cameraList.Add(camera);
                    }
                    foreach (CameraGroup cameraGroup in this.groupList)
                    {
                        CameraGroup cameraGroupTemp = new CameraGroup(cameraGroup.No, cameraGroup.Name);
                        groupList.Add(cameraGroupTemp);
                    }
                    foreach (NodeRelation nodeRelation in this.nodeRelationList)
                    {
                        NodeRelation nodeRelationTemp = new NodeRelation(nodeRelation.No, nodeRelation.Path, nodeRelation.Type);
                        nodeRelationList.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();
                }
            }
            logEx.Debug("cameraList.{0}", cameraList.Count);
            logEx.Debug("groupList.{0}", groupList.Count);
            logEx.Debug("nodeRelationList.{0}", nodeRelationList.Count);
            logEx.Debug("Get all cameras success.");
            return err;
        }