public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     if (value)
     {
         Hardware.Runner.EnableMotorAll();
     }
     else
     {
         Hardware.Runner.DisableMotorAll();
     }
 }
Exemplo n.º 2
0
        public override void Execute(ResolutionSessionRuntimeContext ctx)
        {
            try
            {
                var sw = Stopwatch.StartNew();

                var allReached = false;

                while (true)
                {
                    allReached = true;

                    int timeout;

                    using (var state = GlobalState.GetState())
                    {
                        if (state.Simulated)
                        {
                            System.Threading.Thread.Sleep(200);
                            return;
                        }
                        foreach (var m in state.Motors.Motors)
                        {
                            var targetPos = ctx.GetTargetPosition(m.Courronne, m.Axe);
                            if (targetPos != null && targetPos != m.Position)
                            {
                                allReached = false;
                            }
                        }

                        timeout = state.HardwareConfigGlobal.WaitTargetReachedInstructionTimeoutMilliseconds;
                    }

                    if (allReached || ctx.CancelAsked)
                    {
                        return;
                    }
                    else if (sw.ElapsedMilliseconds > timeout)
                    {
                        throw new Exception("Tous les moteurs n'ont pas atteint leur position dans le temps imparti");
                    }
                    else
                    {
                        System.Threading.Thread.Sleep(10);
                    }
                }
            }
            finally
            {
                ctx.ResetTargetPositions();
            }
        }
Exemplo n.º 3
0
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
 }
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     Hardware.Runner.SetSpeedAll(value);
 }
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     MainForm.Instance.Viewer.RefreshCube(Cube);
 }
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     MainForm.Instance.Viewer.ExecuteMachineMove(Move);
 }
 public abstract void Execute(ResolutionSessionRuntimeContext ctx);
Exemplo n.º 8
0
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     Runner.MoveToKnownPosition(Axe, Couronne, KnownPosition, ctx);
 }
 public override void Execute(ResolutionSessionRuntimeContext ctx)
 {
     System.Threading.Thread.Sleep(TimeSpan.FromSeconds(Seconds));
 }