Beispiel #1
0
        private void onProgramExecutionEnd(object sender, EventArgs e)
        {
            var exec = sender as IProgramExecutor;

            exec.ProgramExecutionEnd -= onProgramExecutionEnd;

            RobotLog.AddEntry(new RobotLogEntry($"Program {exec.Program.Name} execution completed!"));

            notifyPropertiesChanged(nameof(Status));
        }
Beispiel #2
0
        public IProgramExecutor RunProgram()
        {
            if (IsProgramRunning)
            {
                throw new RobotsException("Robot cannot run 2 programs at same time!");
            }
            RobotLog.Clear();


            ProgramExecutor = programExecutionService.Execute(AssignedProgram, Robot);

            RobotLog.AddEntry(new RobotLogEntry($"Program {AssignedProgram} execution started!"));

            ProgramExecutor.ProgramExecutionEnd += onProgramExecutionEnd;

            ProgramExecutor.CommandExecutionStart += programExecutor_CommandExecutionStart;
            ProgramExecutor.CommandExecutionEnd   += programExecutor_CommandExecutionEnd;

            notifyPropertiesChanged(nameof(Status));

            return(ProgramExecutor);
        }
Beispiel #3
0
 private void programExecutor_CommandExecutionStart(object sender, ProgramExecutorCommandEventArgs e)
 {
     RobotLog.AddEntry(new RobotLogEntry($"Completed execution of command: {e.Command.Describe()}."));
 }