| | |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | { |
| | | Thread.Sleep(1000); |
| | | Dt_Task? task = GetTask(commonStackerCrane); |
| | | if (task != null) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | } |
| | | } |
| | | if (task.TargetAddress.Contains("SCUTL-001")) |
| | | if (task.TargetAddress.Contains("SCUTL-001")) //èªå¨ä¸çº¿ |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi); |
| | | } |
| | | else |
| | | else if (task.TargetAddress.Contains("SCUTL-002")) //èªå¨äºçº¿ |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1103", targetAddress: "1103"); |
| | | } |
| | | else //æå¨çº¿ |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102"); |
| | | } |
| | |
| | | //} |
| | | } |
| | | catch { } |
| | | |
| | | if (_taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.TaskState==TaskStatusEnum.SC_Executing.ObjToInt())!=null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | WriteDebug(commonStackerCrane.DeviceCode, $"读åå°å½åä»»å¡å·:{commonStackerCrane.CurrentTaskNum}"); |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | if (OutTaskStationIsOccupied(task) == null) |
| | | { |
| | | bool flag = false; |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress,task.TaskType).Select(x => x.ChildPosi).ToList(); |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | foreach (var item in tasks) |
| | | { |
| | |
| | | Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO); |
| | | //å¤æç§»åºè´§ä½ä»»å¡æ¯å¦å·²åå¨ï¼å¦åå¨å
æ§è¡ |
| | | Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress); |
| | | if (existTask != null) |
| | | if (existTask != null && existTask.TaskState == (int)TaskStatusEnum.SC_Execute) |
| | | { |
| | | return existTask; |
| | | } |
| | | else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |