Administrator 2 năm trước cách đây
mục cha
commit
e8556674af

+ 19 - 0
Projects/永冠/WCS.Service/ProtocolProxy.cs

@@ -192,6 +192,24 @@ namespace WCS.Service
             total = 0;
             try
             {
+
+                DB.Do(db =>
+                {
+                    var agvTasks = db.Default.Set<WCS_AGVTask>().Where(v => v.Status < AGVTaskStatus.完成).OrderBy(v => v.CreateTime).ToArray();
+
+                    foreach (var agvtask in agvTasks)
+                    {
+                        var position = agvtask.Position.Replace("_In", "");
+                        if (position.Contains("_Back_")) position = position.Substring(0, position.IndexOf("_0"));
+                        if (!ProtocolProxy.AllDatas.ContainsKey(position)) ProtocolProxy.AllDatas[position] = new ProdLineData();
+
+                        var pld = ProtocolProxy.AllDatas[position] as ProdLineData;
+                        pld.Frame = LogicHandler.Frame;
+                        pld.Code = position;
+                        pld.TaskList.Add(agvtask);
+                    }
+                });
+
                 var gs = AllDatas.GroupBy(v => v.Value.GetType());
 
                 DeviceDataPack pack = new DeviceDataPack();
@@ -229,6 +247,7 @@ namespace WCS.Service
                     YGRedis.LTrim("Packs", 20000, YGlen);
                 }
 
+
                 foreach (var data in AllDatas)
                 {
                     data.Value.Info = "";

+ 0 - 74
Projects/永冠/WCS.Service/Worker.cs

@@ -76,80 +76,6 @@ namespace WCS.Service
                     LogicHandler.AllObjects.AddRange(devices);
                 });
 
-                var d = Device.Find("2172");
-
-                #region 设备扩展数据配置
-
-                Device.AddFlag(DF.扫码, "2265", "2122", "2131", "2143", "2088");
-                Device.Set("ProductLine", 1, "2206");
-                Device.Set("ProductLine", 2, "2205");
-                Device.Set("ProductLine", 3, "2204");
-                Device.Set("ProductLine", 4, "2203");
-                Device.Set("ProductLine", 5, "2211");
-                Device.Set("ProductLine", 6, "2210");
-                Device.Set("ProductLine", 7, "2209");
-                Device.Set("ProductLine", 8, "2208");
-                Device.Set("ProductLine", 9, "2207");
-
-                Device.Set("WorkShop", 1, "2122");
-                Device.Set("WorkShop", 2, "2131");
-                Device.Set("WorkShop", 3, "2143");
-
-                Device.AddFlag(DF.入库, "2252", "2254", "2256", "2265");
-                Device.AddFlag(DF.出库, "2251", "2253", "2255", "2259", "2261", "2263");
-                Device.AddFlag(DF.SC取货, "2256", "2254", "2252");
-                Device.AddFlag(DF.SC放货, "2255", "2253", "2251");
-                Device.Set("Floor", 1, "2256", "2254", "2252", "2255", "2253", "2251");
-
-                Device.AddFlag(DF.入库, "2172", "2174", "2176", "2181", "2187");
-                Device.AddFlag(DF.出库, "2173", "2175", "2177", "2180", "2182");
-                Device.AddFlag(DF.SC取货, "2172", "2174", "2176");
-                Device.AddFlag(DF.SC放货, "2173", "2175", "2177");
-                Device.Set("Floor", 2, "2172", "2174", "2176", "2173", "2175", "2177");
-
-                //Device.Set("LocInfo", new LocInfo(1, 0, 1, 0), "2256");
-                //Device.Set("LocInfo", new LocInfo(3, 0, 1, 0), "2254");
-                //Device.Set("LocInfo", new LocInfo(5, 0, 1, 0), "2252");
-
-                //Device.Set("Tunnel", "TM1", "SC5", "2256", "2255", "2176", "2177");
-                //Device.Set("Tunnel", "TM2", "SC4", "2254", "2253", "2174", "2175");
-                //Device.Set("Tunnel", "TM3", "SC5", "2252", "2251", "2172", "2173");
-                Device.Set("Tunnel", "TY9", "SC9", "2256", "2255", "2176", "2177");
-                Device.Set("Tunnel", "TY8", "SC8", "2254", "2253", "2174", "2175");
-                Device.Set("Tunnel", "TY7", "SC7", "2252", "2251", "2172", "2173");
-
-                //Device.Set("SC", Device.Find("SC5"), v => v.Tunnel() == "TM1" || v.Tunnel() == "TM3");
-                //Device.Set("SC", Device.Find("SC4"), v => v.Tunnel() == "TM2");
-                Device.Set("SC", Device.Find("SC5"), v => v.Tunnel() == "TY5");
-                Device.Set("SC", Device.Find("SC4"), v => v.Tunnel() == "TY4");
-
-                Device.AddFlag(DF.RGV取货, "2255", "2253", "2251", "2265");
-                Device.AddFlag(DF.RGV放货, "2256", "2254", "2252", "2259", "2261", "2263");
-                Device.Set("RGV", Device.Find("RGV1"), v => v.RGV() == null && (v.Is(DF.RGV取货) || v.Is(DF.RGV放货)));
-
-                Device.AddFlag(DF.RGV取货, "2207", "2208", "2209", "2210", "2211", "2173", "2175", "2177", "2181");
-                Device.AddFlag(DF.RGV放货, "2207", "2208", "2209", "2210", "2211", "2172", "2174", "2176", "2180");
-                Device.Set("RGV", Device.Find("RGV2"), v => v.RGV() == null && (v.Is(DF.RGV取货) || v.Is(DF.RGV放货)));
-
-                Device.AddFlag(DF.RGV取货 | DF.RGV放货, "2192", "2195", "2198", "2201", "2187", "2182", "2203", "2204", "2205", "2206", "2202");
-                Device.Set("RGV", Device.Find("RGV3"), v => v.RGV() == null && (v.Is(DF.RGV取货) || v.Is(DF.RGV放货)));
-
-                Device.AddFlag(DF.RGV取货, "2108", "2114", "2123", "2135");
-                Device.AddFlag(DF.RGV放货, "2145", "2114", "2123", "2135");
-                Device.Set("RGV", Device.Find("RGV4"), v => v.RGV() == null && (v.Is(DF.RGV取货) || v.Is(DF.RGV放货)));
-
-                Device.AddFlag(DF.拆盘, "2192", "2195", "2198", "2201");
-                Device.Set("PalletType", 4, "2192");
-                Device.Set("PalletType", 1, "2195");
-                Device.Set("PalletType", 2, "2198");
-                Device.Set("PalletType", 3, "2201");
-
-                Device.AddFlag(DF.组盘, "2203", "2204", "2205", "2206", "2207", "2208", "2209", "2210", "2211");
-
-                //Device.Set("Floor", 1, v=>v.t);
-
-                #endregion 设备扩展数据配置
-
                 var managerTypes = Assembly.GetExecutingAssembly().GetTypes().Where(v => v.IsSubclassOf(typeof(LogicHandler)) && !v.IsGenericType && !v.IsAbstract).ToArray();
                 foreach (var type in managerTypes)
                 {