public IProgramExecutor Execute(IProgram program, IRobot robot) { if (CanExecute(program, robot) == false) { throw new RobotsException("Robot is already running a program!"); } IProgramExecutor executor = ExecutorFactory.Create(program, robot); lock (runningExecutorsMutex) { RunningExecutors.Add(executor); } executor.ProgramExecutionEnd += onExecutionEnd; executor.Start(); ProgramExecutionStarted?.Invoke(this, new ProgramExecutionServiceProgramEventArgs(program)); return(executor); }
protected override void _OnStart() { _programExecutor.Start(); }