oldwine 3 mesi fa
parent
commit
70068f4424
1 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 8 4
      models/billet_trace_pusher.py

+ 8 - 4
models/billet_trace_pusher.py

@@ -15,6 +15,8 @@ class Trace_pusher:
         self.hostsend_flag = hostsend_flag
         self.hostmove_flag = hostmove_flag
         
+        self.heat_filter_index = 1
+        self.heat_filter = ["00000000"] + ['' for i in range(9)]
         self.old_heatNo = "00000000"
         self.current_heatNo = "00000000"
         self.old_heatData = {}
@@ -167,10 +169,9 @@ class Trace_pusher:
         self.billet_in_buffer_action(i)
 
     def billet_in_buffer_action(self, i):
-        time.sleep(1)
         with self.locks[i]:
             if self.strands_cutting[i]:
-                time.sleep(10)
+                time.sleep(12)
                 self.logger.info(f"[TRACE]{i+1}流新增钢坯存储")
                 self.strands_buffer[i] = self.strands_cutting[i]
                 self.strands_cutting[i] = []
@@ -185,6 +186,7 @@ class Trace_pusher:
             self.barrier_up_action(i)
 
     def barrier_up_action(self, i):
+        time.sleep(1)
         with self.locks[i]:
             if self.strands_buffer[i]:
                 self.barrier_checker[i] = True
@@ -201,7 +203,7 @@ class Trace_pusher:
         if self.hostsend_flag and self.hostsend_barrier[i].state:
             self.hostsend_barrier_up_action(i)
 
-            
+
     def barrier_down_action(self, i):
         if self.barrier_checker[i]:
             self.logger.debug(f"[TRACE]{i+1}流挡板关闭")
@@ -239,7 +241,7 @@ class Trace_pusher:
 
             if gp_tmp:
                 self.logger.info(f"[TRACE]{i+1}流钢坯热送")
-                if not (gp_tmp[0].startswith(self.current_heatNo) or gp_tmp[0].startswith(self.old_heatNo)):
+                if gp_tmp[0][:8] not in self.heat_filter:
                     self.change_heat(gp_tmp)
                 if not gp_tmp[0].startswith('0'):
                     self.hostsend(gp_tmp)
@@ -250,6 +252,8 @@ class Trace_pusher:
         self.old_heatData = self.current_heatData
         self.current_heatNo = data[0][:8]
         self.current_heatData = data[1]
+        self.heat_filter[self.heat_filter_index] = self.current_heatNo
+        self.heat_filter_index = (self.heat_filter_index + 1) % 10
         # 上一炉终止信号在这里发
         self.total = 0
         self.strand = [0, 0, 0, 0, 0, 0, 0, 0]