public static GCodeFile Load(string path, ILogger logger = null) { var parser = new GCodeParser(logger == null ? Services.Logger : logger); parser.Reset(); parser.ParseFile(path); return(new GCodeFile(parser.Commands) { FileName = path.Substring(path.LastIndexOf('\\') + 1) }); }