Пример #1
0
 public static BaseAction CreateBackStepAction(this UnloadToolAction a)
 {
     return(new LoadToolAction()
     {
         ToolSink = a.ToolSink,
         ToolSource = a.ToolSource
     });
 }
Пример #2
0
 private BaseAction CreateBackStepAction(UnloadToolAction action)
 {
     return(new LoadToolAction()
     {
         ToolSource = action.ToolSource,
         ToolSink = action.ToolSink
     });
 }
Пример #3
0
        private void AddActionCommandImpl()
        {
            BaseAction action = null;

            switch (ActionType)
            {
            case ActionType.AddPanel:
                action = new AddPanelAction();
                break;

            case ActionType.LinearPositionLink:
                action = new LinearPositionLinkAction();
                break;

            case ActionType.TwoPositionLink:
                action = new TwoPositionLinkAction();
                break;

            case ActionType.LoadTool:
                action = new LoadToolAction();
                break;

            case ActionType.UnloadTool:
                action = new UnloadToolAction();
                break;

            case ActionType.LinearPositionLinkGantryOn:
                action = new LinearPositionLinkGantryOnAction();
                break;

            case ActionType.LinearPositionLinkGantryOff:
                action = new LinearPositionLinkGantryOffAction();
                break;

            case ActionType.LinearInterpolatedPositionLink:
                action = new LinearInterpolatedPositionLinkAction();
                break;

            case ActionType.ArcInterpolatedPositionLink:
                action = new ArcInterpolatedPositionLinkAction();
                break;

            default:
                break;
            }

            if (action != null)
            {
                action.Id   = _index++;
                action.Name = $"Action {action.Id}";
                Actions.Add(action);
                MachineStep.Actions.Add(action);
            }
            else
            {
                throw new InvalidOperationException("Action type not supported!");
            }
        }
Пример #4
0
 public static void ExecuteAction(this UnloadToolAction a, int actionId = 0)
 {
     Messenger.Default.Send(new UnloadToolMessage()
     {
         ToolSource   = a.ToolSource,
         ToolSink     = a.ToolSink,
         BackNotifyId = actionId
     });
 }
Пример #5
0
        private void Execute(UnloadToolAction action, int notifyId)
        {
            Messenger.Send(new MoveToolRequestMessage()
            {
                Source = action.ToolSink,
                Sink   = action.ToolSource
            });

            NotifyExecuted(notifyId);
        }