| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Common.WareHouseEnum; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | ////夿AGVä»»å¡å®æï¼ååç»å°é¢ç«åè´§å®æ |
| | | //device.SetValue(GroundStationDBName.W_TakeRequest, false, item.StationCode); |
| | | //device.SetValue(GroundStationDBName.W_TakeFinish, false, item.StationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.NextAddress==item.StationCode); |
| | | if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.NextAddress==item.StationCode); |
| | | Dt_Task? taskOther = _taskRepository.QueryFirst(x => x.Roadway == item.StackerCraneCode && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && (x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Executing.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() || x.TaskState == TaskStatusEnum.Exception.ObjToInt())); |
| | | if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish && taskOther == null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode); |
| | | } |
| | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); |
| | | } |
| | | } |
| | | if (item.StationCode == "301") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType1= device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType1 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | }else if(item.StationCode == "302") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | else if (item.StationCode == "303") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | else if (item.StationCode == "304") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |