| | |
| | | List<Task> tasks = new List<Task>(); |
| | | foreach (string childDeviceCode in childDeviceCodes) |
| | | { |
| | | try |
| | | { |
| | | ConveyorLineTaskCommandR command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandR>(childDeviceCode); |
| | | if (command != null && command.Status == (ushort)ConveyorStatus.Stored)//æ·»å è¾éçº¿ç¶æConveyorLineStatus enum |
| | | { |
| | |
| | | // RequestOutNextAddress(conveyorLine, command, childDeviceCode); |
| | | // break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | Task.WaitAll(tasks.ToArray()); |
| | |
| | | { |
| | | ConveyorLineDTO lineDTO = new ConveyorLineDTO() |
| | | { |
| | | //TaskNum = task.TaskNum, |
| | | TaskNum = task.TaskNum, |
| | | stationCode = childDeviceCode, |
| | | Barcode = command.Barcode, |
| | | Spec = command.Spec, |
| | |
| | | |
| | | if (content.Status) |
| | | { |
| | | task.TargetAddress = AppSettings.Configuration["OKAddress"]; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.CurrentAddress = childDeviceCode; |
| | | task.NextAddress = AppSettings.Configuration["OKAddress"]; |
| | | task.ExceptionMessage = null; |
| | | ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task); |
| | | |
| | | if (conveyorLine.SendCommand(taskCommand, childDeviceCode)) |
| | |
| | | } |
| | | else |
| | | { |
| | | if (content.Code == 404)//ä¿®æ¹ç»ç¹å°å |
| | | { |
| | | task.TargetAddress = AppSettings.Configuration["NGAddress"]; |
| | | task.NextAddress = task.TargetAddress; |
| | | //if (content.Code == 404)//ä¿®æ¹ç»ç¹å°å |
| | | //{ |
| | | task.CurrentAddress = childDeviceCode; |
| | | task.NextAddress = AppSettings.Configuration["NGAddress"]; |
| | | task.ExceptionMessage = content.Message; |
| | | task.TaskState = (int)TaskInStatusEnum.InException; |
| | | ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task); |
| | | if (conveyorLine.SendCommand(taskCommand, childDeviceCode)) _taskService.UpdateData(task); |
| | | } |
| | | //} |
| | | } |
| | | } |
| | | } |