private void sendDebug() { if (con.serial == null && !con.isVirtualActive) { return; } int v = 0; if (switchEcho.On) { v += 1; } if (switchInfo.On) { v += 2; } if (switchErrors.On) { v += 4; } if (switchDryRun.On) { v += 8; } con.GetInjectLock(); con.injectManualCommand("M111 S" + v); con.ReturnInjectLock(); }
public void DoEndKillActions() { if (exclusive) // not a normal print job { exclusive = false; return; } con.GetInjectLock(); if (con.afterJobDisableExtruder) { con.injectManualCommand("M104 S0"); } if (con.afterJobDisablePrintbed) { con.injectManualCommand("M140 S0"); } con.ReturnInjectLock(); if (con.afterJobGoDispose) { con.doDispose(); } if (con.afterJobDisableMotors) { con.injectManualCommand("M84"); } }
private void toolAddFile_Click(object sender, EventArgs e) { Printjob job = Main.conn.job; if (job.hasData()) { updateButtons(); return; } SDCardUpload f = SDCardUpload.Execute(); if (f.exit) { toolStatus.Text = "Uploading file ..."; progress.Value = 0; job.BeginJob(); job.exclusive = true; job.PushData("M28 " + f.textFilename.Text); if (f.checkAppendPrepend.Checked) { job.PushData(Main.main.editor.getContent(1)); } if (f.radioCurrent.Checked) { job.PushData(Main.main.editor.getContent(0)); } else { try { job.PushData(System.IO.File.ReadAllText(f.extFilename.Text)); } catch (Exception ex) { job.exclusive = false; job.BeginJob(); job.EndJob(); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } if (f.checkAppendPrepend.Checked) { job.PushData(Main.main.editor.getContent(2)); } if (f.checkJobFinished.Checked) { PrinterConnection con = Main.conn; if (con.afterJobDisableExtruder) { job.PushData("M104 S0"); } if (con.afterJobDisablePrintbed) { job.PushData("M140 S0"); } con.ReturnInjectLock(); if (con.afterJobGoDispose) { job.PushData("G90"); job.PushData("G1 X" + con.disposeX.ToString(GCode.format) + " Y" + con.disposeY.ToString(GCode.format) + " F" + con.travelFeedRate.ToString(GCode.format)); } } job.PushData("M29"); job.EndJob(); uploading = true; } }