| | |
| | | { |
| | | getStackerObject.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | } |
| | | if (getStackerObject.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && getStackerObject.StackerCraneStatusValue == StackerCraneStatus.Ready) |
| | | { |
| | | getStackerObject.CheckStackerCraneTaskCompleted();//æ£æµå åæºä»»å¡å®æäºä»¶ |
| | | |
| | | if(getStackerObject.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | getStackerObject.CheckStackerCraneTaskCompleted();//æ£æµå åæºä»»å¡å®æäºä»¶ |
| | | |
| | | if (getStackerObject.StackerCraneStatusValue == StackerCraneStatus.Ready) |
| | | { |
| | | Dt_Task? task = GetTask(speStackerCrane); |
| | | if (task != null) |
| | | { |
| | | Dt_Task? task = GetTask(speStackerCrane); |
| | | if (task != null) |
| | | bool sendFlag = true; |
| | | //if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.PalletOutbound.ObjToInt()) |
| | | //{ |
| | | // //åWMSç³è¯·åºå
¥åºå£æ¯å¦æç©ºæç |
| | | // sendFlag = false; |
| | | //} |
| | | if(sendFlag) |
| | | { |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = getStackerObject.SendCommand(stackerCraneTaskCommand); |
| | | sendFlag = getStackerObject.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | speStackerCrane.SetValue(StackerCraneDBName.CommandSend, 1);//å¯å¨å½ä»¤ |
| | | speStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | |
| | | SpeStackerCrane? speStackerCrane = sender as SpeStackerCrane; |
| | | if (speStackerCrane != null) |
| | | { |
| | | if (speStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | if (speStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CommandSend) != 2) |
| | | { |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | speStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | speStackerCrane.SetValue(StackerCraneDBName.CommandSend, 2); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum, "å åæº"); |
| | | } |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(speStackerCrane.DeviceCode); |
| | | if(task == null) |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(speStackerCrane.DeviceCode); |
| | | } |
| | |
| | | |
| | | stackerCraneTaskCommand.Barcode = task.PalletCode; |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | stackerCraneTaskCommand.TrayType = 0; |
| | | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() || task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt())//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |
| | | string[] sourceCodes = task.SourceAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |
| | |
| | | return null; |
| | | } |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.PalletOutbound.ObjToInt()) |
| | | { |
| | | stackerCraneTaskCommand.WorkType = 2; |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.SourceAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |
| | |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.Relocation.ObjToInt()) |
| | | { |
| | | stackerCraneTaskCommand.WorkType = 3; |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.SourceAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |