示例#1
0
        public NcFileParser()
        {
            path       = new ToolPath();
            splitters  = new string[] { " " };
            pathGCodes = new string[] { "G0", "G00", "G1", "G01", "G2", "G02", "G3", "G03", "G4", "G04" };
            mCodes     = new string[] { "M61", "M62", "M63", "M64", "M65", "M66" };
            pathStart  = new string[] { "START", "M61 " };
            pathEnd    = new string[] { "END", "M62" };
            invFCode   = "G93";
            //_mcodeDictionary = new MCodeDictionary();
            //mCodes = machineMCodes;
            n = "N";

            g = "G";
            x = "X";
            y = "Y";
            z = "Z";
            i = "I";
            j = "J";
            k = "K";
            a = "A";
            b = "B";
            c = "C";
            m = "M";
            f = "F";
        }
示例#2
0
        private IToolpath CreatePath(List <string> file, string filename)
        {
            try
            {
                IToolpath  toolpath = new ToolPath();
                NCFileType fileType = selectFileType(filename);
                if (file.Count > 0)
                {
                    switch (fileType)
                    {
                    case NCFileType.NCIFile:
                        NciFileParser ncifile = new NciFileParser();
                        toolpath = ncifile.ParsePath(file);
                        break;

                    case NCFileType.NCMachiningFile:

                        NcFileParser ncfile = new NcFileParser();
                        toolpath = ncfile.ParsePath(file);
                        break;
                    }
                }
                else
                {
                    throw new Exception("NC file is empty");
                }
                return(toolpath);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
        public List <string> Build(ToolPath path, bool invertFeedrates, List <string> header)
        {
            invertF = invertFeedrates;
            var file = new List <string>();

            file.AddRange(header);
            foreach (var pe in path)
            {
                file.Add(BuildLine(pe));
            }
            return(file);
        }
示例#4
0
 public NciFileParser()
 {
     toolpath = new ToolPath();
 }