/// <summary> /// Start the central manager /// </summary> public void StartAll() { CounterManager.StartThreads(); GateManager.StartThreads(); SortingMachine.Start(); ScheduleManager.Start(); PersonsManager.Start(); }
/// <summary> /// Closes the gate and the relative counters /// </summary> /// <param name="id"></param> public void CloseGate(uint id) { Gate gate = GateManager.GetGate(id); CounterDesk[] desks = CounterManager.GetDesksFromGateId(id); gate.Close(); for (int i = 0; i < desks.Length; i++) { desks[i].Close(); } }
public void CreateManagers() { ScheduleManager = new ScheduleManager(@"Data/AirplaneSchedule.txt"); uint[] gateIds = ScheduleManager.GetAllGateIds(); GateManager = new GateManager(gateIds); CounterManager = new CounterManager(GateManager.GetGateIds(), (uint)gateIds.Length * 2); SortingMachine = new Sorting(CounterManager.Counters, GateManager.Gates); PersonsManager = new PersonManager(CounterManager.Counters); FileLogger = new FileLogger(@"Log-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt"); ConsoleLogger = new ConsoleLogger(); ScheduleManager.AddActiveEventChangedMethod(ScheduleHasChanged); }