Ejemplo n.º 1
0
 /// <summary>
 /// キーに紐づくアクションクラスのインスタンスを返します。
 /// </summary>
 /// <param name="actionName"></param>
 /// <returns></returns>
 public Action GetCommandAction(CommandActionType actionType)
 {
     try
     {
         return(CommandClasses[actionType]);
     }catch (KeyNotFoundException keyEx)
     {
         //キーが存在しない
         throw new ApplicationException($"指定されたキー「{actionType}」に紐づくActionが存在しません。設定してから使用する必要があります。", keyEx);
     }
 }
        private void InitialCommand(CommandActionType commandAction)
        {
            switch (commandAction)
            {
            case CommandActionType.Move:
                AgvcTransCommandType = EnumAgvcTransCommandType.Move;
                CompleteStatus       = CompleteStatus.Move;
                TransferStep         = EnumTransferStep.MoveToAddress;
                EnrouteState         = CommandState.None;
                break;

            case CommandActionType.Load:
                AgvcTransCommandType = EnumAgvcTransCommandType.Load;
                CompleteStatus       = CompleteStatus.Load;
                TransferStep         = EnumTransferStep.MoveToLoad;
                EnrouteState         = CommandState.LoadEnroute;
                break;

            case CommandActionType.Unload:
                AgvcTransCommandType = EnumAgvcTransCommandType.Unload;
                CompleteStatus       = CompleteStatus.Unload;
                TransferStep         = EnumTransferStep.MoveToUnload;
                EnrouteState         = CommandState.UnloadEnroute;
                break;

            case CommandActionType.Loadunload:
                AgvcTransCommandType = EnumAgvcTransCommandType.LoadUnload;
                CompleteStatus       = CompleteStatus.Loadunload;
                TransferStep         = EnumTransferStep.MoveToLoad;
                EnrouteState         = CommandState.LoadEnroute;
                break;

            case CommandActionType.Movetocharger:
                AgvcTransCommandType = EnumAgvcTransCommandType.MoveToCharger;
                CompleteStatus       = CompleteStatus.MoveToCharger;
                TransferStep         = EnumTransferStep.MoveToAddress;
                EnrouteState         = CommandState.None;
                break;

            case CommandActionType.Home:
                break;

            case CommandActionType.Override:
                AgvcTransCommandType = EnumAgvcTransCommandType.Override;
                //CompleteStatus = CompleteStatus.Loadunload;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
 public void AddCommandAction(CommandActionType actionType, Action commandClass)
 {
     CommandClasses.Add(actionType, commandClass);
 }