| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | SpeStackerCrane speStackerCrane = (SpeStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (speStackerCrane != null) |
| | | { |
| | |
| | | speStackerCrane.LastTaskType = task.TaskType; |
| | | task.Dispatchertime = DateTime.Now; |
| | | task.ExceptionMessage = ""; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); |
| | | WebResponseContent webResponseContent = _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | //å»¶æ¶1s |
| | | Thread.Sleep(1000); |
| | | } |
| | |
| | | /// <returns>妿æªè¢«å ç¨ï¼è¿åä¼ å
¥çä»»å¡ä¿¡æ¯ï¼å¦åï¼è¿ånull</returns> |
| | | private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) |
| | | { |
| | | Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault(); |
| | | if (router != null) |
| | | try |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "CL01"); |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | if (conveyorLine.IsOccupied(router.ChildPosi))//åºåºç«å°æªè¢«å ç¨ |
| | | OtherDevice conveyorLine = (OtherDevice)device; |
| | | DeviceProDTO? deviceProDTO = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == task.NextAddress && x.DeviceProParamName == "IsOccupied"); //æ ¹æ®å åæºå°åï¼å°ååç§°æ¾åè®® |
| | | if (deviceProDTO != null) |
| | | { |
| | | bool B_Event_Test = conveyorLine.Communicator.Read<bool>(deviceProDTO.DeviceProAddress); //夿è¾é线æ¯å¦å
许æ¾è´§ä¿¡å· |
| | | if (!B_Event_Test) |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°åºåºç«å°ã{router.ChildPosiDeviceCode}ã对åºçéè®¯å¯¹è±¡ï¼æ æ³å¤æåºåºç«å°æ¯å¦è¢«å ç¨"); |
| | | } |
| | | } |
| | | else |
| | | catch (Exception ex) |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³æ ¡éªç«å°"); |
| | | |
| | | throw; |
| | | } |
| | | return null; |
| | | } |