| | |
| | | if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | //æå䏿¥¼å
¥åºå£åå
¥å¯¹åºå
¥åºç«å°å°å |
| | | if (conveyorLineInfoRead!=null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | |
| | | task.PalletType = 1; |
| | | task.PalletCode = conveyorLineInfoRead.PalletCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteError(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | //å
¥åºç«å°åé
è´§ä½åå¤å åå
¥åº |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | |
| | | task.NextAddress = local; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡å åæºå
¥åº"); |
| | | //string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, "AGV_CP"); |
| | | //if (string.IsNullOrEmpty(locationCode) && task.TaskType != TaskTypeEnum.EmptyProductBack.ObjToInt()) |
| | | //{ |
| | | // WriteError(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | // continue; |
| | | //} |
| | | |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡å åæºå
¥åº"); |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | //åºåºç«å°åé
åºåºå¯¹åºç®æ åºåºå£å°å |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | //è·ååºåºç«å°æ¯å¦åå¨åºåºå¾
æ§è¡ä»»å¡ |
| | |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡çº¿ä½åºåº"); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡çº¿ä½åºåº"); |
| | | } |
| | | } |
| | | } |