Beispiel #1
0
 def connectObj(self):
     # 显示图像队列
     self.connectedObj = True
     #server_addr = '0.0.0.0'
     server_addr = self.server_addr
     # 检测结果队列
     self.obj_queue_0 = Queue()
     self.obj_queue_1 = Queue()
     self.obj_queue_2 = Queue()
     self.obj_queue_3 = Queue()
     self.obj_queue_4 = Queue()
     self.obj_queue_5 = Queue()
     QueueManager.register('obj_0', callable=lambda: self.obj_queue_0)
     QueueManager.register('obj_1', callable=lambda: self.obj_queue_1)
     QueueManager.register('obj_2', callable=lambda: self.obj_queue_2)
     QueueManager.register('obj_3', callable=lambda: self.obj_queue_3)
     QueueManager.register('obj_4', callable=lambda: self.obj_queue_4)
     QueueManager.register('obj_5', callable=lambda: self.obj_queue_5)
     cambar_manager = QueueManager(address=(server_addr, 9112),
                                   authkey=b'dihuge')
     try:
         cambar_manager.start()
     except Exception as e:
         print(e)
         cambar_manager.connect()
     self.obj_0 = cambar_manager.obj_0()
     self.obj_1 = cambar_manager.obj_1()
     self.obj_2 = cambar_manager.obj_2()
     self.obj_3 = cambar_manager.obj_3()
     self.obj_4 = cambar_manager.obj_4()
     self.obj_5 = cambar_manager.obj_5()
Beispiel #2
0
 def connectShow(self):
     # 显示图像队列
     self.connectedCamShow = True
     #server_addr = '0.0.0.0'
     server_addr = self.server_addr
     # 检测结果队列
     self.show_queue = Queue()
     QueueManager.register('show', callable=lambda: self.show_queue)
     cambar_manager = QueueManager(address=(server_addr, 9111),
                                   authkey=b'dihuge')
     try:
         cambar_manager.start()
     except Exception as e:
         print(e)
         cambar_manager.connect()
     self.show = cambar_manager.show()
Beispiel #3
0
 def connectCapture(self):
     # capture queue, for plc control
     self.connectedCapture = True
     #server_addr = '0.0.0.0'
     server_addr = self.server_addr
     # 检测结果队列
     self.capture_queue = Queue()
     QueueManager.register('capture', callable=lambda: self.capture_queue)
     cambar_manager = QueueManager(address=(server_addr, 9110),
                                   authkey=b'dihuge')
     try:
         cambar_manager.start()
     except Exception as e:
         print(e)
         cambar_manager.connect()
     self.capture = cambar_manager.capture()
Beispiel #4
0
 def connectRet(self):
     # 结果队列
     self.connectedRet = True
     #server_addr = '0.0.0.0'
     server_addr = self.server_addr
     # 检测结果队列
     self.ret_queue = Queue()
     QueueManager.register('result', callable=lambda: self.ret_queue)
     camcolor_manager = QueueManager(address=(server_addr, 9113),
                                     authkey=b'dihuge')
     try:
         camcolor_manager.start()
     except Exception as e:
         print(e)
         camcolor_manager.connect()
     self.ret_sender = camcolor_manager.result()
Beispiel #5
0
 def connectButton(self):
     # 操作信息
     self.connectedButton = True
     #server_addr = '0.0.0.0'
     server_addr = self.server_addr
     # 检测结果队列
     self.button_queue = Queue()
     QueueManager.register('button_type',
                           callable=lambda: self.button_queue)
     button_manager = QueueManager(address=(server_addr, 9114),
                                   authkey=b'dihuge')
     try:
         button_manager.start()
     except Exception as e:
         print(e)
         button_manager.connect()
     self.button_type_sender = button_manager.button_type()