예제 #1
0
        // the timer checks the direction of the agv and can rotate it
        private void AGVtimer_Tick(object sender, EventArgs e)
        {
            pbMain.Refresh();

            foreach (AGV agv in wh.AGVList)
            {
                Graphics g = pbMain.CreateGraphics();

                agv.Move(pbMain, g);

                busy = false;
                if (agv.PointList.Count == 1)
                {
                    pbMain.BackgroundImage = wh.DrawAreas();
                    pbMain.Invalidate();
                    agv.DoNextRoute();
                }
            }
            if (wh.AGVList.All(x => x.finished == true))
            {
                delayCounter++;
                if (delayCounter == 200)
                {
                    OnStopSimulation();
                    delayCounter = 0;
                }
            }
        }
예제 #2
0
        private void btnWSsave_Click(object sender, EventArgs e)
        {
            wh.AGVList.Clear();
            int noOfRacks        = Convert.ToInt32(numericUpDown3.Value);
            int noOfRacksperLine = Convert.ToInt32(numericUpDown4.Value);
            int noOfAgv          = Convert.ToInt32(numericUpDown5.Value);

            wh.CreateLines(noOfRacks, noOfRacksperLine);
            wh.AGVList.Clear();
            for (int i = 0; i < noOfAgv; i++)
            {
                AGV agv = new AGV(i, wh);
                wh.AGVList.Add(agv);
            }

            if (checkBoxSave.Checked)
            {
                CsvHandler csvh = new CsvHandler(wh);
                csvh.SaveWHSpecsToFile(numericUpDown3.Value.ToString(), numericUpDown4.Value.ToString(), numericUpDown5.Value.ToString());
            }


            this.Close();

            mainFormImage.BackgroundImage = wh.DrawAreas();
            mainFormImage.Refresh();

            iBlade.map.CreateMap("map", iBlade.wh.Width, iBlade.wh.Height);
            // wh.AGVList[0].ShortestPath(300, 299, "");

            //refresh the picture box when setting warehouse specificaions
            //iBlade mainForm = new iBlade();
            //mainForm.pbMain.Refresh();
        }
예제 #3
0
        private void btnWSsave_Click(object sender, EventArgs e)
        {
            int noOfRacks        = Convert.ToInt32(numericUpDown3.Value);
            int noOfRacksperLine = Convert.ToInt32(numericUpDown4.Value);
            int noOfAgv          = Convert.ToInt32(numericUpDown5.Value);

            wh.CreateLines(noOfRacks, noOfRacksperLine, mainFormImage);

            for (int i = 0; i < noOfAgv; i++)
            {
                AGV agv = new AGV(1197, 789, ++counter);
                //agv.LoadImage();
                wh.AGVList.Add(agv);
            }



            this.Close();
            mainFormImage.BackgroundImage = wh.DrawAreas();
            mainFormImage.Refresh();

            iBlade.map.CreateMap("map", iBlade.wh.Width, iBlade.wh.Height);
            // wh.AGVList[0].ShortestPath(300, 299, "");
        }