コード例 #1
0
        public static GCodeFile FromList(IEnumerable <string> file)
        {
            GCodeParser.Reset();
            GCodeParser.Parse(file);

            GCodeFile gcodeFile = new GCodeFile(GCodeParser.Commands)
            {
                FileName = "output.nc"
            };

            gcodeFile.Warnings.InsertRange(0, GCodeParser.Warnings);
            return(gcodeFile);
        }
コード例 #2
0
        public static GCodeFile Load(string path)
        {
            GCodeParser.Reset();
            GCodeParser.ParseFile(path);

            GCodeFile gcodeFile = new GCodeFile(GCodeParser.Commands)
            {
                FileName = path.Substring(path.LastIndexOf('\\') + 1)
            };

            gcodeFile.Warnings.InsertRange(0, GCodeParser.Warnings);
            return(gcodeFile);
        }