| | |
| | | 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); |
| | |
| | | true => "æ
é", |
| | | false => "æ£å¸¸", |
| | | }; |
| | | string StackerCraneAlarm(uint alarm) => alarm switch |
| | | { |
| | | 0 => "æä»¤æå°åé误", |
| | | 1 => "æ¥å", |
| | | 2 => "å
éè®¯ä¸æ", |
| | | 3 => "ç»æå¤±è", |
| | | 4 => "è¡èµ°å颿
é", |
| | | 5 => "è¡èµ°æé触å", |
| | | 6 => "è¡èµ°è¿è¡è¶
æ¶", |
| | | 7 => "æåå颿
é", |
| | | 8 => "æåæé触å", |
| | | 9 => "æåè¿è¡è¶
æ¶", |
| | | 10 => "载货å°è¶
è½½", |
| | | 11 => "è½½è´§å°æ¬ è½½ï¼æ¾ç»³)", |
| | | 12 => "载货å°å¤±é", |
| | | 13 => "è´§åå颿¥è¦", |
| | | 14 => "è´§åè¿è¡è¶
æ¶", |
| | | 15 => "è´§åæé触å", |
| | | 16 => "è´§åä¸å±
ä¸", |
| | | 17 => "左侧è¶
é«", |
| | | 18 => "å³ä¾§è¶
é«", |
| | | 19 => "左侧è¶
宽", |
| | | 20 => "å³ä¾§è¶
宽", |
| | | 21 => "å·¦è¶
åº", |
| | | 22 => "å³è¶
åº", |
| | | 23 => "åè´§æ¶è½½è´§å°æè´§", |
| | | 24 => "åè´§åè½½è´§å°æ è´§", |
| | | 25 => "åæ·±è´§ä½æ¶æµ
è´§ä½æè´§", |
| | | 26 => "æ¾è´§æ¶è½½è´§å°æ è´§", |
| | | 27 => "æ¾è´§æ¶è´§æ¶æè´§", |
| | | 28 => "æ¾è´§åè½½è´§å°æè´§", |
| | | 29 => "æ¾æ·±è´§æ¶æµ
è´§ä½æè´§", |
| | | 30 => "", |
| | | 31 => "", |
| | | _ => $"æªç¥æ¥è¦({alarm})" |
| | | }; |
| | | object obj = new |
| | | { |
| | | Automatic = StackerCraneAutoStatus(commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Automatic)), |
| | |
| | | CurrentLayer = Convert.ToInt32(commonStackerCrane.GetValue<StackerCraneDBName, byte>(StackerCraneDBName.CurrentLayer)), |
| | | LevelPoint = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.LevelPoint), |
| | | CurrentTaskNum = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CurrentTaskNum), |
| | | StackerAlarm = StackerCraneAlarm(commonStackerCrane.GetValue<StackerCraneDBName, uint>(StackerCraneDBName.StackerAlarm)), |
| | | |
| | | commonStackerCrane.DeviceCode, |
| | | commonStackerCrane.DeviceName, |
| | | }; |
| | |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | WriteInfo("å åæºä»»å¡å®æ", $"{commonStackerCrane.DeviceName}宿任å¡å·{TaskNum}"); |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == TaskNum); |
| | | if (task != null) |
| | | { |
| | |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.TaskNum = (byte)Convert.ToSByte(task.TaskNum); |
| | | stackerCraneTaskCommand.TaskNum = (short)Convert.ToInt16(task.TaskNum); |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | |
| | |
| | | string[] sourceCodes = stationManager.stationLocation.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] targetCodes = stationManager.stationLocation.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] sourceCodes = task.SourceAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(Convert.ToInt16(sourceCodes[0]) % 2 != 0 ? (short)1 : (short)2); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(Convert.ToInt16(targetCodes[0]) % 2 != 0 ? (short)1 : (short)2); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | |
| | | public int GetRowCode(int number) |
| | | { |
| | | if (number == 1 || number == 15 || number == 11 || number == 19) |
| | | { |
| | | return 1; |
| | | } |
| | | else if (number == 2 || number == 5 || number == 8 || number == 12 || number == 16 || number == 20) |
| | | { |
| | | return 2; |
| | | } |
| | | else if (number == 3 || number == 6 || number == 9 || number == 13 || number == 17 || number == 21) |
| | | { |
| | | return 3; |
| | | } |
| | | else if (number == 4 || number == 7 || number == 10 || number == 14 || number == 18 || number == 22) |
| | | { |
| | | return 4; |
| | | } |
| | | else |
| | | { |
| | | throw new ArgumentOutOfRangeException(nameof(number), "è¾å
¥çæ°åå¿
é¡»å¨1-16èå´å
"); |
| | | } |
| | | } |
| | | } |
| | | } |