public JobController.Result Start(out List <string> start_gcode) { start_gcode = null; if (MyJobImplementation == null) { return(JobController.Result.FAILED_Create); } ClearAllWarnings(); if (m_JobMode.Value == JobParams.Mode.SavingToSDCardAutoStartPrint) { m_lsAdditionalTimeRemaining = MyJobImplementation.EstimatedPrintTime; } if (!MyJobImplementation.Start(out List <string> start_gcode1)) { return(JobController.Result.FAILED_JobNotStarted); } job_timer.Restart(); if (IsSavingToSD) { if (start_gcode == null) { start_gcode = new List <string>(); } start_gcode = new List <string>() { string.Format("M28 {0}", m_sGcodeFile) }; } else if (MyJobImplementation.Details.jobParams.jobMode != JobParams.Mode.SaveToBinaryGCodeFile && MyJobImplementation.Details.jobParams.options.calibrate_before_print) { var calibrateBeforePrintZ = MyJobImplementation.Details.jobParams.options.calibrate_before_print_z; start_gcode = PrinterCalibration.CreateCalibrationGCode(PrinterCalibration.Type.G30, calibrateBeforePrintZ, 5f, m_oParentFirmwareController.MyPrinterProfile.OptionsConstants); } if (start_gcode == null) { start_gcode = start_gcode1; } else if (start_gcode1 != null) { start_gcode.AddRange(start_gcode1); } Printing = true; SaveJobState(); return(JobController.Result.Success); }
public JobController.Result ForceShutdownNow() { AbstractJob jobImplementation = MyJobImplementation; if (MyJobImplementation == null) { return(JobController.Result.FAILED_JobNotStarted); } SaveJobState(); MyJobImplementation.Stop(); job_timer.Stop(); m_oJobImplementation.Value = null; Printing = false; return(JobController.Result.Success); }
public void FinalizeEndOfJob(out List <string> end_gcode) { end_gcode = null; if (IsSavingToSD) { end_gcode = new List <string> { "M29" }; if (!m_oJobImplementation.Value.Done) { end_gcode.Add(string.Format("M30 {0}", m_sGcodeFile)); } MyJobImplementation.Stop(); } m_oJobImplementation.Value = null; SaveJobState(); }
public GCode GetNextGCode() { return(MyJobImplementation?.GetNextCommand()); }