| | |
| | | Dt_Task? task = GetTask(commonStackerCrane); |
| | | if (task != null) |
| | | { |
| | | var stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | object? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | bool sendFlag = SendStackerCraneCommand(commonStackerCrane, stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (IsOutTaskStationAvailable(task)) |
| | | { |
| | | //if (IsOutTaskStationAvailable(task)) |
| | | //{ |
| | | return task; |
| | | } |
| | | //} |
| | | |
| | | List<string> otherOutStationCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress, task.TaskType) |
| | | .Select(x => x.ChildPosi).ToList(); |
| | |
| | | /// <summary> |
| | | /// 任务实体转换成命令Model |
| | | /// </summary> |
| | | public dynamic? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | public object? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | // 根据配置判断命令类型 |
| | | string commandType = GetCommandType(task.Roadway); |
| | |
| | | { |
| | | "Formation" => BuildCommand(task, CreateFormationCommand(task)), |
| | | _ => BuildCommand(task, CreateStandardCommand(task)) |
| | | }; |
| | | } |
| | | |
| | | private static bool SendStackerCraneCommand(IStackerCrane commonStackerCrane, object command) |
| | | { |
| | | return command switch |
| | | { |
| | | FormationStackerCraneTaskCommand formationCommand => commonStackerCrane.SendCommand(formationCommand), |
| | | StackerCraneTaskCommand standardCommand => commonStackerCrane.SendCommand(standardCommand), |
| | | _ => false |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | return new StackerCraneTaskCommand |
| | | { |
| | | Barcode = task.PalletCode, |
| | | //Barcode = task.PalletCode, |
| | | TaskNum = task.TaskNum, |
| | | WorkType = 1, |
| | | TrayType = 0 |
| | | WorkAction = 1 |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建组盘堆垛机命令 |
| | | /// 创建分容堆垛机命令 |
| | | /// </summary> |
| | | private static FormationStackerCraneTaskCommand CreateFormationCommand(Dt_Task task) |
| | | { |