Esempio n. 1
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!");
            }
        }
Esempio n. 2
0
 public static BaseAction CreateBackStepAction(this LinearPositionLinkGantryOffAction a)
 {
     return(new LinearPositionLinkGantryOnAction()
     {
         MasterId = a.MasterId,
         SlaveId = a.SlaveId,
         SlaveUnhooked = a.SlaveUnhooked
     });
 }
Esempio n. 3
0
 public static void ExecuteAction(this LinearPositionLinkGantryOffAction a, int actionId = 0)
 {
     Messenger.Default.Send(new LinearPositionGantryOffMessage()
     {
         MasterId     = a.MasterId,
         SlaveId      = a.SlaveId,
         BackNotifyId = actionId
     });
 }
Esempio n. 4
0
 private BaseAction CreateBackStepAction(LinearPositionLinkGantryOffAction action)
 {
     return(new LinearPositionLinkGantryOnAction()
     {
         MasterId = action.MasterId,
         SlaveId = action.SlaveId,
         SlaveUnhooked = action.SlaveUnhooked
     });
 }
Esempio n. 5
0
        private void Execute(LinearPositionLinkGantryOffAction action, int notifyId)
        {
            Messenger.Send(new GantryMessage()
            {
                Master = action.MasterId,
                Slave  = action.SlaveId,
                State  = false
            });

            NotifyExecuted(notifyId);
        }