public void startCheckIn2(DropOff dr) { UpdateComboBoxes(); CreateCheckIn2(dr); airport.AssignTimerToBags(2, dr); //CheckIn checkIn2; //checkIn2 = new CheckIn(dr, "checkIn2", 2); //airport.addCheckin(checkIn2); //Conveyor conveyor3 = new Conveyor(dr, "conv3"); //Conveyor conveyor4 = new Conveyor(dr, "conv4"); //checkIn2.Point = new Point(365, 0); //LinkedList link2 = new LinkedList(); //C2 = new CreateLinkList(link2, checkIn2, conveyor3, conveyor4, mpa, dr); //btnCheckIn2.Enabled = false; //comboBox2.Enabled = false; //lbDrop2.Text = dr.Name; bool more50 = MoreThen50Bags(dr, 2); if (more50 == false) { CheckIn2Timer.Tag = dr; CheckIn2Timer.Interval = 1; CheckIn2Timer.Start(); } }
public void startCheckIn3(DropOff dr) { UpdateComboBoxes(); CreateCheckIn3(dr); airport.AssignTimerToBags(3, dr); //CheckIn checkIn3 = new CheckIn(dr, "checkIn3", 3); //airport.addCheckin(checkIn3); //Conveyor conveyor5 = new Conveyor(dr, "conv5"); //Conveyor conveyor6 = new Conveyor(dr, "conv6"); //checkIn3.Point = new Point(525, 0); //LinkedList link3 = new LinkedList(); //C3 = new CreateLinkList(link3, checkIn3, conveyor5, conveyor6, mpa, dr); //btnCheckIn3.Enabled = false; //comboBox3.Enabled = false; //lbDrop3.Text = dr.Name; bool more50 = MoreThen50Bags(dr, 3); if (more50 == false) { CheckIn3Timer.Tag = dr; CheckIn3Timer.Interval = 1; CheckIn3Timer.Start(); } //CheckIn checkIn3 = new CheckIn(dr, "checkIn2", 3); //airport.addCheckin(checkIn3); //checkIn3.Point = new Point(525, 0); }
public void startCheckIn4(DropOff dr) { UpdateComboBoxes(); CreateCheckIn4(dr); airport.AssignTimerToBags(4, dr); //CheckIn checkIn4 = new CheckIn(dr, "checkIn4", 4); //airport.addCheckin(checkIn4); //Conveyor conveyor7 = new Conveyor(dr, "conv7"); //Conveyor conveyor8 = new Conveyor(dr, "conv8"); //checkIn4.Point = new Point(685, 0); //LinkedList link4 = new LinkedList(); //C4 = new CreateLinkList(link4, checkIn4, conveyor7, conveyor8, mpa, dr); //btnCheckIn4.Enabled = false; //comboBox4.Enabled = false; //lbDrop4.Text = dr.Name; bool more50 = MoreThen50Bags(dr, 4); if (more50 == false) { CheckIn4Timer.Tag = dr; CheckIn4Timer.Interval = 1; CheckIn4Timer.Start(); } }
public void AssignTimerToBags(int timerId, DropOff d) { foreach (Baggage b in getBagByDropOff(d)) { b.TimerId = timerId; } }
private void btnCheckIn3_Click_1(object sender, EventArgs e) { UpdateComboBoxes(); DropOff drop = GetDropSelected(3); if (drop.UsedBy != 0) { startCheckIn3(drop); airport.DevideBetween2Checks(drop, 3, drop.UsedBy); drop.UsedBy = 3; //comboBox3.Items.RemoveAt(drop.Number); } else { startCheckIn3(drop); drop.UsedBy = 3; CheckIn3Timer.Interval = 1; CheckIn3Timer.Tag = drop; CheckIn3Timer.Start(); } btnCheckIn3.Enabled = false; }
public void startCheckIn1(DropOff dr) { UpdateComboBoxes(); CreateCheckIn1(dr); airport.AssignTimerToBags(1, dr); //CheckIn checkIn1; //checkIn1 = new CheckIn(dr, "checkIn1", 1); //airport.addCheckin(checkIn1); //Conveyor conveyor1 = new Conveyor(dr, "conv1"); //Conveyor conveyor2 = new Conveyor(dr, "conv2"); //checkIn1.Point = new Point(205, 0); //LinkedList link1 = new LinkedList(); //C1 = new CreateLinkList(link1, checkIn1, conveyor1, conveyor2, mpa, dr); //btnStart.Enabled = false; //comboBox1.Enabled = false; //lbDrop1.Text = dr.Name; bool more50 = MoreThen50Bags(dr, 1); if (more50 == false) { CheckIn1Timer.Tag = dr; CheckIn1Timer.Interval = 1; CheckIn1Timer.Start(); } //CheckIn checkIn2 = new CheckIn(dr, "checkIn2", 2); //airport.addCheckin(checkIn2); //checkIn2.Point = new Point(525, 0); }
public Airport() { //create fixed dropoffs DropOffs = new List <DropOff>() { new DropOff(1, "drop1"), new DropOff(2, "drop2"), new DropOff(3, "drop3") }; //random values for passengers for (int i = 0; i < 100; i++) { Passengers.Add(new Passenger(i.ToString(), RandomDrop = DropOffs[rnd.Next(DropOffs.Count)])); Baggage b = new Baggage(RandomDrop, i, Passengers[i]); string r = ""; for (int q = 0; q < 7; q++) { r += nig.Next(0, 9).ToString(); } b.BaggageId = "EIN" + r; bags.Add(b); } }
public Conveyor(DropOff destinationgate) { this.DropOffGate = destinationgate; Random random = new Random(); Number = random.Next(0, 3); Broken(); }
public void Seized(DropOff d, PictureBox pb, Baggage b) { Controls.Remove(pb); Baggage bag = new Baggage(b.DropOffGate, b.BaggageNumber, b.passenger); bag.TimerId = b.TimerId; bag.BaggageId = b.BaggageId; airport.AddBag(bag); }
public Baggage(DropOff dropOffGate, int baggageNumber, Passenger passenger) { this.DropOffGate = dropOffGate; this.BaggageNumber = baggageNumber; this.passenger = passenger; this.Suspicious = false; this.IsOnConveyer = false; ReachedDrop = false; TimerId = 0; }
public Conveyor(DropOff destinationgate, string name) { this.DropOffGate = destinationgate; this.Name = name; Random random = new Random(); Number = 2; //random.Next(0, 3) Broken(); }
public List <CheckIn> GetCheckInForDrops(DropOff d) { List <CheckIn> ch = new List <CheckIn>(); foreach (CheckIn c in checkIns) { if (c.DestinationGate == d) { ch.Add(c); } } return(ch); }
public int GetNumberOfTicketsSold(DropOff d) { List <Ticket> temp = new List <Ticket>(); foreach (Ticket t in ticketsSold) { if (t.cust.flightDropOff == d) { temp.Add(t); } } return(temp.Count()); }
public List <Passenger> getPassengers(DropOff d) { List <Passenger> temp = new List <Passenger>(); foreach (Passenger passenger in Passengers) { if (passenger.flightDropOff == d) { temp.Add(passenger); } } return(temp); }
public List <Baggage> getBagByDropOff(DropOff d) { List <Baggage> temp = new List <Baggage>(); foreach (Baggage b in bags) { if (b.DropOffGate.Name == d.Name) { temp.Add(b); } } return(temp); }
public DropOff getDrop(string name) { DropOff dropy = null; foreach (DropOff d in DropOffs) { if (d.Name == name) { dropy = d; } } return(dropy); }
private void btnStart_Click(object sender, EventArgs e) { mpa = new MainProcessArea("mpa1"); btnStart.Enabled = false; DropOff drop = GetDropSelected(1); drop.UsedBy = 1; startCheckIn1(drop); btnCheckIn2.Enabled = true; btnCheckIn3.Enabled = true; btnBreak.Enabled = true; btnCheckIn4.Enabled = true; button1.Enabled = true; button2.Enabled = true; }
//in case using 2 checkIns for the same drop off public void DevideBetween2Checks(DropOff d, int a, int b) { int[] nums = new int[2]; nums[0] = a; nums[1] = b; int ran; //assgin the timerusage for each bag between a&b foreach (Baggage B in getBagByDropOff(d)) { if (B.ReachedDrop == false) { ran = rnd.Next(0, 2); B.TimerId = nums[ran]; } } }
public void CreateCheckIn4(DropOff d) { CheckIn checkIn4 = new CheckIn(d, "checkIn4", 4); airport.addCheckin(checkIn4); Conveyor conveyor7 = new Conveyor(d, "conv7"); Conveyor conveyor8 = new Conveyor(d, "conv8"); checkIn4.Point = new Point(685, 0); LinkedList link4 = new LinkedList(); CreateLinkList C4 = new CreateLinkList(link4, checkIn4, conveyor7, conveyor8, mpa, d); airport.addLinkList(C4); btnCheckIn4.Enabled = false; comboBox4.Enabled = false; lbDrop4.Text = d.Name; }
public void CreateCheckIn1(DropOff d) { CheckIn checkIn1; checkIn1 = new CheckIn(d, "checkIn1", 1); airport.addCheckin(checkIn1); Conveyor conveyor1 = new Conveyor(d, "conv1"); Conveyor conveyor2 = new Conveyor(d, "conv2"); checkIn1.Point = new Point(205, 0); LinkedList link1 = new LinkedList(); CreateLinkList C1 = new CreateLinkList(link1, checkIn1, conveyor1, conveyor2, mpa, d); airport.addLinkList(C1); btnStart.Enabled = false; comboBox1.Enabled = false; lbDrop1.Text = d.Name; }
public void CreateCheckIn2(DropOff d) { CheckIn checkIn2; checkIn2 = new CheckIn(d, "checkIn2", 2); airport.addCheckin(checkIn2); Conveyor conveyor3 = new Conveyor(d, "conv3"); Conveyor conveyor4 = new Conveyor(d, "conv4"); checkIn2.Point = new Point(365, 0); LinkedList link2 = new LinkedList(); CreateLinkList C2 = new CreateLinkList(link2, checkIn2, conveyor3, conveyor4, mpa, d); airport.addLinkList(C2); btnCheckIn2.Enabled = false; comboBox2.Enabled = false; lbDrop2.Text = d.Name; }
public void CreateCheckIn3(DropOff d) { CheckIn checkIn3 = new CheckIn(d, "checkIn3", 3); airport.addCheckin(checkIn3); Conveyor conveyor5 = new Conveyor(d, "conv5"); Conveyor conveyor6 = new Conveyor(d, "conv6"); checkIn3.Point = new Point(525, 0); LinkedList link3 = new LinkedList(); CreateLinkList C3 = new CreateLinkList(link3, checkIn3, conveyor5, conveyor6, mpa, d); airport.addLinkList(C3); btnCheckIn3.Enabled = false; comboBox3.Enabled = false; lbDrop3.Text = d.Name; }
public void adder(DropOff DF) { DropOff d1 = airport.getDrop("drop1"); DropOff d2 = airport.getDrop("drop2"); DropOff d3 = airport.getDrop("drop3"); if (DF == d1) { d1.CurrentBag++; } if (DF == d2) { d2.CurrentBag++; } if (DF == d3) { d3.CurrentBag++; } }
public int checker(DropOff DF) { DropOff d1 = airport.getDrop("drop1"); DropOff d2 = airport.getDrop("drop2"); DropOff d3 = airport.getDrop("drop3"); if (DF == d1) { return(d1.CurrentBag); } if (DF == d2) { return(d2.CurrentBag); } if (DF == d3) { return(d3.CurrentBag); } return(0); }
public List <Baggage> GenerateBaggages() { List <Baggage> temp = new List <Baggage>(); for (int i = 0; i < 100; i++) { Passengers.Add(new Passenger(i.ToString(), RandomDrop = DropOffs[rnd.Next(DropOffs.Count)])); Baggage b = new Baggage(RandomDrop, i, Passengers[i]); string r = ""; for (int q = 0; q < 7; q++) { r += nig.Next(0, 9).ToString(); } b.BaggageId = "EINM" + r; temp.Add(b); } return(temp); }
private DropOff GetDropSelected(int n) { //n is for which combox ComboBox cb = null; DropOff d = null; if (n == 1) { cb = comboBox1; } else if (n == 2) { cb = comboBox2; } else if (n == 3) { cb = comboBox3; } else if (n == 4) { cb = comboBox4; } //after gitting which combox now which drop 1||2||3 if (cb.Text == "drop1") { d = airport.getDrop("drop1"); } else if (cb.Text == "drop2") { d = airport.getDrop("drop2"); } else if (cb.Text == "drop3") { d = airport.getDrop("drop3"); } return(d); }
public Baggage(DropOff dropOffGate, int baggageNumber, Passenger passenger) { this.DropOffGate = dropOffGate; this.BaggageNumber = baggageNumber; this.passenger = passenger; }
public CheckIn(DropOff destination) { this.DestinationGate = destination; }
public CreateLinkList(LinkedList link, CheckIn Check, Conveyor Con1, Conveyor Con2, MainProcessArea Main, DropOff Drop) { this.LinkList = link; this.CheckIn = Check; this.Conv1 = Con1; this.Conv2 = Con2; this.MainProcessArea = Main; this.DropOff = Drop; LinkList.AddLast(CheckIn); LinkList.AddLast(Conv1); // LinkList.AddLast(MainProcessArea); LinkList.AddLast(Conv2); LinkList.AddLast(DropOff); }
private void btnStart_Click(object sender, EventArgs e) { MainProcessArea mpa = new MainProcessArea(); mpa.Name = "mpa"; //FOR DROPOFF 1 DropOff dropOff1 = new DropOff(5); dropOff1.Name = "drop1"; CheckIn checkIn1 = new CheckIn(dropOff1); checkIn1.Name = "checkIn 1"; airport.addCheckin(checkIn1); Conveyor conveyor1 = new Conveyor(dropOff1); conveyor1.Name = "conv1"; Conveyor conveyor3 = new Conveyor(dropOff1); conveyor3.Name = "conv3"; LinkedList system = new LinkedList(); Passenger a = new Passenger("34sa6etr7", dropOff1); airport.addPassenger(a); Baggage baggage = new Baggage(dropOff1, 1, a); airport.AddBag(baggage); Passenger b = new Passenger("3f45frg83", dropOff1); airport.addPassenger(b); Baggage baggage1 = new Baggage(dropOff1, 3, b); airport.AddBag(baggage1); system.AddLast(checkIn1); system.AddLast(conveyor1); system.AddLast(mpa); system.AddLast(conveyor3); system.AddLast(dropOff1); system.PassBaggage(baggage); system.PassBaggage(baggage1); gbDropoff1.Text = dropOff1.Name.ToString(); lbCheckIn.Text = airport.GetNumberOfChickIns(gbDropoff1.Text).ToString(); lbBags.Text = system.getAllBags().Count().ToString(); lbPassenger.Text = airport.getPassengers(dropOff1).Count().ToString(); lbBagsLost.Text = (airport.getBagByDropOff(dropOff1).Count() - system.getAllBags().Count()).ToString(); //////////////////////////////////////// //FOR DROPOFF 2 DropOff dropOff2 = new DropOff(6); dropOff2.Name = "drop2"; CheckIn checkIn2 = new CheckIn(dropOff2); checkIn2.Name = "check2"; airport.addCheckin(checkIn2); CheckIn checkIn4 = new CheckIn(dropOff2); checkIn4.Name = "check4"; airport.addCheckin(checkIn4); Conveyor conveyor2 = new Conveyor(dropOff2); conveyor2.Name = "conv2"; Conveyor conveyor4 = new Conveyor(dropOff2); conveyor4.Name = "conv4"; LinkedList sys = new LinkedList(); Passenger c = new Passenger("5br467hg", dropOff2); airport.addPassenger(c); Baggage bag2 = new Baggage(dropOff2, 2, c); airport.AddBag(bag2); Passenger k = new Passenger("er43ovosz", dropOff2); airport.addPassenger(k); DropOff f = new DropOff(44); Baggage bag4 = new Baggage(f, 6, k); airport.AddBag(bag4); sys.AddLast(checkIn2); sys.AddLast(checkIn4); sys.AddLast(conveyor2); sys.AddLast(mpa); sys.AddLast(conveyor4); sys.AddLast(dropOff2); sys.PassBaggage(bag2); sys.PassBaggage(bag4); gbDropoff2.Text = dropOff2.Name.ToString(); lbCheckIn2.Text = airport.GetNumberOfChickIns(gbDropoff2.Text).ToString(); lbBags2.Text = sys.getAllBags().Count().ToString(); lbPassenger2.Text = airport.getPassengers(dropOff1).Count().ToString(); lbBagsLost2.Text = (airport.getBagByDropOff(dropOff1).Count() - sys.getAllBags().Count()).ToString(); //////////////////////////////////////// //FOR DROPOFF 3 DropOff drop3 = new DropOff(3); drop3.Name = "drop 3"; CheckIn check3 = new CheckIn(drop3); check3.Name = "check 3"; airport.addCheckin(check3); Conveyor conv6 = new Conveyor(drop3); conv6.Name = "conv6"; Conveyor conv8 = new Conveyor(drop3); conv8.Name = "conv8"; LinkedList syss = new LinkedList(); Passenger d = new Passenger("5br467hg", drop3); airport.addPassenger(d); Baggage bag3 = new Baggage(drop3, 2, d); airport.AddBag(bag3); syss.AddLast(check3); syss.AddLast(conv6); syss.AddLast(mpa); syss.AddLast(conv8); syss.AddLast(drop3); syss.PassBaggage(bag3); airport.buyTicket(a, 500, "FR6013"); airport.buyTicket(b, 500, "FR6013"); airport.buyTicket(c, 500, "FR6013"); airport.buyTicket(d, 500, "FR6013"); airport.buyTicket(k, 500, "FR6013"); gbDropoff3.Text = drop3.Name.ToString(); lbCheckIn3.Text = airport.GetNumberOfChickIns(gbDropoff3.Text).ToString(); lbBags3.Text = syss.getAllBags().Count().ToString(); lbPassenger3.Text = airport.getPassengers(drop3).Count().ToString(); lbBagsLost3.Text = (airport.getBagByDropOff(drop3).Count() - syss.getAllBags().Count()).ToString(); lbTickets1.Text = airport.GetNumberOfTicketsSold(dropOff1).ToString(); lbTickets2.Text = airport.GetNumberOfTicketsSold(dropOff2).ToString(); lbTickets3.Text = airport.GetNumberOfTicketsSold(drop3).ToString(); Console.ReadLine(); }