Add hotEnough methods

This commit is contained in:
Scott Lahteine 2018-01-20 18:40:00 -06:00
parent 74873f377d
commit c970869d74
3 changed files with 18 additions and 15 deletions

View File

@ -6493,7 +6493,7 @@ inline void gcode_M17() {
COPY(resume_position, current_position); COPY(resume_position, current_position);
// Initial retract before move to filament change 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); 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) // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
@ -6603,7 +6603,7 @@ inline void gcode_M17() {
thermalManager.reset_heater_idle_timer(e); 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 the new filament
load_filament(load_length, extrude_length, max_beep_count, true, nozzle_timed_out); load_filament(load_length, extrude_length, max_beep_count, true, nozzle_timed_out);
} }

View File

@ -196,6 +196,9 @@ class Temperature {
FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; }
#endif #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: private:
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)

View File

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