Refactor heater watch, job timer auto-start (#16725)

This commit is contained in:
Scott Lahteine
2020-01-30 03:24:43 -06:00
committed by GitHub
parent 50889c0f94
commit 9caf5c05e7
7 changed files with 113 additions and 57 deletions

View File

@ -20,6 +20,12 @@
*
*/
/**
* gcode/temperature/M104_M109.cpp
*
* Hotend target temperature control
*/
#include "../../inc/MarlinConfigPre.h"
#if EXTRUDERS
@ -73,14 +79,11 @@ void GcodeSuite::M104() {
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
* standby mode, for instance in a dual extruder setup, without affecting
* the running print timer.
* Hotends use EXTRUDE_MINTEMP / 2 to allow nozzles to be put into hot standby
* mode, for instance in a dual extruder setup, without affecting the running
* print timer.
*/
if (temp <= (EXTRUDE_MINTEMP) / 2) {
print_job_timer.stop();
ui.reset_status();
}
thermalManager.check_timer_autostart(false, true);
#endif
}
@ -90,8 +93,10 @@ void GcodeSuite::M104() {
}
/**
* M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
* Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
* M109: Sxxx Wait for hotend(s) to reach temperature. Waits only when heating.
* Rxxx Wait for hotend(s) to reach temperature. Waits when heating and cooling.
*
* With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating and stop it if turned off.
*/
void GcodeSuite::M109() {
@ -125,12 +130,7 @@ void GcodeSuite::M109() {
* standby mode, (e.g., in a dual extruder setup) without affecting
* the running print timer.
*/
if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
print_job_timer.stop();
ui.reset_status();
}
else
startOrResumeJob();
thermalManager.check_timer_autostart(true, true);
#endif
#if HAS_DISPLAY

View File

@ -20,6 +20,12 @@
*
*/
/**
* gcode/temperature/M140_M190.cpp
*
* Bed target temperature control
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HEATED_BED
@ -50,6 +56,8 @@ void GcodeSuite::M140() {
/**
* M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
*
* With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating.
*/
void GcodeSuite::M190() {
if (DEBUGGING(DRYRUN)) return;
@ -58,8 +66,7 @@ void GcodeSuite::M190() {
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetBed(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (parser.value_celsius() > BED_MINTEMP)
startOrResumeJob();
thermalManager.check_timer_autostart(true, false);
#endif
}
else return;

View File

@ -20,6 +20,12 @@
*
*/
/**
* gcode/temperature/M141_M191.cpp
*
* Chamber target temperature control
*/
#include "../../inc/MarlinConfig.h"
#if HAS_HEATED_CHAMBER
@ -59,8 +65,7 @@ void GcodeSuite::M191() {
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetChamber(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (parser.value_celsius() > CHAMBER_MINTEMP)
startOrResumeJob();
thermalManager.check_timer_autostart(true, false);
#endif
}
else return;