private void toolPrintJob_Click(object sender, EventArgs e) { Printjob job = conn.job; job.BeginJob(); job.PushData(textGCodePrepend.Text); job.PushData(textGCode.Text); job.PushData(textGCodeAppend.Text); job.EndJob(); }
private void toolPrintJob_Click(object sender, EventArgs e) { Printjob job = conn.job; if (job.dataComplete) { conn.pause("Press OK to continue.\n\nYou can add pauses in your code with\n@pause Some text like this"); } else { toolRunJob.Image = imageList.Images[3]; job.BeginJob(); job.PushData(editor.getContent(1)); job.PushData(editor.getContent(0)); job.PushData(editor.getContent(2)); job.EndJob(); } }
private void toolAddFile_Click(object sender, EventArgs e) { Printjob job = Main.connection.job; //if (job.mode == 1) if (job.mode == Printjob.jobMode.printingJob) { updateButtons(); return; } SDCardUpload f = SDCardUpload.Execute(); if (f.exit) { toolStatus.Text = Trans.T("L_UPLOADING_FILE..."); // "Uploading file ..."; progress.Value = 0; job.BeginJob(); job.exclusive = true; job.PushData("M28 " + (currentDirectory.Length > 0?"/":"") + currentDirectory + f.textFilename.Text); if (f.checkAppendPrepend.Checked) { job.PushGCodeShortArray(Main.main.editor.getContentArray(1)); } if (f.radioCurrent.Checked) { job.PushGCodeShortArray(Main.main.editor.getContentArray(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.PushGCodeShortArray(Main.main.editor.getContentArray(2)); } if (f.checkJobFinished.Checked) { PrinterConnection con = Main.connection; if (con.afterJobDisableExtruder) { for (int i = 0; i < Main.connection.numberExtruder; i++) { job.PushData("M104 S0 T" + i.ToString()); } } if (con.afterJobDisablePrintbed) { job.PushData("M140 S0"); } 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; startTime = DateTime.Now.Ticks; } }
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; } }