| | |
| | | var axis = _packaxisRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.StationCode == Convert.ToInt32(item.StackerCraneStationCode)); |
| | | if (axis != null) |
| | | { |
| | | //è¿è¡ç»æ |
| | | if (Convert.ToInt32(PackNum) == axis.PackNum) |
| | | { |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 2); |
| | | } |
| | | |
| | | ConsoleHelper.WriteInfoLine($"ç åå·¥ä½{item.StationCode}ç¶æ{Allow}"); |
| | | //ç åç³è¯· |
| | | if (Allow == 3 || Allow == 7) |
| | | { |
| | | //è·åå½åä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryData(x => x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.MD_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode).OrderBy(x => x.TaskNum).FirstOrDefault(); |
| | | |
| | | if (task != null) //ç åç³è¯· |
| | | if (task != null) |
| | | { |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 1); |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | if (device.DeviceCode == "MD8_CP") |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDA.ToString()).DeviceProDataBlock, -1); |
| | | } |
| | | else |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDA.ToString()).DeviceProDataBlock, 1); |
| | | } |
| | | |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 3); |
| | | |
| | |
| | | //_taskRepository.UpdateData(task); |
| | | Thread.Sleep(1500); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{task.TaskNum}ç å"); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | } |