예제 #1
0
        public CameraDevice this[int id]
        {
            get
            {
                CameraDevice cameraDevice = Find(id);
                if (cameraDevice == null)
                {
                    Camera camera = new Camera(id, "相机" + id);
                    camera.SerialNo = "123";
                    CameraAPIHandle cameraAPIHandle = new CameraAPIHandle(camera);
                    cameraDevice = new CameraDevice();
                    cameraDevice.SetCameraHandle(cameraAPIHandle);
                    //cameraDevices.Add(cameraDevice);
                }

                return(cameraDevice);
            }
        }
예제 #2
0
        public CameraDevice Start(CtrllerBrand ctrller, string serialNo)
        {
            CameraDevice cameraDevice = Find(serialNo);

            if (cameraDevice == null)
            {
                Camera camera = new Camera(-1, "");
                camera.CtrllerBrand = ctrller;
                camera.SerialNo     = serialNo;
                camera.Name         = "相机" + serialNo;
                CameraAPIHandle cameraAPIHandle = new CameraAPIHandle(camera);
                cameraDevice = new CameraDevice();
                cameraDevice.SetCameraHandle(cameraAPIHandle);

                cameraDevice.Connect();
                cameraDevices.Add(cameraDevice);
            }

            return(cameraDevice);
        }