public static void CreatePoint(PictureBox pic, AGV agv, int raddix, Color corlo, int sw)
 {
     try
     {
         if (pic.InvokeRequired)
         {
             pic.BeginInvoke(new AddCreatPoint(CreatePoint), new object [] { pic, agv, raddix, corlo, sw });
         }
         else
         {
             SingleAgv itemagv = new SingleAgv(agv, sw);
             Graphics  g       = pic.CreateGraphics();
             g.FillEllipse(new SolidBrush(Color.Black), (float)ORIGIN.X - 3, (float)ORIGIN.Y - 3, 6, 6);
             foreach (double[] barr in itemagv.BarrierLocator)
             {
                 g.FillEllipse(new SolidBrush(corlo), (float)barr[1] - raddix, (float)barr[2] - raddix, raddix * 2, raddix * 2);
                 if ((int)barr[4] != 0)
                 {
                     g.DrawLine(Pens.Blue, new Point((int)agv.AgvLocation_X, (int)agv.AgvLocation_Y), new Point((int)barr [1], (int)barr [2]));
                 }
             }
             g.Dispose();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     GC.Collect();
     Application.DoEvents();
 }
Exemple #2
0
 /// <
 /// summary>
 ///
 /// </summary>
 void GetAGVLocation()
 {
     if (agv.Polar != null && agv.Angle != null)
     {
         int []   poalte = agv.Polar.ToList().Distinct().ToArray();
         float [] antem  = agv.Angle.ToList().Distinct().ToArray();
         double [,] edge = new double[poalte.Length, poalte.Length];
         TheLightNode [] worldcoord = new TheLightNode[poalte.Length];
         for (int i = 0; i < poalte.Length; i++)
         {
             worldcoord [i] = new TheLightNode();
         }
         edge       = GetEdge(poalte, antem);
         worldcoord = G.GetCurrentWorldCoordinate(edge);
         GetBatter(worldcoord, poalte, antem);
         AgvAbsoluteLocation agvlocation = new AgvAbsoluteLocation(ref agv);
         if (LidarMode.TargetDetectionState)  //靶标探测模式
         {
             SingleAgv addbiaoba = new SingleAgv(agv);
         }
     }
     GC.Collect();
 }