public void Run(PrinterConnection printerConnection) { if (printerConnection.IsConnected) { printerConnection.MacroStart(); printerConnection.QueueLine(GCode); if (GCode.Contains(MacroProcessingStream.MacroPrefix)) { printerConnection.QueueLine("\n" + MacroProcessingStream.MacroPrefix + "close()"); } } }
public void Save() { if (!changed) { return; // nothing changed } string cmdsteps = "M92 X" + sx + " Y" + sy + " Z" + sz + " E" + se; string cmdfeed = "M203 X" + fx + " Y" + fy + " Z" + fz + " E" + fe; string cmdmacc = "M201 X" + ax + " Y" + ay + " Z" + az + " E" + ae; string cmdacc = "M204"; if (acc_printing_moves_legacy != "0") { cmdacc += $" S{acc_printing_moves_legacy}"; } if (acc_printing_moves != "0") { cmdacc += $" P{acc_printing_moves}"; } if (acc_travel_moves != "0") { cmdacc += $" T{acc_travel_moves}"; } if (acc_retraction != "0") { cmdacc += $" R{acc_retraction}"; } string cmdav = "M205 S" + avs + " T" + avt + " B" + avb + " X" + avx + " Z" + avz; if (avj != "0") { cmdav += " J" + avj; } string cmdho = "M206 X" + hox + " Y" + hoy + " Z" + hoz; string cmdpid = "M301 P" + ppid + " I" + ipid + " D" + dpid; // string cmdbed_pid = "M304 P" + bed_ppid + " I" + bed_ipid + " D" + bed_dpid; printerConnection.QueueLine(cmdsteps); printerConnection.QueueLine(cmdfeed); printerConnection.QueueLine(cmdmacc); printerConnection.QueueLine(cmdacc); printerConnection.QueueLine(cmdav); printerConnection.QueueLine(cmdho); if (hasPID) { printerConnection.QueueLine(cmdpid); } changed = false; }
public static void Run(this GCodeMacro macro, PrinterConnection printerConnection) { if (printerConnection.IsConnected) { printerConnection.MacroStart(); printerConnection.QueueLine(macro.GCode); } }
public void Run(PrinterConnection printerConnection) { if (printerConnection.IsConnected) { printerConnection.MacroStart(); printerConnection.QueueLine(GCode); } }
public void Save(PrinterConnection printerConnection) { if (!changed) { return; } string cmd = "M206 T" + type + " P" + position + " "; if (type == 3) { cmd += "X" + value; } else { cmd += "S" + value; } printerConnection.QueueLine(cmd); changed = false; }
public void AskPrinterForSettings(PrinterConnection printerConnection) { printerConnection.QueueLine("M205"); }