| | |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly IContainerItemRepository _containerItemRepository; |
| | | private readonly WebSocketServer _webSocketServer; |
| | | public GantryJob(ITaskRepository taskRepository, ITaskService taskService, IContainerItemRepository containerItemRepository, WebSocketServer webSocketServer) |
| | | private readonly IOrderDetailsService _orderDetailsService; |
| | | public GantryJob(ITaskRepository taskRepository, ITaskService taskService, IContainerItemRepository containerItemRepository, WebSocketServer webSocketServer, IOrderDetailsService orderDetailsService) |
| | | { |
| | | _taskRepository = taskRepository; |
| | | _taskService = taskService; |
| | | _containerItemRepository = containerItemRepository; |
| | | _webSocketServer = webSocketServer; |
| | | _orderDetailsService = orderDetailsService; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | string[] takePositions = task.CurrentAddress.Split("*"); |
| | | if (takePositions.Length != 5) |
| | | { |
| | | //WriteError |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "åè´§ä½ç½®é误"); |
| | | if (task.ExceptionMessage?.Contains("åè´§ä½ç½®é误") ?? true) |
| | | { |
| | | task.ExceptionMessage = "åè´§ä½ç½®é误"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | string[] putPositions = task.NextAddress.Split("*"); |
| | | if (putPositions.Length != 5) |
| | | { |
| | | //WriteError |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "æ¾è´§ä½ç½®é误"); |
| | | if (task.ExceptionMessage?.Contains("æ¾è´§ä½ç½®é误") ?? true) |
| | | { |
| | | task.ExceptionMessage = "æ¾è´§ä½ç½®é误"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | Dt_ContainerItem containerItem = _containerItemRepository.QueryFirst(x => x.ItemCode == task.PalletCode); |
| | | if (containerItem == null) |
| | | { |
| | | //WriteError |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "æ¿æå°ºå¯¸è·åé误"); |
| | | if (task.ExceptionMessage?.Contains("æ¿æå°ºå¯¸è·åé误") ?? true) |
| | | { |
| | | task.ExceptionMessage = "æ¿æå°ºå¯¸è·åé误"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | if (LightStatusStorage.LightStatusDic.TryGetValue(putPositions[0], out LightStatusEnum lightStatusDic)) |
| | | { |
| | | if (lightStatusDic != LightStatusEnum.LightWorking) |
| | | { |
| | | LightStatusStorage.LightStatusDic[putPositions[0]] = LightStatusEnum.LightWorking; |
| | | } |
| | | } |
| | | |
| | | otherDevice.SetValue(GantryDBName.TwoHand, true); |
| | | otherDevice.SetValue(GantryDBName.TaskNum, task.TaskNum); |
| | | if (!LightStatusStorage.StationStautsDic.TryGetValue(putPositions[0],out bool stationStatus)) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", $"å·¥ä½ã{putPositions[0]}ãææ 嫿¿æ°æ®é误,{LightStatusStorage.StationStautsDic.Serialize()}"); |
| | | if (task.ExceptionMessage?.Contains($"å·¥ä½ã{putPositions[0]}ãææ 嫿¿æ°æ®é误") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"å·¥ä½ã{putPositions[0]}ãææ 嫿¿æ°æ®é误"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | if (!stationStatus) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", $"å·¥ä½ã{putPositions[0]}ãæ å«æ¿,{LightStatusStorage.StationStautsDic.Serialize()}"); |
| | | if (task.ExceptionMessage?.Contains($"å·¥ä½ã{putPositions[0]}ãæ å«æ¿") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"å·¥ä½ã{putPositions[0]}ãæ å«æ¿"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | int takePoX = Convert.ToInt32(takePositions[1]); |
| | | int takePoY = Convert.ToInt32(takePositions[2]); |
| | | int takePoZ = OPositions.HPositions[takePositions[0]].PositionZ + 30 * 1000 - Convert.ToInt32(takePositions[3]) * 1000; |
| | | |
| | | if(OPositions.HPositions[takePositions[0]].PositionZ == 0) |
| | | if (OPositions.HPositions[takePositions[0]].PositionZ == 0) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "åè´§Zåæ è¯»å为0"); |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "读ååè´§Zåæ è¯»å为0"); |
| | | if (task.ExceptionMessage?.Contains($"读ååè´§Zåæ è¯»å为0") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"读ååè´§Zåæ è¯»å为0"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | |
| | | if (OPositions.HPositions[takePositions[0]].PositionZ == 0) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "æ¾è´§Zåæ è¯»å为0"); |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "è¯»åæ¾è´§Zåæ è¯»å为0"); |
| | | if (task.ExceptionMessage?.Contains($"è¯»åæ¾è´§Zåæ è¯»å为0") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"è¯»åæ¾è´§Zåæ è¯»å为0"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | int putPoR = 0; |
| | | |
| | | if (Convert.ToInt32(takePositions[4]) == 1) |
| | | int temp = 1000; |
| | | if(otherDevice.DeviceCode == "GT02") |
| | | { |
| | | takePoX = takePoX * 1000 + OPositions.HPositions[takePositions[0]].PositionX; |
| | | takePoY = takePoY * 1000 + OPositions.HPositions[takePositions[0]].PositionY; |
| | | putPoX = putPoX * 1000 + OPositions.HPositions[putPositions[0]].PositionX; |
| | | putPoY = putPoY * 1000 + OPositions.HPositions[putPositions[0]].PositionY; |
| | | temp = -1000; |
| | | } |
| | | |
| | | if (Convert.ToInt32(takePositions[4]) == 1 || Convert.ToInt32(takePositions[4]) == 2) |
| | | { |
| | | takePoX = takePoX * temp + OPositions.HPositions[takePositions[0]].PositionX; |
| | | takePoY = takePoY * temp + OPositions.HPositions[takePositions[0]].PositionY; |
| | | putPoX = putPoX * temp + OPositions.HPositions[putPositions[0]].PositionX; |
| | | putPoY = putPoY * temp + OPositions.HPositions[putPositions[0]].PositionY; |
| | | takePoR = OPositions.HPositions[takePositions[0]].PositionR; |
| | | putPoR = OPositions.HPositions[putPositions[0]].PositionR; |
| | | |
| | | if (Convert.ToInt32(takePositions[4]) == 1) |
| | | putPoR = OPositions.HPositions[putPositions[0]].PositionR; |
| | | else |
| | | { |
| | | if (otherDevice.DeviceCode == "GT03") |
| | | putPoR = otherDevice.Communicator.Read<int>("DB10.840"); |
| | | else if (otherDevice.DeviceCode == "GT02") |
| | | putPoR = otherDevice.Communicator.Read<int>("DB10.836"); |
| | | else if (otherDevice.DeviceCode == "GT01") |
| | | putPoR = otherDevice.Communicator.Read<int>("DB10.832"); |
| | | else |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "Råæ é误"); |
| | | if (task.ExceptionMessage?.Contains($"Råæ é误") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Råæ é误"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | |
| | | WriteDebug($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"åè´§ä½ï¼{takePositions[0]},æ¾è´§ä½ï¼{putPositions[0]}{Environment.NewLine}åè´§åæ ï¼X:{takePoX} Y:{takePoY} Z:{takePoZ} R:{takePoR}{Environment.NewLine}æ¾è´§åæ ï¼X:{putPoX} Y:{putPoY} Z:{putPoZ} R:{putPoR}{Environment.NewLine}读åPLCåè´§åæ ï¼X:{OPositions.HPositions[takePositions[0]].PositionX} Y:{OPositions.HPositions[takePositions[0]].PositionY} Z:{OPositions.HPositions[takePositions[0]].PositionZ} R:{OPositions.HPositions[takePositions[0]].PositionR}{Environment.NewLine}读åPLCæ¾è´§åæ ï¼X:{OPositions.HPositions[putPositions[0]].PositionX} Y:{OPositions.HPositions[putPositions[0]].PositionY} Z:{OPositions.HPositions[putPositions[0]].PositionZ} R:{OPositions.HPositions[putPositions[0]].PositionR}"); |
| | | } |
| | | else |
| | | { |
| | | takePoX = takePoX * 1000 + OPositions.ZPositions[takePositions[0]].PositionX; |
| | | takePoY = takePoY * 1000 + OPositions.ZPositions[takePositions[0]].PositionY; |
| | | putPoX = putPoX * 1000 + OPositions.ZPositions[putPositions[0]].PositionX; |
| | | putPoY = putPoY * 1000 + OPositions.ZPositions[putPositions[0]].PositionY; |
| | | takePoX = takePoX * temp + OPositions.ZPositions[takePositions[0]].PositionX; |
| | | takePoY = takePoY * temp + OPositions.ZPositions[takePositions[0]].PositionY; |
| | | putPoX = putPoX * temp + OPositions.ZPositions[putPositions[0]].PositionX; |
| | | putPoY = putPoY * temp + OPositions.ZPositions[putPositions[0]].PositionY; |
| | | takePoR = OPositions.ZPositions[takePositions[0]].PositionR; |
| | | putPoR = OPositions.ZPositions[putPositions[0]].PositionR; |
| | | |
| | | WriteDebug($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"åè´§ä½ï¼{takePositions[0]},æ¾è´§ä½ï¼{putPositions[0]}{Environment.NewLine}åè´§åæ ï¼X:{takePoX} Y:{takePoY} Z:{takePoZ} R:{takePoR}{Environment.NewLine}æ¾è´§åæ ï¼X:{putPoX} Y:{putPoY} Z:{putPoZ} R:{putPoR}{Environment.NewLine}读åPLCåè´§åæ ï¼X:{OPositions.ZPositions[takePositions[0]].PositionX} Y:{OPositions.ZPositions[takePositions[0]].PositionY} Z:{OPositions.ZPositions[takePositions[0]].PositionZ} R:{OPositions.ZPositions[takePositions[0]].PositionR}{Environment.NewLine}读åPLCæ¾è´§åæ ï¼X:{OPositions.ZPositions[putPositions[0]].PositionX} Y:{OPositions.ZPositions[putPositions[0]].PositionY} Z:{OPositions.ZPositions[putPositions[0]].PositionZ} R:{OPositions.ZPositions[putPositions[0]].PositionR}"); |
| | | } |
| | | #region |
| | | List<DeviceProDTO> devicePros = otherDevice.DeviceProDTOs.Where(x => x.DeviceProParamType == "MaxPosition").ToList(); |
| | | |
| | | int maxX = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxX); |
| | | int minX = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinX); |
| | | int maxY = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxY); |
| | | int minY = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinY); |
| | | int maxZ = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxZ); |
| | | int minZ = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinZ); |
| | | int maxR = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxR); |
| | | int minR = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinR); |
| | | DeviceProDTO? devicePro = devicePros.OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if(devicePro == null) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", "设å¤åè®®åæ°éè¯¯ï¼æªæ¾å°æå¤§æå°åæ å°å"); |
| | | if (task.ExceptionMessage?.Contains($"设å¤åè®®åæ°éè¯¯ï¼æªæ¾å°æå¤§æå°åæ å°å") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"设å¤åè®®åæ°éè¯¯ï¼æªæ¾å°æå¤§æå°åæ å°å"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | int[] data = otherDevice.Communicator.Read<int>(devicePro.DeviceProAddress, (ushort)(devicePros.Count)); |
| | | |
| | | if(takePoX < minX || takePoX > maxX) |
| | | int maxX = data[0]; |
| | | int minX = data[1]; |
| | | int maxY = data[2]; |
| | | int minY = data[3]; |
| | | int maxZ = data[4]; |
| | | int minZ = data[5]; |
| | | int maxR = data[6]; |
| | | int minR = data[7]; |
| | | |
| | | //int maxX = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxX); |
| | | //int minX = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinX); |
| | | //int maxY = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxY); |
| | | //int minY = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinY); |
| | | //int maxZ = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxZ); |
| | | //int minZ = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinZ); |
| | | //int maxR = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MaxR); |
| | | //int minR = otherDevice.GetValue<GantryDBName, int>(GantryDBName.MinR); |
| | | |
| | | |
| | | if (takePoX < minX || takePoX > maxX) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Xåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}"); |
| | | if (task.ExceptionMessage?.Contains($"Xåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Xåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if(putPoX < minX || putPoX > maxX) |
| | | if (putPoX < minX || putPoX > maxX) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Xæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}"); |
| | | if (task.ExceptionMessage?.Contains($"Xæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Xæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoX},æå¤§å¼ï¼{maxX},æå°å¼ï¼{minX}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (takePoY < minY || takePoY > maxY) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Yåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}"); |
| | | if (task.ExceptionMessage?.Contains($"Yåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Yåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (putPoY < minY || putPoY > maxY) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Yæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}"); |
| | | if (task.ExceptionMessage?.Contains($"Yæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Yæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoY},æå¤§å¼ï¼{maxY},æå°å¼ï¼{minY}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (takePoZ < minZ || takePoZ > maxZ) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Zåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}"); |
| | | if (task.ExceptionMessage?.Contains($"Zåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Zåè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (putPoZ < minZ || putPoZ > maxZ) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Zæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}"); |
| | | if (task.ExceptionMessage?.Contains($"Zæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Zæ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoZ},æå¤§å¼ï¼{maxZ},æå°å¼ï¼{minZ}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (takePoR < minR || takePoR > maxR) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Råè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}"); |
| | | if (task.ExceptionMessage?.Contains($"Råè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Råè´§åæ è¶
åºèå´,åè´§åæ ï¼{takePoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | if (putPoR < minR || putPoR > maxR) |
| | | { |
| | | WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}-åæ ", $"Ræ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}"); |
| | | if (task.ExceptionMessage?.Contains($"Ræ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}") ?? true) |
| | | { |
| | | task.ExceptionMessage = $"Ræ¾è´§åæ è¶
åºèå´,åè´§åæ ï¼{putPoR},æå¤§å¼ï¼{maxR},æå°å¼ï¼{minR}"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | #endregion |
| | | |
| | | otherDevice.SetValue(GantryDBName.TwoHand, true); |
| | | otherDevice.SetValue(GantryDBName.TaskNum, task.TaskNum); |
| | | otherDevice.SetValue(GantryDBName.TakePositionX, takePoX); |
| | | otherDevice.SetValue(GantryDBName.TakePositionY, takePoY); |
| | | otherDevice.SetValue(GantryDBName.TakePositionZ, takePoZ); |
| | |
| | | |
| | | task.TaskState = TaskStatusEnum.Gantry_Executing.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | |
| | | if (LightStatusStorage.LightStatusDic.TryGetValue(putPositions[0], out LightStatusEnum lightStatusDic)) |
| | | { |
| | | if (lightStatusDic != LightStatusEnum.LightWorking) |
| | | { |
| | | LightStatusStorage.LightStatusDic[putPositions[0]] = LightStatusEnum.LightWorking; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (gantryWorkStatus == 5) |
| | | { |
| | | int currentTaskNum = otherDevice.GetValue<GantryDBName, int>(GantryDBName.CurrentTaskNum); |
| | | int currentTaskNum = otherDevice.GetValue<GantryDBName, int>(GantryDBName.TaskNum); |
| | | if (currentTaskNum > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == currentTaskNum); |
| | |
| | | { |
| | | _taskService.TaskComplete(task); |
| | | |
| | | Task.Run(() => |
| | | { |
| | | _orderDetailsService.ToMes(task.PalletCode, 4); |
| | | }); |
| | | |
| | | |
| | | string[] putPositions = task.NextAddress.Split("*"); |
| | | if (putPositions.Length != 5) |
| | | { |