Esempio n. 1
0
    public void btnWrite()
    {
        XMLRead bxXMLRead = new XMLRead("Boxian.xml");

        bxXMLRead.Read();
        XmlDocument doc     = bxXMLRead.XMLdoc;
        XmlNode     root    = doc.SelectSingleNode("Missions");
        XmlElement  Mission = doc.CreateElement("Mission_" + bxIndex.ToString());
        XmlElement  Log     = doc.CreateElement("Log");

        Log.InnerText = "第" + (bxIndex + 1).ToString() + "步";
        XmlElement AxisAngles = doc.CreateElement("AxisAngles");

        for (int i = 0; i < 6; i++)
        {
            XmlElement Axisangle = doc.CreateElement("Axis_" + i.ToString() + "_angle");
            Axisangle.InnerText = temp_Pos[i].ToString();
            AxisAngles.AppendChild(Axisangle);
        }
        XmlElement IO = doc.CreateElement("IO");

        IO.InnerText = "-1";
        Mission.AppendChild(Log);
        Mission.AppendChild(AxisAngles);
        Mission.AppendChild(IO);
        root.AppendChild(Mission);
        doc.Save(bxXMLRead.path);
        bxIndex++;
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     positionRead = new XMLRead("URPositions.xml");
     if (positionRead.Read())
     {
         root = positionRead.XMLdoc.SelectSingleNode("Positions");
         PositionSet(ItemName.LeftUR);
         PositionSet(ItemName.RightUR);
         PositionSet(ItemName.Zhijia);
         print("文件读取正确");
     }
     else
     {
         print("文件路径不对");
     }
 }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     xmlRead = new XMLRead("Missions.xml");
     print(xmlRead.CreatePath());
     if (xmlRead.Read())
     {
         print("文件读取正确");
         foreach (XmlElement xmlEle in xmlRead.XMLdoc.SelectSingleNode("Missions").ChildNodes)
         {
             Mission mission = new Mission(xmlEle);
             mission_List.Add(mission);
         }
     }
     else
     {
         print("文件路径不对");
     }
 }
Esempio n. 4
0
    // Start is called before the first frame update
    void Start()
    {
        //Do_Initilize();
        leftIO           = new IOManager(Toggles.Length);
        leftIO.ToggleSet = Toggles;
        leftIO.Init();
        leftIO.sleepTimeSet = sleepTime;
        for (int i = 0; i < 6; i++)
        {
            axises[i] = new AxisManager(URStore.transform.Find("Axis" + i.ToString()).gameObject);
        }
        URDateCollector.OnGetPositionSuccess += new URDateHandle.GetPositionSuccess(UpdatePositionsValue);
        URDateCollector.OnGetAngleSuccess    += new URDateHandle.GetAngleSuccess(UpdateAnglesValue);
        for (int i = 0; i < 6; i++)
        {
            temp_Pos[i] = "0.0";
        }

        //任务队列测试
        if (inTest)
        {
            txIndex = URMissionList.transform.Find("Texts").transform.Find("Index").gameObject.GetComponent <Text>();
            txLog   = URMissionList.transform.Find("Texts").transform.Find("Log").gameObject.GetComponent <Text>();
            xmlRead = new XMLRead("fangxianjia.xml");
            if (xmlRead.Read())
            {
                print("文件读取正确");
                foreach (XmlElement xmlEle in xmlRead.XMLdoc.SelectSingleNode("Missions").ChildNodes)
                {
                    Mission mission = new Mission(xmlEle);
                    mission_List.Add(mission);
                }
            }
            else
            {
                print(xmlRead.path);
                print("文件路径不对");
            }
        }
    }