Exemplo n.º 1
0
        /// <summary>
        /// Border:英寸转化为毫米
        /// </summary>
        /// <param name="border"></param>
        /// <returns></returns>
        public static CBorder CBorderFeetToMM(CBorder border)
        {
            CPoint3d spoint = CPoint3dFeetToMM(border.GetPointBegin());
            CPoint3d epoint = CPoint3dFeetToMM(border.GetPointEnd());

            return(new CBorder(spoint, epoint, border.GetBulge()));
        }
Exemplo n.º 2
0
 static bool LoadZonesFromFile(string filename)
 {
     try {
         string[] file = File.ReadAllLines(filename);
         int      z;
         for (z = 0; z *6 + 5 < file.Length; z++)
         {
             CPoint3d[] points = new CPoint3d[5];
             for (int p = 0; p < 5; p++)
             {
                 points[p] = new CPoint3d();
                 string[] pos = file[z * 6 + p + 1].Split(' ');
                 points[p].X = float.Parse(pos[0]);
                 points[p].Y = float.Parse(pos[1]);
                 points[p].Z = float.Parse(pos[2]);
             }
             _zones.Zones[z] = CZone.CreateBaseZoneXY(points[0], points[1], points[2], points[3], points[4].Z, points[4].X, points[4].Y);
         }
         _zones.NbZoneActive = z;
         _jaco.ConfigurationsManager.SetProtectionZones(_zones);
         Console.WriteLine(_info + "Read zone configuration from file \"" + filename + "\".");
         Console.WriteLine(_info + "You will need to reboot the robot for changes to take effect.");
         PrintZones();
         return(true);
     } catch (Exception) {
         Console.WriteLine(_error + "Could not read zone configuration from file \"" + filename + "\".");
     }
     return(false);
 }
Exemplo n.º 3
0
 public static void MMToFeet(ref CPoint3d pt)
 {
     pt.x = MMToFeet(pt.x);
     pt.y = MMToFeet(pt.y);
     pt.z = MMToFeet(pt.z);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 坐标点:毫米转化为英寸
 /// </summary>
 /// <param name="temPt"></param>
 /// <returns></returns>
 public static CPoint3d MMToFeet(CPoint3d temPt)
 {
     return(new CPoint3d(MMToFeet(temPt.x), MMToFeet(temPt.y), MMToFeet(temPt.z)));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 坐标点:英寸转化为毫米
 /// </summary>
 /// <param name="brd"></param>
 public static void FeetToMM(ref CPoint3d pt)
 {
     pt.x = FeetToMM(pt.x);
     pt.y = FeetToMM(pt.y);
     pt.z = FeetToMM(pt.z);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 坐标点:英寸转化为毫米
 /// </summary>
 /// <param name="temPt"></param>
 /// <returns></returns>
 public static CPoint3d CPoint3dFeetToMM(CPoint3d pt)
 {
     return(new CPoint3d(FeetToMM(pt.x), FeetToMM(pt.y), FeetToMM(pt.z)));
 }
Exemplo n.º 7
0
 static bool LoadZonesFromFile (string filename)
 {
   try {
     string[] file = File.ReadAllLines(filename);
     int z;
     for (z=0; z*6+5<file.Length; z++) {
       CPoint3d[] points = new CPoint3d[5];
       for (int p=0; p<5; p++) {
         points[p] = new CPoint3d();
         string[] pos = file[z*6+p+1].Split(' ');
         points[p].X = float.Parse(pos[0]);
         points[p].Y = float.Parse(pos[1]);
         points[p].Z = float.Parse(pos[2]);
       }
       _zones.Zones[z] = CZone.CreateBaseZoneXY(points[0], points[1], points[2], points[3], points[4].Z, points[4].X, points[4].Y);
     }
     _zones.NbZoneActive = z;
     _jaco.ConfigurationsManager.SetProtectionZones(_zones);
     Console.WriteLine(_info + "Read zone configuration from file \"" + filename + "\".");
     Console.WriteLine(_info + "You will need to reboot the robot for changes to take effect.");
     PrintZones();
     return true;
   } catch (Exception) {
     Console.WriteLine(_error + "Could not read zone configuration from file \"" + filename + "\".");
   }
   return false;
 }