| | |
| | | using HslCommunication; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.ServiceLog; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core.Enums; |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane; |
| | | try |
| | | { |
| | | if (commonStackerCrane != null) |
| | |
| | | |
| | | |
| | | //æ¥è¯¢æåæº/ç»ç«æºä¿¡å· |
| | | //Task.Run(delegate |
| | | //{ |
| | | Task.Run(delegate |
| | | { |
| | | try |
| | | { |
| | | |
| | |
| | | if(IsWriteOne == 0) |
| | | { |
| | | |
| | | commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1); |
| | | var d= commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1); |
| | | } |
| | | //读åæåæºä¿¡å·ï¼ç¡®å®æ¯å¦æå宿 |
| | | |
| | | commonStackerCrane.Communicator.Read<short>("DB2.2.0"); |
| | | IsFinish= commonStackerCrane.Communicator.Read<short>("DB2.2.0"); |
| | | } |
| | | else if (task3001.SourceAddress == "SC01-002-000-002")//WMS 1002ç«ç¹ |
| | | { |
| | |
| | | { |
| | | MESSendCMD sendcmd = new MESSendCMD { cmd = 2002, task_id = task3001.TaskNum, status = 6 }; |
| | | MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); |
| | | string inparam = JsonConvert.SerializeObject(sendcmd); |
| | | WriteDebug(nameof(CommonStackerCraneJob), $"æåæºæå宿ï¼åä¼ WMS,å
¥åï¼{inparam}"); |
| | | |
| | | if (res != null && res.code != 0) |
| | | { |
| | | WriteDebug(nameof(CommonStackerCraneJob), $"æåæºæå宿ï¼åä¼ WMS失败ï¼ä»»å¡å·{task3001.TaskNum}"); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | WriteError(nameof(CommonStackerCraneJob), "æ¥è¯¢æåå
¥PLCç¶æå¤±è´¥ï¼", ex); |
| | | } |
| | | |
| | | |
| | | //}); |
| | | |
| | | }); |
| | | |
| | | |
| | | |