| | |
| | | class cameraController(object): |
| | | |
| | | def __init__(self,IMAGE_WIDTH,IMAGE_HEIGHT,CAMERA_COUNT,device_id,queue_dict): |
| | | self.image_width = IMAGE_WIDTH |
| | | self.image_height = IMAGE_HEIGHT |
| | | self.camera_count = CAMERA_COUNT |
| | | self.IMAGE_WIDTH = IMAGE_WIDTH |
| | | self.IMAGE_HEIGHT = IMAGE_HEIGHT |
| | | self.CAMERA_COUNT = CAMERA_COUNT |
| | | self.device_id = device_id |
| | | self.queue_dict = queue_dict |
| | | self.device_state_queue = self.queue_dict["device_state"] |
| | |
| | | self.working_ports.append(dev_port) |
| | | self.cameras.append(camera) |
| | | msg = f"{time.asctime()} {self.device_id} camera port {dev_port} is working and reads images ({h} x {w})" |
| | | |
| | | else: |
| | | msg = f"{time.asctime()} {self.device_id} camera port {dev_port} is not working" |
| | | msg = f"{time.asctime()} {self.device_id} camera port {dev_port} can not work" |
| | | else: |
| | | msg = f"{time.asctime()} {self.device_id} camera port {dev_port} can not found" |
| | | |
| | | # add msg to queue |
| | | self.device_state_queue.put(msg) |
| | | print(msg) |
| | | # add msg to queue |
| | | self.device_state_queue.put(msg) |
| | | print(msg) |
| | | |
| | | |
| | | def _start_captureThread(self): |