Ver Fonte

调整部分出坯组坯逻辑和数字

oldwine há 10 meses atrás
pai
commit
525bcc8fd2
3 ficheiros alterados com 18 adições e 11 exclusões
  1. 10 7
      models/billet_trace_pusher.py
  2. 1 1
      models/data_sender.py
  3. 7 3
      models/overhead_crane.py

+ 10 - 7
models/billet_trace_pusher.py

@@ -134,7 +134,7 @@ class Trace_pusher:
         with self.locks[i]:
             if self.strands_buffer[i]:
                 self.barrier_checker[i] = True
-                time.sleep(5)
+                time.sleep(8)
                 billetData = self.strands_buffer[i]
                 self.strands_buffer[i] = []
                 if self.strand_position[i] <= self.pusher_left.data:
@@ -231,7 +231,7 @@ class Trace_pusher:
 
         if count == 0:
             dst[0].extend(billets)
-        elif count == 3 and len(billets) >= 4:
+        elif count == 3 and (len(billets) >= 4 or len(dst[count-1]) >= 4):
             self.logger.error(f"组坯异常!")
             flag = False
             for j in dst:
@@ -249,7 +249,7 @@ class Trace_pusher:
             self.logger.error(f"组坯异常!")
             dst[count-1].extend(billets)
             count -= 1
-        elif len(billets) >= 4:
+        elif len(billets) >= 4 or len(dst[count-1]) >= 4 or len(dst[count-1]) + len(billets) > 4:
             dst[count].extend(billets)
         else:
             dst[count-1].extend(billets)
@@ -278,6 +278,8 @@ class Trace_pusher:
             self.strand[int(strandNo)-1] += 1
             billetNo = self.current_heatNo + ccmNo + strandNo + '{:0>2}'.format(self.strand[int(strandNo)-1])
             billetsNo.append(billetNo)
+            i[0] = billetNo
+            i[1] = self.current_heatData
             if self.current_heatData:
                 self.sender.billet_upload(self.current_heatData, billetNo, self.total, i[2], i[3], i[4], i[5], billet_unionNo)
         
@@ -329,10 +331,11 @@ class Trace_pusher:
             self.bed_right = [[], [], []]
 
     def get_billet(self, direc):
-        if direc == "left":
-            return self.get_billet_action(self.bed_left)
-        if direc == "right":
-            return self.get_billet_action(self.bed_right)
+        with self.count_lock:
+            if direc == "left":
+                return self.get_billet_action(self.bed_left)
+            if direc == "right":
+                return self.get_billet_action(self.bed_right)
         
     def get_billet_action(self, src):
         for i in range(len(src)-1, -1, -1):

+ 1 - 1
models/data_sender.py

@@ -13,7 +13,7 @@ class Sender:
             'host_send': 'syn/billetHotsendBase/save',
             'car_add': 'syn/storageBill/add',
             'car_save': 'syn/billetHotsendBase/shipp/save',
-            'car_go': 'syn/billetHotsendBase/shipp/save/depart'
+            'car_go': 'syn/billetHotsendBase/shipp/depart'
         }
 
         self.url = {

+ 7 - 3
models/overhead_crane.py

@@ -33,7 +33,7 @@ class Crane:
         }
 
         self.areas = {
-            "6#小冷床(左)": [35000, 38500],
+            "6#小冷床(左)": [34000, 38500],
             "6#小冷床(右)": [22000, 24000],
             "车位3": [2000, 4000],
             "高线辊道": [60300, 62300],
@@ -129,6 +129,7 @@ class Crane:
                 tmp = self.tracer_6.get_billet("left")
             elif areaNo == "6#小冷床(右)":
                 tmp = self.tracer_6.get_billet("right")
+            time.sleep(0.5)
         
         self.billetsNo[craneNo] = ','.join(tmp)
         self.billets_from[craneNo] = areaNo
@@ -138,12 +139,15 @@ class Crane:
         # 直接放下
         tmp = self.billetsNo[craneNo]
         self.billetsNo[craneNo] = ""
+        tmp_from = self.billets_from[craneNo]
         self.billets_from[craneNo] = ""
         if areaNo == "车位3":
             self.logger.info(f"有一夹子钢坯放置进了车位3")
-            self.sender.car_save(self.parking.ccmNo_list[2], tmp, self.parking.current_car[2], craneNo, time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), self.billets_from[craneNo], areaNo)
+            if not tmp.startswith("00"):
+                self.sender.car_save(self.parking.ccmNo_list[2], tmp, self.parking.current_car[2], craneNo, time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), tmp_from, areaNo)
         elif areaNo == "高线辊道":
             self.logger.info(f"有一夹子钢坯放置进了高线辊道")
-            self.sender.host_send("6", tmp, "高线", craneNo, self.billets_from[craneNo])
+            if not tmp.startswith("00"):
+                self.sender.host_send("6", tmp, "高线", craneNo, tmp_from)
         elif areaNo == "601堆垛":
             self.logger.info(f"有一夹子钢坯放置进了601堆垛")