示例#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));
        }
示例#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);
        }
示例#3
0
 private void programExecutor_CommandExecutionStart(object sender, ProgramExecutorCommandEventArgs e)
 {
     RobotLog.AddEntry(new RobotLogEntry($"Completed execution of command: {e.Command.Describe()}."));
 }