From 6d4be793db7bfe31ad12b10c9468d4ef1a5e8f52 Mon Sep 17 00:00:00 2001
From: wu_xinjun <bent20140204@outlook.com>
Date: 星期五, 04 三月 2022 17:30:55 +0800
Subject: [PATCH] second commit

---
 src/engine/AcquisitionMain.py |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/engine/AcquisitionMain.py b/src/engine/AcquisitionMain.py
index dfdbe31..1644666 100644
--- a/src/engine/AcquisitionMain.py
+++ b/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.")
+ 
+            
 
 
 

--
Gitblit v1.9.1