wu_xinjun
2022-03-04 6d4be793db7bfe31ad12b10c9468d4ef1a5e8f52
src/engine/AcquisitionMain.py
@@ -7,6 +7,7 @@
import queue
import requests
import time
import threading
from .CaptureThread import CaptureThread
from .ControllThread import ControllThread
@@ -240,8 +241,8 @@
        # connecting to camera via opencv
        cc.open_cameras()
        # capture the data, and wrap it to data queue
        cc._start_captureThread()
        pass
        # cc._start_captureThread()
    def connecting_microwave(self):
        pass
@@ -252,14 +253,31 @@
    def run_all(self):
        # connecting to MQ server,launching the message delivery queues
        self.run_rabbitmq()
        # connecting to devices and wrap data to the corressponding queue
        self.run_device()
    def stop_all(self):
        self._stop_alarm_state_up_msg_sender_thread()
        self._stop_device_state_up_msg_sender_thread()
        self._stop_command_request_receiver_thread()
        self._start_command_response_sender_thread()
    def start(self):
        self.run_all()
        try:
            self.run_all()
            self._device_state_sender_thread.join()
        except Exception as e:
            print("running error, stop all threads")
        self._stop_alarm_state_up_msg_sender_thread()
        self.stop
        print("main thread end.")