예제 #1
0
 /// <summary>
 /// Start the central manager
 /// </summary>
 public void StartAll()
 {
     CounterManager.StartThreads();
     GateManager.StartThreads();
     SortingMachine.Start();
     ScheduleManager.Start();
     PersonsManager.Start();
 }
예제 #2
0
        /// <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();
            }
        }
예제 #3
0
        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);
        }