Пример #1
0
 public static BaseAction CreateBackStepAction(this LinearPositionLinkAction a)
 {
     return(new LinearPositionLinkLazyAction()
     {
         LinkId = a.LinkId
     });
 }
Пример #2
0
 private BaseAction CreateBackStepAction(LinearPositionLinkAction action)
 {
     return(new LinearPositionLinkLazyAction()
     {
         LinkId = action.LinkId
     });
 }
Пример #3
0
 public static void ExecuteAction(this LinearPositionLinkAction a, int actionId = 0)
 {
     //Messenger.Default.Send(new UpdateLinearLinkStateMessage(a.LinkId, a.RequestedPosition));
     Messenger.Default.Send(new MoveLinearLinkMessage(a.LinkId, a.RequestedPosition, a.Duration)
     {
         BackNotifyId = actionId
     });
 }
Пример #4
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!");
            }
        }
Пример #5
0
 private void ExecuteDynamic(LinearPositionLinkAction action, int notifyId)
 {
     Messenger.Send(new GetLinkMessage()
     {
         Id      = action.LinkId,
         SetLink = (link) =>
         {
             LinkMovementManager.Add(action.LinkId, action.RequestedPosition, action.Duration, notifyId);
         }
     });
 }
Пример #6
0
 private void Execute(LinearPositionLinkAction action, int notifyId)
 {
     if (IsDynamic)
     {
         ExecuteDynamic(action, notifyId);
     }
     else
     {
         ExecuteStatic(action, notifyId);
     }
 }
Пример #7
0
        private void ExecuteStatic(LinearPositionLinkAction action, int notifyId)
        {
            Messenger.Send(new GetLinkMessage()
            {
                Id      = action.LinkId,
                SetLink = (link) =>
                {
                    link.Value = action.RequestedPosition;
                }
            });

            NotifyExecuted(notifyId);
        }