From 14131ccafa4f0ccd292e0468a5b2b90420e6b37e Mon Sep 17 00:00:00 2001 From: taoye Date: Sun, 23 Oct 2022 20:21:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?180=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.AGV/AGVHelper.cs | 70 +- .../Pages/Model/AlarmHelper.cs | 12 +- BPASmartClient.Helper/RTrig.cs | 10 +- FryPot_DosingSystem/App.xaml.cs | 7 +- FryPot_DosingSystem/Control/DeviceOperate.cs | 12 +- .../Control/DosingLogicControl.cs | 1222 +++++++++++------ FryPot_DosingSystem/Control/GlobalVariable.cs | 43 +- FryPot_DosingSystem/View/DebugView.xaml.cs | 5 +- .../ViewModel/FlowProcessSetViewModel.cs | 4 +- .../ViewModel/NewRecipeViewModel.cs | 72 +- 10 files changed, 944 insertions(+), 513 deletions(-) diff --git a/BPASmartClient.AGV/AGVHelper.cs b/BPASmartClient.AGV/AGVHelper.cs index 22e76ae4..ca56e07e 100644 --- a/BPASmartClient.AGV/AGVHelper.cs +++ b/BPASmartClient.AGV/AGVHelper.cs @@ -147,8 +147,8 @@ namespace BPASmartClient.AGV //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -210,8 +210,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + var objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { @@ -266,8 +266,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -321,8 +321,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -376,8 +376,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[","").Replace("]",""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -431,8 +431,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -486,8 +486,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -541,8 +541,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -596,8 +596,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -651,8 +651,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -706,8 +706,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -762,8 +762,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -802,7 +802,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 22; - httpJobData.unloadEquipmentId = 10; + httpJobData.unloadEquipmentId = 20; httpModel.jobData = httpJobData; string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -817,8 +817,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -857,7 +857,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 33; - httpJobData.unloadEquipmentId = 10; + httpJobData.unloadEquipmentId = 30; httpModel.jobData = httpJobData; string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -872,8 +872,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -927,8 +927,8 @@ namespace BPASmartClient.AGV //string body = JsonConvert.SerializeObject(httpModel); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -987,8 +987,8 @@ namespace BPASmartClient.AGV string body = JsonConvert.SerializeObject(notify); //启用签名 //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); - object objData = JsonConvert.DeserializeObject(data); + string data = HttpRequest(url, head, body).Replace("[", "").Replace("]", ""); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; @@ -1023,7 +1023,7 @@ namespace BPASmartClient.AGV //启用签名 //url = url + "?sign=" + MD5Deal(body); string data = HttpRequest(url, head, body); - object objData = JsonConvert.DeserializeObject(data); + object objData = JsonConvert.DeserializeObject(data); if (objData != null && objData is HttpResponseBodyModel response) { return response.code; diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs b/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs index 1ca88c78..785250d5 100644 --- a/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs +++ b/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs @@ -17,12 +17,16 @@ namespace BPASmartClient.CustomResource.Pages.Model public class AlarmHelper where AlarmT : class, new() { private volatile static ConcurrentDictionary _Instance; + private static readonly object Obj_Lock = new object(); public static AlarmT GetInstance(string name = "") { - if (string.IsNullOrEmpty(name)) name = typeof(AlarmT).Name; - if (_Instance == null) _Instance = new ConcurrentDictionary(); - if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT()); - return _Instance[name]; + lock (Obj_Lock) + { + if (string.IsNullOrEmpty(name)) name = typeof(AlarmT).Name; + if (_Instance == null) _Instance = new ConcurrentDictionary(); + if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT()); + return _Instance[name]; + } } private AlarmHelper() { } diff --git a/BPASmartClient.Helper/RTrig.cs b/BPASmartClient.Helper/RTrig.cs index 469cebb6..160fb9eb 100644 --- a/BPASmartClient.Helper/RTrig.cs +++ b/BPASmartClient.Helper/RTrig.cs @@ -13,11 +13,15 @@ namespace BPASmartClient.Helper public class RTrig { private volatile static ConcurrentDictionary _Instance; + private static readonly object Lock = new object(); public static RTrig GetInstance(string name) { - if (_Instance == null) _Instance = new ConcurrentDictionary(); - if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new RTrig()); - return _Instance[name]; + lock (Lock) + { + if (_Instance == null) _Instance = new ConcurrentDictionary(); + if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new RTrig()); + return _Instance[name]; + } } private RTrig() { } diff --git a/FryPot_DosingSystem/App.xaml.cs b/FryPot_DosingSystem/App.xaml.cs index e9089c8a..17eb8f26 100644 --- a/FryPot_DosingSystem/App.xaml.cs +++ b/FryPot_DosingSystem/App.xaml.cs @@ -38,19 +38,20 @@ namespace FryPot_DosingSystem if (res != null && res == true) { mv.Show(); - MessageLog.GetInstance.ShowUserLog("用户登录"); + MessageNotify.GetInstance.ShowUserLog("用户登录"); try { await Task.Run(() => { DeviceOperate deviceOperate = DeviceOperate.GetInstance; }); } catch (Exception) { - MessageLog.GetInstance.ShowRunLog("下位机PLC连接失败,请检查无误后重启上位机"); + MessageNotify.GetInstance.ShowRunLog("下位机PLC连接失败,请检查无误后重启上位机"); } //开启实时PLC数据读取 DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 - HubHelper.GetInstance.Connect("172.16.12.100", 8089); AlarmHelper.Init();//报警实时监控 + HubHelper.GetInstance.Connect("172.16.12.100", 8089); + } else mv.Close(); diff --git a/FryPot_DosingSystem/Control/DeviceOperate.cs b/FryPot_DosingSystem/Control/DeviceOperate.cs index 8106297b..15e21ea1 100644 --- a/FryPot_DosingSystem/Control/DeviceOperate.cs +++ b/FryPot_DosingSystem/Control/DeviceOperate.cs @@ -180,7 +180,7 @@ namespace FryPot_DosingSystem.Control string DeviceName = devices.Devices[i].DeviceName; switch (DeviceName) { - case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break; + case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break; //case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break; //case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break; //case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break; @@ -259,7 +259,7 @@ namespace FryPot_DosingSystem.Control DeviceManage devices = Json.Data; var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1"); if (res != null) - fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC重连成功"); + fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC重连成功"); } Thread.Sleep(10); }), $"炒锅1实时数据读取线程"); @@ -289,7 +289,7 @@ namespace FryPot_DosingSystem.Control DeviceManage devices = Json.Data; var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2"); if (res != null) - fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC重连成功"); + fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC重连成功"); } Thread.Sleep(10); }), $"炒锅2实时数据读取线程"); @@ -319,7 +319,7 @@ namespace FryPot_DosingSystem.Control DeviceManage devices = Json.Data; var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3"); if (res != null) - fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC重连成功"); + fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC重连成功"); } Thread.Sleep(10); }), $"炒锅3实时数据读取线程"); @@ -349,7 +349,7 @@ namespace FryPot_DosingSystem.Control DeviceManage devices = Json.Data; var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4"); if (res != null) - fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("4号炒锅PLC重连成功"); + fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC重连成功"); } Thread.Sleep(10); }), $"炒锅4实时数据读取线程"); @@ -379,7 +379,7 @@ namespace FryPot_DosingSystem.Control DeviceManage devices = Json.Data; var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5"); if (res != null) - fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageLog.GetInstance.ShowRunLog("5号炒锅PLC重连成功"); + fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC重连成功"); } Thread.Sleep(10); }), $"炒锅5实时数据读取线程"); diff --git a/FryPot_DosingSystem/Control/DosingLogicControl.cs b/FryPot_DosingSystem/Control/DosingLogicControl.cs index 3b4a5871..2f2b9d17 100644 --- a/FryPot_DosingSystem/Control/DosingLogicControl.cs +++ b/FryPot_DosingSystem/Control/DosingLogicControl.cs @@ -22,6 +22,8 @@ using FryPot_DosingSystem.FryPotStatus; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Diagnostics; +using BPASmartClient.CustomResource.UserControls.MessageShow; +using BPASmartClient.CustomResource.UserControls; namespace FryPot_DosingSystem.Control { @@ -30,11 +32,11 @@ namespace FryPot_DosingSystem.Control public static DosingLogicControl _instance; public static DosingLogicControl GetInstance => _instance ??= new DosingLogicControl(); - + public ushort[] RollerNum = new ushort[] { 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 207, 208, 301, 302, 303, 304, 305, 306, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 501, 502, 503, 504, 505, 506, 507, 508 }; /// /// 桶净重 /// r - public ushort RollerNetweight =19;//19公斤 + public ushort RollerNetweight = 19;//19公斤 /// /// 滚筒线PLC数据 @@ -153,9 +155,9 @@ namespace FryPot_DosingSystem.Control List LNinerobotJobId = new List(); //从线体3到清洗台路径 List LTenrobotJobId = new List(); //从清洗台到线体4路径 - Dictionary agvCode = new Dictionary() { { "1", 1 }, { "2", 2 }, { "3", 3 }, { "4", 4 } };//agv小车的编号对AGV动画小车编号 - + Dictionary agvCode = new Dictionary() { { "ZT11-21", 1 }, { "ZT11-22", 2 }, { "ZT11-23", 3 }, { "ZT11-24", 4 } };//agv小车的编号对AGV动画小车编号 + private static readonly object Obj_Lock = new object();//3条滚筒线洗桶线程互斥锁 public int CleanNum = 0;//当前清洗台桶数 #endregion @@ -263,17 +265,17 @@ namespace FryPot_DosingSystem.Control ActionManage.GetInstance.Register(() => { - globalVar.rollerLineOne.RecipeCompleteSingle = 1; + // globalVar.rollerLineOne.RecipeCompleteSingle = 1; }, "LineOneRecipeComSignal"); ActionManage.GetInstance.Register(() => { - globalVar.rollerLineTwo.RecipeCompleteSingle = 1; + // globalVar.rollerLineTwo.RecipeCompleteSingle = 1; }, "LineTwoRecipeComSignal"); ActionManage.GetInstance.Register(() => { - globalVar.rollerLineThree.RecipeCompleteSingle = 1; + // globalVar.rollerLineThree.RecipeCompleteSingle = 1; }, "LineThreeRecipeComSignal"); ActionManage.GetInstance.Register(new Action(() => @@ -709,7 +711,7 @@ namespace FryPot_DosingSystem.Control EventData objData = JsonConvert.DeserializeObject(obj.ToString()); if (objData != null) { - AGVHelper.GetInstance.UpDownFeedBack(objData.agvCode,objData.jobId,objData.msgId); + AGVHelper.GetInstance.UpDownFeedBack(objData.agvCode, objData.jobId, objData.msgId); #region 线体到炒锅请求上下料 //线体1请求上下料 if (objData.equipmentId == 1 && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 @@ -717,7 +719,7 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveUpLoad = true;//AGV到达上料位置 } - if ((objData.equipmentId == 5||objData.equipmentId==8) && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if ((objData.equipmentId == 5 || objData.equipmentId == 8) && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.agvArriveUnLoad = true;//AGV到达下料位置 } @@ -727,7 +729,7 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLTwoUpLoad = true;//AGV到达上料位置 } - if ((objData.equipmentId == 6||objData.equipmentId==9) && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if ((objData.equipmentId == 6 || objData.equipmentId == 9) && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.LTwoagvArriveUnLoad = true;//AGV到达下料位置 @@ -738,16 +740,18 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLThreeUpLoad = true;//AGV到达上料位置 } - if (objData.equipmentId ==7 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if (objData.equipmentId == 7 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.LThreeagvArriveUnLoad = true;//AGV到达下料位置 } #endregion #region 炒锅到线体4请求上下料 //炒锅1,4到线体4 - if ((objData.equipmentId == 5||objData.equipmentId==8) && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 + if ((objData.equipmentId == 5 || objData.equipmentId == 8) && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 { globalVar.agvArriveUpLoad = true;//AGV到达上料位置 + MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅空桶上料位置"); + AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//发送AGV到位信号 } if (objData.equipmentId == 4 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { @@ -756,9 +760,11 @@ namespace FryPot_DosingSystem.Control } //炒锅2,5到线体4 - if ((objData.equipmentId == 6||objData.equipmentId==9) && objData.command == "LOAD") + if ((objData.equipmentId == 6 || objData.equipmentId == 9) && objData.command == "LOAD") { globalVar.agvArriveLTwoUpLoad = true;//AGV到达上料位置 + MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅空桶上料位置"); + AgvArriveFryPotTwoOrFiveOutEmptyRollerSingleSetDown();//发送AGV到位信号 } if (objData.equipmentId == 4 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 @@ -771,7 +777,8 @@ namespace FryPot_DosingSystem.Control if (objData.equipmentId == 7 && objData.command == "LOAD") { globalVar.agvArriveLThreeUpLoad = true;//AGV到达上料位置 - + MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置"); + AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//发送AGV到位信号 } if (objData.equipmentId == 4 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { @@ -780,12 +787,12 @@ namespace FryPot_DosingSystem.Control #endregion #region 线体123到清洗台请求上下料 //线体1到清洗台 - if (objData.equipmentId==11 && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 + if (objData.equipmentId == 11 && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 { globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置 } - if (objData.equipmentId==10 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if (objData.equipmentId == 10 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//AGV到达下料位置 } @@ -795,18 +802,18 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLineTwoLoadEmptyRoller = true;//AGV到达上料位置 } - if (objData.equipmentId==10&& objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if (objData.equipmentId == 20 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;//AGV到达下料位置 } - if (objData.equipmentId==33&& objData.command == "LOAD") + if (objData.equipmentId == 33 && objData.command == "LOAD") { globalVar.agvArriveLineThreeLoadEmptyRoller = true;//AGV到达上料位置 } - if (objData.equipmentId==10 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + if (objData.equipmentId == 30 && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.rollerLineThree.agvArriveCleanUnLoad = true;//AGV到达下料位置 @@ -814,11 +821,11 @@ namespace FryPot_DosingSystem.Control } #endregion #region 清洗台到线体4请求上下料 - if (objData.equipmentId==10&& objData.command == "LOAD") + if (objData.equipmentId == 10 && objData.command == "LOAD") { globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置 } - if (objData.equipmentId==44 && objData.command == "UNLOAD") + if (objData.equipmentId == 44 && objData.command == "UNLOAD") { globalVar.agvArriveLineFour = true;//agv到达线体4下料位置 } @@ -841,7 +848,7 @@ namespace FryPot_DosingSystem.Control catch (Exception) { - MessageLog.GetInstance.ShowRunLog("Agv任务回报数据异常"); + MessageNotify.GetInstance.ShowRunLog("Agv任务回报数据异常"); objData = null; } if (objData != null) @@ -852,24 +859,25 @@ namespace FryPot_DosingSystem.Control } #region 线体上下料任务信息回报 //线体1任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.pointCode == "sTEwzw")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "sTEwzw")// AGV正在上料,指线体上料 { } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.pointCode == "PChS6R")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "PChS6R")// AGV正在上料,指线体上料 { //日志 } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.pointCode == "HHif8Z")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "HHif8Z")// AGV正在上料,指线体上料 { //日志 } //线体1任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.pointCode == "sTEwzw")//指定上料点上料完成,这里指线体上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "sTEwzw")//指定上料点上料完成,这里指线体上料 { + DeviceOperate.GetInstance.WritePlcData("D1052", 0); globalVar.agvLineOneLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(1, (--globalVar.LOneMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes); @@ -884,8 +892,9 @@ namespace FryPot_DosingSystem.Control } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.pointCode == "PChS6R")//指定上料点上料完成,这里指线体上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "PChS6R")//指定上料点上料完成,这里指线体上料 { + DeviceOperate.GetInstance.WritePlcData("D1053", 0); globalVar.agvLineTwoLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(2, (--globalVar.LTwoMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes); @@ -900,8 +909,9 @@ namespace FryPot_DosingSystem.Control } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.pointCode == "HHif8Z")//指定上料点上料完成,这里指线体上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "HHif8Z")//指定上料点上料完成,这里指线体上料 { + DeviceOperate.GetInstance.WritePlcData("D1054", 0); globalVar.agvLineThreeLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(3, (--globalVar.LThreeMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes); @@ -909,39 +919,56 @@ namespace FryPot_DosingSystem.Control } //线体1任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && (objData.jobData.pointCode == "DXDnMJ"||objData.jobData.pointCode== "naFssQ"))//指定下料点正在下料,指线体到炒锅下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && (objData.jobData.targetPointCode == "DXDnMJ" || objData.jobData.targetPointCode == "naFssQ"))//指定下料点正在下料,指线体到炒锅下料 { } //线体2任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTworobotJobId && (objData.jobData.pointCode == "PChS6R" || objData.jobData.pointCode == "sxSX88"))//指定下料点正在下料,指线体到炒锅下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTworobotJobId && (objData.jobData.targetPointCode == "PChS6R" || objData.jobData.targetPointCode == "sxSX88"))//指定下料点正在下料,指线体到炒锅下料 { } //线体3任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.pointCode == "biZG87")//指定下料点正在下料,指线体到炒锅下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "biZG87")//指定下料点正在下料,指线体到炒锅下料 { } //线体1任务上报 - if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && (objData.jobData.pointCode == "DXDnMJ" || objData.jobData.pointCode == "naFssQ"))//指定下料位置下料完成,指线体到炒锅下料 + if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && (objData.jobData.targetPointCode == "DXDnMJ" || objData.jobData.targetPointCode == "naFssQ"))//指定下料位置下料完成,指线体到炒锅下料 { + if (objData.jobData.targetPointCode == "DXDnMJ") + { + DeviceOperate.GetInstance.WritePlcData("D1055", 0); + } + else + { + DeviceOperate.GetInstance.WritePlcData("D1058", 0); + } AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hj); AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]); AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes); } //线体2任务上报 - if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && (objData.jobData.pointCode == "PChS6R" || objData.jobData.pointCode == "sxSX88"))//指定下料位置下料完成,指线体到炒锅下料 + if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && (objData.jobData.targetPointCode == "CDPGde" || objData.jobData.targetPointCode == "sxSX88"))//指定下料位置下料完成,指线体到炒锅下料 { + if (objData.jobData.targetPointCode == "CDPGde") + { + DeviceOperate.GetInstance.WritePlcData("D1056", 0); + } + else + { + DeviceOperate.GetInstance.WritePlcData("D1059", 0); + } AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hj); AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]); AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes); } //线体3任务上报 - if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.pointCode == "biZG87")//指定下料位置下料完成,指线体到炒锅下料 + if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "biZG87")//指定下料位置下料完成,指线体到炒锅下料 { + DeviceOperate.GetInstance.WritePlcData("D1057", 0); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hj); AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]); @@ -950,24 +977,33 @@ namespace FryPot_DosingSystem.Control #endregion #region 炒锅空桶上下料任务信息回报 //线体1任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFourrobotJobId && (objData.jobData.pointCode == "DXDnMJ"||objData.jobData.pointCode== "naFssQ"))// AGV正在上料,指炒锅空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFourrobotJobId && (objData.jobData.startPointCode == "DXDnMJ" || objData.jobData.startPointCode == "naFssQ"))// AGV正在上料,指炒锅空桶上料 { //日志 } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFiverobotJobId && (objData.jobData.pointCode == "CDPGde" || objData.jobData.pointCode== "sxSX88"))// AGV正在上料,指炒锅空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFiverobotJobId && (objData.jobData.startPointCode == "CDPGde" || objData.jobData.startPointCode == "sxSX88"))// AGV正在上料,指炒锅空桶上料 { //日志 } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.pointCode == "biZG87")// AGV正在上料,指炒锅空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "biZG87")// AGV正在上料,指炒锅空桶上料 { //日志 } //线体1任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFourrobotJobId && (objData.jobData.pointCode == "DXDnMJ" || objData.jobData.pointCode == "naFssQ"))//指定上料点上料完成,这里指炒锅空桶上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LFourrobotJobId && (objData.jobData.startPointCode == "DXDnMJ" || objData.jobData.startPointCode == "naFssQ"))//指定上料点上料完成,这里指炒锅空桶上料 { + if (objData.jobData.startPointCode == "DXDnMJ") + { + DeviceOperate.GetInstance.WritePlcData("D1060", 0); + } + else + { + DeviceOperate.GetInstance.WritePlcData("D1063", 0); + } + globalVar.agvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); if (globalVar.LOneFryPotSerial == 1) @@ -980,8 +1016,18 @@ namespace FryPot_DosingSystem.Control } } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFiverobotJobId && (objData.jobData.pointCode == "CDPGde" || objData.jobData.pointCode == "sxSX88"))//指定上料点上料完成,这里指炒锅空桶上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LFiverobotJobId && (objData.jobData.startPointCode == "CDPGde" || objData.jobData.startPointCode == "sxSX88"))//指定上料点上料完成,这里指炒锅空桶上料 { + + if (objData.jobData.startPointCode == "CDPGde") + { + DeviceOperate.GetInstance.WritePlcData("D1061", 0); + } + else + { + DeviceOperate.GetInstance.WritePlcData("D1064", 0); + } + globalVar.LTwoagvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); if (globalVar.LTwoFryPotSerial == 2) @@ -994,8 +1040,9 @@ namespace FryPot_DosingSystem.Control } } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSixrobotJobId && objData.jobData.pointCode == "biZG87")//指定上料点上料完成,这里指炒锅空桶上料 + if (objData.state == "LOAD_COMPLETED" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "biZG87")//指定上料点上料完成,这里指炒锅空桶上料 { + DeviceOperate.GetInstance.WritePlcData("D1062", 0); globalVar.LThreeagvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_3); @@ -1003,31 +1050,31 @@ namespace FryPot_DosingSystem.Control //线体1任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 { AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); } //线体2任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 { AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); } //线体3任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料点正在下料,指炒锅空桶下料 { AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); } //线体1任务上报 - if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 { MessageNotify.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成"); - + DeviceOperate.GetInstance.WritePlcData("D1067", 0); if (globalVar.LFourRollerNum >= 8) { AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); @@ -1042,10 +1089,10 @@ namespace FryPot_DosingSystem.Control } //线体2任务上报 - if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 { MessageNotify.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成"); - + DeviceOperate.GetInstance.WritePlcData("D1067", 0); if (globalVar.LFourRollerNum >= 8) { AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); @@ -1059,10 +1106,10 @@ namespace FryPot_DosingSystem.Control AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes); } //线体3任务上报 - if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.pointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.targetPointCode == "w2jZhM")//指定下料位置下料完成,指炒锅空桶下料 { MessageNotify.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成"); - + DeviceOperate.GetInstance.WritePlcData("D1067", 0); if (globalVar.LFourRollerNum >= 8) { AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); @@ -1078,8 +1125,9 @@ namespace FryPot_DosingSystem.Control #endregion #region 线体123空桶到清戏台 //线体1任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "sTEwzw")//指定上料点上料完成,这里指线体1空桶上料 + if (objData.state == "LOAD_COMPLETED" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "sTEwzw")//指定上料点上料完成,这里指线体1空桶上料 { + DeviceOperate.GetInstance.WritePlcData("D1052", 0); globalVar.agvArriveLineOneLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(1, (--globalVar.LOneMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); @@ -1087,8 +1135,9 @@ namespace FryPot_DosingSystem.Control //到清洗处 } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "PChS6R")//指定上料点上料完成,这里指线体2空桶上料 + if (objData.state == "LOAD_COMPLETED" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "PChS6R")//指定上料点上料完成,这里指线体2空桶上料 { + DeviceOperate.GetInstance.WritePlcData("D1053", 0); globalVar.agvArriveLineTwoLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(2, (--globalVar.LTwoMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); @@ -1097,8 +1146,9 @@ namespace FryPot_DosingSystem.Control } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "HHif8Z")//指定上料点上料完成,这里指线体3空桶上料 + if (objData.state == "LOAD_COMPLETED" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "HHif8Z")//指定上料点上料完成,这里指线体3空桶上料 { + DeviceOperate.GetInstance.WritePlcData("D1054", 0); globalVar.agvArriveLineThreeLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(3, (--globalVar.LThreeMaterialNum).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); @@ -1108,8 +1158,9 @@ namespace FryPot_DosingSystem.Control } - if (objData.state == "DONE" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "TitRYC")//指定下料位置下料完成,指从线体1到清戏台空桶下料 + if (objData.state == "DONE" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "TitRYC")//指定下料位置下料完成,指从线体1到清戏台空桶下料 { + DeviceOperate.GetInstance.WritePlcData("D1065", 0); LSevenrobotJobId.Remove(objData.robotJobId); MessageNotify.GetInstance.ShowRunLog("线体【1】空桶在清洗台卸桶完成"); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); @@ -1117,8 +1168,9 @@ namespace FryPot_DosingSystem.Control AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes); AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum); } - if (objData.state == "DONE" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "TitRYC" )//指定下料位置下料完成,指从线体2到清戏台空桶下料 + if (objData.state == "DONE" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "TitRYC")//指定下料位置下料完成,指从线体2到清戏台空桶下料 { + DeviceOperate.GetInstance.WritePlcData("D1065", 0); LEightrobotJobId.Remove(objData.robotJobId); MessageNotify.GetInstance.ShowRunLog("线体【2】空桶在清洗台卸桶完成"); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); @@ -1126,8 +1178,9 @@ namespace FryPot_DosingSystem.Control AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes); AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum); } - if (objData.state == "DONE" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "TitRYC" )//指定下料位置下料完成,指从线体3到清戏台空桶下料 + if (objData.state == "DONE" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "TitRYC")//指定下料位置下料完成,指从线体3到清戏台空桶下料 { + DeviceOperate.GetInstance.WritePlcData("D1065", 0); LNinerobotJobId.Remove(objData.robotJobId); MessageNotify.GetInstance.ShowRunLog("线体【3】空桶在清洗台卸桶完成"); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No); @@ -1137,23 +1190,25 @@ namespace FryPot_DosingSystem.Control } #endregion #region 清洗台到线体4 - if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "TitRYC")//指定上料位置上料完成,指清戏台空桶到上料 + if (objData.state == "LOAD_COMPLETED" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "TitRYC")//指定上料位置上料完成,指清戏台空桶到上料 { - globalVar.AllowNextEmptyRollerToClean = true; - MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); + DeviceOperate.GetInstance.WritePlcData("D1066", 0); + globalVar.AllowNextEmptyRollerToClean = true; + MessageNotify.GetInstance.ShowRunLog("清洗台空桶装载完成"); AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_4);//去四号空桶线 AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum); } - if (objData.state == "ROLLER_UNLOAD_DOING" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "TitRYC")//指定下料点正在下料,指清洗台空桶到线体4下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "TitRYC")//指定下料点正在下料,指清洗台空桶到线体4下料 { AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); } - if (objData.state == "DONE" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.pointCode == "w2jZhM")//指定下料位置下料完成,指清戏台空桶到线体4下料 + if (objData.state == "DONE" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "w2jZhM")//指定下料位置下料完成,指清戏台空桶到线体4下料 { + DeviceOperate.GetInstance.WritePlcData("D1067", 0); LTenrobotJobId.Remove(objData.robotJobId); MessageNotify.GetInstance.ShowRunLog("【4】号线空桶回桶完成"); if (globalVar.LFourRollerNum >= 8) @@ -1416,34 +1471,34 @@ namespace FryPot_DosingSystem.Control })); GetAddressData("D2031", new Action((data) => { - globalVar.rollerLineOne.OutMaterialingSingle = data[3]; - globalVar.rollerLineTwo.OutMaterialingSingle = data[4]; - globalVar.rollerLineThree.OutMaterialingSingle = data[5]; + //globalVar.rollerLineOne.OutMaterialingSingle = data[3]; + //globalVar.rollerLineTwo.OutMaterialingSingle = data[4]; + //globalVar.rollerLineThree.OutMaterialingSingle = data[5]; - AlarmHelper.GetInstance().LineOneRollerRunning = data[3]; - AlarmHelper.GetInstance().LineTwoRollerRunning = data[4]; - AlarmHelper.GetInstance().LineThreeRollerRunning = data[5]; + //AlarmHelper.GetInstance().LineOneRollerRunning = data[3]; + //AlarmHelper.GetInstance().LineTwoRollerRunning = data[4]; + //AlarmHelper.GetInstance().LineThreeRollerRunning = data[5]; - AlarmHelper.GetInstance().LOneRollerTrouble = data[6]; - AlarmHelper.GetInstance().LTwoRollerTrouble = data[7]; - AlarmHelper.GetInstance().LThreeRollerTrouble = data[8]; - - })); - GetAddressData("D2040", new Action((data) => - { - globalVar.fryPotOne.InputMaterialRollerRunningSingle = data[0]; - globalVar.fryPotTwo.InputMaterialRollerRunningSingle = data[1]; - globalVar.fryPotThree.InputMaterialRollerRunningSingle = data[2]; - globalVar.fryPotFour.InputMaterialRollerRunningSingle = data[3]; - globalVar.fryPotFive.InputMaterialRollerRunningSingle = data[4]; - - AlarmHelper.GetInstance().FryPotOneRollerRunning = data[0]; - AlarmHelper.GetInstance().FryPotTwoRollerRunning = data[1]; - AlarmHelper.GetInstance().FryPotThreeRollerRunning = data[2]; - AlarmHelper.GetInstance().FryPotFourRollerRunning = data[3]; - AlarmHelper.GetInstance().FryPotFiveRollerRunning = data[4]; + AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble = data[6]; + AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble = data[7]; + AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble = data[8]; })); + //GetAddressData("D2040", new Action((data) => + //{ + // globalVar.fryPotOne.InputMaterialRollerRunningSingle = data[0]; + // globalVar.fryPotTwo.InputMaterialRollerRunningSingle = data[1]; + // globalVar.fryPotThree.InputMaterialRollerRunningSingle = data[2]; + // globalVar.fryPotFour.InputMaterialRollerRunningSingle = data[3]; + // globalVar.fryPotFive.InputMaterialRollerRunningSingle = data[4]; + + // AlarmHelper.GetInstance().FryPotOneRollerRunning = data[0]; + // AlarmHelper.GetInstance().FryPotTwoRollerRunning = data[1]; + // AlarmHelper.GetInstance().FryPotThreeRollerRunning = data[2]; + // AlarmHelper.GetInstance().FryPotFourRollerRunning = data[3]; + // AlarmHelper.GetInstance().FryPotFiveRollerRunning = data[4]; + + //})); GetAddressData("D2045", new Action((data) => { globalVar.fryPotOne.InputMaterialArrivedSingle = data[0]; @@ -1460,20 +1515,20 @@ namespace FryPot_DosingSystem.Control globalVar.fryPotFour.EmptyBarrelArrivedSingle = data[3]; globalVar.fryPotFive.EmptyBarrelArrivedSingle = data[4]; })); - GetAddressData("D2065", new Action((data) => - { - globalVar.fryPotOne.EmptyBarrelRollerRunningSingle = data[0]; - globalVar.fryPotTwo.EmptyBarrelRollerRunningSingle = data[1]; - globalVar.fryPotThree.EmptyBarrelRollerRunningSingle = data[2]; - globalVar.fryPotFour.EmptyBarrelRollerRunningSingle = data[3]; - globalVar.fryPotFive.EmptyBarrelRollerRunningSingle = data[4]; - - AlarmHelper.GetInstance().FryPotOneEmptyRollerRunning = data[0]; - AlarmHelper.GetInstance().FryPotTwoEmptyRollerRunning = data[1]; - AlarmHelper.GetInstance().FryPotThreeEmptyRollerRunning = data[2]; - AlarmHelper.GetInstance().FryPotFourEmptyRollerRunning = data[3]; - AlarmHelper.GetInstance().FryPotFiveEmptyRollerRunning = data[4]; - })); + //GetAddressData("D2065", new Action((data) => + //{ + // globalVar.fryPotOne.EmptyBarrelRollerRunningSingle = data[0]; + // globalVar.fryPotTwo.EmptyBarrelRollerRunningSingle = data[1]; + // globalVar.fryPotThree.EmptyBarrelRollerRunningSingle = data[2]; + // globalVar.fryPotFour.EmptyBarrelRollerRunningSingle = data[3]; + // globalVar.fryPotFive.EmptyBarrelRollerRunningSingle = data[4]; + + // AlarmHelper.GetInstance().FryPotOneEmptyRollerRunning = data[0]; + // AlarmHelper.GetInstance().FryPotTwoEmptyRollerRunning = data[1]; + // AlarmHelper.GetInstance().FryPotThreeEmptyRollerRunning = data[2]; + // AlarmHelper.GetInstance().FryPotFourEmptyRollerRunning = data[3]; + // AlarmHelper.GetInstance().FryPotFiveEmptyRollerRunning = data[4]; + //})); GetAddressData("D2070", new Action((data) => { //globalVar.fryPotOne.RollerTroubleSingle = data[0]; @@ -1481,86 +1536,129 @@ namespace FryPot_DosingSystem.Control //globalVar.fryPotThree.RollerTroubleSingle = data[2]; //globalVar.fryPotFour.RollerTroubleSingle = data[3]; //globalVar.fryPotFive.RollerTroubleSingle = data[4]; - AlarmHelper.GetInstance().FryPotOneRollerTrouble = data[0]; - AlarmHelper.GetInstance().FryPotTwoRollerTrouble = data[1]; - AlarmHelper.GetInstance().FryPotThreeRollerTrouble = data[2]; - AlarmHelper.GetInstance().FryPotFourRollerTrouble = data[3]; - AlarmHelper.GetInstance().FryPotFiveRollerTrouble = data[4]; - })); - GetAddressData("D2078", new Action(data => - { - globalVar.rollerLineOne.RecipeCompleteSingle = data[0]; - globalVar.rollerLineTwo.RecipeCompleteSingle = data[1]; - globalVar.rollerLineThree.RecipeCompleteSingle = data[2]; + AlarmHelper.GetInstance("1号炒锅滚筒故障").FryPotOneRollerTrouble = data[0]; + AlarmHelper.GetInstance("2号炒锅滚筒故障").FryPotTwoRollerTrouble = data[1]; + AlarmHelper.GetInstance("3号炒锅滚筒故障").FryPotThreeRollerTrouble = data[2]; + AlarmHelper.GetInstance("4号炒锅滚筒故障").FryPotFourRollerTrouble = data[3]; + AlarmHelper.GetInstance("5号炒锅滚筒故障").FryPotFiveRollerTrouble = data[4]; })); + //GetAddressData("D2078", new Action(data => + //{ + // //globalVar.rollerLineOne.RecipeCompleteSingle = data[0]; + // //globalVar.rollerLineTwo.RecipeCompleteSingle = data[1]; + // //globalVar.rollerLineThree.RecipeCompleteSingle = data[2]; + //})); GetAddressData("D2075", new Action(data => { - AlarmHelper.GetInstance().CleanEnterRollerRunning = data[0]; + AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning = data[0]; globalVar.CleadBarrelEnterSingle = data[0]; })); - GetAddressData("2076", new Action(data => + GetAddressData("D2076", new Action(data => { globalVar.CleanComplete = data[0];//洗桶出桶agv呼叫信号 })); GetAddressData("D2077", new Action(data => { - AlarmHelper.GetInstance().CleanOutputRollerRunning = data[0]; + AlarmHelper.GetInstance("洗桶机出桶未运行").CleanOutputRollerRunning = data[0]; globalVar.CleadBarrelExitSingle = data[0]; })); //滚筒线123开始信号 - GetAddressData("D2100",new Action(data => { + GetAddressData("D2101", new Action(data => + { globalVar.rollerLineOne.ExcuteIsConfirm = data[0]; globalVar.rollerLineTwo.ExcuteIsConfirm = data[1]; globalVar.rollerLineThree.ExcuteIsConfirm = data[2]; })); + GetAddressData("D4400", new Action(data => + { + globalVar.rollerLineOne.EmptyRollerNum = data[0]; + })); + GetAddressData("D4410", new Action(data => + { + globalVar.rollerLineTwo.EmptyRollerNum = data[0]; + })); + GetAddressData("D4420", new Action(data => + { + globalVar.rollerLineThree.EmptyRollerNum = data[0]; + })); + GetAddressData("D2111", new Action(data => + { + globalVar.rollerLineOne.WashEmptyRollerModel = data[0]; + globalVar.rollerLineTwo.WashEmptyRollerModel = data[1]; + globalVar.rollerLineThree.WashEmptyRollerModel = data[2]; + globalVar.rollerLineOne.WashRollerArriveSignal = data[3]; + globalVar.rollerLineTwo.WashRollerArriveSignal = data[4]; + globalVar.rollerLineThree.WashRollerArriveSignal = data[5]; + })); - //炒锅1状态数据 - //GetFryOneData("D2001", new Action(data => - //{ - // //FryPotMonitorManage.GetInstance.fryOne.Temperature =?; - //})); + //炒锅1状态数据 + //GetFryOneData("D2001", new Action(data => + //{ + // //FryPotMonitorManage.GetInstance.fryOne.Temperature =?; + //})); - ////炒锅2状态数据 - //GetFryTwoData("D2001", new Action(data => - //{ + ////炒锅2状态数据 + //GetFryTwoData("D2001", new Action(data => + //{ - //})); - ////炒锅3状态数据 - //GetFryThreeData("D2001", new Action(data => - //{ + //})); + ////炒锅3状态数据 + //GetFryThreeData("D2001", new Action(data => + //{ - //})); - ////炒锅4状态数据 - //GetFryFourData("D2001", new Action(data => - //{ + //})); + ////炒锅4状态数据 + //GetFryFourData("D2001", new Action(data => + //{ - //})); - ////炒锅5状态数据 - //GetFryFiveData("D2001", new Action(data => - //{ + //})); + ////炒锅5状态数据 + //GetFryFiveData("D2001", new Action(data => + //{ - //})); - //线体上放空桶 - if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0) + //})); + //线体上放空桶 + if (globalVar.rollerLineOne.EmptyRollerNum != 0) { - globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum); - ++globalVar.LOneMaterialNum; + if (RollerNum.Contains(globalVar.rollerLineOne.EmptyRollerNum)) + { + if (!globalVar.rollerLineOne.EmptyRollerNums.Contains(globalVar.rollerLineOne.EmptyRollerNum)) + { + globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum); + ++globalVar.LOneMaterialNum; + } + } + //是否手动复位PLC } - if (globalVar.rollerLineTwo.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineTwo.EmptyRollerNum != 0) + if (globalVar.rollerLineTwo.EmptyRollerNum != 0) { - globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum); - ++globalVar.LTwoMaterialNum; + + if (RollerNum.Contains(globalVar.rollerLineTwo.EmptyRollerNum)) + { + if (!globalVar.rollerLineTwo.EmptyRollerNums.Contains(globalVar.rollerLineTwo.EmptyRollerNum)) + { + globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum); + ++globalVar.LTwoMaterialNum; + } + } //是否手动复位PLC } - if (globalVar.rollerLineThree.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineThree.EmptyRollerNum != 0) + if (globalVar.rollerLineThree.EmptyRollerNum != 0) { - globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum); - ++globalVar.LThreeMaterialNum; + + if (RollerNum.Contains(globalVar.rollerLineThree.EmptyRollerNum)) + { + if (!globalVar.rollerLineThree.EmptyRollerNums.Contains(globalVar.rollerLineThree.EmptyRollerNum)) + { + globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum); + ++globalVar.LThreeMaterialNum; + } + } //是否手动复位PLC } //炒锅状态数据 @@ -1849,7 +1947,7 @@ namespace FryPot_DosingSystem.Control hardWareStatusModel.RollerOneModel.LocSixRollerSerial = globalVar.rollerLineOne.StationSix; hardWareStatusModel.RollerOneModel.LocSevenRollerSerial = globalVar.rollerLineOne.StationSeven; hardWareStatusModel.RollerOneModel.LocEightRollerSerial = globalVar.rollerLineOne.StationEight; - if (AlarmHelper.GetInstance().LOneRollerTrouble == 0) + if (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 0) { hardWareStatusModel.RollerOneModel.RollerAlarmState = Color.FromRgb(130, 232, 139);//无故障 @@ -1877,7 +1975,7 @@ namespace FryPot_DosingSystem.Control hardWareStatusModel.RollerTwoModel.LocSixRollerSerial = globalVar.rollerLineTwo.StationSix; hardWareStatusModel.RollerTwoModel.LocSevenRollerSerial = globalVar.rollerLineTwo.StationSeven; hardWareStatusModel.RollerTwoModel.LocEightRollerSerial = globalVar.rollerLineTwo.StationEight; - if (AlarmHelper.GetInstance().LTwoRollerTrouble == 0) + if (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 0) { hardWareStatusModel.RollerTwoModel.RollerAlarmState = Color.FromRgb(130, 232, 139);//无故障 } @@ -1903,7 +2001,7 @@ namespace FryPot_DosingSystem.Control hardWareStatusModel.RollerThreeModel.LocSixRollerSerial = globalVar.rollerLineThree.StationSix; hardWareStatusModel.RollerThreeModel.LocSevenRollerSerial = globalVar.rollerLineThree.StationSeven; hardWareStatusModel.RollerThreeModel.LocEightRollerSerial = globalVar.rollerLineThree.StationEight; - if (AlarmHelper.GetInstance().LThreeRollerTrouble == 0) + if (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 0) { hardWareStatusModel.RollerThreeModel.RollerAlarmState = Color.FromRgb(130, 232, 139);//无故障 } @@ -2055,18 +2153,36 @@ namespace FryPot_DosingSystem.Control ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线3空桶清洗任务线程"); ThreadManage.GetInstance().StartLong(new Action(() => { ToLineFourFromCleanPlate(); Thread.Sleep(10); }), "清洗台空桶回桶任务线程"); ThreadManage.GetInstance().StartLong(new Action(() => { EmptyRollerToLinFourFromPot(); Thread.Sleep(10); }), "炒锅空桶回桶任务线程"); + } + ///// + ///// 1号线统一洗桶 + ///// + //public void LineOneUnifyWashRollerModel() + //{ + //} + ///// + ///// 2号线统一洗桶 + ///// + //public void LineTwoUnifyWashRollerModel() + //{ + //} + ///// + ///// 3号线统一洗桶 + ///// + //public void LineThreeUnifyWashRollerModel() + //{ + + //} /// /// 线体1的执行流程 /// public void LineOneProcessExecute() { - //if (!globalVar.LOneTaskLock) - //{ - // globalVar.LOneTaskLock = true; + LOneRecipeDataToPlc(); LineOneRecipeExecuteConfirm(); LOneLoadRoller(); @@ -2083,9 +2199,7 @@ namespace FryPot_DosingSystem.Control /// public void LineTwoProcessExecute() { - //if (!globalVar.LTwoTaskLock) - //{ - // globalVar.LTwoTaskLock = true; + LTwoRecipeDataToPlc(); LineTwoRecipeExecuteConfirm(); LTwoAgvLoadRoller(); @@ -2102,9 +2216,7 @@ namespace FryPot_DosingSystem.Control /// public void LineThreeProcessExecute() { - //if (!globalVar.LThreeTaskLock) - //{ - // globalVar.LThreeTaskLock = true; + LThreeRecipeDataToPlc(); LineThreeRecipeExecuteConfirm(); LThreeAgvLoadRoller(); @@ -2124,14 +2236,14 @@ namespace FryPot_DosingSystem.Control } public void LineTwoToCleanProcessExecute() { - //线体1到清洗台 + //线体2到清洗台 AgvFromLineTwoToCleanPlate(); AgvArriveCleanPlateFromLineTwo(); } public void LineThreeToCleanProcessExecute() { - //线体1到清洗台 + //线体3到清洗台 AgvFromLineThreeToCleanPlate(); AgvArriveCleanPlateFromLineThree(); @@ -2149,7 +2261,7 @@ namespace FryPot_DosingSystem.Control { globalVar.agvArriveCleanLoad = false; MessageNotify.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); - erp: if (AlarmHelper.GetInstance().CleanOutputRollerRunning == 0) + erp: if (AlarmHelper.GetInstance("洗桶机出桶未运行").CleanOutputRollerRunning == 0) { //plc交互 WritePlcData("D1066", 1);//AGV空桶出桶就位信号下发PlC @@ -2157,7 +2269,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().CleanOutputRollerRunning == 1) + while (AlarmHelper.GetInstance("洗桶机出桶未运行").CleanOutputRollerRunning == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -2174,40 +2286,95 @@ namespace FryPot_DosingSystem.Control /// private void AgvFromLineOneToCleanPlate() { - if (AlarmHelper.GetInstance().LOneRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 0)//输送线无故障 { - //线体1到清洗台 - if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun&& globalVar.AllowNextEmptyRollerToClean) + + if (globalVar.rollerLineOne.WashEmptyRollerModel == 0) { - var res = InputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineOne.StationEight); - if ((globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0) && InputMaterialQuene.Count > 0 && globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0)))//一种情况工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶,另一种在没有下单的情况下,线体上的桶都认为是空桶 + + try { + lock (Obj_Lock) + { + //线体1到清洗台 + if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun && globalVar.AllowNextEmptyRollerToClean && globalVar.rollerLineOne.EmptyRollerNums.Count > 0) + { - //下发AGV去空桶线洗桶任务 - e: string id = Guid.NewGuid().ToString("D"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) - goto e; + var res = InputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineOne.StationEight); + if ((globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0) && InputMaterialQuene.Count > 0 && globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0)))//一种情况工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶,另一种在没有下单的情况下,线体上的桶都认为是空桶 + { - string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 - LSevenrobotJobId.Add(id); - // Thread.Sleep(500); - if (LineToCleanCarryTaskErrorCodeAnalysis(info, 1))//AGV呼叫成功 + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 + LSevenrobotJobId.Add(id); + // Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 1))//AGV呼叫成功 + { + + globalVar.rollerLineOne.IsEpmtyBefore = true; + globalVar.AllowNextEmptyRollerToClean = false; + } + else + { + LSevenrobotJobId.Remove(id); + Thread.Sleep(5000); + } + } + // AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + + } + else + { + AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + } + } + } + catch (Exception) + { + + // throw; + } + } + else //统一洗桶模式 + { + if (RTrig.GetInstance("LineOneModel").Start(Convert.ToBoolean(globalVar.rollerLineOne.WashEmptyRollerModel))) + MessageNotify.GetInstance.ShowRunLog($"1号滚筒线切换为统一洗桶模式"); + lock (Obj_Lock) + { + if (globalVar.rollerLineOne.WashRollerArriveSignal == 1 && globalVar.AllowNextEmptyRollerToClean)//1号线空桶洗桶就位 { - globalVar.rollerLineOne.IsEpmtyBefore = true; - globalVar.AllowNextEmptyRollerToClean = false; + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 + LSevenrobotJobId.Add(id); + // Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 1))//AGV呼叫成功 + { + globalVar.AllowNextEmptyRollerToClean = false; + } + else + { + LSevenrobotJobId.Remove(id); + Thread.Sleep(5000); + } } + else { - LSevenrobotJobId.Remove(id); + AgvFromLineOneToClean();//AGV从线体1到清洗处 } - // AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 } + } - else - { - AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 - } + } } @@ -2219,38 +2386,94 @@ namespace FryPot_DosingSystem.Control { // 线体2到清洗台 - if (AlarmHelper.GetInstance().LTwoRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 0)//输送线无故障 { - if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun&& globalVar.AllowNextEmptyRollerToClean) + if (globalVar.rollerLineTwo.WashEmptyRollerModel == 0) { - var res = LTwoInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineTwo.StationEight); - if ((globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0) && LTwoInputMaterialQuene.Count > 0 && globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 + try { - //下发AGV去空桶线洗桶任务 - e: string id = Guid.NewGuid().ToString("D"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) - goto e; - - string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处 - LEightrobotJobId.Add(id); - //Thread.Sleep(500); - if (LineToCleanCarryTaskErrorCodeAnalysis(info, 2)) + lock (Obj_Lock) { + if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun && globalVar.AllowNextEmptyRollerToClean && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0) + { - globalVar.rollerLineTwo.IsEpmtyBefore = true; - globalVar.AllowNextEmptyRollerToClean = false; - } - else - { - LEightrobotJobId.Remove(id); + var res = LTwoInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineTwo.StationEight); + if ((globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0) && LTwoInputMaterialQuene.Count > 0 && globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 + { + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处 + LEightrobotJobId.Add(id); + //Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 2)) + { + + globalVar.rollerLineTwo.IsEpmtyBefore = true; + globalVar.AllowNextEmptyRollerToClean = false; + } + else + { + LEightrobotJobId.Remove(id); + Thread.Sleep(5000); + } + + //AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体2到清洗处 + } + } + + else + { + AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + } } - //AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体2到清洗处 + } + catch (Exception) + { + + // throw; } } else { - AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + if (RTrig.GetInstance("LineTwoModel").Start(Convert.ToBoolean(globalVar.rollerLineTwo.WashEmptyRollerModel))) + MessageNotify.GetInstance.ShowRunLog($"2号滚筒线切换为统一洗桶模式"); + lock (Obj_Lock) + { + if (globalVar.rollerLineTwo.WashRollerArriveSignal == 1 && globalVar.AllowNextEmptyRollerToClean)//1号线空桶洗桶就位 + { + + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处 + LEightrobotJobId.Add(id); + //Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 2)) + { + + + globalVar.AllowNextEmptyRollerToClean = false; + } + else + { + LEightrobotJobId.Remove(id); + Thread.Sleep(5000); + } + } + + + else + { + + AgvFromLineTwoToClean();//AGV从线体1到清洗处 + } + } } } @@ -2262,38 +2485,91 @@ namespace FryPot_DosingSystem.Control private void AgvFromLineThreeToCleanPlate() { //线体3到清洗台 - if (AlarmHelper.GetInstance().LThreeRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 0)//输送线无故障 { - if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun && globalVar.AllowNextEmptyRollerToClean) + if (globalVar.rollerLineThree.WashEmptyRollerModel == 0) { - var res = LThreeInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineThree.StationEight); - if ((globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0) && LThreeInputMaterialQuene.Count > 0 && globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 + try { - //下发AGV去空桶线洗桶任务 - e: string id = Guid.NewGuid().ToString("D"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) - goto e; - - string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处 - LNinerobotJobId.Add(id); - //Thread.Sleep(500); - if (LineToCleanCarryTaskErrorCodeAnalysis(info, 3))//呼叫成功 + lock (Obj_Lock) { + if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun && globalVar.AllowNextEmptyRollerToClean && globalVar.rollerLineThree.EmptyRollerNums.Count > 0) + { - globalVar.rollerLineThree.IsEpmtyBefore = true; - globalVar.AllowNextEmptyRollerToClean = false; - } - else//呼叫失败 - { - LNinerobotJobId.Remove(id); + var res = LThreeInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineThree.StationEight); + if ((globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0) && LThreeInputMaterialQuene.Count > 0 && globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 + { + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处 + LNinerobotJobId.Add(id); + //Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 3))//呼叫成功 + { + + globalVar.rollerLineThree.IsEpmtyBefore = true; + globalVar.AllowNextEmptyRollerToClean = false; + } + else//呼叫失败 + { + LNinerobotJobId.Remove(id); + Thread.Sleep(5000); + } + + //AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + } + + } + else + { + AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + } } + } + catch (Exception) + { - //AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + // throw; } } else { - AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + if (RTrig.GetInstance("LineThreeModel").Start(Convert.ToBoolean(globalVar.rollerLineThree.WashEmptyRollerModel))) + MessageNotify.GetInstance.ShowRunLog($"3号滚筒线切换为统一洗桶模式"); + lock (Obj_Lock) + { + if (globalVar.rollerLineThree.WashRollerArriveSignal == 1 && globalVar.AllowNextEmptyRollerToClean)//1号线空桶洗桶就位 + { + + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("D"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处 + LNinerobotJobId.Add(id); + //Thread.Sleep(500); + if (LineToCleanCarryTaskErrorCodeAnalysis(info, 3))//呼叫成功 + { + + globalVar.rollerLineThree.IsEpmtyBefore = true; + globalVar.AllowNextEmptyRollerToClean = false; + } + else//呼叫失败 + { + LNinerobotJobId.Remove(id); + Thread.Sleep(5000); + } + + } + else + { + AgvFromLineThreeToClean();//AGV从线体3到清洗处 + } + } } } } @@ -2308,7 +2584,7 @@ namespace FryPot_DosingSystem.Control globalVar.rollerLineOne.agvArriveCleanUnLoad = false; MessageNotify.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶"); - erp: if (AlarmHelper.GetInstance().CleanEnterRollerRunning == 0) + erp: if (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 0) { //plc交互 WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC @@ -2316,7 +2592,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().CleanEnterRollerRunning == 1) + while (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -2340,7 +2616,7 @@ namespace FryPot_DosingSystem.Control globalVar.rollerLineTwo.agvArriveCleanUnLoad = false; MessageNotify.GetInstance.ShowRunLog("空桶从线体2到达清洗位置,准备卸桶"); - erp: if (AlarmHelper.GetInstance().CleanEnterRollerRunning == 0) + erp: if (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 0) { //plc交互 WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC @@ -2348,7 +2624,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().CleanEnterRollerRunning == 1) + while (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -2371,7 +2647,7 @@ namespace FryPot_DosingSystem.Control { globalVar.rollerLineThree.agvArriveCleanUnLoad = false; MessageNotify.GetInstance.ShowRunLog("空桶从线体3到达清洗位置,准备卸桶"); - erp: if (AlarmHelper.GetInstance().CleanEnterRollerRunning == 0) + erp: if (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 0) { //plc交互 WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC @@ -2379,7 +2655,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().CleanEnterRollerRunning == 1) + while (AlarmHelper.GetInstance("洗桶机进筒未运行").CleanEnterRollerRunning == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -2403,10 +2679,12 @@ namespace FryPot_DosingSystem.Control /// public void CallAgvToLineFour() { - if (globalVar.CleanComplete == 1) + if (RTrig.GetInstance("呼叫AGV").Start(Convert.ToBoolean(globalVar.CleanComplete))) { - //是否需要手动给PLC置位?? - globalVar.CleanComplete = 0; + //DeviceOperate.GetInstance.WritePlcData("D2076",0); + //Thread.Sleep(800); + //是否需要手动给PLC置位?? + // globalVar.CleanComplete = 0; e: string id = Guid.NewGuid().ToString("D"); if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null) goto e; @@ -2428,12 +2706,14 @@ namespace FryPot_DosingSystem.Control /// private void LThreeRecipeDataToPlc() { - if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe && globalVar.rollerLineThree.RecipeCompleteSingle == 1) + if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe) { globalVar.rollerLineThree.RecipeComMidSingle = 1; if (globalVar.LThreeCurrentRecipeName != string.Empty) { - MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); + MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); + WritePlcData("D2103", 0); + WritePlcData("D1103", 0);//复位开始执行指令 PlcLineThreeRecipeDataReset(); if (globalVar.LThreeFryPotSerial == 3) { @@ -2450,11 +2730,16 @@ namespace FryPot_DosingSystem.Control Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; }); } } - if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && globalVar.rollerLineThree.RecipeComMidSingle == 1)//后续添加其它限制条件 + if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && globalVar.rollerLineThree.RecipeComMidSingle == 1 && globalVar.rollerLineThree.WashEmptyRollerModel == 0)//后续添加其它限制条件 { Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = string.Empty; })); Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.workflows = new ObservableCollection(); })); AgvViewModel.GetInstance().Set启动或停止炒锅(3, IsRun.Stop); + WritePlcData("D2103", 0); + WritePlcData("D1103", 0);//复位开始执行指令 + //清空配方数据队列 + PlcLineThreeRecipeDataReset();//PLC复位 + Thread.Sleep(800); //if (globalVar.LThreeCurrentRecipeName != string.Empty) // MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); if (LThreeRecipeQuene.TryDequeue(out NewRecipeModel result)) @@ -2469,33 +2754,40 @@ namespace FryPot_DosingSystem.Control MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线开始制作【{result.RecipeName}】 配方"); for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 { - if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && headNum == 3) - { - fryThreeRecipe = result.RecipeName;//炒锅状态开始记录 - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = result.RecipeName; })); - //将配方中原料加入新的队列 - LThreeInputMaterialQuene.Enqueue(new MaterialInfo() - { - materialType = result.materialCollection[i], - materialId = result.RecipeId - }); - RollerThreeDataWrite(i, result.materialCollection[i].MaterialLoc,(ushort) (result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//3号滚筒线桶号以及重量数据、偏差量下发 - } - else + //if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && headNum == 3) + //{ + fryThreeRecipe = result.RecipeName;//炒锅状态开始记录 + Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = result.RecipeName; })); + //将配方中原料加入新的队列 + LThreeInputMaterialQuene.Enqueue(new MaterialInfo() { - MessageNotify.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - LThreeInputMaterialQuene.Clear(); - LThreeErrorRecipe = true; - return; - } + materialType = result.materialCollection[i], + materialId = result.RecipeId + }); + RollerThreeDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight + RollerNetweight), result.materialCollection[i].MaterialOffset);//3号滚筒线桶号以及重量数据、偏差量下发 + //} + //else + //{ + // MessageNotify.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // MessageNotify.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // LThreeInputMaterialQuene.Clear(); + // LThreeErrorRecipe = true; + // return; + //} } DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据 - // globalVar.rollerLineThree.RecipeComMidSingle = 0; + // globalVar.rollerLineThree.RecipeComMidSingle = 0; WritePlcData("D1103", 1);//配方开始执行命令 + globalVar.rollerLineThree.LowSignalJude = true; } } + //else if (RTrig.GetInstance("LineThreeModel").Start(Convert.ToBoolean(globalVar.rollerLineThree.WashEmptyRollerModel))) + //{ + // MessageNotify.GetInstance.ShowUserLog("提示:3号滚筒线处于集中洗桶模式,无法下发配方"); + // Application.Current.Dispatcher.Invoke(new Action(() => { NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "提示", $"3号滚筒线处于集中洗桶模式,无法下发配方"); })); + // LThreeRecipeQuene.Clear(); + //} } @@ -2505,12 +2797,14 @@ namespace FryPot_DosingSystem.Control /// private void LTwoRecipeDataToPlc() { - if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe && globalVar.rollerLineTwo.RecipeCompleteSingle == 1) + if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe) { globalVar.rollerLineTwo.RecipeComMidSingle = 1; if (globalVar.LTwoCurrentRecipeName != string.Empty) { - MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); + MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); + WritePlcData("D2102", 0); + WritePlcData("D1102", 0);//复位开始执行指令 PlcLineTwoRecipeDataReset(); if (globalVar.LTwoFryPotSerial == 2) { @@ -2539,7 +2833,7 @@ namespace FryPot_DosingSystem.Control } } - if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle == 1)//后续添加其它限制条件 + if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle == 1 && globalVar.rollerLineTwo.WashEmptyRollerModel == 0)//后续添加其它限制条件 { if (globalVar.LTwoFryPotSerial == 2) { @@ -2555,6 +2849,11 @@ namespace FryPot_DosingSystem.Control } //if (globalVar.LTwoCurrentRecipeName != string.Empty) // MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); + WritePlcData("D2102", 0); + WritePlcData("D1102", 0);//复位开始执行指令 + //清空配方数据队列 + PlcLineTwoRecipeDataReset();//PLC复位 + Thread.Sleep(800); if (LTwoRecipeQuene.TryDequeue(out NewRecipeModel result)) { LTwoErrorRecipe = false; @@ -2566,39 +2865,46 @@ namespace FryPot_DosingSystem.Control MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线开始制作【{result.RecipeName}】 配方"); for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 { - if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5)) + //if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5)) + //{ + if (headNum == 2)//炒锅2 { - if (headNum == 2)//炒锅2 - { - fryTwoRecipe = result.RecipeName;//炒锅状态开始记录 - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; })); - } - else//炒锅5 - { - fryFiveRecipe = result.RecipeName;//炒锅状态开始记录 - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.goodsName = result.RecipeName; })); - } - //将配方中原料加入新的队列 - LTwoInputMaterialQuene.Enqueue(new MaterialInfo() - { - materialType = result.materialCollection[i], - materialId = result.RecipeId - }); - RollerTwoDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//2号滚筒线桶号以及重量、偏差量数据下发 + fryTwoRecipe = result.RecipeName;//炒锅状态开始记录 + Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; })); } - else + else//炒锅5 { - MessageNotify.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - LTwoInputMaterialQuene.Clear(); - LTwoErrorRecipe = true; - return; + fryFiveRecipe = result.RecipeName;//炒锅状态开始记录 + Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.goodsName = result.RecipeName; })); } + //将配方中原料加入新的队列 + LTwoInputMaterialQuene.Enqueue(new MaterialInfo() + { + materialType = result.materialCollection[i], + materialId = result.RecipeId + }); + RollerTwoDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight + RollerNetweight), result.materialCollection[i].MaterialOffset);//2号滚筒线桶号以及重量、偏差量数据下发 + //} + //else + //{ + // MessageNotify.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // MessageNotify.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // LTwoInputMaterialQuene.Clear(); + // LTwoErrorRecipe = true; + // return; + //} } DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count);//发送2号滚筒线工序数据 - //globalVar.rollerLineTwo.RecipeComMidSingle = 0; + //globalVar.rollerLineTwo.RecipeComMidSingle = 0; WritePlcData("D1102", 1);//配方开始执行命令 + globalVar.rollerLineTwo.LowSignalJude = true; } + //else if (RTrig.GetInstance("LineTwoModel").Start(Convert.ToBoolean(globalVar.rollerLineTwo.WashEmptyRollerModel))) + //{ + // MessageNotify.GetInstance.ShowUserLog("提示:2号滚筒线处于集中洗桶模式,无法下发配方"); + // Application.Current.Dispatcher.Invoke(new Action(() => { NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "提示", $"2号滚筒线处于集中洗桶模式,无法下发配方"); })); + // LTwoRecipeQuene.Clear(); + //} } } @@ -2607,13 +2913,16 @@ namespace FryPot_DosingSystem.Control /// private void LOneRecipeDataToPlc() { - if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe && globalVar.rollerLineOne.RecipeCompleteSingle == 1) + if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe) { globalVar.rollerLineOne.RecipeComMidSingle = 1; if (globalVar.LOneCurrentRecipeName != string.Empty) { - MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); + MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); + WritePlcData("D2101", 0); + WritePlcData("D1101", 0);//复位开始执行指令 PlcLineOneRecipeDataReset(); + if (globalVar.LOneFryPotSerial == 1) { FryPotMonitorManage.GetInstance.fryOne.TotalProduct++; @@ -2640,7 +2949,7 @@ namespace FryPot_DosingSystem.Control Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; }); } } - if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && globalVar.rollerLineOne.RecipeComMidSingle == 1)//后续添加其它限制条件 + if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && globalVar.rollerLineOne.RecipeComMidSingle == 1 && globalVar.rollerLineOne.WashEmptyRollerModel == 0)//后续添加其它限制条件 { if (globalVar.LOneFryPotSerial == 1) { @@ -2654,6 +2963,11 @@ namespace FryPot_DosingSystem.Control Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.workflows = new ObservableCollection(); })); AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Stop); } + WritePlcData("D2101", 0); + WritePlcData("D1101", 0);//复位开始执行指令 + //清空配方数据队列 + PlcLineOneRecipeDataReset();//PLC复位 + Thread.Sleep(800); if (RecipeQuene.TryDequeue(out NewRecipeModel result)) { ErrorRecipe = false; @@ -2665,70 +2979,84 @@ namespace FryPot_DosingSystem.Control MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线开始制作【{result.RecipeName}】 配方"); for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 { - if (result.materialCollection.Count <= 8 && result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 1 || headNum == 4)) + //if (result.materialCollection.Count <= 8 && result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 1 || headNum == 4)) + //{ + if (headNum == 1)//炒锅1 { - if (headNum == 1)//炒锅1 - { - fryOneRecipe = result.RecipeName;//炒锅状态开始记录 - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.goodsName = result.RecipeName; })); - } - else//炒锅4 - { - fryFourRecipe = result.RecipeName;//炒锅状态开始记录 - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.goodsName = result.RecipeName; })); - } - //将配方中原料加入新的队列 - InputMaterialQuene.Enqueue(new MaterialInfo() - { - materialType = result.materialCollection[i], - materialId = result.RecipeId - }); - RollerOneDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//1号滚筒线桶号以及重量、偏差量数据下发 - + fryOneRecipe = result.RecipeName;//炒锅状态开始记录 + Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.goodsName = result.RecipeName; })); } - else + else//炒锅4 { - MessageNotify.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); - InputMaterialQuene.Clear(); - ErrorRecipe = true; - return; + fryFourRecipe = result.RecipeName;//炒锅状态开始记录 + Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.goodsName = result.RecipeName; })); } + //将配方中原料加入新的队列 + InputMaterialQuene.Enqueue(new MaterialInfo() + { + materialType = result.materialCollection[i], + materialId = result.RecipeId + }); + RollerOneDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight + RollerNetweight), result.materialCollection[i].MaterialOffset);//1号滚筒线桶号以及重量、偏差量数据下发 + + //} + //else + //{ + // MessageNotify.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // MessageNotify.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); + // InputMaterialQuene.Clear(); + // ErrorRecipe = true; + // return; + //} } DeviceOperate.GetInstance.WritePlcData("D1009", (ushort)result.materialCollection.Count);//发送1号滚筒线工序数据 - // globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 + // globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 WritePlcData("D1101", 1);//线体1配方开始执行命令 + globalVar.rollerLineOne.LowSignalJude = true; } } - + //else if (RTrig.GetInstance("LineOneModel").Start(Convert.ToBoolean(globalVar.rollerLineOne.WashEmptyRollerModel))) + //{ + // MessageNotify.GetInstance.ShowUserLog("提示:1号滚筒线处于集中洗桶模式,无法下发配方"); + // Application.Current.Dispatcher.Invoke(new Action(() => { NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "提示", $"1号滚筒线处于集中洗桶模式,无法下发配方"); })); + // RecipeQuene.Clear(); + //} } - - + + /// /// 线体1配方执行等待下位确认 /// public void LineOneRecipeExecuteConfirm() { - if (globalVar.rollerLineOne.RecipeComMidSingle == 1) + if (globalVar.rollerLineOne.RecipeComMidSingle == 1 && globalVar.rollerLineOne.LowSignalJude) { if (globalVar.rollerLineOne.ExcuteIsConfirm == 1) //收到下位执行信号 { + WritePlcData("D2101", 0); globalVar.rollerLineOne.NextStart = true; globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 + globalVar.rollerLineOne.LowSignalJude = false; } else if (globalVar.rollerLineOne.ExcuteIsConfirm == 2) //收到下位取消执行命令 { + RecipeQuene.Clear(); + OutputMaterialQuene.Clear(); globalVar.rollerLineOne.NextStart = false; + WritePlcData("D2101", 0); WritePlcData("D1101", 0);//复位开始执行指令 - //清空配方数据队列 + //清空配方数据队列 PlcLineOneRecipeDataReset();//PLC复位 InputMaterialQuene.Clear(); - MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); - MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"1号滚筒线所有配方已清除"); + MessageNotify.GetInstance.ShowUserLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowUserLog($"1号滚筒线所有配方已清除"); globalVar.LOneCurrentRecipeName = string.Empty; + globalVar.rollerLineOne.LowSignalJude = false; } else //未收到下位执行信号 { @@ -2742,23 +3070,31 @@ namespace FryPot_DosingSystem.Control /// public void LineTwoRecipeExecuteConfirm() { - if (globalVar.rollerLineTwo.RecipeComMidSingle == 1) + if (globalVar.rollerLineTwo.RecipeComMidSingle == 1 && globalVar.rollerLineTwo.LowSignalJude) { if (globalVar.rollerLineTwo.ExcuteIsConfirm == 1) //收到下位执行信号 { + WritePlcData("D2102", 0); globalVar.rollerLineTwo.NextStart = true; globalVar.rollerLineTwo.RecipeComMidSingle = 0;//配方完成的中转信号置0 + globalVar.rollerLineTwo.LowSignalJude = false; } else if (globalVar.rollerLineTwo.ExcuteIsConfirm == 2) //收到下位取消执行命令 { + LTwoRecipeQuene.Clear(); + LTwoOutputMaterialQuene.Clear(); globalVar.rollerLineTwo.NextStart = false; + WritePlcData("D2102", 0); WritePlcData("D1102", 0);//复位开始执行指令 - //清空配方数据队列 + //清空配方数据队列 PlcLineTwoRecipeDataReset();//PLC复位 LTwoInputMaterialQuene.Clear(); - MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); - MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"2号滚筒线所有配方已清除"); + MessageNotify.GetInstance.ShowUserLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowUserLog($"2号滚筒线所有配方已清除"); globalVar.LTwoCurrentRecipeName = string.Empty; + globalVar.rollerLineTwo.LowSignalJude = false; } else //未收到下位执行信号 { @@ -2771,23 +3107,33 @@ namespace FryPot_DosingSystem.Control /// public void LineThreeRecipeExecuteConfirm() { - if (globalVar.rollerLineThree.RecipeComMidSingle == 1) + if (globalVar.rollerLineThree.RecipeComMidSingle == 1 && globalVar.rollerLineThree.LowSignalJude) { + if (globalVar.rollerLineThree.ExcuteIsConfirm == 1) //收到下位执行信号 { + WritePlcData("D2103", 0); globalVar.rollerLineThree.NextStart = true; globalVar.rollerLineThree.RecipeComMidSingle = 0;//配方完成的中转信号置0 + globalVar.rollerLineThree.LowSignalJude = false; } else if (globalVar.rollerLineThree.ExcuteIsConfirm == 2) //收到下位取消执行命令 { + LThreeRecipeQuene.Clear(); + LThreeOutputMaterialQuene.Clear(); globalVar.rollerLineThree.NextStart = false; + WritePlcData("D2103", 0); WritePlcData("D1103", 0);//复位开始执行指令 - //清空配方数据队列 + //清空配方数据队列 PlcLineThreeRecipeDataReset();//PLC复位 LThreeInputMaterialQuene.Clear(); - MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); - MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowRunLog($"3号滚筒线所有配方已清除"); + MessageNotify.GetInstance.ShowUserLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); + MessageNotify.GetInstance.ShowUserLog($"3号滚筒线所有配方已清除"); + globalVar.LThreeCurrentRecipeName = string.Empty; + globalVar.rollerLineThree.LowSignalJude = false; } else //未收到下位执行信号 { @@ -2801,7 +3147,7 @@ namespace FryPot_DosingSystem.Control /// public void LOneLoadRoller() { - if (InputMaterialQuene.Count > 0&& globalVar.rollerLineOne.NextStart) + if (InputMaterialQuene.Count > 0 && globalVar.rollerLineOne.NextStart) { AgvToLineOneLoadRoller(); AgvFromLineOneToFryPot();//AGV到1号线体装桶 @@ -2827,7 +3173,7 @@ namespace FryPot_DosingSystem.Control /// public void LTwoAgvLoadRoller() { - if (LTwoInputMaterialQuene.Count > 0&& globalVar.rollerLineTwo.NextStart) + if (LTwoInputMaterialQuene.Count > 0 && globalVar.rollerLineTwo.NextStart) { AgvToLineTwoLoadRoller(); AgvFromLineTwoToFryPot();//AGV到2号线体装桶 @@ -2853,7 +3199,7 @@ namespace FryPot_DosingSystem.Control /// public void LThreeAgvLoadRoller() { - if (LThreeInputMaterialQuene.Count > 0&& globalVar.rollerLineThree.NextStart) + if (LThreeInputMaterialQuene.Count > 0 && globalVar.rollerLineThree.NextStart) { AgvToLineThreeLoadRoller(); @@ -2952,13 +3298,11 @@ namespace FryPot_DosingSystem.Control //炒锅滚筒进料运行到位处理 FryPotOneOrFourInputMaterialRollerOperate(); - //上游下发搬运任务给AGV - if (AgvFromFryPotOneOrFourToClean()) - { - AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Start); - globalVar.InOrOutputLock = true; - globalVar.PotOneOutputRollerArrive = true; - } + AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Start); + FryPotOneRollerTroubleCheck(); + globalVar.InOrOutputLock = true; + globalVar.PotOneOutputRollerArrive = true; + } } @@ -3017,13 +3361,11 @@ namespace FryPot_DosingSystem.Control //炒锅滚筒进料运行到位处理 FryPotTwoOrFiveInputMaterialRollerOperate(); - //上游下发搬运任务给AGV - if (AgvFromFryPotTwoOrFiveToClean()) - { - AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LTwoFryPotSerial, IsRun.Start); - globalVar.LTwoInOrOutputLock = true; - globalVar.LTwoPotOutputRollerArrive = true; - } + AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LTwoFryPotSerial, IsRun.Start); + FryPotTwoRollerTroubleCheck(); + globalVar.LTwoInOrOutputLock = true; + globalVar.LTwoPotOutputRollerArrive = true; + } } @@ -3057,13 +3399,12 @@ namespace FryPot_DosingSystem.Control //炒锅滚筒进料运行到位处理 FryPotThreeInputMaterialRollerOperate(); - //上游下发搬运任务给AGV - if (AgvFromFryPotThreeToClean()) - { - AgvViewModel.GetInstance().Set启动或停止炒锅(3, IsRun.Start); - globalVar.LThreeInOrOutputLock = true; - globalVar.LThreePotOutputRollerArrive = true; - } + + AgvViewModel.GetInstance().Set启动或停止炒锅(3, IsRun.Start); + FryPotThreeRollerTroubleCheck(); + globalVar.LThreeInOrOutputLock = true; + globalVar.LThreePotOutputRollerArrive = true; + } } @@ -3109,25 +3450,26 @@ namespace FryPot_DosingSystem.Control /// public void LOneFryPotOutputMaterial() { - if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && globalVar.agvArriveUpLoad && globalVar.PotOneOutputRollerArrive && !globalVar.AgvArrivePot) + if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFour.EmptyBarrelArrivedSingle == 1) && OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && globalVar.PotOneOutputRollerArrive && !globalVar.AgvArrivePot) { + //上游下发搬运任务给AGV + if (AgvFromFryPotOneOrFourToClean()) + { + globalVar.AgvArrivePot = true; + } + else + { + Thread.Sleep(5000); + } + - MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅空桶上料位置"); - AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号 - globalVar.agvArriveUpLoad = false; - globalVar.AgvArrivePot = true; - FryPotOneRollerTroubleCheck(); } } public void LOneEmptyOperate() { - if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFour.EmptyBarrelArrivedSingle == 1) && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot) + if (globalVar.agvArriveUpLoad && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot) { - - // FryPotOneRollerTroubleCheck(); - //if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//无故障 - //{ if (globalVar.agvFryPotEmptyRollerArrive) { FryPotOneOrFourOutEmpetyRollerOperate(); @@ -3142,6 +3484,7 @@ namespace FryPot_DosingSystem.Control //{ // AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_4); //} + globalVar.agvArriveUpLoad = false; globalVar.agvFryPotEmptyRollerArrive = false; globalVar.InOrOutputLock = false; MessageNotify.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线"); @@ -3166,26 +3509,34 @@ namespace FryPot_DosingSystem.Control /// public void LTwoFryPotOutputMaterial() { - if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && globalVar.agvArriveLTwoUpLoad && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot) + if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && (globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFive.EmptyBarrelArrivedSingle == 1) && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot) { + //上游下发搬运任务给AGV + if (AgvFromFryPotTwoOrFiveToClean()) + { + globalVar.LTwoAgvArrivePot = true; + } + else + { + Thread.Sleep(5000); + } + + - MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅空桶上料位置"); - AgvArriveFryPotTwoOrFiveOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号 - globalVar.agvArriveLTwoUpLoad = false; - globalVar.LTwoAgvArrivePot = true; - FryPotTwoRollerTroubleCheck(); } } public void LTwoEmptyOperate() { - if ((globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFive.EmptyBarrelArrivedSingle == 1) && LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoAgvArrivePot) + if (globalVar.agvArriveLTwoUpLoad && LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoAgvArrivePot) { + //if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//无故障 //{ if (globalVar.LTwoagvFryPotEmptyRollerArrive) { + FryPotTwoOrFiveOutEmpetyRollerOperate(); if (LTwoOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料 { @@ -3198,6 +3549,8 @@ namespace FryPot_DosingSystem.Control //{ // AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_5); //} + + globalVar.agvArriveLTwoUpLoad = false; globalVar.LTwoagvFryPotEmptyRollerArrive = false; globalVar.LTwoInOrOutputLock = false; @@ -3221,29 +3574,36 @@ namespace FryPot_DosingSystem.Control /// public void LThreeFryPotOutputMaterial() { - if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && globalVar.agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot) + if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && globalVar.fryPotThree.EmptyBarrelArrivedSingle == 1 && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot) { - MessageNotify.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置"); - AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号 - globalVar.agvArriveLThreeUpLoad = false; - globalVar.LThreeAgvArrivePot = true; - FryPotThreeRollerTroubleCheck(); + //上游下发搬运任务给AGV + if (AgvFromFryPotThreeToClean()) + { + globalVar.LThreeAgvArrivePot = true; + } + else + { + Thread.Sleep(5000); + } } } public void LThreeEmptyOperate() { - if (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 1 && LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeAgvArrivePot) + if (globalVar.agvArriveLThreeUpLoad && LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeAgvArrivePot) { //if (FryPotThreeAlarm == 1)//无故障 //{ if (globalVar.LThreeagvFryPotEmptyRollerArrive) { - FryPotThreeOutEmpetyRollerOperate(); + //FryPotThreeOutEmpetyRollerOperate(); + MessageNotify.GetInstance.ShowRunLog($"炒锅【3】原料:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); if (LThreeOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料 { //AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes); //AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3); + + globalVar.agvArriveLThreeUpLoad = false; globalVar.LThreeagvFryPotEmptyRollerArrive = false; globalVar.LThreeInOrOutputLock = false; @@ -3760,7 +4120,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineOneToFryPot() { - erp: if (AlarmHelper.GetInstance().LOneRollerTrouble == 0) + erp: if (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 0) { if (globalVar.agvArriveUpLoad && globalVar.LoadRoller && globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.AgvToFryPot)//无故障 { @@ -3782,7 +4142,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().LOneRollerTrouble == 1) + while (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -3796,15 +4156,16 @@ namespace FryPot_DosingSystem.Control /// /// Agv从1号线体运空桶到清洗处 /// - public void AgvFromLineOneToClean(ushort emptyRollerNum) + public void AgvFromLineOneToClean(ushort emptyRollerNum = 0) { - erp: if (AlarmHelper.GetInstance().LOneRollerTrouble == 0)//无故障 + erp: if (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 0)//无故障 { if (globalVar.agvArriveLineOneLoadEmptyRoller)//agv到达上料位置 { MessageNotify.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置"); DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc - MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); globalVar.agvArriveLineOneLoadEmptyRoller = false; @@ -3812,15 +4173,17 @@ namespace FryPot_DosingSystem.Control } if (globalVar.agvArriveLineOneLoadCom)//上料完成 { - globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0); + if (emptyRollerNum != 0) + globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0); globalVar.agvArriveLineOneLoadCom = false; globalVar.rollerLineOne.IsEpmtyBefore = false; - MessageNotify.GetInstance.ShowRunLog($"AGV在【1】号线体完成【{emptyRollerNum}】号空料桶装载"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV在【1】号线体完成【{emptyRollerNum}】号空料桶装载"); } } else//有故障 { - while (AlarmHelper.GetInstance().LOneRollerTrouble == 1) + while (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -3838,7 +4201,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineTwoToFryPot() { - erp: if (AlarmHelper.GetInstance().LTwoRollerTrouble == 0)//无故障 + erp: if (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 0)//无故障 { if (globalVar.agvArriveLTwoUpLoad && globalVar.LTwoLoadRoller && globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LTwoAgvToFryPot)//无故障 { @@ -3861,7 +4224,7 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (AlarmHelper.GetInstance().LTwoRollerTrouble == 1) + while (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineTwoTask) @@ -3875,15 +4238,16 @@ namespace FryPot_DosingSystem.Control /// /// Agv从2号线体运空桶到清洗处 /// - public void AgvFromLineTwoToClean(ushort emptyRollerNum) + public void AgvFromLineTwoToClean(ushort emptyRollerNum = 0) { - erp: if (AlarmHelper.GetInstance().LTwoRollerTrouble == 0)//无故障 + erp: if (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 0)//无故障 { if (globalVar.agvArriveLineTwoLoadEmptyRoller)//agv到达上料位置 { MessageNotify.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置"); DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc - MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); globalVar.agvArriveLineTwoLoadEmptyRoller = false; @@ -3892,15 +4256,17 @@ namespace FryPot_DosingSystem.Control } if (globalVar.agvArriveLineTwoLoadCom)//上料完成 { - globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0); + if (emptyRollerNum != 0) + globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0); globalVar.agvArriveLineTwoLoadCom = false; globalVar.rollerLineTwo.IsEpmtyBefore = false; - MessageNotify.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载"); } } else//有故障 { - while (AlarmHelper.GetInstance().LTwoRollerTrouble == 1) + while (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -3918,7 +4284,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineThreeToFryPot() { - erp: if (AlarmHelper.GetInstance().LThreeRollerTrouble == 0)//无故障 + erp: if (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 0)//无故障 { if (globalVar.agvArriveLThreeUpLoad && globalVar.LThreeLoadRoller && globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LThreeAgvToFryPot)//无故障 { @@ -3941,7 +4307,7 @@ namespace FryPot_DosingSystem.Control } else //有故障 { - while (AlarmHelper.GetInstance().LThreeRollerTrouble == 1) + while (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineThreeTask) @@ -3955,15 +4321,16 @@ namespace FryPot_DosingSystem.Control /// /// Agv从3号线体运空桶到清洗处 /// - public void AgvFromLineThreeToClean(ushort emptyRollerNum) + public void AgvFromLineThreeToClean(ushort emptyRollerNum = 0) { - erp: if (AlarmHelper.GetInstance().LThreeRollerTrouble == 0)//无故障 + erp: if (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 0)//无故障 { if (globalVar.agvArriveLineThreeLoadEmptyRoller)//agv到达上料位置 { MessageNotify.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置"); DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc - MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); globalVar.agvArriveLineThreeLoadEmptyRoller = false; @@ -3973,15 +4340,17 @@ namespace FryPot_DosingSystem.Control } if (globalVar.agvArriveLineThreeLoadCom)//上料完成 { - globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0); + if (emptyRollerNum != 0) + globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0); globalVar.agvArriveLineThreeLoadCom = false; globalVar.rollerLineThree.IsEpmtyBefore = false; - MessageNotify.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载"); + if (emptyRollerNum != 0) + MessageNotify.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载"); } } else//有故障 { - while (AlarmHelper.GetInstance().LThreeRollerTrouble == 1) + while (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) @@ -4088,9 +4457,9 @@ namespace FryPot_DosingSystem.Control public void AgvToLineOneLoadRoller() { - if (AlarmHelper.GetInstance().LOneRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("1号滚筒线故障").LOneRollerTrouble == 0)//输送线无故障 { - if (InputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineLoadRoller && globalVar.rollerLineOne.OutMaterialingSingle == 1 && !globalVar.LoadRoller) + if (InputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineLoadRoller && !globalVar.LoadRoller) { if (globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineOne.IsEpmtyBefore)//工位8上面是配方料桶 { @@ -4105,7 +4474,7 @@ namespace FryPot_DosingSystem.Control } else { - info = AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(id); + info = AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(id); } LOnerobotJobId = id; if (LineCarryTaskErrorCodeAnalysis(info, 1)) @@ -4113,6 +4482,10 @@ namespace FryPot_DosingSystem.Control globalVar.AllowAgvToLineLoadRoller = false; globalVar.LoadRoller = true; } + else + { + Thread.Sleep(5000); + } } //else if (globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) @@ -4156,9 +4529,9 @@ namespace FryPot_DosingSystem.Control } public void AgvToLineTwoLoadRoller() { - if (AlarmHelper.GetInstance().LTwoRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("2号滚筒线故障").LTwoRollerTrouble == 0)//输送线无故障 { - if (LTwoInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineTwoLoadRoller && globalVar.rollerLineTwo.OutMaterialingSingle == 1 && !globalVar.LTwoLoadRoller) + if (LTwoInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineTwoLoadRoller && !globalVar.LTwoLoadRoller) { if (globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineTwo.IsEpmtyBefore)//工位8上面是配方料桶 { @@ -4182,7 +4555,10 @@ namespace FryPot_DosingSystem.Control globalVar.LTwoLoadRoller = true; globalVar.AllowAgvToLineTwoLoadRoller = false; } - + else + { + Thread.Sleep(5000); + } } //else if (globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) //{ @@ -4218,9 +4594,9 @@ namespace FryPot_DosingSystem.Control } public void AgvToLineThreeLoadRoller() { - if (AlarmHelper.GetInstance().LThreeRollerTrouble == 0)//输送线无故障 + if (AlarmHelper.GetInstance("3号滚筒线故障").LThreeRollerTrouble == 0)//输送线无故障 { - if (LThreeInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineThreeLoadRoller && globalVar.rollerLineThree.OutMaterialingSingle == 1 && !globalVar.LThreeLoadRoller) + if (LThreeInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineThreeLoadRoller && !globalVar.LThreeLoadRoller) { if (globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineThree.IsEpmtyBefore)//工位8上面是配方料桶 { @@ -4237,6 +4613,10 @@ namespace FryPot_DosingSystem.Control globalVar.LThreeLoadRoller = true; globalVar.AllowAgvToLineThreeLoadRoller = false; } + else + { + Thread.Sleep(5000); + } } //else if (globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) @@ -4305,7 +4685,7 @@ namespace FryPot_DosingSystem.Control /// /// /// - public void RollerOneDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) + public void RollerOneDataWrite(int count, ushort materialLoc, ushort materialWeight, float materialOffset) { switch (count) { @@ -4358,7 +4738,7 @@ namespace FryPot_DosingSystem.Control /// /// /// - public void RollerTwoDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) + public void RollerTwoDataWrite(int count, ushort materialLoc, ushort materialWeight, float materialOffset) { switch (count) { @@ -4411,7 +4791,7 @@ namespace FryPot_DosingSystem.Control /// /// /// - public void RollerThreeDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) + public void RollerThreeDataWrite(int count, ushort materialLoc, ushort materialWeight, float materialOffset) { switch (count) { @@ -4540,7 +4920,7 @@ namespace FryPot_DosingSystem.Control switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) { case 1: - if (AlarmHelper.GetInstance().FryPotOneRollerTrouble == 1) + if (AlarmHelper.GetInstance("1号炒锅滚筒故障").FryPotOneRollerTrouble == 1) { FryPotAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } @@ -4549,7 +4929,7 @@ namespace FryPot_DosingSystem.Control FryPotAlarm = 1; return; } - while (AlarmHelper.GetInstance().FryPotOneRollerTrouble == 1) + while (AlarmHelper.GetInstance("1号炒锅滚筒故障").FryPotOneRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) return; @@ -4557,7 +4937,7 @@ namespace FryPot_DosingSystem.Control MessageNotify.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行"); FryPotAlarm = 1; break; case 4: - if (AlarmHelper.GetInstance().FryPotFourRollerTrouble == 1) { FryPotFourAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFourAlarm = 1; return; } while (AlarmHelper.GetInstance().FryPotFourRollerTrouble == 1) + if (AlarmHelper.GetInstance("4号炒锅滚筒故障").FryPotFourRollerTrouble == 1) { FryPotFourAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFourAlarm = 1; return; } while (AlarmHelper.GetInstance("4号炒锅滚筒故障").FryPotFourRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineOneTask) return; @@ -4577,7 +4957,7 @@ namespace FryPot_DosingSystem.Control switch (LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) { case 2: - if (AlarmHelper.GetInstance().FryPotTwoRollerTrouble == 1) { FryPotTwoAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotTwoAlarm = 1; return; } while (AlarmHelper.GetInstance().FryPotTwoRollerTrouble == 1) + if (AlarmHelper.GetInstance("2号炒锅滚筒故障").FryPotTwoRollerTrouble == 1) { FryPotTwoAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotTwoAlarm = 1; return; } while (AlarmHelper.GetInstance("2号炒锅滚筒故障").FryPotTwoRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineTwoTask) return; @@ -4585,7 +4965,7 @@ namespace FryPot_DosingSystem.Control MessageNotify.GetInstance.ShowRunLog("炒锅【1】输送滚筒故障解除,继续运行"); FryPotTwoAlarm = 1; break; case 5: - if (AlarmHelper.GetInstance().FryPotFiveRollerTrouble == 1) { FryPotFiveAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFiveAlarm = 1; return; } while (AlarmHelper.GetInstance().FryPotFiveRollerTrouble == 1) + if (AlarmHelper.GetInstance("5号炒锅滚筒故障").FryPotFiveRollerTrouble == 1) { FryPotFiveAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【4】输送滚筒发生故障"); } else { FryPotFiveAlarm = 1; return; } while (AlarmHelper.GetInstance("5号炒锅滚筒故障").FryPotFiveRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineTwoTask) return; @@ -4600,7 +4980,7 @@ namespace FryPot_DosingSystem.Control public void FryPotThreeRollerTroubleCheck() { FryPotThreeAlarm = 0; - if (AlarmHelper.GetInstance().FryPotThreeRollerTrouble == 1) { FryPotThreeAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【3】输送滚筒发生故障"); } else { FryPotThreeAlarm = 1; return; } while (AlarmHelper.GetInstance().FryPotThreeRollerTrouble == 1) + if (AlarmHelper.GetInstance("3号炒锅滚筒故障").FryPotThreeRollerTrouble == 1) { FryPotThreeAlarm = -1; MessageNotify.GetInstance.ShowRunLog("警告:炒锅【3】输送滚筒发生故障"); } else { FryPotThreeAlarm = 1; return; } while (AlarmHelper.GetInstance("3号炒锅滚筒故障").FryPotThreeRollerTrouble == 1) { Thread.Sleep(1000); if (globalVar.ExitLineThreeTask) return; @@ -4614,9 +4994,9 @@ namespace FryPot_DosingSystem.Control /// public void PlcLineOneRecipeDataReset() { - + //复位桶号,桶重,,工序 - WritePlcData("D1001",0); + WritePlcData("D1001", 0); WritePlcData("D1002", 0); WritePlcData("D1003", 0); WritePlcData("D1004", 0); @@ -4634,7 +5014,7 @@ namespace FryPot_DosingSystem.Control WritePlcData("D1016", 0); WritePlcData("D1017", 0); //桶偏差 - DeviceOperate.GetInstance.WriteRealPlcData("D1200",0.0F); + DeviceOperate.GetInstance.WriteRealPlcData("D1200", 0.0F); DeviceOperate.GetInstance.WriteRealPlcData("D1202", 0.0F); DeviceOperate.GetInstance.WriteRealPlcData("D1204", 0.0F); DeviceOperate.GetInstance.WriteRealPlcData("D1206", 0.0F); diff --git a/FryPot_DosingSystem/Control/GlobalVariable.cs b/FryPot_DosingSystem/Control/GlobalVariable.cs index 0e1c1608..6814738a 100644 --- a/FryPot_DosingSystem/Control/GlobalVariable.cs +++ b/FryPot_DosingSystem/Control/GlobalVariable.cs @@ -295,7 +295,20 @@ namespace FryPot_DosingSystem.Control /// public bool NextStart { get; set; } - + /// + /// 下位信号判断 + /// + public bool LowSignalJude { get; set; } + + /// + /// 集中洗桶模式 + /// + public ushort WashEmptyRollerModel { get; set; } + /// + /// 洗桶就位信号 + /// + public ushort WashRollerArriveSignal { get; set; } + } /// /// 滚筒线2相关变量 @@ -386,6 +399,20 @@ namespace FryPot_DosingSystem.Control /// 线体1流程控制互锁信号 /// public bool NextStart { get; set; } + + /// + /// 下位信号判断 + /// + public bool LowSignalJude { get; set; } + + /// + /// 集中洗桶模式 + /// + public ushort WashEmptyRollerModel { get; set; } + /// + /// 洗桶就位信号 + /// + public ushort WashRollerArriveSignal { get; set; } } /// /// 滚筒线3相关变量 @@ -477,6 +504,20 @@ namespace FryPot_DosingSystem.Control /// public bool NextStart { get; set; } + /// + /// 下位信号判断 + /// + public bool LowSignalJude { get; set; } + + /// + /// 集中洗桶模式 + /// + public ushort WashEmptyRollerModel { get; set; } + /// + /// 洗桶就位信号 + /// + public ushort WashRollerArriveSignal { get; set; } + } /// /// 滚筒线4相关变量 diff --git a/FryPot_DosingSystem/View/DebugView.xaml.cs b/FryPot_DosingSystem/View/DebugView.xaml.cs index fb3b6fa6..b58cb33a 100644 --- a/FryPot_DosingSystem/View/DebugView.xaml.cs +++ b/FryPot_DosingSystem/View/DebugView.xaml.cs @@ -1,5 +1,6 @@ using BPASmartClient.AGV; using BPASmartClient.Helper; +using FryPot_DosingSystem.Control; using System; using System.Collections.Generic; using System.Linq; @@ -62,8 +63,8 @@ namespace FryPot_DosingSystem.View private void Button_Click(object sender, RoutedEventArgs e) { - - AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(Guid.NewGuid().ToString("D")); + DeviceOperate.GetInstance.WritePlcData("D1060", 0); + // AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(Guid.NewGuid().ToString("D")); } private void Button_Click_1(object sender, RoutedEventArgs e) diff --git a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs index 9457a8ea..35f5bc42 100644 --- a/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs @@ -109,8 +109,8 @@ namespace FryPot_DosingSystem.ViewModel var res = flowProcessModels.Where(p => p.FryMaterialNum == item.MaterialLoc.ToString()); if (res.Count() > 1) { - // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"保存失败,桶号重复!"); - MessageLog.GetInstance.ShowUserLog("保存失败,桶号重复"); + // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"保存失败,桶号重复!"); + MessageNotify.GetInstance.ShowUserLog("保存失败,桶号重复"); MessageBox.Show("保存失败,桶号重复","提示",MessageBoxButton.OK,MessageBoxImage.Error); return; } diff --git a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs index b0e20989..1dbb1865 100644 --- a/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs @@ -101,18 +101,18 @@ namespace FryPot_DosingSystem.ViewModel if (materials.Count<=8&& materials.Count> 0) { - int lineNum= materials.ElementAt(0).MaterialLoc / 100; - //桶号正确性验证 - for (int i = 0; i < materials.Count; i++) - { - if (materials.ElementAt(i).MaterialLoc / 100 != lineNum|| materials.ElementAt(i).MaterialLoc % 100!=i+1||lineNum<=0||lineNum>5) - { - MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】"); - NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效"); - ActionManage.GetInstance.Send("CloseNewRecipeView"); - return; - } - } + //int lineNum= materials.ElementAt(0).MaterialLoc / 100; + // //桶号正确性验证 + // for (int i = 0; i < materials.Count; i++) + // { + // if (materials.ElementAt(i).MaterialLoc / 100 != lineNum|| materials.ElementAt(i).MaterialLoc % 100!=i+1||lineNum<=0||lineNum>5) + // { + // MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】"); + // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效"); + // ActionManage.GetInstance.Send("CloseNewRecipeView"); + // return; + // } + // } prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); @@ -144,18 +144,18 @@ namespace FryPot_DosingSystem.ViewModel { if (materials.Count > 0 && materials.Count <= 8) { - int lineNum = materials.ElementAt(0).MaterialLoc / 100; - //桶号正确性验证 - for (int i = 0; i < materials.Count; i++) - { - if (materials.ElementAt(i).MaterialLoc / 100 != lineNum && materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) - { - MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); - NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); - ActionManage.GetInstance.Send("CloseNewRecipeView"); - return; - } - } + //int lineNum = materials.ElementAt(0).MaterialLoc / 100; + ////桶号正确性验证 + //for (int i = 0; i < materials.Count; i++) + //{ + // if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) + // { + // MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); + // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); + // ActionManage.GetInstance.Send("CloseNewRecipeView"); + // return; + // } + //} bom.materialCollection = materials; bom.RecipeName = RecipeName; bom.UpdateTime = DateTime.Now.ToShortDateString(); @@ -180,18 +180,18 @@ namespace FryPot_DosingSystem.ViewModel { if (materials.Count>0&& materials.Count<=8)//验证配方中原料桶数 { - int lineNum = materials.ElementAt(0).MaterialLoc / 100; - //桶号正确性验证 - for (int i = 0; i < materials.Count; i++) - { - if (materials.ElementAt(i).MaterialLoc / 100 != lineNum && materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) - { - MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); - NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); - ActionManage.GetInstance.Send("CloseNewRecipeView"); - return; - } - } + //int lineNum = materials.ElementAt(0).MaterialLoc / 100; + ////桶号正确性验证 + //for (int i = 0; i < materials.Count; i++) + //{ + // if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) + // { + // MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); + // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); + // ActionManage.GetInstance.Send("CloseNewRecipeView"); + // return; + // } + //} prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 var res = Json.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); From cef3957d9d8fe5f221eca6a33d342da819a6584f Mon Sep 17 00:00:00 2001 From: pengliangyang <1406009520@qq.com> Date: Mon, 24 Oct 2022 14:39:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=89=E9=A6=99=E5=B1=85=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.JXJFoodBigStation/App.config | 2 +- .../Model/HK_PLC/DB_Write.cs | 3 +- .../Model/HK_PLC/HKDeviceStatus.cs | 12 +- .../HK_PLC/{Test1.cs => StockBinName.cs} | 2 +- .../Model/ProcessControl.cs | 396 +++++------------- .../Model/Siemens/DL_DataColl_DB.cs | 39 ++ .../Model/Siemens/DL_Finish_DB.cs | 35 +- .../Model/Siemens/DL_Start_DB.cs | 35 +- .../Model/Siemens/DL_Status_DB.cs | 66 ++- .../Model/Siemens/SiemensDeviceStatus.cs | 17 +- .../Model/ProcessControl.cs | 6 +- .../Model/Siemens/SiemensDeviceStatus.cs | 1 + .../Model/Siemens/XL_DataColl_DB.cs | 39 ++ .../Model/Siemens/XL_Finish_DB.cs | 20 +- .../Model/Siemens/XL_Start_DB.cs | 8 +- .../Model/Siemens/XL_Status_DB.cs | 29 +- 16 files changed, 306 insertions(+), 404 deletions(-) rename BPASmartClient.JXJFoodBigStation/Model/HK_PLC/{Test1.cs => StockBinName.cs} (97%) create mode 100644 BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_DataColl_DB.cs create mode 100644 BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_DataColl_DB.cs diff --git a/BPASmartClient.JXJFoodBigStation/App.config b/BPASmartClient.JXJFoodBigStation/App.config index e5c7f162..3559a687 100644 --- a/BPASmartClient.JXJFoodBigStation/App.config +++ b/BPASmartClient.JXJFoodBigStation/App.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Write.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Write.cs index f03a21f0..4edb4386 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Write.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Write.cs @@ -79,7 +79,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC public float Bareel1Bin13SetWeight { get; set; } public float Bareel1Bin14SetWeight { get; set; } - public float Bareel2Bin1SetWeight { get; set; } public float Bareel2Bin2SetWeight { get; set; } public float Bareel2Bin3SetWeight { get; set; } @@ -94,7 +93,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC public float Bareel2Bin12SetWeight { get; set; } public float Bareel2Bin13SetWeight { get; set; } public float Bareel2Bin14SetWeight { get; set; } - public float Bareel4Bin1SetWeight { get; set; } public float Bareel4Bin2SetWeight { get; set; } @@ -110,6 +108,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC public float Bareel4Bin12SetWeight { get; set; } public float Bareel4Bin13SetWeight { get; set; } public float Bareel4Bin14SetWeight { get; set; } + public float Bareel5Bin1SetWeight { get; set; } public float Bareel5Bin2SetWeight { get; set; } public float Bareel5Bin3SetWeight { get; set; } diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs index 102503c9..38cd6123 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs @@ -17,7 +17,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC public bool IsConnected => HK_PLC_S7.IsConnected; public DB_Write PlcWrite = new DB_Write(); public DB_Read PlcRead = new DB_Read(); - + public StockBinName StockBinName = new StockBinName(); public void Init() { if (IsConnected) @@ -26,11 +26,15 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC { HK_PLC_S7.WriteClass(PlcWrite, 99); var res1 = HK_PLC_S7.ReadClass(98); - var res2 = HK_PLC_S7.ReadClass(97); + var res2 = HK_PLC_S7.ReadClass(97); if (res1 != null && res1 is DB_Read data1) { PlcRead = data1; } + if (res2 != null && res2 is StockBinName data2) + { + StockBinName = data2; + } Thread.Sleep(10); }),"信号收发处理"); } @@ -264,7 +268,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC } else { - MessageLog.GetInstance.ShowRunLog($"桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); + MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); switch (barrel) { case 1: @@ -470,7 +474,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC default: break; } - } + } } } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/Test1.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs similarity index 97% rename from BPASmartClient.JXJFoodBigStation/Model/HK_PLC/Test1.cs rename to BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs index 0a9f0d6c..69529513 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/Test1.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC { - internal class Test1 + public class StockBinName { [Siemens(6)] public string RawMaterialName1 { get; set; } diff --git a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs index ee3e1e4e..27d7ae01 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs @@ -48,27 +48,11 @@ namespace BPASmartClient.JXJFoodBigStation.Model public ConcurrentQueue RecipeQueue4 = new ConcurrentQueue(); public ConcurrentQueue RecipeQueue5 = new ConcurrentQueue(); /// - /// AGV到达工站队列 - /// - public ConcurrentQueue AGVToWorkStationQueue = new ConcurrentQueue(); - /// /// 接收原料数据 /// public RecipeRawMaterial RawMaterial; public void Init() { - RawMaterialsNamePos.Add("1", 1); - RawMaterialsNamePos.Add("2", 2); - RawMaterialsNamePos.Add("3", 3); - RawMaterialsNamePos.Add("4", 4); - RawMaterialsNamePos.Add("5", 5); - RawMaterialsNamePos.Add("6", 6); - RawMaterialsNamePos.Add("7", 7); - RawMaterialsNamePos.Add("8", 8); - RawMaterialsNamePos.Add("9", 9); - RawMaterialsNamePos.Add("10", 10); - RawMaterialsNamePos.Add("11", 11); - RawMaterialsNamePos.Add("12", 12); ActionManage.GetInstance.Register(new Action((res) => { ObservableCollection RawMaterials = new ObservableCollection(); @@ -87,7 +71,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model RawMaterialBarrelNum = recipe.Material[i].Material_BarrelNum, RawMaterialWeight = recipe.Material[i].Material_Weight, RawMaterialLocation = (int)RawMaterialsNamePos[recipe.Material[i].Material_Name] - }); + }); } else { @@ -99,7 +83,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model RecipeName = recipe.RecipeName, RecipeCode = recipe.RecipeCode, RawMaterial = RawMaterials, - TrayCode = recipe.TrayCode + //TrayCode = recipe.Order_No, }); } } @@ -108,7 +92,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"]; try { - HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71500, HK_PLC_IP); + //HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71500, HK_PLC_IP); //SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); if (HKDevice.IsConnected) { @@ -138,136 +122,16 @@ namespace BPASmartClient.JXJFoodBigStation.Model item.RawMaterialLocation = Convert.ToInt32(item.RawMaterialName); } } - + MessageNotify.GetInstance.ShowAlarmLog("海科plc连接失败"); } }), "ManualSendRecipe", true); RecipeQueue1.Clear(); - - - //Json.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 ThreadManage.GetInstance().StartLong(new Action(() => { - //ReadPLCDeviceInfo(); ReceviceData(); RecipeInfoToHKPLC(); Thread.Sleep(10); }), "流程处理", true); - ThreadManage.GetInstance().StartLong(new Action(() => - { - if (HKDevice.IsConnected && SiemensDevice.IsConnected) - { - AgvGetInOut(); - } - Thread.Sleep(10); - }), "AGV进站送取货", true); - ThreadManage.GetInstance().StartLong(new Action(() => - { - ReadSiemensCommData(); - ReadHKPLCCommData(); - Thread.Sleep(10); - }), "读取西门子和海科PLC的数据", true); - } - /// - /// AGV送货 - /// - /// - private void AGV_Delivery(int bitNum) - { - if ((ReadSiemens("M4002." + bitNum) is bool) && BigStation.AgvDeliveryPosition == 0) - { - BigStation.AgvDeliveryPosition = 1; - WriteHKPLC("M4002." + bitNum, true); - WriteSiemens("M4002." + bitNum, false); - } - else if (ReadHK("M5002." + bitNum) is bool && BigStation.AgvDeliveryPosition == 1) - { - BigStation.AgvDeliveryPosition = 2; - WriteSiemens("M5002." + bitNum, true); - WriteHKPLC("M5002." + bitNum, false); - } - else if (ReadSiemens("M4004." + bitNum) is bool && BigStation.AgvDeliveryPosition == 2) - { - BigStation.AgvDeliveryPosition = 3; - WriteHKPLC("M4004." + bitNum, true); - WriteSiemens("M4004." + bitNum, false); - } - else if (ReadHK("M5004." + bitNum) is bool && BigStation.AgvDeliveryPosition == 3) - { - BigStation.AgvDeliveryPosition = 4; - WriteSiemens("M5004." + bitNum, true); - WriteHKPLC("M5004." + bitNum, false); - } - else if (ReadSiemens("M4005." + bitNum) is bool && BigStation.AgvDeliveryPosition == 4) - { - BigStation.AgvDeliveryPosition = 5; - WriteHKPLC("M4005." + bitNum, true); - WriteSiemens("M4005." + bitNum, false); - } - else if (ReadHK("M5005." + bitNum) is bool && BigStation.AgvDeliveryPosition == 5) - { - WriteSiemens("M5005." + bitNum, true); - WriteHKPLC("M5005." + bitNum, false); - } - } - /// - /// AGV取货 - /// - /// - private void AGV_Pick(int bitNum) - { - if (ReadSiemens("M4003" + bitNum) is bool && BigStation.AgvPickUpPosition == 0) - { - BigStation.AgvPickUpPosition = 1; - WriteHKPLC("M4003." + bitNum, true); - WriteSiemens("M4003." + bitNum, false); - } - if (ReadHK("M5003" + bitNum) is bool && BigStation.AgvPickUpPosition == 1) - { - BigStation.AgvPickUpPosition = 2; - WriteSiemens("M5003" + bitNum, true); - WriteHKPLC("M5003" + bitNum, false); - } - if (ReadSiemens("M4006." + bitNum) is bool && BigStation.AgvPickUpPosition == 2) - { - BigStation.AgvPickUpPosition = 3; - WriteHKPLC("M4006." + bitNum, true); - WriteSiemens("M4006." + bitNum, false); - } - if (ReadHK("M5006." + bitNum) is bool && BigStation.AgvPickUpPosition == 3) - { - WriteSiemens("M5006." + bitNum, true); - WriteHKPLC("M5006." + bitNum, false); - } - } - /// - /// AGV进站送货 - /// - private void AgvGetInOut() - { - //获取工位上是否有小车 - SiemensDevice.Siemens_PLC_S7.Write(SiemensCommAddress.StationIsExistCar, (bool) - HKDevice.HK_PLC_S7.Read("M4007.0")); - //检测AGV到站信号 - if (AGVToWorkStationQueue.Count > 0) - { - int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == AGVToWorkStationQueue.ElementAt(0)); - int TrayLocation = RemoteRecipes.ElementAt(index).TrayCode;//根据配方编号,找到托盘的ID 托盘ID1-6 - string RecipeCode = (string)RemoteRecipes.ElementAt(index).RecipeCode; - if (TrayLocation > 0 && TrayLocation < 7) - { - AGV_Delivery(TrayLocation - 1); - if (BigStation.AgvDeliveryPosition == 5) - { - BigStation.AgvDeliveryPosition = 0; - } - AGV_Pick(TrayLocation - 1); - if (BigStation.AgvPickUpPosition == 3) - { - BigStation.AgvPickUpPosition = 0; - AGVToWorkStationQueue.TryDequeue(out RecipeCode); - } - } - } } private void ReceviceData() { @@ -318,6 +182,10 @@ namespace BPASmartClient.JXJFoodBigStation.Model RecipeQueue4.Clear(); RecipeQueue5.Clear(); BigStation.Recipe1DosingStatus = 0; + BigStation.Recipe2DosingStatus = 0; + BigStation.Recipe3DosingStatus = 0; + BigStation.Recipe4DosingStatus = 0; + BigStation.Recipe5DosingStatus = 0; } } private void RecipeInfoToHKPLC() @@ -333,23 +201,20 @@ namespace BPASmartClient.JXJFoodBigStation.Model { HKDevice.StockBinPar(RemoteRecipes.ElementAt(index)); HKDevice.PlcWrite.Recipe1IssuedFinish = true; - //HKDevice.HK_PLC_S7.Write("DB98.DBX0.1", false);//复位允许下发配方1信号 BigStation.Recipe1DosingStatus = 1; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); + MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},下发完成"); } if (HKDevice.PlcRead.ReceiveFinishRecipe1 && BigStation.Recipe1DosingStatus == 1) { BigStation.Recipe1DosingStatus = 2; HKDevice.PlcWrite.Recipe1IssuedFinish = false; - HKDevice.PlcWrite.RecipeCode = 0; - HKDevice.PlcWrite.TrayCode = 0; - WeightReset(); - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); + StockBinParReset(); + MessageNotify.GetInstance.ShowRunLog($"配方编号:{code},托盘编号:{trayCode},PLC接收配方完成"); } if (BigStation.Recipe1DosingStatus == 2 && HKDevice.PlcRead.Recipe1DosingFinish) { BigStation.Recipe1DosingStatus = 3; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); if (HKDevice.PlcRead.Recipe1TrayCode == 1) { foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) @@ -425,7 +290,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model { SiemensDevice.Siemens_PLC_S7.WriteClass(FinishData, 3); } - //HKDevice.HK_PLC_S7.Write("DB98.DBX1.1",false); RecipeQueue1.TryDequeue(out code); IssuedComplete.Add(RemoteRecipes.ElementAt(index));//将该配方添加到下 if (!BigStation.IsAllowManual) @@ -453,21 +317,19 @@ namespace BPASmartClient.JXJFoodBigStation.Model HKDevice.StockBinPar(RemoteRecipes.ElementAt(index)); HKDevice.PlcWrite.Recipe2IssuedFinish = true; BigStation.Recipe2DosingStatus = 1; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); } if (HKDevice.PlcRead.ReceiveFinishRecipe2 && BigStation.Recipe2DosingStatus == 1) { BigStation.Recipe2DosingStatus = 2; HKDevice.PlcWrite.Recipe2IssuedFinish = false; - HKDevice.PlcWrite.RecipeCode = 0; - HKDevice.PlcWrite.TrayCode = 0; - WeightReset(); - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); + StockBinParReset(); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); } if (BigStation.Recipe2DosingStatus == 2 && HKDevice.PlcRead.Recipe2DosingFinish) { BigStation.Recipe2DosingStatus = 3; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); if (HKDevice.PlcRead.Recipe2TrayCode > 0) { foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) @@ -529,7 +391,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model item.Laying_Off_Weight = HKDevice.PlcRead.StockBin14ActualWeight; } } - FinishData.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; FinishData.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) @@ -539,11 +400,11 @@ namespace BPASmartClient.JXJFoodBigStation.Model FinishData.Material[i].Material_BarrelNum = (short)RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; FinishData.Material[i].Material_Laying_Off_Weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight; } - } if (SiemensDevice.IsConnected) { SiemensDevice.Siemens_PLC_S7.WriteClass(FinishData, 3); + MessageNotify.GetInstance.ShowRunLog($"配方配料完成,将信号反馈给西门子"); } RecipeQueue2.TryDequeue(out code); IssuedComplete.Add(RemoteRecipes.ElementAt(index));//将该配方添加到下 @@ -556,7 +417,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model Json.Data.Recipes.RemoveAt(index);//制作完成,移除当前配方 } BigStation.Recipe2DosingStatus = 0; - } } } @@ -572,20 +432,18 @@ namespace BPASmartClient.JXJFoodBigStation.Model HKDevice.StockBinPar(RemoteRecipes.ElementAt(index)); HKDevice.PlcWrite.Recipe3IssuedFinish = true; BigStation.Recipe3DosingStatus = 1; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); } if (HKDevice.PlcRead.ReceiveFinishRecipe3 && BigStation.Recipe3DosingStatus == 1) { BigStation.Recipe3DosingStatus = 2; - HKDevice.PlcWrite.RecipeCode = 0; - HKDevice.PlcWrite.TrayCode = 0; - WeightReset(); - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); + StockBinParReset(); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); } if (HKDevice.PlcRead.Recipe3DosingFinish && BigStation.Recipe3DosingStatus == 2) { BigStation.Recipe3DosingStatus = 3; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); if (HKDevice.PlcRead.Recipe3TrayCode > 0) { foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) @@ -691,21 +549,19 @@ namespace BPASmartClient.JXJFoodBigStation.Model HKDevice.StockBinPar(RemoteRecipes.ElementAt(index)); HKDevice.PlcWrite.Recipe4IssuedFinish = true; BigStation.Recipe4DosingStatus = 1; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); } if (HKDevice.PlcRead.ReceiveFinishRecipe4 && BigStation.Recipe4DosingStatus == 1) { BigStation.Recipe4DosingStatus = 2; HKDevice.PlcWrite.Recipe4IssuedFinish = false; - HKDevice.PlcWrite.RecipeCode = 0; - HKDevice.PlcWrite.TrayCode = 0; - WeightReset(); - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); + StockBinParReset(); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); } if (BigStation.Recipe4DosingStatus == 2 && HKDevice.PlcRead.Recipe4DosingFinish) { BigStation.Recipe4DosingStatus = 3; - MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); + MessageNotify.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); if (HKDevice.PlcRead.Recipe4TrayCode > 0) { foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) @@ -799,128 +655,15 @@ namespace BPASmartClient.JXJFoodBigStation.Model } } } - public ConcurrentDictionary ReadHKPLCData = new ConcurrentDictionary(); - public ConcurrentDictionary ReadSiemensData = new ConcurrentDictionary(); - - - private void ReadSiemensCommData() - { - if (SiemensDevice.IsConnected) - { - GetSiemensStatus("", new Action((obj) => - { - if (obj is bool[] bools && bools.Length > 0) - { - - } - })); - } - } - private void ReadHKPLCCommData() - { - if (HKDevice.IsConnected) - { - GetHKStatus("", new Action((obj) => - { - if (obj is bool[] bools && bools.Length > 0) - { - - } - })); - } - } - private void GetHKStatus(string key, Action action) - { - if (ReadHKPLCData.ContainsKey(key)) - { - if (ReadHKPLCData[key] != null) - { - action?.Invoke(ReadHKPLCData[key]); - } - } - } - private void GetSiemensStatus(string key, Action action) - { - - if (ReadSiemensData.ContainsKey(key)) - { - if (ReadSiemensData[key] != null) - { - action?.Invoke(ReadSiemensData[key]); - } - } - } - private void WriteSiemens(string Address, object Value) - { - if (SiemensDevice.IsConnected) - { - SiemensDevice.Siemens_PLC_S7.Write(Address, Value); - } - } - private void WriteHKPLC(string Address, object Value) - { - HKDevice.HK_PLC_S7.Write(Address, Value); - } - private object ReadSiemens(string Address) - { - if (SiemensDevice.IsConnected) - { - return SiemensDevice.Siemens_PLC_S7.Read(Address); - } - else - { - return null; - } - } - private bool[] ReadBoolsSiemens(int address, int count) - { - if (SiemensDevice.IsConnected) - { - return SiemensDevice.Siemens_PLC_S7.ReadBools(address, count); - } - else - { - return null; - } - } - private object ReadHK(string Address) - { - if (HKDevice.IsConnected) - { - return HKDevice.HK_PLC_S7.Read(Address); - } - else - { - return null; - } - } - private bool[] ReadBoolsHK(int address, int count) - { - if (HKDevice.IsConnected) - { - return HKDevice.HK_PLC_S7.ReadBools(address, count); - } - else - { - return null; - } - } /// - /// 获取料仓的原料名称和原料位置 + /// 下发配方的数据复位 /// - private void ReadPLCDeviceInfo() - { - /*for (int i = 0; i < 12; i++) - { - string RawMaterialName = HKDevice.HK_PLC_S7.Read(""); - short RawMaterialLocation = HKDevice.HK_PLC_S7.Read(""); - if (RawMaterialsNamePos.ContainsKey(RawMaterialName)) - RawMaterialsNamePos.Add(RawMaterialName, RawMaterialLocation); - }*/ - - } - private void WeightReset() + private void StockBinParReset() { + + HKDevice.PlcWrite.RecipeCode = 0; + HKDevice.PlcWrite.TrayCode = 0; + HKDevice.PlcWrite.Bareel1Bin1SetWeight = 0; HKDevice.PlcWrite.Bareel1Bin2SetWeight = 0; HKDevice.PlcWrite.Bareel1Bin3SetWeight = 0; @@ -982,5 +725,82 @@ namespace BPASmartClient.JXJFoodBigStation.Model HKDevice.PlcWrite.Bareel5Bin13SetWeight = 0; HKDevice.PlcWrite.Bareel5Bin14SetWeight = 0; } + private void testData() + { + RawMaterialsNamePos.Clear(); + if (!HKDevice.IsConnected) + { + HKDevice.StockBinName.RawMaterialName1 = "1"; + HKDevice.StockBinName.RawMaterialName2 = "2"; + HKDevice.StockBinName.RawMaterialName3 = "3"; + HKDevice.StockBinName.RawMaterialName4 = "4"; + HKDevice.StockBinName.RawMaterialName5 = "5"; + HKDevice.StockBinName.RawMaterialName6 = "6"; + HKDevice.StockBinName.RawMaterialName7 = "7"; + HKDevice.StockBinName.RawMaterialName8 = "8"; + HKDevice.StockBinName.RawMaterialName9 = "9"; + HKDevice.StockBinName.RawMaterialName10 = "10"; + HKDevice.StockBinName.RawMaterialName11 = "11"; + HKDevice.StockBinName.RawMaterialName12 = "12"; + HKDevice.StockBinName.RawMaterialName13 = "13"; + HKDevice.StockBinName.RawMaterialName14 = "14"; + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName1)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName1, 1); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName2)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName2, 2); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName3)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName3, 3); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName4)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName4, 4); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName5)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName5, 5); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName6)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName6, 6); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName7)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName7, 7); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName8)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName8, 8); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName9)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName9, 9); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName10)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName10, 10); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName11)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName11, 11); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName12)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName12, 12); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName13)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName13, 13); + } + if (!RawMaterialsNamePos.ContainsKey(HKDevice.StockBinName.RawMaterialName14)) + { + RawMaterialsNamePos.Add(HKDevice.StockBinName.RawMaterialName14, 14); + } + } } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_DataColl_DB.cs b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_DataColl_DB.cs new file mode 100644 index 00000000..f7279b1a --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_DataColl_DB.cs @@ -0,0 +1,39 @@ +using BPASmartClient.S7Net; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.JXJFoodBigStation.Model.Siemens +{ + public class DL_DataColl_DB + { + [Siemens(16)] + public string RecipeCode { get; set; } + [Siemens(16)] + public string RecipeName { get; set; } + public bool var1 { get; set; } + public bool var2 { get; set; } + + public bool var3 { get; set; } + + public bool var4 { get; set; } + + public bool var5 { get; set; } + + public bool var6 { get; set; } + + public bool var7 { get; set; } + + public bool var8 { get; set; } + + public bool var9 { get; set; } + public short Mode { get; set; } + + public bool[] Alarm { get; set; } = new bool[24]; + public int Reserved1 { get; set; } + public int Reserved2 { get; set; } + + } +} diff --git a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs index 4394ac10..80e91369 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs @@ -1,4 +1,5 @@ -using System; +using BPASmartClient.S7Net; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,32 +9,42 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens { internal class DL_Finish_DB { + + /// + /// 配料完成信号确认 + /// + public bool Ask_For_Finish_PLC { get; set; } + + public short[] StandbyFinish { get; set; } = new short[4]; + [Siemens(16)] /// /// 生产工单编码 /// - public string Order_No; + public string Order_No{get; set; } + [Siemens(16)] /// /// 产品名称 /// - public string Product_Code; + public string Product_Code { get; set; } + public short job_No { get; set; } /// /// 原料信息 /// - public UDT1[] Material = new UDT1[20]; + public UDT1[] Material { get; set; } = new UDT1[20]; + public short ProcessTime { get; set; } /// /// 配料完成信号 /// - public bool Ask_For_Finish; - /// - /// 配料完成信号确认 - /// - public bool Ask_For_Finish_PLC; + public bool Ask_For_Finish { get; set; } + + public short[] StandbyFinish1 { get; set; } = new short[4]; } public class UDT1 { - public string Material_Name; - public float Material_Laying_Off_Weight; - public short Material_BarrelNum; + [Siemens(6)] + public string Material_Name { get; set; } + public float Material_Laying_Off_Weight { get; set; } + public short Material_BarrelNum { get; set; } } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Start_DB.cs b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Start_DB.cs index 13066a70..a4a5c592 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Start_DB.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Start_DB.cs @@ -1,4 +1,5 @@ -using System; +using BPASmartClient.S7Net; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,44 +9,46 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens { internal class DL_Start_DB { + [Siemens(16)] /// /// 配方编码 /// - public string RecipeCode; + public string RecipeCode { get; set; } + [Siemens(16)] /// /// 配发名称 /// - public string RecipeName; + public string RecipeName { get; set; } + public short Order_No { get; set; } + public short Pallet_No { get; set; } /// /// 物料信息 /// - public UDT[] Material = new UDT[20]; - /// - /// 托盘编号 - /// - public int TrayCode; + public UDT[] Material { get; set; } = new UDT[20]; + public bool Order_Type { get; set; } + public bool Order_Request_Ack { get; set; } + + public short[] Standby { get; set; } = new short[4]; /// /// 配方发送请求 /// - public bool Ask_For_Send_Bit; - /// - /// 上位机确认配方接收完成 - /// - public bool Ack_Ask_For_Send_Bit; + public bool Ask_For_Send_Bit { get; set; } + public short[] Standby1 { get; set; } = new short[4]; } public class UDT { + [Siemens(6)] /// /// 原料名称 /// - public string Material_Name; + public string Material_Name { get; set; } /// /// 原料重量 /// - public float Material_Weight; + public float Material_Weight { get; set; } /// /// 原料桶号 /// - public short Material_BarrelNum; + public short Material_BarrelNum { get; set; } } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Status_DB.cs b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Status_DB.cs index 88126d64..efcaf0d1 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Status_DB.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Status_DB.cs @@ -1,4 +1,5 @@ -using System; +using BPASmartClient.S7Net; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,53 +9,36 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens { internal class DL_Status_DB { - /// - /// 生产工单 - /// - public string RecipeCode; /// /// 配料开始 /// - public bool Dosing_Start; + public bool Dosing_Start { get; set; } /// /// 配料开始确认 /// - public bool Dosing_Confirm; - /// - /// 托盘占位情况 - /// - public bool[] Pallet_Position_Occ = new bool[16]; - /// - /// 工位允许放货架 - /// - public bool[] Allow_AGV_Put = new bool[16]; - /// - /// 工位允许取货架 - /// - public bool[] Allow_AGV_Get = new bool[16]; - /// - /// AGV请求放货架 - /// - public bool[] AGV_Request_Put = new bool[16]; - /// - /// AGV请求取货架 - /// - public bool[] AGV_Request_Get = new bool[16]; - /// - /// AGV放托盘完成 - /// - public bool[] AGV_Put_Done = new bool[16]; - /// - /// 托盘号 - /// - public short[] Pan_No = new short[16]; - /// - /// 配料时间 - /// - public int DosingTime; + public bool Dosing_Confirm { get; set; } + public bool Dosing_Cancel { get; set; } + public bool Dosing_Cancel2 { get; set; } + + public bool Dosing_Cancel3 { get; set; } + + public short a { get; set; } + public short[] Standby { get; set; } = new short[3]; + [Siemens(16)] /// - /// 备用 + /// 生产工单 /// - public byte Reserve; + public string RecipeCode { get; set; } + public bool Dosing_Cancel4 { get; set; } + + public bool Dosing_Cancel5 { get; set; } + + public bool Dosing_Cancel6 { get; set; } + + public bool Dosing_Cancel7 { get; set; } + + public short Dosing_Cancel8 { get; set; } + + public short[] Standby2 { get; set; } = new short[4]; } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs b/BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs index a3361db3..d4969c2e 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs @@ -21,21 +21,22 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens { ThreadManage.GetInstance().StartLong(new Action(() => { - var res = this.Siemens_PLC_S7.ReadClass(1); - var res1 = this.Siemens_PLC_S7.ReadClass(2); - var res2 = this.Siemens_PLC_S7.ReadClass(3); - if (res != null && RTrig.GetInstance("RecipeTrig").Start(res.Ask_For_Send_Bit)) + var res = this.Siemens_PLC_S7.ReadClass(2301); + var res1 = this.Siemens_PLC_S7.ReadClass(2331); + var res2 = this.Siemens_PLC_S7.ReadClass(2361); + var res3 = this.Siemens_PLC_S7.ReadClass(2391); + /*if (res != null && RTrig.GetInstance("RecipeTrig").Start(res.Ask_For_Send_Bit)) { ActionManage.GetInstance.Send("SiemensSendRecipe", res); res.Ask_For_Send_Bit = false;//接受配方信号复位 - res.Ack_Ask_For_Send_Bit = true;//配方接受完成 + //res.Ack_Ask_For_Send_Bit = true;//配方接受完成 this.Siemens_PLC_S7.WriteClass(res, 1); } - if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[0]").Start(res1.Allow_AGV_Put[0])) + if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[0]").Start(res1.)) { ActionManage.GetInstance.Send("AGVToStation1Sign", res1); - res1.Allow_AGV_Put[0] = false; + //res1.Allow_AGV_Put[0] = false; this.Siemens_PLC_S7.WriteClass(res1, 2); } if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[1]").Start(res1.Allow_AGV_Put[1])) @@ -68,7 +69,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens res1.Allow_AGV_Put[5] = false; this.Siemens_PLC_S7.WriteClass(res1, 2); } - +*/ if (res2 != null && res2.Ask_For_Finish_PLC) { ActionManage.GetInstance.Send("配料完成信号确认完成"); diff --git a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs index e145bf5b..4404997f 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs @@ -80,7 +80,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model } else { - MessageNotify.GetInstance.AlarmLog("配方名称与本地不符合"); + //MessageNotify.GetInstance.AlarmLog("配方名称与本地不符合"); } } Json.Data.Recipes.Add(new RemoteRecipeData() @@ -112,7 +112,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model try { //HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71200, HK_PLC_IP); - SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); + //SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); //WindSendDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71200,WindSend_PLC_IP); if (HKDevice.IsConnected) { @@ -272,7 +272,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model break; default: break; - } } else if (o.ToString().Contains("阻挡气缸")) @@ -327,7 +326,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model break; default: break; - } } else if (o.ToString().Contains("进料桶顶升气缸")) diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs index 107f2920..031c17eb 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs @@ -24,6 +24,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens var res = this.Siemens_PLC_S7.ReadClass(2201); var res1 = this.Siemens_PLC_S7.ReadClass(2231); var res2 = this.Siemens_PLC_S7.ReadClass(2261); + var res4 = this.Siemens_PLC_S7.ReadClass(2291); if (res != null && res.Order_Request_ACK == false && GVL_SmallStation.GetInstance.IsAllowSiemensSendRecipe) { res.Order_Request_ACK = true; diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_DataColl_DB.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_DataColl_DB.cs new file mode 100644 index 00000000..dabd8bde --- /dev/null +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_DataColl_DB.cs @@ -0,0 +1,39 @@ +using BPASmartClient.S7Net; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens +{ + internal class XL_DataColl_DB + { + [Siemens(16)] + public string RecipeCode { get; set; } + [Siemens(16)] + public string RecipeName { get; set; } + public bool var1 { get; set; } + public bool var2 { get; set; } + + public bool var3 { get; set; } + + public bool var4 { get; set; } + + public bool var5 { get; set; } + + public bool var6 { get; set; } + + public bool var7 { get; set; } + + public bool var8 { get; set; } + + public bool var9 { get; set; } + public short Mode { get; set; } + + public bool[] Alarm { get; set; } = new bool[24]; + public int Reserved1 { get; set; } + public int Reserved2 { get; set; } + + } +} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Finish_DB.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Finish_DB.cs index 0e977bde..7fe9e791 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Finish_DB.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Finish_DB.cs @@ -9,33 +9,37 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens { internal class XL_Finish_DB { - [Siemens(6)] + + /// + /// 配料完成信号确认 + /// + public bool Ask_For_Finish_PLC { get; set; } + public short[] StandbyFinish { get; set; }=new short[4]; + + [Siemens(16)] /// /// 生产工单编码 /// /// 产品名称 /// public string Product_Code { get; set; } public short Job_No { get; set; } - public UDT2[] Powder = new UDT2[10]; + public UDT2[] Powder { get; set; } = new UDT2[10]; /// /// 原料信息 /// - public UDT1[] Material = new UDT1[20]; + public UDT1[] Material { get; set; } = new UDT1[20]; public short DosingTime { get; set; } /// /// 配料完成信号 /// public bool Ask_For_Finish { get; set; } - /// - /// 配料完成信号确认 - /// - public bool Ask_For_Finish_PLC { get; set; } + public short[] StandbyFinish2 { get; set; } = new short[4]; } public class UDT1 { diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Start_DB.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Start_DB.cs index 5109c0cf..cd7e7ad2 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Start_DB.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Start_DB.cs @@ -23,19 +23,19 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens public short StockCode { get; set; } public short TrayCode { get; set; } - public UDT2Start[] Powder = new UDT2Start[10]; + public UDT2Start[] Powder { get; set; } = new UDT2Start[10]; /// /// 物料信息 /// - public UDTStart[] Material = new UDTStart[20]; + public UDTStart[] Material { get; set; } = new UDTStart[20]; /// /// plc确认配方接收完成 /// public bool Order_Request_ACK { get; set; } - public short[] Standby = new short[4]; + public short[] Standby { get; set; } = new short[4]; public bool Order_Request { get; set; } - public short[] Standby1 = new short[4]; + public short[] Standby1 { get; set; } = new short[4]; } public class UDTStart diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Status_DB.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Status_DB.cs index 8e454427..85ec6ebd 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Status_DB.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/XL_Status_DB.cs @@ -7,8 +7,16 @@ using System.Threading.Tasks; namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens { - internal class XL_Status_DB + public class XL_Status_DB { + public bool Dosing_Confirm { get; set; } + public bool Agv1 { get; set; } + public bool Agv2 { get; set; } + public bool Agv3 { get; set; } + public bool Agv4 { get; set; } + public short AgvPos { get; set; } + public short[] Standby { get; set; } = new short[3]; + [Siemens(16)] /// /// 生产工单 @@ -18,23 +26,14 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens /// 配料开始 /// public bool Dosing_Start { get; set; } - /// - /// 配料开始确认 - /// - public bool Dosing_Confirm; - public bool Agv1 { get; set; } - public bool Agv2 { get; set; } - public bool Agv3 { get; set; } - public bool Agv4 { get; set; } - public short AgvPos { get; set; } - - public UDTStatus[] Powder = new UDTStatus[10]; - - public bool Agv5{ get; set; } + public bool Agv5 { get; set; } public bool Agv6 { get; set; } public bool Agv7 { get; set; } - public int Agv8 { get; set; } + + public UDTStatus[] Powder { get; set; } = new UDTStatus[10]; + public short AgvUse { get; set; } + public short[] StandbyStatus { get; set; } = new short[4]; } public class UDTStatus { From ca436dbf90823572200bd331989dca034e5d6eb9 Mon Sep 17 00:00:00 2001 From: pengliangyang <1406009520@qq.com> Date: Mon, 24 Oct 2022 14:40:50 +0800 Subject: [PATCH 3/3] 1 --- SmartClient.sln | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/SmartClient.sln b/SmartClient.sln index fd280f95..3bfb83f0 100644 --- a/SmartClient.sln +++ b/SmartClient.sln @@ -178,9 +178,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.SmallBatchin EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkMOC", "BPASmartClient.MorkMOC\BPASmartClient.MorkMOC.csproj", "{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DosingHKProject", "BPASmartClient.DosingProject\BPASmartClient.DosingHKProject.csproj", "{6763F73A-555C-41E2-91F7-ADF26C59A946}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmart.MenuLoad", "BPASmart.MenuLoad\BPASmart.MenuLoad.csproj", "{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.MenuLoad", "BPASmart.MenuLoad\BPASmart.MenuLoad.csproj", "{7A7547D3-F2EF-4DA4-AD45-D1B49210082B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1676,26 +1674,6 @@ Global {D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x64.Build.0 = Release|Any CPU {D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x86.ActiveCfg = Release|Any CPU {D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x86.Build.0 = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|ARM.ActiveCfg = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|ARM.Build.0 = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|ARM64.Build.0 = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|x64.ActiveCfg = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|x64.Build.0 = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|x86.ActiveCfg = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Debug|x86.Build.0 = Debug|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|Any CPU.Build.0 = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|ARM.ActiveCfg = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|ARM.Build.0 = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|ARM64.ActiveCfg = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|ARM64.Build.0 = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|x64.ActiveCfg = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|x64.Build.0 = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|x86.ActiveCfg = Release|Any CPU - {6763F73A-555C-41E2-91F7-ADF26C59A946}.Release|x86.Build.0 = Release|Any CPU {7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A7547D3-F2EF-4DA4-AD45-D1B49210082B}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -1798,7 +1776,6 @@ Global {E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} {BA588F22-87FB-4124-AF62-CA8DC492ED7D} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} {D5081D7B-3EBB-42C7-8FB9-A889870D08C2} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} - {6763F73A-555C-41E2-91F7-ADF26C59A946} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} {7A7547D3-F2EF-4DA4-AD45-D1B49210082B} = {06F0B369-0483-46DD-82D2-70431FB505C1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution