文件名从 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs 修改 |
| | |
| | | _taskService = taskService; |
| | | _taskRepository = taskRepository; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 瀹夊叏淇″彿鐢宠 AGV-WCS |
| | | /// </summary> |
| | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | //if (!content.Status) |
| | | //{ |
| | | // throw new Exception(content.Message); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | //if (!content.Status) |
| | | //{ |
| | | // throw new Exception(content.Message); |
| | | //} |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | //if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | else |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | //if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | |
| | | } |
| | | task.CurrentAddress = dt_Station.StationCode; |
| | | task.NextAddress = ""; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | task.DeviceCode = "SC01_CSJ"; |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |