Explorar o código

五号机带天车

oldwine hai 3 meses
pai
achega
4fa26ea735
Modificáronse 1 ficheiros con 27 adicións e 3 borrados
  1. 27 3
      models/overhead_crane.py

+ 27 - 3
models/overhead_crane.py

@@ -37,15 +37,25 @@ class Crane:
             "6#小冷床(右)": [22000, 24000],
             "车位3": [2000, 4000],
             "高线辊道": [60300, 62300],
-            "601堆垛": [10000, 14000]
+            "601堆垛": [10000, 14000],
+            "5#小冷床(左)": [86000, 96000],
+            "5#小冷床(右)": [72140, 76140],
+            "501堆垛": [110000, 114000],
+            "车位1": [119500, 121500],
+            "车位2": [41800, 43800]
         }
 
         self.threads_poor = [
             threading.Thread(target=self.area_producer, args=("6#小冷床(左)",)),
             threading.Thread(target=self.area_producer, args=("6#小冷床(右)",)),
+            threading.Thread(target=self.area_producer, args=("5#小冷床(左)",)),
+            threading.Thread(target=self.area_producer, args=("5#小冷床(右)",)),
+            threading.Thread(target=self.area_consumer, args=("车位1",)),
+            threading.Thread(target=self.area_consumer, args=("车位2",)),
             threading.Thread(target=self.area_consumer, args=("车位3",)),
             threading.Thread(target=self.area_consumer, args=("高线辊道",)),
-            threading.Thread(target=self.area_consumer, args=("601堆垛",))
+            threading.Thread(target=self.area_consumer, args=("601堆垛",)),
+            threading.Thread(target=self.area_consumer, args=("501堆垛",))
         ]
 
         for i in self.threads_poor:
@@ -129,6 +139,10 @@ class Crane:
                 tmp = self.tracer_6.get_billet("left")
             elif areaNo == "6#小冷床(右)":
                 tmp = self.tracer_6.get_billet("right")
+            elif areaNo == "5#小冷床(左)":
+                tmp = self.tracer_5.get_billet("left")
+            elif areaNo == "5#小冷床(右)":
+                tmp = self.tracer_5.get_billet("right")
             time.sleep(0.5)
         
         self.billetsNo[craneNo] = ','.join(tmp)
@@ -141,6 +155,14 @@ class Crane:
         self.billetsNo[craneNo] = ""
         tmp_from = self.billets_from[craneNo]
         self.billets_from[craneNo] = ""
+        if areaNo == "车位1":
+            self.logger.info(f"有一夹子钢坯放置进了车位1")
+            if not tmp.startswith("00"):
+                self.sender.car_save(self.parking.ccmNo_list[0], tmp, self.parking.current_car[0], craneNo, time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), tmp_from, areaNo)
+        if areaNo == "车位2":
+            self.logger.info(f"有一夹子钢坯放置进了车位2")
+            if not tmp.startswith("00"):
+                self.sender.car_save(self.parking.ccmNo_list[1], tmp, self.parking.current_car[1], craneNo, time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), tmp_from, areaNo)
         if areaNo == "车位3":
             self.logger.info(f"有一夹子钢坯放置进了车位3")
             if not tmp.startswith("00"):
@@ -150,4 +172,6 @@ class Crane:
             if not tmp.startswith("00"):
                 self.sender.host_send("6", tmp, "高线", craneNo, tmp_from)
         elif areaNo == "601堆垛":
-            self.logger.info(f"有一夹子钢坯放置进了601堆垛")
+            self.logger.info(f"有一夹子钢坯放置进了601堆垛")
+        elif areaNo == "501堆垛":
+            self.logger.info(f"有一夹子钢坯放置进了501堆垛")