public static BaseAction CreateBackStepAction(this LinearPositionLinkAction a) { return(new LinearPositionLinkLazyAction() { LinkId = a.LinkId }); }
private BaseAction CreateBackStepAction(LinearPositionLinkAction action) { return(new LinearPositionLinkLazyAction() { LinkId = action.LinkId }); }
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 }); }
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!"); } }
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); } }); }
private void Execute(LinearPositionLinkAction action, int notifyId) { if (IsDynamic) { ExecuteDynamic(action, notifyId); } else { ExecuteStatic(action, notifyId); } }
private void ExecuteStatic(LinearPositionLinkAction action, int notifyId) { Messenger.Send(new GetLinkMessage() { Id = action.LinkId, SetLink = (link) => { link.Value = action.RequestedPosition; } }); NotifyExecuted(notifyId); }