| | |
| | | using WIDESEAWCS_Model.BasicInfo; |
| | | using WIDESEAWCS_Tasks.RGVJob; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_TaskInfoRepository; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (commonStackerCrane != null) |
| | | { |
| | | //if (!commonStackerCrane.IsEventSubscribed) |
| | | //{ |
| | | // commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | //} |
| | | |
| | | //commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.TaskCompleted)) |
| | | { |
| | | var x = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CurrentTaskNum); |
| | |
| | | var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); |
| | | var userIds = tokenInfos?.Select(x => x.UserId).ToList(); |
| | | |
| | | string StackerCraneAutoStatus(bool AutoStatus) => AutoStatus switch |
| | | { |
| | | true => "èæºæ¨¡å¼", |
| | | false => "åæºæ¨¡å¼", |
| | | }; |
| | | string StackerCraneWorkStatus(bool WorkStatus) => WorkStatus switch |
| | | { |
| | | true => "è¿è¡ä¸", |
| | | false => "å¾
æº", |
| | | }; |
| | | string StackerCraneStatus(bool Status) => Status switch |
| | | { |
| | | true => "æ
é", |
| | | false => "æ£å¸¸", |
| | | }; |
| | | object obj = new |
| | | { |
| | | Automatic = commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Automatic), |
| | | Fault = commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Fault), |
| | | Running = commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Running), |
| | | //commonStackerCrane.StackerCraneAutoStatusDes, |
| | | //commonStackerCrane.StackerCraneWorkStatusDes, |
| | | //commonStackerCrane.DeviceCode, |
| | | //commonStackerCrane.DeviceName, |
| | | //commonStackerCrane.CurrentTaskNum, |
| | | //commonStackerCrane.LastTaskNum, |
| | | Automatic = StackerCraneAutoStatus(commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Automatic)), |
| | | Fault = StackerCraneStatus(commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Fault)), |
| | | Running = StackerCraneWorkStatus(commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Running)), |
| | | CurrentColumn = Convert.ToInt32(commonStackerCrane.GetValue<StackerCraneDBName, byte>(StackerCraneDBName.CurrentColumn)), |
| | | CurrentLayer = Convert.ToInt32(commonStackerCrane.GetValue<StackerCraneDBName, byte>(StackerCraneDBName.CurrentLayer)), |
| | | LevelPoint = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.LevelPoint), |
| | | CurrentTaskNum = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CurrentTaskNum), |
| | | commonStackerCrane.DeviceCode, |
| | | commonStackerCrane.DeviceName, |
| | | }; |
| | | _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { commonStackerCrane.DeviceName, data = obj }); |
| | | |
| | |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | #region æ¥å¿è®°å½ |
| | | ConsoleHelper.WriteColorLine($"ã{commonStackerCrane.DeviceName}ãå åæºä½ä¸ç¶æï¼ããæ¶é´ã{DateTime.Now}ã", ConsoleColor.Magenta); |
| | | |
| | | string str = $"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonStackerCrane.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | |
| | | #endregion |
| | | |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == TaskNum); |
| | | if (task != null) |
| | | { |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | if (Convert.ToInt32(task.TargetAddress) > 1999 && Convert.ToInt32(task.TargetAddress) < 3000) |
| | | { |
| | | |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == task.Roadway && x.stationChildCode == task.TargetAddress); |
| | | if (stationManager != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManager.stationPLC); |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | |
| | | var InteractiveSignal = conveyorLine.GetValue<ConveyorLineDBName, byte>(ConveyorLineDBName.InteractiveSignal, stationManager.stationChildCode); |
| | | |
| | | var structs = BitConverter.GetBytes(InteractiveSignal).ToArray().ToBoolArray(); |
| | | if (structs[2]) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, Convert.ToInt16(stationManager.stationNextChildCode), stationManager.stationChildCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, Convert.ToInt16(task.TaskNum), stationManager.stationChildCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, Convert.ToSByte(2), stationManager.stationChildCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var content = _taskService.StackCraneTaskCompleted(TaskNum); |
| | | } |
| | | } |
| | |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.TaskNum = (byte)Convert.ToSByte(task.TaskNum); |
| | | stackerCraneTaskCommand.TaskNum = (short)Convert.ToInt16(task.TaskNum); |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | |