| | |
| | | { |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //读å |
| | | |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //åå
¥ |
| | | |
| | | if (deviceProRead != null && deviceProWrite != null) |
| | | if (deviceProRead != null && deviceProWrite != null) //读ååå
¥ |
| | | { |
| | | R_ConveyorLineInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | |
| | |
| | | //å
¥åºçæå åæºå
¥åºä»»å¡ |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK) |
| | | { |
| | | if (conveyorLineInfoRead.TaskNo != 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | { |
| | | WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode, conveyorLineInfoRead.TaskNo); |
| | | WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode,item.StationCode); |
| | | if (contentweb.Status) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo,1, item.StationCode); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && ACK) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Free && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK && conveyorLineInfoRead.TaskNo == 0)//åºåº |
| | | /*else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Free && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK && conveyorLineInfoRead.TaskNo == 0)//åºåº |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == item.StationDeviceCode && _taskService.TaskOutboundTypes.Contains(x.TaskType)); |
| | | if (task != null ) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//åºåº |
| | | { |
| | | |
| | | Dt_Task dt_Ta = _taskService.GetOutTaskInfo(item.StationCode); |
| | | if (dt_Ta != null) |
| | | { |
| | | Dt_Router dt_Router = _routerRepository.QueryFirst(x => x.StartPosi == dt_Ta.TargetAddress); |
| | | |
| | | {.1111 |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.OutboundPlatform, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | //å åæºä»»å¡å®æä¸ä¸å°åæ¹æè¾é线ä¸ä¸å°åï¼è®¾å¤ç¼å·æ¹æè¾é线 |
| | | _taskService.UpdateTaskStatusToNext(dt_Ta.TaskNum); |