Ejemplo n.º 1
0
        private void Run(StepLever stepLever)
        {
            movingLever = levers.Single(lever => lever.Type == stepLever.Lever);

            worker.Stepper = movingLever.Stepper;
            worker.Stepper.SetStepsCount(stepLever.StepsCount);

            new Task(worker.Start).Start();
        }
Ejemplo n.º 2
0
        private void Worker_OnStop(object sender, EventArgs e)
        {
            var stepLever = new StepLever(movingLever.Type, movingLever.Stepper.CurrentStepsCount);

            movingLever = null;

            OnMovingEnd(this, new LeverMovingEndEventArgs(stepLever, worker.StopReason));

            if (IsQueueMoving)
            {
                if (worker.StopReason != StepperStopReason.WorkDone)
                {
                    steppersQueue.Clear();
                }
                else
                {
                    new Task(Continue).Start();
                }
            }
        }