Esempio n. 1
0
        /// <summary>
        /// 读取Move点位
        /// </summary>
        /// <param name="xeRoot"></param>
        /// <param name="robotStdPoint"></param>
        Point5D ReadMovePos(XmlElement xeRoot, string name)
        {
            try
            {
                Point5D p = new Point5D();
                p.DblValue1 = ReadChildAttributeDbl(xeRoot, name, "X");
                p.DblValue2 = ReadChildAttributeDbl(xeRoot, name, "Y");
                p.DblValue3 = ReadChildAttributeDbl(xeRoot, name, "Z");
                p.DblValue4 = ReadChildAttributeDbl(xeRoot, name, "R");
                string annotation = ReadChildAttributeStr(xeRoot, name, "Annotation");
                p.Annotation = annotation;

                string arm = ReadChildAttributeStr(xeRoot, name, "Arm", "Left");
                if (arm == ArmRobot_enum.Left.ToString())
                {
                    p.DblValue5 = 1;
                }
                else
                {
                    p.DblValue5 = 2;
                }
                return(p);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Esempio n. 2
0
        bool WriteMovePoint(XmlElement xeRoot, string name, Point5D point)
        {
            try
            {
                XmlElement xeChild = CreateNewXe(xeRoot, name);
                xeRoot.AppendChild(xeChild);

                ArmRobot_enum armRobot_e = (ArmRobot_enum)point.DblValue5 - 1;

                WriteAttribute(xeChild, "X", point.DblValue1.ToString());
                WriteAttribute(xeChild, "Y", point.DblValue2.ToString());
                WriteAttribute(xeChild, "Z", point.DblValue3.ToString());
                WriteAttribute(xeChild, "R", point.DblValue4.ToString());
                WriteAttribute(xeChild, "Arm", armRobot_e.ToString());
                WriteAttribute(xeChild, "Annotation", point.Annotation.ToString());
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }