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); } }
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); }