public GCodeFile Parse(TextReader input) { GCodeFile file = new GCodeFile(); int lines = 0; while (input.Peek() >= 0) { string line = input.ReadLine(); int nLineNum = lines++; GCodeLine l = ParseLine(line, nLineNum); file.AppendLine(l); } return(file); }
public virtual void Interpret(GCodeFile file, InterpretArgs args) { IEnumerable <GCodeLine> lines_enum = (args.HasTypeFilter) ? file.AllLines() : file.AllLinesOfType(args.eTypeFilter); listener.Begin(); foreach (GCodeLine line in lines_enum) { if (line.type == GCodeLine.LType.GCode) { Action <GCodeLine> parseF; if (GCodeMap.TryGetValue(line.code, out parseF)) { parseF(line); } } } listener.End(); }
public GCodeFileAccumulator(GCodeFile useFile = null) { File = (useFile != null) ? useFile : new GCodeFile(); }
public void SaveGCode(TextWriter output, GCodeFile file) { StandardGCodeWriter writer = new StandardGCodeWriter(); writer.WriteFile(file, output); }
public void Reset() { File = new GCodeFile(); }
public virtual void SaveGCodeToFile(TextWriter output, GCodeFile file) { Writer.WriteFile(file, output); }