diff --git a/BPASmartClient.AGV/AGVHelper.cs b/BPASmartClient.AGV/AGVHelper.cs index 5f00a27a..29a8c7ce 100644 --- a/BPASmartClient.AGV/AGVHelper.cs +++ b/BPASmartClient.AGV/AGVHelper.cs @@ -95,49 +95,49 @@ namespace BPASmartClient.AGV /// public string AgvToLineOneLoadRoller(string robotJobId) { - string url = AGVRequestUrl.GetInstance.TaskSendUrl; - //请求报文头 - HttpRequestHeaderModel.GetInstance.appKey = ""; - HttpRequestHeaderModel.GetInstance.appSecret = ""; - HttpRequestHeaderModel.GetInstance.requestId = ""; - HttpRequestHeaderModel.GetInstance.timestamp = ""; - HttpRequestHeaderModel.GetInstance.version = "2.8"; - string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); - //请求报文体 - AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 - AGVModel.GetInstance.warehouseId = 123; //仓库编号 - AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 - AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 - AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE - //详细任务数据 - //点到点 - AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 - AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 - AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 - AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 - AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 - AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 - AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; - string body = JsonConvert.SerializeObject(AGVModel.GetInstance); - // string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求 - - //货位到货位 - //AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 - //AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 - //AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 - //AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 - //AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 - //AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 - //AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); - //启用签名 - //url = url + "?sign=" + MD5Deal(body); - string data = HttpRequest(url, head, body); - object objData = JsonConvert.DeserializeObject(data); - if (objData != null && objData is HttpResponseBodyModel response) - { - return response.code; - } + //// string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求 + + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} return "Analysis Error"; } /// @@ -239,6 +239,55 @@ namespace BPASmartClient.AGV return "Analysis Error"; } /// + /// AGV从清洗台到4号线体卸桶 + /// + /// + public string AgvFromCleanToLineFourUnLoadRoller(string robotJobId) + { + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; + //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} + return "Analysis Error"; + } + /// /// AGV离开炒锅1 /// /// @@ -483,6 +532,203 @@ namespace BPASmartClient.AGV //} return "Analysis Error"; } + + /// + /// AGV从1号线运空桶洗桶 + /// + /// + public string AgvLeaveLOneToClean(string robotJobId) + { + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; + //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} + return "Analysis Error"; + } + /// + /// AGV从2号线运空桶洗桶 + /// + /// + public string AgvLeaveLTwoToClean(string robotJobId) + { + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; + //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} + return "Analysis Error"; + } + /// + /// AGV从3号线运空桶洗桶 + /// + /// + public string AgvLeaveLThreeToClean(string robotJobId) + { + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; + //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} + return "Analysis Error"; + } + /// + /// AGV从洗桶处运桶到4号洗桶线 + /// + /// + public string AgvLeaveCleanToLFour(string robotJobId) + { + //string url = AGVRequestUrl.GetInstance.TaskSendUrl; + ////请求报文头 + //HttpRequestHeaderModel.GetInstance.appKey = ""; + //HttpRequestHeaderModel.GetInstance.appSecret = ""; + //HttpRequestHeaderModel.GetInstance.requestId = ""; + //HttpRequestHeaderModel.GetInstance.timestamp = ""; + //HttpRequestHeaderModel.GetInstance.version = "2.8"; + //string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); + ////请求报文体 + //AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 + //AGVModel.GetInstance.warehouseId = 123; //仓库编号 + //AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 + //AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 + //AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE + ////详细任务数据 + ////点到点 + //AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 + //AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 + //AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + //AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 + //AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + //AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 + //AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; + //string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////货位到货位 + ////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 + ////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 + ////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 + ////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 + ////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 + ////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 + ////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; + ////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); + ////启用签名 + ////url = url + "?sign=" + MD5Deal(body); + //string data = HttpRequest(url, head, body); + //object objData = JsonConvert.DeserializeObject(data); + //if (objData != null && objData is HttpResponseBodyModel response) + //{ + // return response.code; + //} + return "Analysis Error"; + } /// /// 任务取消 /// diff --git a/BPASmartClient.Business/Plugin/ConfigMgr.cs b/BPASmartClient.Business/Plugin/ConfigMgr.cs index a524cebb..82bde613 100644 --- a/BPASmartClient.Business/Plugin/ConfigMgr.cs +++ b/BPASmartClient.Business/Plugin/ConfigMgr.cs @@ -84,6 +84,7 @@ namespace BPASmartClient.Business IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()); configurationBuilder.AddApolloConfiguration(p => { + p.AppId = apoid; p.MetaServer = apolloUri; p.Namespaces = new List() { "application", namespa }; diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index 80cbab40..b5146049 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -114,6 +114,10 @@ + + + + @@ -123,6 +127,7 @@ + @@ -272,9 +277,14 @@ + + + + + PreserveNewest diff --git a/BPASmartClient.CustomResource/Image/按钮/AddGreen.png b/BPASmartClient.CustomResource/Image/按钮/AddGreen.png new file mode 100644 index 00000000..13676da2 Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/AddGreen.png differ diff --git a/BPASmartClient.CustomResource/Image/按钮/Delete.png b/BPASmartClient.CustomResource/Image/按钮/Delete.png new file mode 100644 index 00000000..f53eb2b3 Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/Delete.png differ diff --git a/BPASmartClient.CustomResource/Image/按钮/停用.png b/BPASmartClient.CustomResource/Image/按钮/停用.png new file mode 100644 index 00000000..cb46f6d7 Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/停用.png differ diff --git a/BPASmartClient.CustomResource/Image/按钮/添加.png b/BPASmartClient.CustomResource/Image/按钮/添加.png new file mode 100644 index 00000000..d6e06298 Binary files /dev/null and b/BPASmartClient.CustomResource/Image/按钮/添加.png differ diff --git a/BPASmartClient.CustomResource/Image/权限背景.png b/BPASmartClient.CustomResource/Image/权限背景.png new file mode 100644 index 00000000..59876f6a Binary files /dev/null and b/BPASmartClient.CustomResource/Image/权限背景.png differ diff --git a/BPASmartClient.CustomResource/Pages/Model/Config.cs b/BPASmartClient.CustomResource/Pages/Model/Config.cs index cf2e3fe3..dc0eb6ca 100644 --- a/BPASmartClient.CustomResource/Pages/Model/Config.cs +++ b/BPASmartClient.CustomResource/Pages/Model/Config.cs @@ -38,10 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.Model private void AddData() { - Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.管理员, UserName = "admin", Password = "admin" }); ; - Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.操作员, UserName = "czy", Password = "123456" }); - Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.观察员, UserName = "gcy", Password = "654321" }); - Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.技术员, UserName = "jsy", Password = "88888888" }); + Global.userManager.userInfos.Add(new UserInfo() { permission = Permission.管理员, UserName = "admin", Password = "admin" }); SaveUser(); } diff --git a/BPASmartClient.CustomResource/Pages/Model/Global.cs b/BPASmartClient.CustomResource/Pages/Model/Global.cs index cd0a6548..86de75c5 100644 --- a/BPASmartClient.CustomResource/Pages/Model/Global.cs +++ b/BPASmartClient.CustomResource/Pages/Model/Global.cs @@ -12,6 +12,10 @@ namespace BPASmartClient.CustomResource.Pages.Model public static UserManager userManager { get; set; } = new UserManager(); public static UserInfo userInfo { get; set; } = new UserInfo(); + /// + /// 重置密码页面传值 + /// + public static UserInfo changeUserInfo { get; set; } = null; } } diff --git a/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs b/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs index 1edcc1ab..9522aae3 100644 --- a/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs +++ b/BPASmartClient.CustomResource/Pages/Model/MenuManage.cs @@ -114,7 +114,7 @@ namespace BPASmartClient.CustomResource.Pages.Model /// 子菜单的显示隐藏设置 /// public Visibility SubMenuVisibility { get { return _mSubMenuVisibility; } set { _mSubMenuVisibility = value; OnPropertyChanged(); } } - private Visibility _mSubMenuVisibility; + private Visibility _mSubMenuVisibility = Visibility.Collapsed; } diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs index b82a7dca..251fa976 100644 --- a/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs +++ b/BPASmartClient.CustomResource/Pages/Model/MessageLog.cs @@ -7,6 +7,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using BPASmartClient.Model; +using System.Windows.Media; namespace BPASmartClient.CustomResource.Pages.Model { @@ -72,8 +73,9 @@ namespace BPASmartClient.CustomResource.Pages.Model RunLog?.Invoke(info); } } + int AlarmID; - public void ShowAlarmLog(string info, string AlarmNumber="_", AlarmLevel level= AlarmLevel.一般报警) + public void ShowAlarmLog(string info, string AlarmNumber = "_", AlarmLevel level = AlarmLevel.一般报警) { lock (alarmlock) { @@ -85,7 +87,7 @@ namespace BPASmartClient.CustomResource.Pages.Model Time = DateTime.Now.ToString("HH:mm:ss"), Info = info, Value = AlarmNumber, - Grade = (level)+"" + Grade = (level) + "" }; Sqlite.GetInstance.Base.Add(alarmLog); Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); })); diff --git a/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs b/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs index b8c11c6c..80834923 100644 --- a/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs +++ b/BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs @@ -1,5 +1,6 @@ using Microsoft.Toolkit.Mvvm.ComponentModel; using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -10,6 +11,6 @@ namespace BPASmartClient.CustomResource.Pages.Model { public class PlcVariableInfoManage:ObservableObject { - public ObservableCollection VariablesInfo { get; set; } = new ObservableCollection(); + public ConcurrentDictionary> VariablesInfo { get; set; } = new ConcurrentDictionary>(); } } diff --git a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs index b0bd7add..7f85b3dc 100644 --- a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs +++ b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs @@ -10,6 +10,8 @@ namespace BPASmartClient.CustomResource.Pages.Model { public class UserInfo:ObservableObject { + public String LastLogInTime { get; set; } = "无"; + public List userTreeViewModels { get; set; } public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } } private string _id; public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } } diff --git a/BPASmartClient.CustomResource/Pages/Model/UserManager.cs b/BPASmartClient.CustomResource/Pages/Model/UserManager.cs index 1baf3908..f07f7f37 100644 --- a/BPASmartClient.CustomResource/Pages/Model/UserManager.cs +++ b/BPASmartClient.CustomResource/Pages/Model/UserManager.cs @@ -10,5 +10,6 @@ namespace BPASmartClient.CustomResource.Pages.Model public class UserManager { public ObservableCollection userInfos { get; set; } = new ObservableCollection(); + } } diff --git a/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs b/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs new file mode 100644 index 00000000..4fb56aae --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs @@ -0,0 +1,16 @@ +using Microsoft.Toolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.Model +{ + public class UserTreeViewModel: ObservableObject + { + public string Name { get; set; } + + public List TreeViewItems { get; set; } + } +} diff --git a/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml new file mode 100644 index 00000000..8ffed030 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -124,6 +568,5 @@ --> - diff --git a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs index f133e9ba..51a962d4 100644 --- a/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs +++ b/BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs @@ -29,7 +29,93 @@ namespace BPASmartClient.CustomResource.Pages.View { e.Row.Header = e.Row.GetIndex() + 1; } + private void fryOne_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + + private void fryTwo_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + + private void fryThree_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + + private void fryFour_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + + private void fryFive_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + + private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + ComboBox cbo= sender as ComboBox; + if (cbo != null) + { + switch (cbo.SelectedValue) + { + case "滚筒输送线": + this.GT.Visibility = Visibility.Visible; + this.fryOne.Visibility = Visibility.Collapsed; + this.fryTwo.Visibility=Visibility.Collapsed; + this.fryThree.Visibility = Visibility.Collapsed; + this.fryFour.Visibility = Visibility.Collapsed; + this.fryFive.Visibility = Visibility.Collapsed; + break; + case "炒锅1": + this.GT.Visibility = Visibility.Collapsed; + this.fryOne.Visibility = Visibility.Visible; + this.fryTwo.Visibility = Visibility.Collapsed; + this.fryThree.Visibility = Visibility.Collapsed; + this.fryFour.Visibility = Visibility.Collapsed; + this.fryFive.Visibility = Visibility.Collapsed; + break; + case "炒锅2": + this.GT.Visibility = Visibility.Collapsed; + this.fryOne.Visibility = Visibility.Collapsed; + this.fryTwo.Visibility = Visibility.Visible; + this.fryThree.Visibility = Visibility.Collapsed; + this.fryFour.Visibility = Visibility.Collapsed; + this.fryFive.Visibility = Visibility.Collapsed; + break; + case "炒锅3": + this.GT.Visibility = Visibility.Collapsed; + this.fryOne.Visibility = Visibility.Collapsed; + this.fryTwo.Visibility = Visibility.Collapsed; + this.fryThree.Visibility = Visibility.Visible; + this.fryFour.Visibility = Visibility.Collapsed; + this.fryFive.Visibility = Visibility.Collapsed; + break; + case "炒锅4": + this.GT.Visibility = Visibility.Collapsed; + this.fryOne.Visibility = Visibility.Collapsed; + this.fryTwo.Visibility = Visibility.Collapsed; + this.fryThree.Visibility = Visibility.Collapsed; + this.fryFour.Visibility = Visibility.Visible; + this.fryFive.Visibility = Visibility.Collapsed; + break; + case "炒锅5": + this.GT.Visibility = Visibility.Collapsed; + this.fryOne.Visibility = Visibility.Collapsed; + this.fryTwo.Visibility = Visibility.Collapsed; + this.fryThree.Visibility = Visibility.Collapsed; + this.fryFour.Visibility = Visibility.Collapsed; + this.fryFive.Visibility = Visibility.Visible; + break; + } + + + } + + } - + } } diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs new file mode 100644 index 00000000..3d16eea7 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs @@ -0,0 +1,61 @@ +using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.Helper; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.ViewModel +{ + public class AddNewUserViewModel:ObservableObject + { + public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } + private string _mErrorInfo; + + public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } } + private string _userName; + + + public string NewPassword1 { get { return _mNewPassword1; } set { _mNewPassword1 = value; OnPropertyChanged(); } } + private string _mNewPassword1; + + + public string NewPassword2 { get { return _mNewPassword2; } set { _mNewPassword2 = value; OnPropertyChanged(); } } + private string _mNewPassword2; + + public RelayCommand ExitCommand { get; set; } + + public RelayCommand ConfirmCommand { get; set; } + + private void Confirm() + { + if (UserName == null) { ErrorInfo = "用户名不能为空"; return; } + if (NewPassword1 == null) { ErrorInfo = "请输入密码"; return; } + if (NewPassword2 != NewPassword1) { ErrorInfo = "两次密码不一致"; return; } + var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == UserName); + if (res != null) { ErrorInfo = "用户名已存在";return; } + Global.userManager.userInfos.Add(new UserInfo + { + UserName = UserName, + Password = NewPassword1, + userTreeViewModels = new List() + }); + Config.GetInstance.SaveUser(); + ActionManage.GetInstance.Send("AddNewUserViewConfirm"); + } + + public AddNewUserViewModel() + { + ConfirmCommand = new RelayCommand(Confirm); + + ExitCommand = new RelayCommand(() => + { + ActionManage.GetInstance.Send("AddNewUserViewCancel"); + + }); + } + } +} diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs index 1bb9c66a..0856154d 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs @@ -63,26 +63,60 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel Global.userInfo.permission = res.permission; Global.userInfo.UserName = res.UserName; Global.userInfo.Password = res.Password; - for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++) + Global.userInfo.LastLogInTime = DateTime.Now.ToString(); + res.LastLogInTime = DateTime.Now.ToString(); + Config.GetInstance.SaveUser(); + if(res.permission == Enums.Permission.管理员) { - if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission)) - MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible; - else - MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; - - if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null) - MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; - - for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++) + foreach( var items in MenuManage.GetInstance.menuModels) { - if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission)) - MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible; - else - MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed; + foreach(var item in items.subMenumodels) + { + item.SubMenuVisibility = Visibility.Visible; + } } } + else + { + if (res.userTreeViewModels != null) + { + if (res.userTreeViewModels.Count > 0) + { + foreach (var items in MenuManage.GetInstance.menuModels) + { + foreach (var item in items.subMenumodels) + { + if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) + { + item.SubMenuVisibility = Visibility.Visible; + } + } + } + } + } + } + + //for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++) + //{ + // if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission)) + // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible; + // else + // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; + + // if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null) + // MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; + + // for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++) + // { + // if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission)) + // MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible; + // else + // MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed; + // } + //} ActionManage.GetInstance.Send("PermissionChange"); ActionManage.GetInstance.Send("LoginOk"); + } else { diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs index 2acd2f58..acf516e9 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs @@ -10,37 +10,48 @@ using Microsoft.Toolkit.Mvvm.Input; namespace BPASmartClient.CustomResource.Pages.ViewModel { + public class PasswordChangeViewModel : ObservableObject { - public PasswordChangeViewModel() + private void CheckPassword(UserInfo userInfo) { - LoginCommand = new RelayCommand(() => + if (userInfo.Password == OldPassword) { - if (Global.userInfo.Password == OldPassword) + if (NewPassword1 == NewPassword2) { - if (NewPassword1 == NewPassword2) - { - Global.userInfo.Password = NewPassword2; - int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == Global.userInfo.UserName); - if (index >= 0 && index < Global.userManager.userInfos.Count) - Global.userManager.userInfos.ElementAt(index).Password = NewPassword1; - Config.GetInstance.SaveUser(); - ActionManage.GetInstance.Send("PasswordChangeViewconfirm"); - } - else - { - ErrorInfo = "新密码不匹配"; - } + userInfo.Password = NewPassword2; + int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == userInfo.UserName); + if (index >= 0 && index < Global.userManager.userInfos.Count) + Global.userManager.userInfos.ElementAt(index).Password = NewPassword1; + Config.GetInstance.SaveUser(); + ActionManage.GetInstance.Send("PasswordChangeViewconfirm"); + Global.changeUserInfo = null; } else { - ErrorInfo = "原密码错误"; + ErrorInfo = "新密码不匹配"; } + } + else + { + ErrorInfo = "原密码错误"; + } + } + + public PasswordChangeViewModel( ) + { + LoginCommand = new RelayCommand(() => + { + if (Global.changeUserInfo == null) CheckPassword(Global.userInfo); + else { CheckPassword(Global.changeUserInfo); } + + }); ExitCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("PasswordChangeViewCancel"); + Global.changeUserInfo = null; }); } diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs new file mode 100644 index 00000000..b9eb013c --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs @@ -0,0 +1,14 @@ +using Microsoft.Toolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.ViewModel +{ + public class PermissionConfigurationViewModel:ObservableObject + { + + } +} diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs new file mode 100644 index 00000000..1a673535 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs @@ -0,0 +1,158 @@ +using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.CustomResource.Pages.View; +using BPASmartClient.Helper; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.ViewModel +{ + public class UserConfigViewModel:ObservableObject + { + /// + /// 页面列表集合 + /// + public ObservableCollection pageTreeViewModels { get; set; } = new ObservableCollection(); + /// + /// 已选择页面 + /// + public ObservableCollection SelectePage { get; set; } = new ObservableCollection(); + + /// + /// 用户名 + /// + public string UserName { get { return _username; } set { _username = value; OnPropertyChanged(); } } + private string _username; + + public RelayCommand AddUserPageCommand { get; set; } + + public RelayCommand DeleteUserPageCommand { get; set; } + + public RelayCommand DeleteAllPageCommand { get; set; } + + public RelayCommand AddAllPageCommand { get; set; } + + + + public RelayCommand SaveCommand { get; set; } + + public RelayCommand CancelCommand { get; set; } + + private void AddUserPage(object o) + { + if (o == null) return; + if(o is string name) + { + var s = SelectePage.FirstOrDefault(x => x.Name == name); + if (!SelectePage.Contains(s)) + { + foreach (UserTreeViewModel item in pageTreeViewModels) + { + var res = item.TreeViewItems.FirstOrDefault(P => P.Name == name); + if(res != null) + { + SelectePage.Add(res); + return; + } + } + } + } + } + private void DeleteUserPage(object o) + { + if (o == null) return; + if (o is string name) + { + var res = SelectePage.FirstOrDefault(p=>p.Name == name); + SelectePage.Remove(res); + } + } + + + public UserConfigViewModel() + { + AddUserPageCommand = new RelayCommand(AddUserPage); + + DeleteUserPageCommand = new RelayCommand(DeleteUserPage); + + DeleteAllPageCommand = new RelayCommand(() => + { + SelectePage.Clear(); + }); + + AddAllPageCommand = new RelayCommand(() => + { + foreach(UserTreeViewModel item in pageTreeViewModels) + { + foreach(var res in item.TreeViewItems) + { + if (!SelectePage.Contains(res)) SelectePage.Add(res); + } + } + }); + + + SaveCommand = new RelayCommand(() => + { + var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == Global.changeUserInfo.UserName && p.Password == Global.changeUserInfo.Password); + if(res != null) + { + + + res.userTreeViewModels = new List(); + + + res.userTreeViewModels.AddRange(SelectePage); + Config.GetInstance.SaveUser(); + } + Global.changeUserInfo = null; + ActionManage.GetInstance.Send("UserConfigViewConfirm"); + }); + + CancelCommand = new RelayCommand(() => + { + Global.changeUserInfo = null; + ActionManage.GetInstance.Send("UserConfigViewCancel"); + }); + + foreach (var item in MenuManage.GetInstance.menuModels) + { + List list = new List(); + foreach(var res in item.subMenumodels) + { + list.Add(new UserTreeViewModel { Name = res.SubMenuName}); + } + pageTreeViewModels.Add(new UserTreeViewModel + { + Name = item.MainMenuName, + TreeViewItems = list + }); + } + + if(Global.changeUserInfo != null) + { + UserName = Global.changeUserInfo.UserName; + if (Global.changeUserInfo.userTreeViewModels != null) + { + if(Global.changeUserInfo.userTreeViewModels.Count > 0) + { + foreach(UserTreeViewModel item in Global.changeUserInfo.userTreeViewModels) + { + SelectePage.Add(item); + } + } + } + } + + + + + } + + } +} diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs new file mode 100644 index 00000000..8582c0d7 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs @@ -0,0 +1,77 @@ +using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.CustomResource.Pages.View; +using Microsoft.Toolkit.Mvvm.Input; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.ViewModel +{ + public class UserManagerViewModel + { + /// + /// datagrid绑定 + /// + public ObservableCollection userManager { get; set; } = Global.userManager.userInfos; + + + public RelayCommand ChangePasswardCommand { get; set; } + + public RelayCommand AddNewUserCommand { get; set; } + + public RelayCommand DeleteUserCommand { get; set; } + + public RelayCommand EditUserConfigCommand { get; set; } + + private void ChangePassward(object o) + { + if (o != null && o is UserInfo infos) + { + Global.changeUserInfo = infos; + PasswordChangeView passwordChangeView = new PasswordChangeView(); + passwordChangeView.ShowDialog(); + } + } + + private void DeleteUser(object o) + { + if (o != null && o is UserInfo infos) + { + var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == infos.UserName); + if (res != null) Global.userManager.userInfos.Remove(res); + Config.GetInstance.SaveUser(); + } + } + + private void EditUserConfig(object o) + { + if (o != null && o is UserInfo infos) + { + Global.changeUserInfo = null; + Global.changeUserInfo = infos; + UserConfigView userConfigView = new UserConfigView(); + userConfigView.ShowDialog(); + } + + } + + public UserManagerViewModel() + { + ChangePasswardCommand = new RelayCommand(ChangePassward); + + AddNewUserCommand = new RelayCommand(() => + { + AddNewUser addNewUser = new AddNewUser(); + addNewUser.ShowDialog(); + }); + + DeleteUserCommand = new RelayCommand(DeleteUser); + + EditUserConfigCommand = new RelayCommand(EditUserConfig); + } + + } +} diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs index f8ff0489..afaae21d 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs @@ -15,15 +15,45 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel public class VariableViewModel : ObservableObject { public ObservableCollection Variables { get; set; } = new ObservableCollection(); - + + public ObservableCollection FryOneVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryTwoVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryThreeVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryFourVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryFiveVariables { get; set; } = new ObservableCollection(); + + public List DeviceName { get; set; } = new List { "滚筒输送线", "炒锅1", "炒锅2", "炒锅3", "炒锅4", "炒锅5" }; public RelayCommand SaveDataCommand { get; set; } public VariableViewModel() { Json.Read(); - Variables = Json.Data.VariablesInfo; + + try + { + if (Json.Data.VariablesInfo.Count>0) + { + Variables = Json.Data.VariablesInfo["滚筒输送线"]; + FryOneVariables = Json.Data.VariablesInfo["炒锅1"]; + FryTwoVariables = Json.Data.VariablesInfo["炒锅2"]; + FryThreeVariables = Json.Data.VariablesInfo["炒锅3"]; + FryFourVariables = Json.Data.VariablesInfo["炒锅4"]; + FryFiveVariables = Json.Data.VariablesInfo["炒锅5"]; + } + } + catch (Exception) + { + + + } SaveDataCommand = new RelayCommand(() => { + Json.Data.VariablesInfo["滚筒输送线"] = Variables; + Json.Data.VariablesInfo["炒锅1"] = FryOneVariables; + Json.Data.VariablesInfo["炒锅2"]=FryTwoVariables; + Json.Data.VariablesInfo["炒锅3"] = FryThreeVariables; + Json.Data.VariablesInfo["炒锅4"]= FryFourVariables; + Json.Data.VariablesInfo["炒锅5"] = FryFiveVariables; Json.Save(); MessageBox.Show("保存成功","提示",MessageBoxButton.OK,MessageBoxImage.Information); }); diff --git a/BPASmartClient.MorkS/Control_Morks.cs b/BPASmartClient.MorkS/Control_Morks.cs index 00c62d80..7ac1a0e5 100644 --- a/BPASmartClient.MorkS/Control_Morks.cs +++ b/BPASmartClient.MorkS/Control_Morks.cs @@ -34,7 +34,8 @@ namespace BPASmartClient.MorkS public override void DoMain() { - + + MonitorViewModel.DeviceId = DeviceId; ServerInit(); DataParse(); diff --git a/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs index 958de6e4..9471ed5d 100644 --- a/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkS/ViewModel/DebugViewModel.cs @@ -18,7 +18,10 @@ namespace BPASmartClient.MorkS.ViewModel { public DebugViewModel() { - InitCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("InitDevice"); }); + InitCommand = new RelayCommand(() => { + ActionManage.GetInstance.Send("InitDevice"); + ActionManage.GetInstance.Send("初始化设定煮面时间"); + }); SimOrderCommand = new RelayCommand(() => { new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish(); diff --git a/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs index f45648f2..2639b78c 100644 --- a/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs @@ -8,6 +8,7 @@ using BPASmartClient.Helper; using BPASmartClient.Model; using BPASmartClient.MorkS.Model; using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; namespace BPASmartClient.MorkS.ViewModel { @@ -15,29 +16,34 @@ namespace BPASmartClient.MorkS.ViewModel { public ParSetViewModel() { - SaveInfoCommand = new Action(() => - { - List values = new List(); - values.Clear(); - - List bools = new List(); - bools.Clear(); + SaveInfoCommand = new RelayCommand(SaveSettingData); - for (int i = 0; i < Json.Data.parSets.Count; i++) - { - values.Clear(); - values.Add(Json.Data.parSets[i].Minute); - values.Add(Json.Data.parSets[i].Second); - bools.Add(Json.Data.parSets[i].IsShield); - ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() }); - } - ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() }); - Json.Save(); - }); + ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间"); + } - public Action SaveInfoCommand { get; set; } + public RelayCommand SaveInfoCommand { get; set; } public ObservableCollection parSets { get; set; } = Json.Data.parSets; + + private void SaveSettingData() + { + List values = new List(); + values.Clear(); + + List bools = new List(); + bools.Clear(); + + for (int i = 0; i < Json.Data.parSets.Count; i++) + { + values.Clear(); + values.Add(Json.Data.parSets[i].Minute); + values.Add(Json.Data.parSets[i].Second); + bools.Add(Json.Data.parSets[i].IsShield); + ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() }); + } + ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() }); + Json.Save(); + } } } diff --git a/BPASmartClient.S7Net/BPASmartClient.S7Net.csproj b/BPASmartClient.S7Net/BPASmartClient.S7Net.csproj new file mode 100644 index 00000000..ce772d6a --- /dev/null +++ b/BPASmartClient.S7Net/BPASmartClient.S7Net.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/BPASmartClient.S7Net/SiemensHelper.cs b/BPASmartClient.S7Net/SiemensHelper.cs new file mode 100644 index 00000000..482eae2b --- /dev/null +++ b/BPASmartClient.S7Net/SiemensHelper.cs @@ -0,0 +1,69 @@ +using S7.Net; + +namespace BPASmartClient.S7Net +{ + public class SiemensHelper + { + + Plc myPlc; + + public bool IsConnected => myPlc is null ? false : myPlc.IsConnected; + + /// + /// 打开连接 + /// + /// PLC CPU 类型 + /// plc ip 地址 + /// plc 端口号 + /// PLC 机架号 + /// PLC 插槽号 + public void Connect(CpuType cpuType, string ip, int port = 102, short rack = 0, short solt = 0) + { + myPlc = new Plc(cpuType, ip, port, rack, solt); + myPlc.Open(); + } + + /// + /// 断开和PLC的连接 + /// + public void Disconnect() + { + myPlc?.Close(); + } + + public object Read(string address) + { + if (!IsConnected) return default; + return myPlc?.Read(address); + } + + public void Write(string address, object value) + { + myPlc?.Write(address, value); + } + + public ReadT ReadStruct(int db, int startAddress = 0) + { + if (!IsConnected) return default; + return (ReadT)myPlc.ReadStruct(typeof(ReadT), db, startAddress); + } + + public void WriteStruct(object structValue, int db, int startAddress = 0) + { + myPlc?.WriteStruct(structValue, db, startAddress); + } + + + public int ReadClass(object sourceClass, int db, int startAddress = 0) + { + if (!IsConnected) return -1; + return myPlc.ReadClass(sourceClass, db, startAddress); + } + + public void WriteClass(object sourceClass, int db, int startAddress = 0) + { + myPlc?.WriteClass(sourceClass, db, startAddress); + } + + } +} \ No newline at end of file diff --git a/BPASmartClient/App.config b/BPASmartClient/App.config index c29e4b30..41a2a64f 100644 --- a/BPASmartClient/App.config +++ b/BPASmartClient/App.config @@ -6,20 +6,20 @@ - - --> + - + - + diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs index ddc0a531..e6579b11 100644 --- a/DosingSystem/App.xaml.cs +++ b/DosingSystem/App.xaml.cs @@ -171,6 +171,13 @@ namespace BPASmartClient.DosingSystem AssemblyName = "BPASmartClient.CustomResource", ToggleWindowPath = "Pages.View.PasswordChangeView" }); + UserManager.Add(new SubMenumodel() + { + SubMenuName = "用户管理", + SubMenuPermission = new Permission[] { Permission.管理员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.UserManagerView" + }); UserManager.Add(new SubMenumodel() { diff --git a/FryPot_DosingSystem/AGV/WhichCart.cs b/FryPot_DosingSystem/AGV/WhichCart.cs index b3c6a33e..e1c5d6dc 100644 --- a/FryPot_DosingSystem/AGV/WhichCart.cs +++ b/FryPot_DosingSystem/AGV/WhichCart.cs @@ -51,6 +51,14 @@ namespace FryPot_DosingSystem.AGV hs_4,//4号炒锅-运输空碗到-空碗流水线 hs_5,//5号炒锅-运输空碗到-空碗流水线 + tqx_1, + tqx_2, + tqx_3, + + qxt_4, + jtqx, + + qxt_hj, hj,//空碗流水线-回到充电桩或者停车桩 } diff --git a/FryPot_DosingSystem/Control/DeviceOperate.cs b/FryPot_DosingSystem/Control/DeviceOperate.cs index 7a33ee88..c5eb9758 100644 --- a/FryPot_DosingSystem/Control/DeviceOperate.cs +++ b/FryPot_DosingSystem/Control/DeviceOperate.cs @@ -20,15 +20,35 @@ namespace FryPot_DosingSystem.Control private static DeviceOperate _instance; public static DeviceOperate GetInstance => _instance ??= new DeviceOperate(); public bool IsConfig { get; set; }//设备plc数据是否配置 - ModbusTcp modbus = new ModbusTcp(); - private string Ip { get; set; } - private string Port { get; set; } + ModbusTcp modbus = new ModbusTcp();//滚筒线Modbus通讯对象 + ModbusTcp fryOneModbus = new ModbusTcp();//炒锅1Modbus通讯对象 + ModbusTcp fryTwoModbus = new ModbusTcp();//炒锅2Modbus通讯对象 + ModbusTcp fryThreeModbus = new ModbusTcp();//炒锅3Modbus通讯对象 + ModbusTcp fryFourModbus = new ModbusTcp();//炒锅4Modbus通讯对象 + ModbusTcp fryFiveModbus = new ModbusTcp();//炒锅5Modbus通讯对象 + // private string Ip { get; set; } + // private string Port { get; set; } public bool Connected { get; set; } + public bool FryOneConnected { get; set; } + public bool FryTwoConnected { get; set; } + public bool FryThreeConnected { get; set; } + public bool FryFourConnected { get; set; } + public bool FryFiveConnected { get; set; } - private string DeviceName { get; set; } + // private string DeviceName { get; set; } public ConcurrentDictionary Data { get; set; } = new ConcurrentDictionary(); + public ConcurrentDictionary FryOneData { get; set; } = new ConcurrentDictionary(); + public ConcurrentDictionary FryTwoData { get; set; } = new ConcurrentDictionary(); + public ConcurrentDictionary FryThreeData { get; set; } = new ConcurrentDictionary(); + public ConcurrentDictionary FryFourData { get; set; } = new ConcurrentDictionary(); + public ConcurrentDictionary FryFiveData { get; set; } = new ConcurrentDictionary(); public ObservableCollection Variables { get; set; } = new ObservableCollection(); + public ObservableCollection FryOneVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryTwoVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryThreeVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryFourVariables { get; set; } = new ObservableCollection(); + public ObservableCollection FryFiveVariables { get; set; } = new ObservableCollection(); public DeviceOperate() { Init(); @@ -37,18 +57,69 @@ namespace FryPot_DosingSystem.Control } public void Init() { - if (Variables.Count > 0) - { - Variables.Clear(); - } + Variables.Clear(); + FryOneVariables.Clear(); + FryTwoVariables.Clear(); + FryThreeVariables.Clear(); + FryFourVariables.Clear(); + FryFiveVariables.Clear(); + Json.Read(); if (Json.Data.VariablesInfo.Count > 0) { try { - foreach (var item in Json.Data.VariablesInfo) + if (Json.Data.VariablesInfo["滚筒输送线"].Count>0) { - Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + //foreach (var item in Json.Data.VariablesInfo["滚筒运输线"]) + //{ + // Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + //} + foreach (KeyValuePair> dic in Json.Data.VariablesInfo) + { + if (string.Equals(dic.Key, "滚筒输送线")) + { + foreach (var item in dic.Value) + { + Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + if (string.Equals(dic.Key, "炒锅1")) + { + foreach (var item in dic.Value) + { + FryOneVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + if (string.Equals(dic.Key, "炒锅2")) + { + foreach (var item in dic.Value) + { + FryTwoVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + if (string.Equals(dic.Key, "炒锅3")) + { + foreach (var item in dic.Value) + { + FryThreeVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + if (string.Equals(dic.Key, "炒锅4")) + { + foreach (var item in dic.Value) + { + FryFourVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + if (string.Equals(dic.Key, "炒锅5")) + { + foreach (var item in dic.Value) + { + FryFiveVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) }); + } + } + } } IsConfig = true; } @@ -59,8 +130,8 @@ namespace FryPot_DosingSystem.Control } } else - { - IsConfig= false; + { + IsConfig = false; } //Variables.Add(new PlcVariableModel() { Address = "D2001", Length = 8 });//1号线体滚筒工位号 //Variables.Add(new PlcVariableModel() { Address = "D2011", Length = 8 });//2号线体滚筒工位号 @@ -88,13 +159,26 @@ namespace FryPot_DosingSystem.Control { if (devices.Devices.Count > 0) { - Ip = devices.Devices[0].Ip; - Port = devices.Devices[0].Port; - DeviceName = devices.Devices[0].DeviceName; - Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); - // Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); App.Current.Dispatcher.Invoke(new Action(() => { BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.RunLog("PLC连接成功"); })); }); + for (int i = 0; i < devices.Devices.Count; i++) + { + string Ip = devices.Devices[i].Ip; + string Port = devices.Devices[i].Port; + string DeviceName = devices.Devices[i].DeviceName; + switch (DeviceName) + { + case "滚筒输送线": Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + case "炒锅1": Task.Run(() => { fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + case "炒锅2": Task.Run(() => { fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + case "炒锅3": Task.Run(() => { fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + case "炒锅4": Task.Run(() => { fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + case "炒锅5": Task.Run(() => { fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break; + + } + + } + // Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); App.Current.Dispatcher.Invoke(new Action(() => { BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.RunLog("PLC连接成功"); })); }); } - } + } } } public void ReadData() @@ -103,6 +187,7 @@ namespace FryPot_DosingSystem.Control { ThreadManage.GetInstance().StartLong(new Action(() => { + //滚筒线 Connected = modbus.Connected; while (Connected) { @@ -118,11 +203,106 @@ namespace FryPot_DosingSystem.Control Data.TryAdd(item.Address, res); } } - Thread.Sleep(500); + Thread.Sleep(50); + + } + //炒锅1 + FryOneConnected = fryOneModbus.Connected; + while (FryOneConnected) + { + foreach (var item in FryOneVariables) + { + var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据 + if (FryOneData.ContainsKey(item.Address)) + { + FryOneData[item.Address] = res; + } + else + { + FryOneData.TryAdd(item.Address, res); + } + } + Thread.Sleep(50); } - Thread.Sleep(1000); - }), $"设备【{DeviceName}】PLC实时数据读取线程"); + //炒锅2 + FryTwoConnected = fryTwoModbus.Connected; + while (FryTwoConnected) + { + foreach (var item in FryTwoVariables) + { + var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据 + if (FryTwoData.ContainsKey(item.Address)) + { + FryTwoData[item.Address] = res; + } + else + { + FryTwoData.TryAdd(item.Address, res); + } + } + Thread.Sleep(50); + + } + //炒锅3 + FryThreeConnected = fryThreeModbus.Connected; + while (FryThreeConnected) + { + foreach (var item in FryThreeVariables) + { + var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据 + if (FryThreeData.ContainsKey(item.Address)) + { + FryThreeData[item.Address] = res; + } + else + { + FryThreeData.TryAdd(item.Address, res); + } + } + Thread.Sleep(50); + + } + //炒锅4 + FryFourConnected = fryFourModbus.Connected; + while (FryFourConnected) + { + foreach (var item in FryFourVariables) + { + var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据 + if (FryFourData.ContainsKey(item.Address)) + { + FryFourData[item.Address] = res; + } + else + { + FryFourData.TryAdd(item.Address, res); + } + } + Thread.Sleep(50); + + } + //炒锅5 + FryFiveConnected = fryFiveModbus.Connected; + while (FryFiveConnected) + { + foreach (var item in FryFiveVariables) + { + var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据 + if (FryFiveData.ContainsKey(item.Address)) + { + FryFiveData[item.Address] = res; + } + else + { + FryFiveData.TryAdd(item.Address, res); + } + } + Thread.Sleep(50); + + } + Thread.Sleep(500); + }), $"PLC实时数据读取线程"); } } public void WritePlcData(string address, ushort value) @@ -136,5 +316,25 @@ namespace FryPot_DosingSystem.Control { return Data; } + public ConcurrentDictionary GetFryOneData() + { + return FryOneData; + } + public ConcurrentDictionary GetFryTwoData() + { + return FryTwoData; + } + public ConcurrentDictionary GetFryThreeData() + { + return FryThreeData; + } + public ConcurrentDictionary GetFryFourData() + { + return FryFourData; + } + public ConcurrentDictionary GetFryFiveData() + { + return FryFiveData; + } } } diff --git a/FryPot_DosingSystem/Control/DosingLogicControl.cs b/FryPot_DosingSystem/Control/DosingLogicControl.cs index f3519d10..4078b7f4 100644 --- a/FryPot_DosingSystem/Control/DosingLogicControl.cs +++ b/FryPot_DosingSystem/Control/DosingLogicControl.cs @@ -21,6 +21,7 @@ using FryPot_DosingSystem.AGV; using FryPot_DosingSystem.FryPotStatus; using System.IO; using System.Runtime.Serialization.Formatters.Binary; +using System.Diagnostics; namespace FryPot_DosingSystem.Control { @@ -28,7 +29,16 @@ namespace FryPot_DosingSystem.Control { public static DosingLogicControl _instance; public static DosingLogicControl GetInstance => _instance ??= new DosingLogicControl(); + /// + /// 滚筒线PLC数据 + /// public ConcurrentDictionary PlcReadData = new ConcurrentDictionary(); + + public ConcurrentDictionary FryOneData = new ConcurrentDictionary(); + public ConcurrentDictionary FryTwoData = new ConcurrentDictionary(); + public ConcurrentDictionary FryThreeData = new ConcurrentDictionary(); + public ConcurrentDictionary FryFourData = new ConcurrentDictionary(); + public ConcurrentDictionary FryFiveData = new ConcurrentDictionary(); /// /// 线体1配方队列 /// @@ -106,6 +116,11 @@ namespace FryPot_DosingSystem.Control bool ErrorRecipe;//线体1错误配方标识 bool LTwoErrorRecipe;//线体2错误配方标识 bool LThreeErrorRecipe;//线体3错误配方标识 + string fryOneRecipe = string.Empty; + string fryTwoRecipe = string.Empty; + string fryThreeRecipe = string.Empty; + string fryFourRecipe = string.Empty; + string fryFiveRecipe = string.Empty; #endregion #region agv临时变量 //bool agvArriveUpLoad = false;//agv是否到达线体1上料位置 @@ -120,18 +135,114 @@ namespace FryPot_DosingSystem.Control //bool LTwoagvFryPotEmptyRollerArrive = false; //线体2的agv是否拿到炒锅空桶 //bool LThreeagvFryPotEmptyRollerArrive = false;//线体3的agv是否拿到炒锅空桶 - string LOnerobotJobId = String.Empty;//线体1当前上游系统任务号,全局唯一 - string LTworobotJobId = String.Empty;//线体2当前上游系统任务号,全局唯一 - string LThreerobotJobId = String.Empty;//线体3当前上游系统任务号,全局唯一 - string LFourrobotJobId = String.Empty;//线体4当前上游系统任务号,全局唯一 + string LOnerobotJobId = string.Empty;//线体1当前上游系统任务号,全局唯一 从线体1到炒锅路径 + string LTworobotJobId = string.Empty;//线体2当前上游系统任务号,全局唯一 从线体2到炒锅路径 + string LThreerobotJobId = string.Empty;//线体3当前上游系统任务号,全局唯一 从线体3到炒锅路径 + string LFourrobotJobId = string.Empty;//线体4当前上游系统任务号,全局唯一 从炒锅1、4到线体4路径 + string LFiverobotJobId = string.Empty; //从炒锅2、5到线体4路径 + string LSixrobotJobId = string.Empty; //从炒锅3到线体4路径 + string LSevenrobotJobId = string.Empty; //从线体1到清洗台路径 + string LEightrobotJobId = string.Empty; //从线体2到清洗台路径 + string LNinerobotJobId = string.Empty; //从线体3到清洗台路径 + string LTenrobotJobId = string.Empty; //从清洗台到线体4路径 + + public int CleanNum = 0;//当前清洗台桶数 - //bool loadInteractive = false;// fasle:不需要上料交互 true:需要上料交互 #endregion /// /// 调试命令注册 /// public void CommandRegist() { + + #region 线体空桶清洗及回收调试 + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineOneLoadEmptyRoller = true; + + }), "AgvArriveLineOneEmptyRollerLoc"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineTwoLoadEmptyRoller = true; + + }), "AgvArriveLineTwoEmptyRollerLoc"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineThreeLoadEmptyRoller = true; + + }), "AgvArriveLineThreeEmptyRollerLoc"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.CleanComplete = 1; + + }), "CleanPlateCallAgv"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveCleanUnLoad = true;//清洗台空桶下料就位 + + }), "AgvArriveCleanPlateLoc"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveCleanLoad = true;//清洗台空桶上料就位 + + }), "AgvArriveCleanPlateLocLoad"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineFour = true; + + }), "AgvArriveLineFourLoc"); + + ActionManage.GetInstance.Register(new Action(() => + { + EmptyRollerCleanTaskRestart(); + + }), "EmptyRollerCleanTaskRestart"); + + #endregion + //接口调试 + ActionManage.GetInstance.Register(new Action(() => + { + string id = Guid.NewGuid().ToString(); + string errorCode = AGVHelper._Instance.AgvToLineOneLoadRoller(id); + if (errorCode == "SUCCESS") + { + MessageLog.GetInstance.ShowRunLog($"AGV任务下发成功"); + } + else if (errorCode == "Analysis Error") + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV 调用API失败,请检查请求报文"); + } + else + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}"); + } + }), "AgvDebug"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineOneLoadCom = true; + }), "AgvLineOneLoadEmptyCom"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineTwoLoadCom = true; + }), "AgvLineTwoLoadEmptyCom"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.agvArriveLineThreeLoadCom = true; + }), "AgvLineThreeLoadEmptyCom"); + + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.rollerLineOne.CanRun = true; + }), "AGVLineOneLoadCom"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.rollerLineTwo.CanRun = true; + }), "AGVLineTwoLoadCom"); + ActionManage.GetInstance.Register(new Action(() => + { + globalVar.rollerLineThree.CanRun = true; + }), "AGVLineThreeLoadCom"); + ActionManage.GetInstance.Register(new Action(() => { globalVar.rollerLineOne.OutMaterialingSingle = 1; @@ -248,6 +359,7 @@ namespace FryPot_DosingSystem.Control //fryFive = new PotFiveStatus(); hardWareStatusModel = HardWareStatusViewModel.GetInstance; DateTimeJudge(); + FileRegClean(); ActionManage.GetInstance.Register(new Action(RecipeDataParse), "RecipeSetDown"); //ActionManage.GetInstance.Register(new Action(() => { RecipeQuene.Clear(); InputMaterialQuene.Clear(); OutputMaterialQuene.Clear(); LTwoInputMaterialQuene.Clear(); LTwoOutputMaterialQuene.Clear(); LThreeInputMaterialQuene.Clear(); LThreeOutputMaterialQuene.Clear(); }), "ClearRecipes"); ActionManage.GetInstance.Register(new Action(() => { RecipeQuene.Clear(); InputMaterialQuene.Clear(); OutputMaterialQuene.Clear(); }), "ClearOneRecipes"); @@ -262,58 +374,257 @@ namespace FryPot_DosingSystem.Control HubHelper.GetInstance.Upstreamrequest = new Action(AgvFeedBackUpReportDataAnalysis); // ResetProgram(); ReadPlcData(); + SaveFryPotData(); MainTask(); CommandRegist(); } + /// + /// 文件数据定期清理 + /// + /// + private void FileRegClean() + { + int days = 5; //清除期限 + string[] filesOne = Directory.GetDirectories("AccessFile//DB//炒锅1状态数据"); + if (filesOne.Count() > 0) + { + foreach (var item in filesOne) + { + FileInfo info = new FileInfo(item); + DateTime createTime = info.CreationTime; + DateTime timeNow = DateTime.Now; + if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days) + { + Directory.Delete(item); + } + } + } + string[] filesTwo = Directory.GetDirectories("AccessFile//DB//炒锅2状态数据"); + if (filesTwo.Count() > 0) + { + foreach (var item in filesTwo) + { + FileInfo info = new FileInfo(item); + DateTime createTime = info.CreationTime; + DateTime timeNow = DateTime.Now; + if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days) + { + Directory.Delete(item); + } + } + } + string[] filesThree = Directory.GetDirectories("AccessFile//DB//炒锅3状态数据"); + if (filesThree.Count() > 0) + { + foreach (var item in filesThree) + { + FileInfo info = new FileInfo(item); + DateTime createTime = info.CreationTime; + DateTime timeNow = DateTime.Now; + if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days) + { + Directory.Delete(item); + } + } + } + string[] filesFour = Directory.GetDirectories("AccessFile//DB//炒锅4状态数据"); + if (filesFour.Count() > 0) + { + foreach (var item in filesFour) + { + FileInfo info = new FileInfo(item); + DateTime createTime = info.CreationTime; + DateTime timeNow = DateTime.Now; + if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days) + { + Directory.Delete(item); + } + } + } + string[] filesFive = Directory.GetDirectories("AccessFile//DB//炒锅5状态数据"); + if (filesFive.Count() > 0) + { + foreach (var item in filesFive) + { + FileInfo info = new FileInfo(item); + DateTime createTime = info.CreationTime; + DateTime timeNow = DateTime.Now; + if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days) + { + Directory.Delete(item); + } + } + } + } + /// + /// 时间差计算 + /// + /// 当前时间 + /// 创建时间 + /// + private int TimeDiff(DateTime t, DateTime t2) + { + long lReturn = -1; + System.TimeSpan NowValue = new TimeSpan(t.Ticks); + System.TimeSpan TimeValue = new TimeSpan(t2.Ticks); + System.TimeSpan DateDiff = TimeSpan.Zero; + try + { + //计算时间差 + //DateDiff = TimeValue.Subtract(NowValue).Duration(); + DateDiff = NowValue.Subtract(TimeValue); + int h = DateDiff.Hours; + int m = DateDiff.Minutes; + return DateDiff.Days; + } + catch + { + return -1; + } + } + /// + /// 炒锅数据实时保存 + /// + /// + private void SaveFryPotData() + { + Task.Run(new Action(() => + { + while (true) + { + FryPotDataSaveToBinaryFile(); Thread.Sleep(1000); + } + })); + } + /// /// 时间判断,数据处理 /// private void DateTimeJudge() { - if (Sqlite.GetInstance.GetData().Count > 0) + #region sqlite数据库保存 + //if (Sqlite.GetInstance.GetData().Count > 0) + //{ + // string time1 = Sqlite.GetInstance.GetData().Last().Time; + // if (time1.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + // { + // FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; + // FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + // } + //} + //if (Sqlite.GetInstance.GetData().Count > 0) + //{ + // string time2 = Sqlite.GetInstance.GetData().Last().Time; + // if (time2.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + // { + // FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; + // FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + // } + //} + //if (Sqlite.GetInstance.GetData().Count > 0) + //{ + // string time3 = Sqlite.GetInstance.GetData().Last().Time; + // if (time3.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + // { + // FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; + // FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + // } + //} + //if (Sqlite.GetInstance.GetData().Count > 0) + //{ + // string time4 = Sqlite.GetInstance.GetData().Last().Time; + // if (time4.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + // { + // FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; + // FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + // } + //} + + //if (Sqlite.GetInstance.GetData().Count > 0) + //{ + // string time5 = Sqlite.GetInstance.GetData().Last().Time; + // if (time5.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + // { + // FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; + // FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + // } + //} + #endregion + string p1 = "AccessFile//" + "Statistic//" + "FryOne.txt"; + string p2 = "AccessFile//" + "Statistic//" + "FryTwo.txt"; + string p3 = "AccessFile//" + "Statistic//" + "FryThree.txt"; + string p4 = "AccessFile//" + "Statistic//" + "FryFour.txt"; + string p5 = "AccessFile//" + "Statistic//" + "FryFive.txt"; + if (!Directory.Exists("AccessFile//" + "Statistic")) + Directory.CreateDirectory("AccessFile//" + "Statistic"); + if (File.Exists(p1)) { - string time1 = Sqlite.GetInstance.GetData().Last().Time; - if (time1.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + using (StreamReader sReader = new StreamReader(p1, Encoding.UTF8)) { - FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; - FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + string time = sReader.ReadLine(); + string statistic = sReader.ReadLine(); + if (DateTime.Now.ToShortDateString() == time) + { + FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); + FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); + + } } } - if (Sqlite.GetInstance.GetData().Count > 0) + if (File.Exists(p2)) { - string time2 = Sqlite.GetInstance.GetData().Last().Time; - if (time2.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + using (StreamReader sReader = new StreamReader(p2, Encoding.UTF8)) { - FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; - FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + string time = sReader.ReadLine(); + string statistic = sReader.ReadLine(); + if (DateTime.Now.ToShortDateString() == time) + { + FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); + FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); + + } } } - if (Sqlite.GetInstance.GetData().Count > 0) + if (File.Exists(p3)) { - string time3 = Sqlite.GetInstance.GetData().Last().Time; - if (time3.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + using (StreamReader sReader = new StreamReader(p3, Encoding.UTF8)) { - FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; - FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + string time = sReader.ReadLine(); + string statistic = sReader.ReadLine(); + if (DateTime.Now.ToShortDateString() == time) + { + FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); + FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); + + } } } - if (Sqlite.GetInstance.GetData().Count > 0) + if (File.Exists(p4)) { - string time4 = Sqlite.GetInstance.GetData().Last().Time; - if (time4.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + using (StreamReader sReader = new StreamReader(p4, Encoding.UTF8)) { - FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; - FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + string time = sReader.ReadLine(); + string statistic = sReader.ReadLine(); + if (DateTime.Now.ToShortDateString() == time) + { + FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); + FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); + + } } } - - if (Sqlite.GetInstance.GetData().Count > 0) + if (File.Exists(p5)) { - string time5 = Sqlite.GetInstance.GetData().Last().Time; - if (time5.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 + using (StreamReader sReader = new StreamReader(p5, Encoding.UTF8)) { - FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Sqlite.GetInstance.GetData().Last().TotalOilCapactiy; - FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Sqlite.GetInstance.GetData().Last().TotalProduct; + string time = sReader.ReadLine(); + string statistic = sReader.ReadLine(); + if (DateTime.Now.ToShortDateString() == time) + { + FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); + FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); + + } } } } @@ -331,6 +642,7 @@ namespace FryPot_DosingSystem.Control if (objData != null) { + #region 线体到炒锅 //线体1请求上下料 if (objData.robotJobId == LOnerobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 { @@ -362,8 +674,84 @@ namespace FryPot_DosingSystem.Control if (objData.robotJobId == LThreerobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 { globalVar.LThreeagvArriveUnLoad = true;//AGV到达下料位置 + } + #endregion + + #region 炒锅到线体4请求上下料 + if (objData.robotJobId == LFourrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 + { + globalVar.agvArriveUpLoad = true;//AGV到达上料位置 + + } + if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveLineFour = true;//AGV到达下料位置 + + } + + if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD") + { + globalVar.agvArriveLTwoUpLoad = true;//AGV到达上料位置 + + } + if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveLineFour = true;//AGV到达下料位置 + + } + + if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD") + { + globalVar.agvArriveLThreeUpLoad = true;//AGV到达上料位置 } + if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveLineFour = true;//AGV到达下料位置 + } + #endregion + #region 线体到清洗台 + if (objData.robotJobId == LSevenrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 + { + globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置 + + } + if (objData.robotJobId == LSevenrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置 + + } + + if (objData.robotJobId == LEightrobotJobId && objData.command == "LOAD") + { + globalVar.agvArriveLineTwoLoadEmptyRoller = true;//AGV到达上料位置 + + } + if (objData.robotJobId == LEightrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置 + + } + + if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD") + { + globalVar.agvArriveLineThreeLoadEmptyRoller = true;//AGV到达上料位置 + + } + if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 + { + globalVar.agvArriveCleanUnLoad = true;//AGV到达下料位置 + } + #endregion + + if (objData.robotJobId == LTenrobotJobId && objData.command == "LOAD") + { + globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置 + } + if (objData.robotJobId == LTenrobotJobId && objData.command == "UNLOAD") + { + globalVar.agvArriveLineFour = true;//agv到达线体4下料位置 + } } } @@ -382,24 +770,40 @@ namespace FryPot_DosingSystem.Control { #region 线体上下料任务信息回报 //线体1任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体上料 { } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体上料 { //日志 } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体上料 { //日志 } - + //---------------------空桶从线体去清洗-------------------------------// //线体1任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指线体上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料 + { + // globalVar.rollerLineOne.IsEpmtyBefore = false; + } + //线体2任务上报 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料 + { + // globalVar.rollerLineTwo.IsEpmtyBefore = false; + } + //线体3任务上报 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料 { + // globalVar.rollerLineThree.IsEpmtyBefore = false; + } + //线体1任务上报 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 + { + AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes); if (globalVar.LOneFryPotSerial == 1) @@ -410,11 +814,12 @@ namespace FryPot_DosingSystem.Control { AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_4); } - } + //线体2任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指线体上料 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 { + AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes); if (globalVar.LTwoFryPotSerial == 2) @@ -425,14 +830,46 @@ namespace FryPot_DosingSystem.Control { AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5); } + } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指线体上料 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 { + AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes); AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3); + } + + //线体1任务上报 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料 + { + globalVar.agvArriveLineOneLoadCom = true; + AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString()); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1); + //到清洗处 + } + //线体2任务上报 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料 + { + globalVar.agvArriveLineTwoLoadCom = true; + AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString()); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2); + //到清洗处 + + } + //线体3任务上报 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料 + { + globalVar.agvArriveLineThreeLoadCom = true; + AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString()); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3); + //到清洗处 + } //线体1任务上报 if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体下料 @@ -468,23 +905,23 @@ namespace FryPot_DosingSystem.Control #region 空桶上下料任务信息回报 //线体1任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料 { //日志 } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料 { //日志 } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指空桶上料 + if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料 { //日志 } //线体1任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 { globalVar.agvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.OnllYes); @@ -498,7 +935,7 @@ namespace FryPot_DosingSystem.Control } } //线体2任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 { globalVar.LTwoagvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.OnllYes); @@ -512,16 +949,18 @@ namespace FryPot_DosingSystem.Control } } //线体3任务上报 - if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料 + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 { globalVar.LThreeagvFryPotEmptyRollerArrive = true; AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes); AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3); } + + //线体1任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料 { - AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start); + AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No); if (globalVar.LFourRollerNum >= 8) { @@ -533,9 +972,9 @@ namespace FryPot_DosingSystem.Control } } //线体2任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料 { - AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start); + AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.No); if (globalVar.LFourRollerNum >= 8) { @@ -547,9 +986,9 @@ namespace FryPot_DosingSystem.Control } } //线体3任务上报 - if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指空桶下料 + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料 { - AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start); + AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.No); if (globalVar.LFourRollerNum >= 8) { @@ -561,29 +1000,77 @@ namespace FryPot_DosingSystem.Control } } //线体1任务上报 - if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料 { - globalVar.EmptyRollerUnLoadcCom = true; + // globalVar.EmptyRollerUnLoadcCom = true; AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj")); AgvViewModel.GetInstance().Set小车停止(1); AgvViewModel.GetInstance().Set停车桩(1, IsBool.Yes); + } //线体2任务上报 - if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料 { - globalVar.LTwoEmptyRollerUnLoadcCom = true; + // globalVar.EmptyRollerUnLoadcCom = true; AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj")); AgvViewModel.GetInstance().Set小车停止(2); AgvViewModel.GetInstance().Set停车桩(2, IsBool.Yes); } //线体3任务上报 - if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料 + if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料 { - globalVar.LThreeEmptyRollerUnLoadcCom = true; + // globalVar.EmptyRollerUnLoadcCom = true; AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj")); AgvViewModel.GetInstance().Set小车停止(3); AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes); } + + if (objData.state == "DONE" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料 + { + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj")); + AgvViewModel.GetInstance().Set小车停止(4); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); + } + if (objData.state == "DONE" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料 + { + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj")); + AgvViewModel.GetInstance().Set小车停止(4); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); + } + if (objData.state == "DONE" && objData.robotJobId == LNinerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料 + { + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj")); + AgvViewModel.GetInstance().Set小车停止(4); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); + } + if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料 + { + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hs_4);//去四号空桶线 + + } + if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTenrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指清洗台空桶到线体4下料 + { + AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No); + if (globalVar.LFourRollerNum >= 8) + { + AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); + } + else + { + AgvViewModel.GetInstance().Set滚筒线上数量(4, (globalVar.LFourRollerNum + 1).ToString()); + } + } + + if (objData.state == "DONE" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料 + { + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj")); + AgvViewModel.GetInstance().Set小车停止(4); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); + + } + #endregion @@ -656,7 +1143,8 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveUpLoad = false; globalVar.agvArriveUnLoad = false; globalVar.agvFryPotEmptyRollerArrive = false; - globalVar.EmptyRollerUnLoadcCom = false; + globalVar.agvLineOneLoadCom = false; + ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程"); MessageLog.GetInstance.ShowUserLog("滚筒线【1】任务重启成功"); })); @@ -687,7 +1175,8 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLTwoUpLoad = false; globalVar.LTwoagvArriveUnLoad = false; globalVar.LTwoagvFryPotEmptyRollerArrive = false; - globalVar.LTwoEmptyRollerUnLoadcCom = false; + globalVar.agvLineTwoLoadCom = false; + ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程"); MessageLog.GetInstance.ShowUserLog("滚筒线【2】任务重启成功"); })); @@ -716,11 +1205,47 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLThreeUpLoad = false; globalVar.LThreeagvArriveUnLoad = false; globalVar.LThreeagvFryPotEmptyRollerArrive = false; - globalVar.LThreeEmptyRollerUnLoadcCom = false; + globalVar.agvLineThreeLoadCom = false; ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程"); MessageLog.GetInstance.ShowUserLog("滚筒线【3】任务重启成功"); })); } + + public void EmptyRollerCleanTaskRestart() + { + ThreadManage.GetInstance().StopTask("空桶清洗任务线程", new Action(() => + { + globalVar.rollerLineOne.StationEight = 0; + globalVar.rollerLineOne.EmptyRollerNums.Clear(); + globalVar.rollerLineOne.EmptyRollerNums.Add(108); + globalVar.rollerLineOne.IsEpmtyBefore = false; + // globalVar.rollerLineOne.CanRun = true; + + globalVar.rollerLineTwo.StationEight = 0; + globalVar.rollerLineTwo.EmptyRollerNums.Clear(); + globalVar.rollerLineTwo.EmptyRollerNums.Add(208); + globalVar.rollerLineTwo.IsEpmtyBefore = false; + //globalVar.rollerLineTwo.CanRun = true; + + globalVar.rollerLineThree.StationEight = 0; + globalVar.rollerLineThree.EmptyRollerNums.Clear(); + globalVar.rollerLineThree.EmptyRollerNums.Add(308); + globalVar.rollerLineThree.IsEpmtyBefore = false; + //globalVar.rollerLineThree.CanRun = true; + + globalVar.agvArriveLineFour = false; + globalVar.agvArriveCleanLoad = false; + globalVar.agvArriveCleanUnLoad = false; + globalVar.agvArriveLineOneLoadEmptyRoller = false; + globalVar.agvArriveLineTwoLoadEmptyRoller = false; + globalVar.agvArriveLineThreeLoadEmptyRoller = false; + globalVar.agvArriveLineOneLoadCom = false; + globalVar.agvArriveLineTwoLoadCom = false; + globalVar.agvArriveLineThreeLoadCom = false; + ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程"); + MessageLog.GetInstance.ShowUserLog("空桶清洗任务重启成功"); + })); + } /// /// 实时获取plc数据 /// @@ -835,6 +1360,45 @@ namespace FryPot_DosingSystem.Control globalVar.CleadBarrelExitSingle = data[0]; })); + //炒锅1状态数据 + GetFryOneData("D2001", new Action(data => + { + + })); + //炒锅2状态数据 + GetFryTwoData("D2001", new Action(data => + { + + })); + //炒锅3状态数据 + GetFryThreeData("D2001", new Action(data => + { + + })); + //炒锅4状态数据 + GetFryFourData("D2001", new Action(data => + { + + })); + //炒锅5状态数据 + GetFryFiveData("D2001", new Action(data => + { + + })); + //线体上放空桶 + if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0) + { + globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum); + } + if (globalVar.rollerLineTwo.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineTwo.EmptyRollerNum != 0) + { + globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum); + } + if (globalVar.rollerLineThree.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineThree.EmptyRollerNum != 0) + { + globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum); + } + //炒锅状态数据 if (globalVar.fryPotOne.OilConfirm == 1) { FryPotMonitorManage.GetInstance.fryOne.OilCapacity = globalVar.fryPotOne.OilCapacity; @@ -862,10 +1426,7 @@ namespace FryPot_DosingSystem.Control } //炒锅状态实时显示 FryPotStatusDisplay(); - - RollerLineStatusDisplay(); - Thread.Sleep(10); }), "MainViewReadPlcData"); @@ -912,7 +1473,14 @@ namespace FryPot_DosingSystem.Control FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveOil").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.OilCapacity.ToString(); FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveTotalOil").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy.ToString(); FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveTotalProduct").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.TotalProduct.ToString(); - FryPotDataSaveToBinaryFile(); + + //FryPotMonitorManage.GetInstance.fryFive.Temperature = 10; + //FryPotMonitorManage.GetInstance.fryFive.HotPower = "9"; + //FryPotMonitorManage.GetInstance.fryFive.Speed = 8; + //FryPotMonitorManage.GetInstance.fryFive.FryPotWeight=7; + //FryPotMonitorManage.GetInstance.fryFive.OilCapacity = 6; + //FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = 5; + //FryPotMonitorManage.GetInstance.fryFive.TotalProduct = 4; } /// /// 炒锅状态数据保存到二进制文件 @@ -927,12 +1495,12 @@ namespace FryPot_DosingSystem.Control if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString())) Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString()); - if (globalVar.LOneFryPotSerial == 1) + if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty) { - using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LOneCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) { - - PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() }; + writeStream.Position = writeStream.Length; + PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() }; BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(writeStream, p1); @@ -943,12 +1511,12 @@ namespace FryPot_DosingSystem.Control { if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString())) Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString()); - if (globalVar.LOneFryPotSerial == 1) + if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty) { - using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LOneCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) { - - PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() }; + writeStream.Position = writeStream.Length; + PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() }; BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(writeStream, p1); @@ -956,18 +1524,19 @@ namespace FryPot_DosingSystem.Control } } #endregion + #region 炒锅2状态数据保存 if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据")) { Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据"); if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString())) Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString()); - if (globalVar.LOneFryPotSerial == 2) + if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty) { - using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LTwoCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) { - PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() }; + PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() }; BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(writeStream, p1); @@ -978,18 +1547,127 @@ namespace FryPot_DosingSystem.Control { if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString())) Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString()); - if (globalVar.LOneFryPotSerial == 2) + if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + + PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); + + } + } + } + #endregion + #region 炒锅3状态数据保存 + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据")) + { + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据"); + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString()); + + if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + + PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); + + } + } + } + else + { + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString()); + if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + + PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); + + } + } + } + #endregion + #region 炒锅4状态数据保存 + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据")) + { + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据"); + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString()); + + if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + writeStream.Position = writeStream.Length; + PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); + + } + } + } + else + { + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString()); + if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + writeStream.Position = writeStream.Length; + PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); + + } + } + } + #endregion + #region 炒锅5状态数据保存 + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据")) + { + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据"); + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString()); + + if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty) { - using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LTwoCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) { + writeStream.Position = writeStream.Length; + PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() }; + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize(writeStream, p1); - PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() }; + } + } + } + else + { + if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString())) + Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString()); + if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty) + { + using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) + { + writeStream.Position = writeStream.Length; + PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() }; BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(writeStream, p1); } } } + #endregion } /// /// 滚筒线运行状态显示 @@ -1078,7 +1756,7 @@ namespace FryPot_DosingSystem.Control } /// - /// 返回指定地址指定长度的数据 + /// 返回滚筒线PLC指定地址指定长度的数据 /// /// /// @@ -1090,6 +1768,46 @@ namespace FryPot_DosingSystem.Control action((ushort[])(PlcReadData[address])); } } + public void GetFryOneData(string address, Action action) + { + FryOneData = DeviceOperate.GetInstance.GetFryOneData(); + if (FryOneData.ContainsKey(address)) + { + action((ushort[])(FryOneData[address])); + } + } + public void GetFryTwoData(string address, Action action) + { + FryTwoData = DeviceOperate.GetInstance.GetFryTwoData(); + if (FryTwoData.ContainsKey(address)) + { + action((ushort[])(FryTwoData[address])); + } + } + public void GetFryThreeData(string address, Action action) + { + FryThreeData = DeviceOperate.GetInstance.GetFryThreeData(); + if (FryThreeData.ContainsKey(address)) + { + action((ushort[])(FryThreeData[address])); + } + } + public void GetFryFourData(string address, Action action) + { + FryFourData = DeviceOperate.GetInstance.GetFryFourData(); + if (FryFourData.ContainsKey(address)) + { + action((ushort[])(FryFourData[address])); + } + } + public void GetFryFiveData(string address, Action action) + { + FryFiveData = DeviceOperate.GetInstance.GetFryFiveData(); + if (FryFiveData.ContainsKey(address)) + { + action((ushort[])(FryFiveData[address])); + } + } /// /// 写Plc数据 /// @@ -1165,9 +1883,12 @@ namespace FryPot_DosingSystem.Control ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程"); ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程"); ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程"); - + ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程"); } + + + /// /// 线体1的执行流程 /// @@ -1222,7 +1943,157 @@ namespace FryPot_DosingSystem.Control //} } + private void LineFourProcessExecute() + { + //线体123到清洗台 + AgvFromLineToCleanPlate(); + AgvArriveCleanPlate(); + //清洗台到线体4 + CallAgvToLineFour(); + CleanPlateUpLoad(); + EmptyRollerToLinFour(); + } + + private void CleanPlateUpLoad() + { + if (globalVar.agvArriveCleanLoad) + { + globalVar.agvArriveCleanLoad = false; + MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); + MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); + AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum); + AgvViewModel.GetInstance().Set小车是否承载物品(4,IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_4); + } + } + + /// + /// 线体到清洗台 + /// + private void AgvFromLineToCleanPlate() + { + if (AlarmHelper.Alarm.LOneRollerTrouble == 0)//输送线无故障 + { + //线体1到清洗台 + if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun) + { + 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上报的桶号一致,即空桶 + { + + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 + LFourrobotJobId = id; + Thread.Sleep(500); + LineToCleanCarryTaskErrorCodeAnalysis(info, 1); + globalVar.rollerLineOne.IsEpmtyBefore = true; + //globalVar.rollerLineOne.CanRun = false; + AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + } + } + else + { + AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + } + } + // 线体2到清洗台 + if (AlarmHelper.Alarm.LTwoRollerTrouble == 0)//输送线无故障 + { + if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun) + { + 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上面有桶且不是配方上的原料桶,即空桶 + { + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处 + LFiverobotJobId = id; + Thread.Sleep(500); + LineToCleanCarryTaskErrorCodeAnalysis(info, 2); + globalVar.rollerLineTwo.IsEpmtyBefore = true; + // globalVar.rollerLineTwo.CanRun = false; + AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体2到清洗处 + } + } + else + { + AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + } + } + //线体3到清洗台 + if (AlarmHelper.Alarm.LThreeRollerTrouble == 0)//输送线无故障 + { + if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun) + { + 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上面有桶且不是配方上的原料桶,即空桶 + { + //下发AGV去空桶线洗桶任务 + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处 + LSixrobotJobId = id; + Thread.Sleep(500); + LineToCleanCarryTaskErrorCodeAnalysis(info, 3); + globalVar.rollerLineThree.IsEpmtyBefore = true; + //globalVar.rollerLineThree.CanRun = false; + AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + } + } + else + { + AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + } + } + } + + /// + /// AGV到达清洗台下料位置 + /// + private void AgvArriveCleanPlate() + { + if (globalVar.agvArriveCleanUnLoad) + { + globalVar.agvArriveCleanUnLoad = false; + MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶"); + MessageLog.GetInstance.ShowRunLog("卸桶完成"); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); + AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum); + //plc交互 + } + } + /// + /// 呼叫Agv从清洗台运洗好的空桶到四号线体 + /// + public void CallAgvToLineFour() + { + if (globalVar.CleanComplete == 1) + { + //是否需要手动给PLC置位?? + globalVar.CleanComplete = 0; + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(id); + LTenrobotJobId = id; + Thread.Sleep(500); + MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶"); + CleanToLineCarryTaskErrorCodeAnalysis(info, 4); + } + } /// /// 3号滚筒线数据下发 2022/7/4 新增 /// @@ -1234,13 +2105,19 @@ namespace FryPot_DosingSystem.Control if (globalVar.LThreeCurrentRecipeName != string.Empty) { MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); - globalVar.LThreeCurrentRecipeName = string.Empty; if (globalVar.LThreeFryPotSerial == 3) { FryPotMonitorManage.GetInstance.fryThree.TotalProduct++; - Sqlite.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryThree.txt", false, Encoding.UTF8)) + { + txtWriter.WriteLine(DateTime.Now.ToShortDateString()); + txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryThree.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy);//炒锅1产量以及总油量记录 + } + //Sqlite.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 } + globalVar.LThreeCurrentRecipeName = string.Empty; + Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; }); } } if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0)//后续添加其它限制条件 @@ -1257,12 +2134,14 @@ namespace FryPot_DosingSystem.Control globalVar.LThreeMaterialNum = result.materialCollection.Count; globalVar.LThreeFryPotSerial = headNum; globalVar.LThreeCurrentRecipeName = result.RecipeName; + AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString()); MessageLog.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() @@ -1274,6 +2153,7 @@ namespace FryPot_DosingSystem.Control } else { + MessageLog.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); LThreeInputMaterialQuene.Clear(); LThreeErrorRecipe = true; @@ -1281,7 +2161,7 @@ namespace FryPot_DosingSystem.Control } } DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据 - //AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop); + //AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop); } } @@ -1299,19 +2179,30 @@ namespace FryPot_DosingSystem.Control if (globalVar.LTwoCurrentRecipeName != string.Empty) { MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); - globalVar.LTwoCurrentRecipeName = string.Empty; if (globalVar.LTwoFryPotSerial == 2) { FryPotMonitorManage.GetInstance.fryTwo.TotalProduct++; - Sqlite.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryTwo.txt", false, Encoding.UTF8)) + { + txtWriter.WriteLine(DateTime.Now.ToShortDateString()); + txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryTwo.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy);//炒锅1产量以及总油量记录 + } + //Sqlite.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 } if (globalVar.LTwoFryPotSerial == 5) { FryPotMonitorManage.GetInstance.fryFive.TotalProduct++; - Sqlite.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryFive.txt", false, Encoding.UTF8)) + { + txtWriter.WriteLine(DateTime.Now.ToShortDateString()); + txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryFive.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy);//炒锅1产量以及总油量记录 + } + //Sqlite.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 } + globalVar.LTwoCurrentRecipeName = string.Empty; + Task.Run(() => { Thread.Sleep(2000); fryTwoRecipe = string.Empty; fryFiveRecipe = string.Empty; }); } } @@ -1346,10 +2237,12 @@ namespace FryPot_DosingSystem.Control { if (headNum == 1)//炒锅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; })); } //将配方中原料加入新的队列 @@ -1362,6 +2255,7 @@ namespace FryPot_DosingSystem.Control } else { + MessageLog.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); LTwoInputMaterialQuene.Clear(); LTwoErrorRecipe = true; @@ -1387,20 +2281,30 @@ namespace FryPot_DosingSystem.Control if (globalVar.LOneCurrentRecipeName != string.Empty) { MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); - globalVar.LOneCurrentRecipeName = string.Empty; if (globalVar.LOneFryPotSerial == 1) { FryPotMonitorManage.GetInstance.fryOne.TotalProduct++; - Sqlite.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryOne.txt", false, Encoding.UTF8)) + { + txtWriter.WriteLine(DateTime.Now.ToShortDateString()); + txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryOne.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy);//炒锅1产量以及总油量记录 + } + //Sqlite.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 } if (globalVar.LOneFryPotSerial == 4) { FryPotMonitorManage.GetInstance.fryFour.TotalProduct++; - Sqlite.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryFour.txt", false, Encoding.UTF8)) + { + txtWriter.WriteLine(DateTime.Now.ToShortDateString()); + txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryFour.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy);//炒锅1产量以及总油量记录 + } + //Sqlite.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 } - + globalVar.LOneCurrentRecipeName = string.Empty; + Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; }); } } if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0)//后续添加其它限制条件 @@ -1432,10 +2336,12 @@ namespace FryPot_DosingSystem.Control { 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; })); } //将配方中原料加入新的队列 @@ -1448,6 +2354,7 @@ namespace FryPot_DosingSystem.Control } else { + MessageLog.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作"); InputMaterialQuene.Clear(); ErrorRecipe = true; @@ -1549,8 +2456,23 @@ namespace FryPot_DosingSystem.Control { AgvToLineOneLoadRoller(); AgvFromLineOneToFryPot();//AGV到1号线体装桶 + AgvLineOneLoadRollerCom(); } } + /// + /// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件 + /// + /// + private void AgvLineOneLoadRollerCom() + { + if (globalVar.agvLineOneLoadCom) + { + globalVar.rollerLineOne.CanRun = true; + globalVar.agvLineOneLoadCom = false; + MessageLog.GetInstance.ShowRunLog("AGV在【1】号滚筒线装桶完成"); + } + } + /// /// AGV到配方线体2装桶以及出料到炒锅 /// @@ -1558,13 +2480,25 @@ namespace FryPot_DosingSystem.Control { if (LTwoInputMaterialQuene.Count > 0) { - AgvToLineTwoLoadRoller(); AgvFromLineTwoToFryPot();//AGV到2号线体装桶 - + AgvLineTwoLoadRollerCom(); } } + /// + /// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件 + /// + private void AgvLineTwoLoadRollerCom() + { + if (globalVar.agvLineTwoLoadCom) + { + globalVar.rollerLineTwo.CanRun = true; + globalVar.agvLineTwoLoadCom = false; + MessageLog.GetInstance.ShowRunLog("AGV在【2】号滚筒线装桶完成"); + } + } + /// /// AGV到配方线体3装桶以及出料到炒锅 /// @@ -1575,8 +2509,19 @@ namespace FryPot_DosingSystem.Control AgvToLineThreeLoadRoller(); AgvFromLineThreeToFryPot();//AGV到2号线体装桶 - - + AgvLineThreeLoadRollerCom(); + } + } + /// + /// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件 + /// + private void AgvLineThreeLoadRollerCom() + { + if (globalVar.agvLineThreeLoadCom) + { + globalVar.rollerLineThree.CanRun = true; + globalVar.agvLineThreeLoadCom = false; + MessageLog.GetInstance.ShowRunLog("AGV在【3】号滚筒线装桶完成"); } } /// @@ -1631,16 +2576,16 @@ namespace FryPot_DosingSystem.Control { if (!globalVar.InOrOutputLock && (globalVar.fryPotOne.InputMaterialArrivedSingle == 1 || globalVar.fryPotFour.InputMaterialArrivedSingle == 1) && globalVar.PotOneInputMaterialArrive && OutputMaterialQuene.Count > 0 && !globalVar.PotOneOutputRollerArrive) { - if (globalVar.LOneFryPotSerial == 1) - { - Sqlite.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 - } - else - { - Sqlite.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 - } + //if (globalVar.LOneFryPotSerial == 1) + //{ + // Sqlite.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + // Sqlite.GetInstance.Save();//保存数据 + //} + //else + //{ + // Sqlite.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + // Sqlite.GetInstance.Save();//保存数据 + //} FryPotOneRollerTroubleCheck(); if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障 { @@ -1648,11 +2593,9 @@ namespace FryPot_DosingSystem.Control { Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.workflows.Add(new WorkflowModel { id = globalVar.LOneCurrentCookingStep, Name = OutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); })); - } else { - Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.workflows.Add(new WorkflowModel { id = globalVar.LOneCurrentCookingStep, Name = OutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); })); } AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No); @@ -1690,16 +2633,16 @@ namespace FryPot_DosingSystem.Control { if (!globalVar.LTwoInOrOutputLock && (globalVar.fryPotTwo.InputMaterialArrivedSingle == 1 || globalVar.fryPotFive.InputMaterialArrivedSingle == 1) && globalVar.LTwoPotInputMaterialArrive && LTwoOutputMaterialQuene.Count > 0 && !globalVar.LTwoPotOutputRollerArrive) { - if (globalVar.LTwoFryPotSerial == 2) - { - Sqlite.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 - } - else - { - Sqlite.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 - } + //if (globalVar.LTwoFryPotSerial == 2) + //{ + // Sqlite.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + // Sqlite.GetInstance.Save();//保存数据 + //} + //else + //{ + // Sqlite.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + // Sqlite.GetInstance.Save();//保存数据 + //} FryPotTwoRollerTroubleCheck(); if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//炒锅滚筒无故障 { @@ -1743,8 +2686,8 @@ namespace FryPot_DosingSystem.Control { if (!globalVar.LThreeInOrOutputLock && globalVar.fryPotThree.InputMaterialArrivedSingle == 1 && globalVar.LThreePotInputMaterialArrive && LThreeOutputMaterialQuene.Count > 0 && !globalVar.LThreePotOutputRollerArrive) { - Sqlite.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 - Sqlite.GetInstance.Save();//保存数据 + //Sqlite.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 + //Sqlite.GetInstance.Save();//保存数据 FryPotThreeRollerTroubleCheck(); if (FryPotThreeAlarm == 1)//炒锅滚筒无故障 { @@ -1912,7 +2855,6 @@ namespace FryPot_DosingSystem.Control { if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && globalVar.agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot) { - MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置"); AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号 globalVar.agvArriveLThreeUpLoad = false; @@ -1953,58 +2895,53 @@ namespace FryPot_DosingSystem.Control } /// - /// 1号线体对应空桶清洗 - /// - public void LOneEmptyRollerToClean() - { - if (globalVar.EmptyRollerUnLoadcCom)//agv在4号线体下料完成 - { - erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) - { - goto erp; - } - string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id); - LOnerobotJobId = id; - FryCarryTaskErrorCodeAnalysis(info, 1); - globalVar.AllowAgvToLineLoadRoller = true; - globalVar.LoadRoller = false; - globalVar.AgvToFryPot = false; - globalVar.PotOneInputMaterialArrive = false; - globalVar.PotOneOutputRollerArrive = false; - globalVar.AgvArrivePot = false; - } - } - /// - /// 2号线体对应空桶清洗 - /// - public void LTwoEmptyRollerToClean() - { - if (globalVar.LTwoEmptyRollerUnLoadcCom)//agv在4号线体下料完成 - { - globalVar.AllowAgvToLineTwoLoadRoller = true; - globalVar.LTwoLoadRoller = false; - globalVar.LTwoAgvToFryPot = false; - globalVar.LTwoPotInputMaterialArrive = false; - globalVar.LTwoPotOutputRollerArrive = false; - globalVar.LTwoAgvArrivePot = false; - } - } - /// - /// 3号线体对应空桶清洗 + /// 4号线体下料 /// - public void LThreeEmptyRollerToClean() + public void EmptyRollerToLinFour() { - if (globalVar.LThreeEmptyRollerUnLoadcCom)//agv在4号线体下料完成 + if (globalVar.agvArriveLineFour)//agv到达线体4下料位置 { - globalVar.AllowAgvToLineThreeLoadRoller = true; - globalVar.LThreeLoadRoller = false; - globalVar.LThreeAgvToFryPot = false; - globalVar.LThreePotInputMaterialArrive = false; - globalVar.LThreePotOutputRollerArrive = false; - globalVar.LThreeAgvArrivePot = false; + globalVar.agvArriveLineFour = false; + //线体四信号交互 + MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶"); + MessageLog.GetInstance.ShowRunLog("卸桶完成"); + AgvViewModel.GetInstance().Set滚筒线状态(4,IsRun.Start); + AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString()); + AgvViewModel.GetInstance().Set小车是否承载物品(4,IsBool.No); + AgvViewModel.GetInstance().Set小车运动(4,CartMotionTrajectory.hj); + AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); } } + ///// + ///// 2号线体对应空桶清洗 + ///// + //public void LTwoEmptyRollerToLineFour() + //{ + // if (globalVar.LTwoEmptyRollerUnLoadcCom)//agv在4号线体下料完成 + // { + // globalVar.AllowAgvToLineTwoLoadRoller = true; + // globalVar.LTwoLoadRoller = false; + // globalVar.LTwoAgvToFryPot = false; + // globalVar.LTwoPotInputMaterialArrive = false; + // globalVar.LTwoPotOutputRollerArrive = false; + // globalVar.LTwoAgvArrivePot = false; + // } + //} + ///// + ///// 3号线体对应空桶清洗 + ///// + //public void LThreeEmptyRollerToLinFour() + //{ + // if (globalVar.LThreeEmptyRollerUnLoadcCom)//agv在4号线体下料完成 + // { + // globalVar.AllowAgvToLineThreeLoadRoller = true; + // globalVar.LThreeLoadRoller = false; + // globalVar.LThreeAgvToFryPot = false; + // globalVar.LThreePotInputMaterialArrive = false; + // globalVar.LThreePotOutputRollerArrive = false; + // globalVar.LThreeAgvArrivePot = false; + // } + //} /// /// 炒锅滚筒进料运行到位处理 @@ -2287,60 +3224,60 @@ namespace FryPot_DosingSystem.Control { DeviceOperate.GetInstance.WritePlcData("D1062", 1);//agv到炒锅3送料就位信号 } - /// - /// AGV离开炒锅运送空桶任务 - /// - public void AgvFromFryPotToClean(ConcurrentQueue queue) - { - switch (queue.ElementAt(0).materialType.MaterialLoc / 100) - { - case 1: - erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) - { - goto erp; - } - string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id); - LOnerobotJobId = id; - FryCarryTaskErrorCodeAnalysis(info, 1); break; - case 2: - erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id1 == LTworobotJobId) - { - goto erp1; - } - string info1 = AGVHelper.GetInstance.AgvLeaveFryPotTwo(id1); - LTworobotJobId = id1; - FryCarryTaskErrorCodeAnalysis(info1, 2); break; - case 3: - erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id2 == LThreerobotJobId) - { - goto erp2; - } - string info2 = AGVHelper.GetInstance.AgvLeaveFryPotThree(id2); - LThreerobotJobId = id2; - FryCarryTaskErrorCodeAnalysis(info2, 3); break; - case 4: - erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id3 == LOnerobotJobId) - { - goto erp3; - } - string info3 = AGVHelper.GetInstance.AgvLeaveFryPotFour(id3); - LOnerobotJobId = id3; - FryCarryTaskErrorCodeAnalysis(info3, 4); break; - case 5: - erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id4 == LTworobotJobId) - { - goto erp4; - } - string info4 = AGVHelper.GetInstance.AgvLeaveFryPotFive(id4); - LTworobotJobId = id4; - FryCarryTaskErrorCodeAnalysis(info4, 5); break; - } - } + ///// + ///// AGV离开炒锅运送空桶任务 + ///// + //public void AgvFromFryPotToClean(ConcurrentQueue queue) + //{ + // switch (queue.ElementAt(0).materialType.MaterialLoc / 100) + // { + // case 1: + // erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID + // if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) + // { + // goto erp; + // } + // string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id); + // LOnerobotJobId = id; + // FryCarryTaskErrorCodeAnalysis(info, 1); break; + // case 2: + // erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID + // if (id1 == LTworobotJobId) + // { + // goto erp1; + // } + // string info1 = AGVHelper.GetInstance.AgvLeaveFryPotTwo(id1); + // LTworobotJobId = id1; + // FryCarryTaskErrorCodeAnalysis(info1, 2); break; + // case 3: + // erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID + // if (id2 == LThreerobotJobId) + // { + // goto erp2; + // } + // string info2 = AGVHelper.GetInstance.AgvLeaveFryPotThree(id2); + // LThreerobotJobId = id2; + // FryCarryTaskErrorCodeAnalysis(info2, 3); break; + // case 4: + // erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID + // if (id3 == LOnerobotJobId) + // { + // goto erp3; + // } + // string info3 = AGVHelper.GetInstance.AgvLeaveFryPotFour(id3); + // LOnerobotJobId = id3; + // FryCarryTaskErrorCodeAnalysis(info3, 4); break; + // case 5: + // erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID + // if (id4 == LTworobotJobId) + // { + // goto erp4; + // } + // string info4 = AGVHelper.GetInstance.AgvLeaveFryPotFive(id4); + // LTworobotJobId = id4; + // FryCarryTaskErrorCodeAnalysis(info4, 5); break; + // } + //} /// /// AGV离开炒锅1,4运送空桶任务 /// @@ -2350,23 +3287,23 @@ namespace FryPot_DosingSystem.Control { case 1: erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) { goto erp; } MessageLog.GetInstance.ShowRunLog("AGV执行【1】号炒锅空桶回收任务"); string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id); - LOnerobotJobId = id; + LFourrobotJobId = id; FryCarryTaskErrorCodeAnalysis(info, 1); break; case 4: erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId) + if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId || id3 == LFiverobotJobId || id3 == LSixrobotJobId || id3 == LSevenrobotJobId || id3 == LEightrobotJobId || id3 == LNinerobotJobId || id3 == LTenrobotJobId) { goto erp3; } MessageLog.GetInstance.ShowRunLog("AGV执行【4】号炒锅空桶回收任务"); string info3 = AGVHelper.GetInstance.AgvLeaveFryPotFour(id3); - LOnerobotJobId = id3; + LFourrobotJobId = id3; FryCarryTaskErrorCodeAnalysis(info3, 4); break; } } @@ -2379,23 +3316,23 @@ namespace FryPot_DosingSystem.Control { case 2: erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId) + if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId || id1 == LFiverobotJobId || id1 == LSixrobotJobId || id1 == LSevenrobotJobId || id1 == LEightrobotJobId || id1 == LNinerobotJobId || id1 == LTenrobotJobId) { goto erp1; } MessageLog.GetInstance.ShowRunLog("AGV执行【2】号炒锅空桶回收任务"); string info1 = AGVHelper.GetInstance.AgvLeaveFryPotTwo(id1); - LTworobotJobId = id1; + LFiverobotJobId = id1; FryCarryTaskErrorCodeAnalysis(info1, 2); break; case 5: erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId) + if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId || id4 == LFiverobotJobId || id4 == LSixrobotJobId || id4 == LSevenrobotJobId || id4 == LEightrobotJobId || id4 == LNinerobotJobId || id4 == LTenrobotJobId) { goto erp4; } MessageLog.GetInstance.ShowRunLog("AGV执行【5】号炒锅空桶回收任务"); string info4 = AGVHelper.GetInstance.AgvLeaveFryPotFive(id4); - LTworobotJobId = id4; + LFiverobotJobId = id4; FryCarryTaskErrorCodeAnalysis(info4, 5); break; } } @@ -2405,13 +3342,13 @@ namespace FryPot_DosingSystem.Control public void AgvFromFryPotThreeToClean() { erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID - if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId) + if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId || id2 == LFiverobotJobId || id2 == LSixrobotJobId || id2 == LSevenrobotJobId || id2 == LEightrobotJobId || id2 == LNinerobotJobId || id2 == LTenrobotJobId) { goto erp2; } MessageLog.GetInstance.ShowRunLog("AGV执行【3】号炒锅空桶回收任务"); string info2 = AGVHelper.GetInstance.AgvLeaveFryPotThree(id2); - LThreerobotJobId = id2; + LSixrobotJobId = id2; FryCarryTaskErrorCodeAnalysis(info2, 3); } /// @@ -2438,6 +3375,45 @@ namespace FryPot_DosingSystem.Control //原料到位,agv到位,agv自行运料到炒锅 } } + + } + else//有故障 + { + while (AlarmHelper.Alarm.LOneRollerTrouble == 1) + { + Thread.Sleep(5); + if (globalVar.ExitLineOneTask) + return; + } + MessageLog.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行"); + //lineAlarm = 1; + goto erp; + } + } + /// + /// Agv从1号线体运空桶到清洗处 + /// + public void AgvFromLineOneToClean(ushort emptyRollerNum) + { + erp: if (AlarmHelper.Alarm.LOneRollerTrouble == 0)//无故障 + { + if (globalVar.agvArriveLineOneLoadEmptyRoller)//agv到达上料位置 + { + MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置"); + DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc + MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start); + globalVar.LOneMaterialNum--; + globalVar.agvArriveLineOneLoadEmptyRoller = false; + //原料到位,agv到位,agv自行运料到清洗处 + } + if (globalVar.agvArriveLineOneLoadCom)//上料完成 + { + globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0); + globalVar.agvArriveLineOneLoadCom = false; + globalVar.rollerLineOne.IsEpmtyBefore = false; + MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成{emptyRollerNum}号空料桶装载"); + } } else//有故障 { @@ -2451,6 +3427,7 @@ namespace FryPot_DosingSystem.Control //lineAlarm = 1; goto erp; } + } /// /// 处理agv从线体2到送料到炒锅的条件 @@ -2493,6 +3470,46 @@ namespace FryPot_DosingSystem.Control } } /// + /// Agv从2号线体运空桶到清洗处 + /// + public void AgvFromLineTwoToClean(ushort emptyRollerNum) + { + erp: if (AlarmHelper.Alarm.LTwoRollerTrouble == 0)//无故障 + { + if (globalVar.agvArriveLineTwoLoadEmptyRoller)//agv到达上料位置 + { + MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置"); + DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc + MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start); + globalVar.LTwoMaterialNum--; + globalVar.agvArriveLineTwoLoadEmptyRoller = false; + + //原料到位,agv到位,agv自行运料到清洗处 + } + if (globalVar.agvArriveLineTwoLoadCom)//上料完成 + { + globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0); + globalVar.agvArriveLineTwoLoadCom = false; + globalVar.rollerLineTwo.IsEpmtyBefore = false; + MessageLog.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载"); + } + } + else//有故障 + { + while (AlarmHelper.Alarm.LTwoRollerTrouble == 1) + { + Thread.Sleep(5); + if (globalVar.ExitLineOneTask) + return; + } + MessageLog.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行"); + //lineAlarm = 1; + goto erp; + } + + } + /// /// 处理agv从线体3到送料到炒锅的条件 /// /// @@ -2533,7 +3550,48 @@ namespace FryPot_DosingSystem.Control } } /// - /// 线体搬运任务错误码分析 + /// Agv从3号线体运空桶到清洗处 + /// + public void AgvFromLineThreeToClean(ushort emptyRollerNum) + { + erp: if (AlarmHelper.Alarm.LThreeRollerTrouble == 0)//无故障 + { + if (globalVar.agvArriveLineThreeLoadEmptyRoller)//agv到达上料位置 + { + MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置"); + DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc + MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); + AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start); + globalVar.LThreeMaterialNum--; + globalVar.agvArriveLineThreeLoadEmptyRoller = false; + // globalVar.rollerLineThree.IsEpmtyBefore = false; + + //原料到位,agv到位,agv自行运料到清洗处 + } + if (globalVar.agvArriveLineThreeLoadCom)//上料完成 + { + globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0); + globalVar.agvArriveLineThreeLoadCom = false; + globalVar.rollerLineThree.IsEpmtyBefore = false; + MessageLog.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载"); + } + } + else//有故障 + { + while (AlarmHelper.Alarm.LThreeRollerTrouble == 1) + { + Thread.Sleep(5); + if (globalVar.ExitLineOneTask) + return; + } + MessageLog.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行"); + //lineAlarm = 1; + goto erp; + } + + } + /// + /// 线体到炒锅搬运任务错误码分析 /// /// /// @@ -2557,6 +3615,52 @@ namespace FryPot_DosingSystem.Control } } /// + /// 线体到清洗台搬运任务错误码分析 + /// + /// + /// + public void LineToCleanCarryTaskErrorCodeAnalysis(string errorCode, int num) + { + if (errorCode == "SUCCESS") + { + AgvViewModel.GetInstance().Set停车桩(num, IsBool.No); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No); + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue($"tqx_{num}")); + MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶"); + } + else if (errorCode == "Analysis Error") + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文"); + } + else + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}"); + } + } + /// + /// 清洗台到线体搬运任务错误码分析 + /// + /// + /// + public void CleanToLineCarryTaskErrorCodeAnalysis(string errorCode, int num) + { + if (errorCode == "SUCCESS") + { + AgvViewModel.GetInstance().Set停车桩(num, IsBool.No); + AgvViewModel.GetInstance().Set小车是否承载物品(num, IsBool.No); + AgvViewModel.GetInstance().Set小车运动(num, CartMotionTrajectory.jtqx); + MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线卸桶"); + } + else if (errorCode == "Analysis Error") + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线API调用失败,请检查请求报文"); + } + else + { + MessageLog.GetInstance.ShowRunLog($"提示:AGV去{num}号滚筒线失败,错误码:{errorCode}"); + } + } + /// /// 炒锅搬运任务错误码分析 /// /// @@ -2583,16 +3687,48 @@ namespace FryPot_DosingSystem.Control { if (InputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineLoadRoller && globalVar.rollerLineOne.OutMaterialingSingle == 1 && !globalVar.LoadRoller) { - e: string id = Guid.NewGuid().ToString("N"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) - goto e; - - string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id); - LOnerobotJobId = id; - Thread.Sleep(500); - LineCarryTaskErrorCodeAnalysis(info, 1); - globalVar.LoadRoller = true; - + if (globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineOne.IsEpmtyBefore)//工位8上面是配方料桶 + { + globalVar.rollerLineOne.CanRun = false; + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id); + LOnerobotJobId = id; + Thread.Sleep(500); + LineCarryTaskErrorCodeAnalysis(info, 1); + globalVar.LoadRoller = true; + } + //else if (globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) + //{ + // globalVar.rollerLineOne.CanRun = true; + //} + //else // 工位8上面不是配方料桶或没有桶时 + //{ + // if (!globalVar.rollerLineOne.IsEpmtyBefore) + // { + // var res = InputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineOne.StationEight); + // if (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶 + // { + // //下发AGV去空桶线洗桶任务 + // e: string id = Guid.NewGuid().ToString("N"); + // if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + // goto e; + + // string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 + // LFourrobotJobId = id; + // Thread.Sleep(500); + // LineToCleanCarryTaskErrorCodeAnalysis(info, 1); + // globalVar.rollerLineOne.IsEpmtyBefore = true; + // AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + // } + // } + // else + // { + // AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + // } + //} } } @@ -2609,16 +3745,49 @@ namespace FryPot_DosingSystem.Control { if (LTwoInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineTwoLoadRoller && globalVar.rollerLineTwo.OutMaterialingSingle == 1 && !globalVar.LTwoLoadRoller) { - e: string id = Guid.NewGuid().ToString("N"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) - goto e; - - string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id); - LTworobotJobId = id; - Thread.Sleep(500); - LineCarryTaskErrorCodeAnalysis(info, 2); - globalVar.LTwoLoadRoller = true; + if (globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineTwo.IsEpmtyBefore)//工位8上面是配方料桶 + { + globalVar.rollerLineTwo.CanRun = false; + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id); + LTworobotJobId = id; + Thread.Sleep(500); + LineCarryTaskErrorCodeAnalysis(info, 2); + globalVar.LTwoLoadRoller = true; + } + //else if (globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) + //{ + // globalVar.rollerLineTwo.CanRun = true; + //} } + //else// 工位8上面不是配方料桶或没有桶时 + //{ + // if (!globalVar.rollerLineTwo.IsEpmtyBefore) + // { + // var res = LTwoInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineTwo.StationEight); + // if (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶,即空桶 + // { + // //下发AGV去空桶线洗桶任务 + // e: string id = Guid.NewGuid().ToString("N"); + // if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + // goto e; + + // string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处 + // LFiverobotJobId = id; + // Thread.Sleep(500); + // LineToCleanCarryTaskErrorCodeAnalysis(info, 2); + // globalVar.rollerLineTwo.IsEpmtyBefore = true; + // AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体2到清洗处 + // } + // } + // else + // { + // AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处 + // } + //} } } public void AgvToLineThreeLoadRoller() @@ -2627,15 +3796,48 @@ namespace FryPot_DosingSystem.Control { if (LThreeInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineThreeLoadRoller && globalVar.rollerLineThree.OutMaterialingSingle == 1 && !globalVar.LThreeLoadRoller) { - e: string id = Guid.NewGuid().ToString("N"); - if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId) - goto e; - - string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id); - LThreerobotJobId = id; - Thread.Sleep(500); - LineCarryTaskErrorCodeAnalysis(info, 3); - globalVar.LThreeLoadRoller = true; + if (globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineThree.IsEpmtyBefore)//工位8上面是配方料桶 + { + globalVar.rollerLineThree.CanRun = false; + e: string id = Guid.NewGuid().ToString("N"); + if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + goto e; + + string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id); + LThreerobotJobId = id; + Thread.Sleep(500); + LineCarryTaskErrorCodeAnalysis(info, 3); + globalVar.LThreeLoadRoller = true; + } + //else if (globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) + //{ + // globalVar.rollerLineThree.CanRun = true; + //} + //else // 工位8上面不是配方料桶或没有桶时 + //{ + // if (!globalVar.rollerLineThree.IsEpmtyBefore) + // { + // var res = LThreeInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineThree.StationEight); + // if (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶,即空桶 + // { + // //下发AGV去空桶线洗桶任务 + // e: string id = Guid.NewGuid().ToString("N"); + // if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId) + // goto e; + + // string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处 + // LSixrobotJobId = id; + // Thread.Sleep(500); + // LineToCleanCarryTaskErrorCodeAnalysis(info, 3); + // globalVar.rollerLineThree.IsEpmtyBefore = true; + // AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + // } + // } + // else + // { + // AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处 + // } + //} } } diff --git a/FryPot_DosingSystem/Control/GlobalVariable.cs b/FryPot_DosingSystem/Control/GlobalVariable.cs index 1e149760..eb444f1e 100644 --- a/FryPot_DosingSystem/Control/GlobalVariable.cs +++ b/FryPot_DosingSystem/Control/GlobalVariable.cs @@ -57,6 +57,10 @@ namespace FryPot_DosingSystem.Control /// PLC初始化状态 /// public ushort PlcInite { get; set; } + /// + /// 清洗台清洗完成信号 + /// + public ushort CleanComplete { get; set; } #region 上位机内部逻辑条件 /// /// 退出线体1任务 @@ -161,6 +165,7 @@ namespace FryPot_DosingSystem.Control public bool agvArriveUnLoad { get; set; } public bool agvFryPotEmptyRollerArrive { get; set; } public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成 + public bool agvLineOneLoadCom { get; set; }//线体1上料完成 public int LTwoMaterialNum { get; set; } = 0; public int LTwoFryPotSerial { get; set; } = 2; @@ -168,7 +173,7 @@ namespace FryPot_DosingSystem.Control public bool agvArriveLTwoUpLoad { get; set; } public bool LTwoagvArriveUnLoad { get; set; } public bool LTwoagvFryPotEmptyRollerArrive { get; set; } - public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成 + public bool agvLineTwoLoadCom { get; set; }//线体2上料完成 public int LThreeMaterialNum { get; set; } = 0; public int LThreeFryPotSerial { get; set; } = 3; @@ -176,10 +181,24 @@ namespace FryPot_DosingSystem.Control public bool agvArriveLThreeUpLoad { get; set; } public bool LThreeagvArriveUnLoad { get; set; } public bool LThreeagvFryPotEmptyRollerArrive { get; set; } - public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成 + public bool agvLineThreeLoadCom { get; set; }//线体1上料完成 + + public int LFourRollerNum { get; set; } = 0;//4号线体空桶数量 + //新增空桶清洗系列变量 + public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清洗台或炒锅 + public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置 + public bool agvArriveCleanLoad { get; set; }//agv到达清洗台上料位置 + + public bool agvArriveLineOneLoadEmptyRoller { get; set; }//agv到达线体1空桶上料位置 + public bool agvArriveLineTwoLoadEmptyRoller { get; set; }//agv到达线体2空桶上料位置 + + public bool agvArriveLineThreeLoadEmptyRoller { get; set; }//agv到达线体3空桶上料位置 - public int LFourRollerNum { get; set; } = 0; - #endregion + public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成 + public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成 + public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成 + //空桶清洗流程锁 + #endregion } /// /// 滚筒线1相关变量 @@ -230,8 +249,25 @@ namespace FryPot_DosingSystem.Control /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } + /// + /// 线体1上空桶确认信号 + /// + public ushort EmptyRollerConfirmSingle { get; set; } + /// + /// 线体1上单个空桶编号 + /// + public ushort EmptyRollerNum { get; set; } + /// + /// 上一个桶是否是空桶 + /// + public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶 + public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 + /// + /// 线体1上所有空桶的编号集合 + /// + public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线2相关变量 @@ -282,6 +318,25 @@ namespace FryPot_DosingSystem.Control /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } + + /// + /// 线体1上空桶确认信号 + /// + public ushort EmptyRollerConfirmSingle { get; set; } + /// + /// 线体1上单个空桶编号 + /// + public ushort EmptyRollerNum { get; set; } + /// + /// 上一个同时否是空桶 + /// + public bool IsEpmtyBefore { get; set; } + + public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 + /// + /// 线体2上所有空桶的编号集合 + /// + public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线3相关变量 @@ -332,6 +387,26 @@ namespace FryPot_DosingSystem.Control /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } + + /// + /// 线体1上空桶确认信号 + /// + public ushort EmptyRollerConfirmSingle { get; set; } + /// + /// 线体1上单个空桶编号 + /// + public ushort EmptyRollerNum { get; set; } + /// + /// 上一个同时否是空桶 + /// + public bool IsEpmtyBefore { get; set; } + + public bool CanRun { get; set; } = true;//配方料桶上料结束后,线体空桶AGV才能1号线装桶 + + /// + /// 线体3上所有空桶的编号集合 + /// + public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线4相关变量 diff --git a/FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs b/FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs index 84892c28..12fb7bb6 100644 --- a/FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs +++ b/FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs @@ -11,7 +11,8 @@ using System.Threading.Tasks; namespace FryPot_DosingSystem.FryPotStatus { [Table("TbfryPotFive")] - internal class PotFiveStatus:ObservableObject + [Serializable] + internal class PotFiveStatus { [Key] [Column("Id")] @@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 温度 /// - public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } } + public double? Temperature { get { return temperature; } set { temperature = value; } } private double? temperature=0; [Column("HotPower")] [Variable("FryPotFivePower", "5号炒锅火力", "", "")] /// /// 火力 /// - public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } } + public string? HotPower { get { return hotPower; } set { hotPower = value; } } private string? hotPower="0"; [Column("Speed")] [Variable("FryPotFiveSpeed", "5号炒锅搅拌速度", "", "")] /// /// 搅拌速度 /// - public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } } + public double? Speed { get { return speed; } set { speed = value; } } private double? speed=0; [Column("FryPotWeight")] [Variable("FryPotFiveWeight", "5号炒锅载重", "", "")] /// /// 炒锅重量 /// - public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } } + public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } } private double? fryPotWeight=0; [Column("OilCapacity")] [Variable("FryPotFiveOil", "5号炒锅当前配方用油量", "", "")] /// /// 单次配方用油量 /// - public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } } + public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } } private double? oilCapacity=0; [Column("TotalOilCapactiy")] [Variable("FryPotFiveTotalOil", "5号炒锅总用油量", "", "")] /// /// 一天总用油量 /// - public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } } + public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } } private double? totalOilCapactiy=0; [Column("TotalProduct")] @@ -65,8 +66,15 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 一天配方生产总量 /// - public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } } + public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } } private int? totalProduct=0; + + + [Column("ReicpeName")] + /// + /// 当前配方名称 + /// + public string RecipeName { get; set; } = string.Empty; [Column("Time")] /// /// 时间 diff --git a/FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs b/FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs index 83b057b6..5ccb2cc0 100644 --- a/FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs +++ b/FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs @@ -11,7 +11,8 @@ using System.Threading.Tasks; namespace FryPot_DosingSystem.FryPotStatus { [Table("TbfryPotOne")] - internal class PotFourStatus:ObservableObject + [Serializable] + internal class PotFourStatus { [Key] [Column("Id")] @@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 温度 /// - public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } } + public double? Temperature { get { return temperature; } set { temperature = value; } } private double? temperature=0; [Column("HotPower")] [Variable("FryPotFourPower", "4号炒锅火力", "", "")] /// /// 火力 /// - public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } } + public string? HotPower { get { return hotPower; } set { hotPower = value; } } private string? hotPower="0"; [Column("Speed")] [Variable("FryPotFourSpeed", "4号炒锅搅拌速度", "", "")] /// /// 搅拌速度 /// - public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } } + public double? Speed { get { return speed; } set { speed = value; } } private double? speed=0; [Column("FryPotWeight")] [Variable("FryPotFourWeight", "4号炒锅载重", "", "")] /// /// 炒锅重量 /// - public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } } + public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } } private double? fryPotWeight=0; [Column("OilCapacity")] [Variable("FryPotFourOil", "4号炒锅当前配方用油量", "", "")] /// /// 单次配方用油量 /// - public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } } + public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } } private double? oilCapacity=0; [Column("TotalOilCapactiy")] [Variable("FryPotFourTotalOil", "4号炒锅总用油量", "", "")] /// /// 一天总用油量 /// - public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } } + public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value;; } } private double? totalOilCapactiy=0; [Column("TotalProduct")] @@ -65,8 +66,14 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 一天配方生产总量 /// - public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } } + public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } } private int? totalProduct=0; + + [Column("ReicpeName")] + /// + /// 当前配方名称 + /// + public string RecipeName { get; set; } = string.Empty; [Column("Time")] /// /// 时间 diff --git a/FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs b/FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs index a445f143..ef155e38 100644 --- a/FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs +++ b/FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs @@ -11,7 +11,8 @@ using System.Threading.Tasks; namespace FryPot_DosingSystem.FryPotStatus { [Table("TbfryPotOne")] - internal class PotOneStatus:ObservableObject + [Serializable] + internal class PotOneStatus { [Key] [Column("Id")] @@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 温度 /// - public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } } + public double? Temperature { get { return temperature; } set { temperature = value;} } private double? temperature=0; [Column("HotPower")] [Variable("FryPotOnePower", "1号炒锅火力", "", "")] /// /// 火力 /// - public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } } + public string? HotPower { get { return hotPower; } set { hotPower = value; } } private string? hotPower="0"; [Column("Speed")] [Variable("FryPotOneSpeed", "1号炒锅搅拌速度", "", "")] /// /// 搅拌速度 /// - public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } } + public double? Speed { get { return speed; } set { speed = value; } } private double? speed = 0; [Column("FryPotWeight")] [Variable("FryPotOneWeight", "1号炒锅载重", "", "")] /// /// 炒锅重量 /// - public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } } + public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } } private double? fryPotWeight = 0; [Column("OilCapacity")] [Variable("FryPotOneOil", "1号炒锅当前配方用油量", "", "")] /// /// 单次配方用油量 /// - public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } } + public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } } private double? oilCapacity = 0; [Column("TotalOilCapactiy")] [Variable("FryPotOneTotalOil", "1号炒锅总用油量", "", "")] /// /// 一天总用油量 /// - public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } } + public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } } private double? totalOilCapactiy = 0; [Column("TotalProduct")] @@ -65,12 +66,18 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 一天配方生产总量 /// - public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } } + public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } } private int? totalProduct = 0; + [Column("ReicpeName")] + /// + /// 当前配方名称 + /// + public string RecipeName { get; set; } = string.Empty; [Column("Time")] /// /// 时间 /// public string Time { get; set; } = DateTime.Now.ToShortTimeString(); + } } diff --git a/FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs b/FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs index eea023e3..fefc3a48 100644 --- a/FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs +++ b/FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs @@ -11,7 +11,8 @@ using System.Threading.Tasks; namespace FryPot_DosingSystem.FryPotStatus { [Table("TbfryPotThree")] - internal class PotThreeStatus:ObservableObject + [Serializable] + internal class PotThreeStatus { [Key] [Column("Id")] @@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 温度 /// - public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } } + public double? Temperature { get { return temperature; } set { temperature = value; } } private double? temperature=0; [Column("HotPower")] [Variable("FryPotThreePower", "3号炒锅火力", "", "")] /// /// 火力 /// - public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } } + public string? HotPower { get { return hotPower; } set { hotPower = value;} } private string? hotPower="0"; [Column("Speed")] [Variable("FryPotThreeSpeed", "3号炒锅搅拌速度", "", "")] /// /// 搅拌速度 /// - public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } } + public double? Speed { get { return speed; } set { speed = value; } } private double? speed=0; [Column("FryPotWeight")] [Variable("FryPotThreeWeight", "3号炒锅载重", "", "")] /// /// 炒锅重量 /// - public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } } + public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } } private double? fryPotWeight=0; [Column("OilCapacity")] [Variable("FryPotThreeOil", "3号炒锅当前配方用油量", "", "")] /// /// 单次配方用油量 /// - public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } } + public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } } private double? oilCapacity=0; [Column("TotalOilCapactiy")] [Variable("FryPotThreeTotalOil", "3号炒锅总用油量", "", "")] /// /// 一天总用油量 /// - public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } } + public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } } private double? totalOilCapactiy=0; [Column("TotalProduct")] @@ -65,8 +66,15 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 一天配方生产总量 /// - public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } } + public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } } private int? totalProduct=0; + + + [Column("ReicpeName")] + /// + /// 当前配方名称 + /// + public string RecipeName { get; set; } = string.Empty; [Column("Time")] /// /// 时间 diff --git a/FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs b/FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs index 458cadea..388ed607 100644 --- a/FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs +++ b/FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs @@ -11,7 +11,8 @@ using System.Threading.Tasks; namespace FryPot_DosingSystem.FryPotStatus { [Table("TbfryPotTwo")] - internal class PotTwoStatus:ObservableObject + [Serializable] + internal class PotTwoStatus { [Key] [Column("Id")] @@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 温度 /// - public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } } + public double? Temperature { get { return temperature; } set { temperature = value; } } private double? temperature=0; [Column("HotPower")] [Variable("FryPotTwoPower", "2号炒锅火力", "", "")] /// /// 火力 /// - public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } } + public string? HotPower { get { return hotPower; } set { hotPower = value; } } private string? hotPower="0"; [Column("Speed")] [Variable("FryPotTwoSpeed", "2号炒锅搅拌速度", "", "")] /// /// 搅拌速度 /// - public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } } + public double? Speed { get { return speed; } set { speed = value; } } private double? speed=0; [Column("FryPotWeight")] [Variable("FryPotTwoWeight", "2号炒锅载重", "", "")] /// /// 炒锅重量 /// - public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } } + public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } } private double? fryPotWeight=0; [Column("OilCapacity")] [Variable("FryPotTwoOil", "2号炒锅当前配方用油量", "", "")] /// /// 单次配方用油量 /// - public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } } + public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } } private double? oilCapacity=0; [Column("TotalOilCapactiy")] [Variable("FryPotTwoTotalOil", "2号炒锅总用油量", "", "")] /// /// 一天总用油量 /// - public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } } + public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } } private double? totalOilCapactiy=0; [Column("TotalProduct")] @@ -65,8 +66,14 @@ namespace FryPot_DosingSystem.FryPotStatus /// /// 一天配方生产总量 /// - public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } } + public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } } private int? totalProduct=0; + + [Column("ReicpeName")] + /// + /// 当前配方名称 + /// + public string RecipeName { get; set; } = string.Empty; [Column("Time")] /// /// 时间 diff --git a/FryPot_DosingSystem/FryPot_DosingSystem.csproj b/FryPot_DosingSystem/FryPot_DosingSystem.csproj index b2fd326a..13520670 100644 --- a/FryPot_DosingSystem/FryPot_DosingSystem.csproj +++ b/FryPot_DosingSystem/FryPot_DosingSystem.csproj @@ -12,6 +12,7 @@ + @@ -35,6 +36,7 @@ + diff --git a/FryPot_DosingSystem/Model/FlowProcessManage.cs b/FryPot_DosingSystem/Model/FlowProcessManage.cs new file mode 100644 index 00000000..d27924cb --- /dev/null +++ b/FryPot_DosingSystem/Model/FlowProcessManage.cs @@ -0,0 +1,16 @@ +using Microsoft.Toolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FryPot_DosingSystem.Model +{ + internal class FlowProcessManage:ObservableObject + { + public string RecipeName { get; set; } + public ObservableCollection fpModels { get; set; } = new ObservableCollection(); + } +} diff --git a/FryPot_DosingSystem/Model/FlowProcessModel.cs b/FryPot_DosingSystem/Model/FlowProcessModel.cs new file mode 100644 index 00000000..fb2a0a33 --- /dev/null +++ b/FryPot_DosingSystem/Model/FlowProcessModel.cs @@ -0,0 +1,48 @@ +using Microsoft.Toolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FryPot_DosingSystem.Model +{ + internal class FlowProcessModel:ObservableObject + { + /// + /// 工艺对应配方名称 + /// + public string RecipeName { get { return _recipeName; }set { _recipeName = value;OnPropertyChanged(); } } + private string _recipeName; + /// + /// 工艺步骤 + /// + public int Id { get; set; } + + /// + /// 炒制原料/桶号 + /// + public string FryMaterialNum { get { return _fryMaterialNum; } set { _fryMaterialNum = value;OnPropertyChanged(); } } + private string _fryMaterialNum; + /// + /// 炒制速度 + /// + public double FrySpeed { get { return _frySpeed; }set { _frySpeed = value;OnPropertyChanged(); } } + private double _frySpeed; + /// + /// 炒制重量 + /// + public double FryWeight { get { return _fryMaterialWeight; }set { _fryMaterialWeight = value;OnPropertyChanged(); } } + private double _fryMaterialWeight; + /// + /// 炒制温度 + /// + public double FryTemperature { get { return _fryTemperature; } set { _fryTemperature = value;OnPropertyChanged(); } } + private double _fryTemperature; + /// + /// 炒制时间 + /// + public double FryPeriodTime { get { return _fryPeriodTime; } set { _fryPeriodTime = value;OnPropertyChanged(); } } + private double _fryPeriodTime; + } +} diff --git a/FryPot_DosingSystem/Model/RecipeModel.cs b/FryPot_DosingSystem/Model/RecipeModel.cs index 922bd717..053c0dc4 100644 --- a/FryPot_DosingSystem/Model/RecipeModel.cs +++ b/FryPot_DosingSystem/Model/RecipeModel.cs @@ -29,7 +29,12 @@ namespace FryPot_DosingSystem.Model private string _updateTime; public string UpdateTime { get { return _updateTime; } set { _updateTime = value;OnPropertyChanged(); } } - + /// + /// 工艺流程 + /// + public FlowProcessManage FlowProcess { get { return _flowProcessManage; } set { _flowProcessManage = value;OnPropertyChanged(); } } + private FlowProcessManage _flowProcessManage; + /// /// 配方下发状况信息 /// diff --git a/FryPot_DosingSystem/Resources/fonts/demo_index.html b/FryPot_DosingSystem/Resources/fonts/demo_index.html index 555de870..9e093e12 100644 --- a/FryPot_DosingSystem/Resources/fonts/demo_index.html +++ b/FryPot_DosingSystem/Resources/fonts/demo_index.html @@ -52,12 +52,30 @@
    +
  • + +
    节点-子流程
    +
    &#xe6e2;
    +
  • + +
  • + +
    流程
    +
    &#xe64c;
    +
  • +
  • 下载
    &#xe622;
  • +
  • + +
    232编辑、输入
    +
    &#xe8cc;
    +
  • +
  • 账号信息
    @@ -118,6 +136,12 @@
    &#xe6b7;
  • +
  • + +
    工艺流程_0
    +
    &#xe7ab;
    +
  • +
  • 166-NFC
    @@ -142,7 +166,7 @@
    @font-face {
       font-family: 'iconfont';
    -  src: url('iconfont.ttf?t=1659497763775') format('truetype');
    +  src: url('iconfont.ttf?t=1659942239310') format('truetype');
     }
     

    第二步:定义使用 iconfont 的样式

    @@ -168,6 +192,24 @@
      +
    • + +
      + 节点-子流程 +
      +
      .icon-jiedianziliucheng +
      +
    • + +
    • + +
      + 流程 +
      +
      .icon-liucheng +
      +
    • +
    • @@ -177,6 +219,15 @@
    • +
    • + +
      + 232编辑、输入 +
      +
      .icon-bianjishuru +
      +
    • +
    • @@ -267,6 +318,15 @@
    • +
    • + +
      + 工艺流程_0 +
      +
      .icon-gongyiliucheng_0 +
      +
    • +
    • @@ -303,6 +363,22 @@
        +
      • + +
        节点-子流程
        +
        #icon-jiedianziliucheng
        +
      • + +
      • + +
        流程
        +
        #icon-liucheng
        +
      • +
      • #icon-xiazai
      • +
      • + +
        232编辑、输入
        +
        #icon-bianjishuru
        +
      • +
      • #icon-mianxingmima
      • +
      • + +
        工艺流程_0
        +
        #icon-gongyiliucheng_0
        +
      • +