public TestController(IApplicationContext ctx) { _ctx = ctx; _resourceManager = (IResourceManager)ctx.GetObject("ResourceManager"); _resourceManager.SetTestController(this); _testCases = new BindingList<TestCase>(); _communicationManager = new CommunicatorManager(); _robotRepo = new RobotsRepository(); _clientThreadPool = new AgentThreadPool(); _focusedAgent = null; _focusedTestCase = null; _refreshFocusViewLock = new Object(); _driverList = new List<IRobotDriver>(); _mapManager = new MapManager(); }
public void Reset() { try { LOG.Info("Resetting"); UpdateProgress("Resetting...", 10); StopTestThread(); UpdateProgress("Resetting...", 20); _resourceManager.Reset(); _driverList.Clear(); _testCases.Clear(); UpdateProgress("Resetting...", 50); _communicationManager.Reset(); UpdateProgress("Resetting...", 70); _robotRepo.Reset(); _clientThreadPool.Dispose(); _clientThreadPool = new AgentThreadPool(); UpdateProgress("Resetting...", 90); lock (_refreshFocusViewLock) { _focusedAgent = null; _focusedTestCase = null; } UpdateProgress("", 0); _mapManager.Reset(); } catch (CommunicatorException ce) { LogError("Error during reseting: " + ce.Message); UpdateProgress("", 0); } UpdateUI(); }