예제 #1
0
파일: RobotState.cs 프로젝트: shoter/Robots
        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
파일: RobotState.cs 프로젝트: shoter/Robots
        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
파일: RobotState.cs 프로젝트: shoter/Robots
 private void programExecutor_CommandExecutionStart(object sender, ProgramExecutorCommandEventArgs e)
 {
     RobotLog.AddEntry(new RobotLogEntry($"Completed execution of command: {e.Command.Describe()}."));
 }