private void HandleRobotsListRequest() { if (log.IsDebugEnabled) { log.Debug("Got RobotsListsRequest command"); } if (communicator.Receive(Communicator.RECEIVEBLOCKLEVEL_WaitForTimestamp) < 0) { log.Error("Error occured while receiving simulation state"); return; } ; var robotsList = new RobotsList(); for (int i = 0; i < communicator.robotsCount; i++) { robotsList.robotNames.Add(communicator.robots[i].name); } if (log.IsDebugEnabled) { log.Debug(String.Format("Sending RobotsList: {0}", string.Join(",", robotsList.robotNames))); } SendMessage(robotsList); }
public ApplicationState(IRobotFactory robotFactory, IProgramExecutionService programExecutionService) { var robots = robotFactory.GetRegisteredRobots(); RobotsList.Capacity = robots.Count(); foreach (var r in robots) { RobotsList.Add(new RobotState(programExecutionService, r, new RobotLog())); } }