|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | //2016鍑哄簱绔欏彴浠诲姟瀹屾垚 | 
|---|
|  |  |  | if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (conveyorLineSignalRead.STB) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); | 
|---|
|  |  |  | Thread.Sleep(500); | 
|---|
|  |  |  | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); | 
|---|
|  |  |  | _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Thread.Sleep(500); | 
|---|
|  |  |  | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //鍒ゆ柇绌轰腑杩炲粖鍑哄簱绌洪棽 | 
|---|
|  |  |  | if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress)); | 
|---|
|  |  |  | Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress)); | 
|---|
|  |  |  | if (task != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode); | 
|---|
|  |  |  | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//鍏ュ簱 | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode); | 
|---|
|  |  |  | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode); | 
|---|
|  |  |  | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | #region 鍑哄簱 | 
|---|
|  |  |  | if (!conveyorLineSignalWrite.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == item.StationDeviceCode); | 
|---|
|  |  |  | 
|---|
|  |  |  | _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); | 
|---|
|  |  |  | device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) | 
|---|