public Form1() { InitializeComponent(); #region Ling //luggages.Add(l1); //luggages.Add(l2); //luggages.Add(l3); //luggages.Add(l4); //luggages.Add(l5); //foreach (Luggage l in luggages) //{ // listBox1.Items.Add(l.displayInfo()); //} lm = new LuggageManagement(); #endregion EindhovenAirport = new Airport(Factory.FakeBelts(), Factory.FakeFlights(), Factory.FakeEmployees()); foreach (Flight flight in EindhovenAirport.Flights) { listBox1.Items.Add($"{flight.FlightId} with {flight.Passengers.Count} passengers, leaving {flight.Departure} with load {flight.Luggages.Count}"); } //DrawSimulation(); //UpdateListBoxes(); }
private void button3_Click(object sender, EventArgs e) { this.lm = new LuggageManagement(); UpdateListBoxes(); DrawSimulation(); }
public StatisticsForm(LuggageManagement lm) { InitializeComponent(); lmc = lm; this.flights = lm.GetAllFlights(); this.luggages = lm.GetAllLuggages(); this.loadedL = lm.GetAllLoadedLuggages(); this.unloadedL = lm.GetAllUnLoadedLuggages(); //Hardcoded random data for statistics elements chart1.Series["Belt ocupancy"].Points.AddXY("Belt A", lm.totalLuggageBeltA); chart1.Series["Belt ocupancy"].Points.AddXY("Belt B", lm.totalLuggageBeltB); chart1.Series["Belt ocupancy"].Points.AddXY("Belt C", lm.totalLuggageBeltC); lblTotalLuggage.Text = "1329"; lblLuggageLoaded.Text = "22.4"; lblTotalLuggagewaiting.Text = "1.4"; lbEmpName.Items.Add("John Michael"); lbEmpName.Items.Add("Joe Jonas"); lbEmpName.Items.Add("Mike Tyson"); lbEmpName.Items.Add("Ashley Jones"); lbEmpStation.Items.Add("Loading belt"); lbEmpStation.Items.Add("Unloading belt"); lbEmpStation.Items.Add("Loading plane"); lbEmpStation.Items.Add("Check-in desk"); lbEmpHoursWorked.Items.Add("7"); lbEmpHoursWorked.Items.Add("6.5"); lbEmpHoursWorked.Items.Add("9"); lbEmpHoursWorked.Items.Add("9.5"); lbHourlySalary.Items.Add("€ 8.4"); lbHourlySalary.Items.Add("€ 8.7"); lbHourlySalary.Items.Add("€ 10.3"); lbHourlySalary.Items.Add("€ 13.0"); DisplayFlightInfo(flights); DisplayAllLuggage(luggages); DisplayLoadedLuggage(loadedL); DisplayUnloadedLuggage(unloadedL); //Setting color of points in the chart foreach (Series s in chart1.Series) { foreach (DataPoint point in s.Points) { if (point.YValues[0] <= 50) { point.Color = Color.Green; point.BorderColor = Color.Black; } if (point.YValues[0] <= 70 && point.YValues[0] > 50) { point.Color = Color.Yellow; point.BorderColor = Color.Black; } if (point.YValues[0] <= 90 && point.YValues[0] > 70) { point.Color = Color.Orange; point.BorderColor = Color.Black; } if (point.YValues[0] > 90) { point.Color = Color.Red; point.BorderColor = Color.Black; } } } }