Пример #1
0
        //get linklist according to the checkin number
        public CreateLinkList getCLinkList(int checkinNum)
        {
            CreateLinkList c = null;

            foreach (CreateLinkList cl in lists)
            {
                if (cl.CheckIn.Id == checkinNum)
                {
                    c = cl;
                }
            }
            return(c);
        }
Пример #2
0
        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;
        }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }
Пример #5
0
        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;
        }
Пример #6
0
 //add linklist to lists
 public void addLinkList(CreateLinkList l)
 {
     lists.Add(l);
 }
Пример #7
0
        private void CheckIn3Timer_Tick(object sender, EventArgs e)
        {
            DropOff        d     = (DropOff)CheckIn3Timer.Tag;
            CheckIn        ch    = airport.GetCheckInById(3);
            CreateLinkList C     = airport.getCLinkList(3);
            int            timer = 0;

            //getting statistics lables
            Label lbbags      = GetStatisticsLabels(d.Number)[0];
            Label lbCheck     = GetStatisticsLabels(d.Number)[1];
            Label lbPassenger = GetStatisticsLabels(d.Number)[2];

            for (int i = 0; i < this.Controls.Count; i++)
            {
                lbCheck.Text     = airport.GetCheckInForDrops(d).Count().ToString();
                lbPassenger.Text = airport.getPassengers(d).Count().ToString();
                for (int j = 0; j < d.CurrentBag; j++)
                {
                    if (this.Controls[i].Name == $"pictureBox{airport.getBagByDropOff(d)[j].BaggageNumber}" && airport.getBagByDropOff(d)[j].Suspicious == false && (airport.getBagByDropOff(d)[j].TimerId == 3 || airport.getBagByDropOff(d)[j].TimerId == 0))
                    {
                        {
                            bagMove((PictureBox)this.Controls[i]);
                            if (((PictureBox)this.Controls[i]).Location.Y == 546)
                            {
                                if (airport.getBagByDropOff(d)[j].TimerId == 2 || airport.getBagByDropOff(d)[j].TimerId == 0)
                                {
                                    C     = airport.getCLinkList(2);
                                    timer = 2;
                                }
                                else if (airport.getBagByDropOff(d)[j].TimerId == 1)
                                {
                                    C     = airport.getCLinkList(1);
                                    timer = 1;
                                }
                                else if (airport.getBagByDropOff(d)[j].TimerId == 3)
                                {
                                    C     = airport.getCLinkList(3);
                                    timer = 3;
                                }
                                else if (airport.getBagByDropOff(d)[j].TimerId == 4)
                                {
                                    C     = airport.getCLinkList(4);
                                    timer = 4;
                                }

                                LinkedList link = C.LinkList;
                                link.PassBaggage(airport.getBagByDropOff(d)[j]);
                                d.BagsArrived.Add(airport.getBagByDropOff(d)[j]);
                                lbbags.Text = d.BagsArrived.Count().ToString();
                                airport.getBagByDropOff(d)[j].IsOnConveyer = false;
                                airport.getBagByDropOff(d)[j].ReachedDrop  = true;
                                ((PictureBox)this.Controls[i]).Visible     = false;
                            }
                        }
                    }
                }
            }
            //delay for dropOff2
            int[] arrays = { 100, 150, 180 };
            if (d.Count % arrays[nextDropD] == 0)
            {
                sendBag(d, ch.Point);
                Random random = new Random();
                nextDropD = random.Next(0, 2);
            }
            d.Count++;
        }