Exemple #1
0
        public static void Diff(PathFile p1, PathFile p2)
        {
            List <string> diff = new List <string>();

            Diff(p1, p2, diff);

            foreach (string line in diff)
            {
                Debug.WriteLine(line);
            }
        }
Exemple #2
0
        public PathFile(PathFile pf)
        {
            Robot  = new RobotParams(pf.Robot);
            Groups = new PathGroup[pf.Groups.Length];

            for (int i = 0; i < Groups.Length; i++)
            {
                Groups[i] = new PathGroup(pf.Groups[i]);
            }

            IsDirty    = true;
            m_filename = pf.m_filename;
        }
Exemple #3
0
        protected bool GeneratePathFile(RobotParams robot, RobotPath path, string filename)
        {
            bool     ret = true;
            PathFile pf  = new PathFile();

            pf.Robot = robot;
            pf.AddPathGroup("tmp");
            pf.AddPath("tmp", path);

            string json = JsonConvert.SerializeObject(pf);

            try
            {
                File.WriteAllText(filename, json);
            }
            catch (Exception)
            {
                ret = false;
            }

            return(ret);
        }
Exemple #4
0
 public static void Diff(PathFile p1, PathFile p2, List <string> diff)
 {
     Diff(p1.Robot, p2.Robot, diff);
     Diff(p1.Groups, p2.Groups, diff);
 }
Exemple #5
0
 public UndoState(int serial, PathFile pf)
 {
     m_file           = new PathFile(pf);
     m_serial         = serial;
     m_selected_index = -1;
 }