1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Add hotEnough methods

This commit is contained in:
Scott Lahteine 2018-01-22 04:29:29 -06:00
parent 7a52dfad55
commit 61bf8478a2
3 changed files with 18 additions and 15 deletions

View File

@ -287,7 +287,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
COPY(resume_position, current_position);
// Initial retract before move to filament change position
if (retract && !thermalManager.tooColdToExtrude(active_extruder))
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
// Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
@ -397,7 +397,7 @@ void resume_print(const float &load_length/*=0*/, const float &extrude_length/*=
thermalManager.reset_heater_idle_timer(e);
}
if (nozzle_timed_out || !thermalManager.tooColdToExtrude(active_extruder)) {
if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) {
// Load the new filament
load_filament(load_length, extrude_length, max_beep_count, true, nozzle_timed_out);
}

View File

@ -1402,7 +1402,7 @@ void kill_screen(const char* lcd_msg) {
//
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (!thermalManager.targetTooColdToExtrude(active_extruder))
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0"));
else
MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change);
@ -2608,7 +2608,7 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
if (!IS_SD_FILE_OPEN) {
#if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (!thermalManager.targetTooColdToExtrude(active_extruder))
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0"));
else
MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change);
@ -4282,21 +4282,21 @@ void kill_screen(const char* lcd_msg) {
// Unload filament
#if E_STEPPERS == 1
if (!thermalManager.targetTooColdToExtrude(active_extruder))
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, lcd_temp_menu_e0_filament_unload);
#else
#if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
if (!thermalManager.targetTooColdToExtrude(0)
if (thermalManager.targetHotEnoughToExtrude(0)
#if E_STEPPERS > 1
&& !thermalManager.targetTooColdToExtrude(1)
&& thermalManager.targetHotEnoughToExtrude(1)
#if E_STEPPERS > 2
&& !thermalManager.targetTooColdToExtrude(2)
&& thermalManager.targetHotEnoughToExtrude(2)
#if E_STEPPERS > 3
&& !thermalManager.targetTooColdToExtrude(3)
&& thermalManager.targetHotEnoughToExtrude(3)
#if E_STEPPERS > 4
&& !thermalManager.targetTooColdToExtrude(4)
&& thermalManager.targetHotEnoughToExtrude(4)
#endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2
@ -4306,26 +4306,26 @@ void kill_screen(const char* lcd_msg) {
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, lcd_unload_filament_all_temp_menu);
#endif
if (!thermalManager.targetTooColdToExtrude(0))
if (thermalManager.targetHotEnoughToExtrude(0))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, lcd_temp_menu_e0_filament_unload);
if (!thermalManager.targetTooColdToExtrude(1))
if (thermalManager.targetHotEnoughToExtrude(1))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, lcd_temp_menu_e1_filament_unload);
#if E_STEPPERS > 2
if (!thermalManager.targetTooColdToExtrude(2))
if (thermalManager.targetHotEnoughToExtrude(2))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, lcd_temp_menu_e2_filament_unload);
#if E_STEPPERS > 3
if (!thermalManager.targetTooColdToExtrude(3))
if (thermalManager.targetHotEnoughToExtrude(3))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, lcd_temp_menu_e3_filament_unload);
#if E_STEPPERS > 4
if (!thermalManager.targetTooColdToExtrude(4))
if (thermalManager.targetHotEnoughToExtrude(4))
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4"));
else
MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, lcd_temp_menu_e4_filament_unload);

View File

@ -188,6 +188,9 @@ class Temperature {
FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; }
#endif
FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); }
FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); }
private:
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)