| | |
| | | IsExecutingTask.TargetStation = station.remark; |
| | | IsExecutingTask.TaskState = (int)TaskOutStatusEnum.RGV_TransFer; |
| | | } |
| | | |
| | | |
| | | _taskRepository.UpdateData(IsExecutingTask); |
| | | Thread.Sleep(1000); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | Dt_Task taskNew = null; |
| | | taskNew = GetTransFerTask(FirstRgv); |
| | | if (taskNew == null) |
| | | { |
| | | taskNew = DispatchTask(FirstRgv); |
| | | if (IsExistTransTask(FirstRgv)) |
| | | { |
| | | taskNew = DispatchTask(FirstRgv); |
| | | } |
| | | } |
| | | if (taskNew != null) |
| | | { |
| | | RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew); |
| | | if (rgvTaskCommand != null) |
| | | { |
| | | Thread.Sleep(1000); |
| | | bool sendFlag = SendCommand(FirstRgv, rgvTaskCommand); |
| | | if (sendFlag) |
| | | RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew); |
| | | if (rgvTaskCommand != null) |
| | | { |
| | | if (taskNew.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish) |
| | | Thread.Sleep(1000); |
| | | bool sendFlag = SendCommand(FirstRgv, rgvTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | taskNew.TaskState = (int)TaskInStatusEnum.RGV_InExecuting; |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else if (taskNew.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish) |
| | | { |
| | | taskNew.TaskState = (int)TaskOutStatusEnum.RGV_OutExecuting; |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else if (taskNew.Remark != null) |
| | | { |
| | | taskNew.RGVName = "RGV02"; |
| | | taskNew.CurrentAddress = taskNew.Remark; |
| | | taskNew.Remark = ""; |
| | | taskNew.TaskState = (int)TaskOutStatusEnum.RGV_TransFer; |
| | | Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskNew.NextAddress); |
| | | taskNew.SourceStation = taskNew.CurrentAddress == "1025" ? 10 : 7; |
| | | if (taskNew.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | if (taskNew.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish) |
| | | { |
| | | taskNew.TargetStation = station.stationRemark; |
| | | taskNew.TaskState = (int)TaskInStatusEnum.RGV_InExecuting; |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else if (taskNew.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish) |
| | | { |
| | | taskNew.TaskState = (int)TaskOutStatusEnum.RGV_OutExecuting; |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else if (taskNew.Remark != null) |
| | | { |
| | | taskNew.RGVName = "RGV02"; |
| | | taskNew.CurrentAddress = taskNew.Remark; |
| | | taskNew.Remark = ""; |
| | | taskNew.TaskState = (int)TaskOutStatusEnum.RGV_TransFer; |
| | | Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskNew.NextAddress); |
| | | taskNew.SourceStation = taskNew.CurrentAddress == "1025" ? 10 : 7; |
| | | if (taskNew.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | { |
| | | taskNew.TargetStation = station.stationRemark; |
| | | } |
| | | else |
| | | { |
| | | taskNew.TargetStation = station.remark; |
| | | } |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else |
| | | { |
| | | taskNew.TargetStation = station.remark; |
| | | taskNew.RGVName = FirstRgv.DeviceCode; |
| | | _taskRepository.UpdateData(taskNew); |
| | | _taskService.UpdateTaskStatusToNext(taskNew.TaskNum); |
| | | Thread.Sleep(1000); |
| | | } |
| | | _taskRepository.UpdateData(taskNew); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else |
| | | { |
| | | taskNew.RGVName = FirstRgv.DeviceCode; |
| | | _taskRepository.UpdateData(taskNew); |
| | | _taskService.UpdateTaskStatusToNext(taskNew.TaskNum); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇 |
| | |
| | | IsExecutingTask.RGVName = "RGV01"; |
| | | IsExecutingTask.CurrentAddress = IsExecutingTask.Remark; |
| | | IsExecutingTask.Remark = ""; |
| | | |
| | | |
| | | Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == IsExecutingTask.NextAddress); |
| | | IsExecutingTask.SourceStation = IsExecutingTask.CurrentAddress == "1025" ? 10 : 7; |
| | | if (IsExecutingTask.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | Dt_Task taskNew = null; |
| | | taskNew = GetTransFerTask(SecondRgv); |
| | | if (taskNew == null) |
| | | { |
| | | taskNew = DispatchTask(SecondRgv); |
| | | if (IsExistTransTask(SecondRgv)) |
| | | { |
| | | taskNew = DispatchTask(SecondRgv); |
| | | } |
| | | } |
| | | |
| | | if (taskNew != null) |
| | | { |
| | | RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇 |
| | |
| | | } |
| | | } |
| | | |
| | | public bool IsExistTransTask(CommonRGV_FirstFloor commonRGV) |
| | | { |
| | | if (commonRGV.DeviceCode == "RGV01") |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => x.Floor == "1F" && (x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish || x.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish)&&x.RGVName=="RGV02"); |
| | | return task == null ? true : false; |
| | | } |
| | | else |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => x.Floor == "1F" && (x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish || x.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish) && x.RGVName == "RGV01"); |
| | | return task == null ? true : false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// RGV浠诲姟瀹屾垚 |
| | | /// </summary> |