| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | else |
| | | { |
| | | task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.CurrentAddress); |
| | | if (stationManger != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: stationManger.StackerCraneCode, currentAddress: stationManger.StackerCraneStationCode, nextAddress: task.TargetAddress); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) |
| | |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | WriteError(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | } |