Browse Source

🎨 Standard 'cooldown' method

vanilla_fb_2.0.x
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
d29a9014f2
  1. 3
      Marlin/src/gcode/control/M80_M81.cpp
  2. 10
      Marlin/src/lcd/e3v2/creality/dwin.cpp
  3. 13
      Marlin/src/lcd/e3v2/enhanced/dwin.cpp
  4. 23
      Marlin/src/lcd/e3v2/jyersui/dwin.cpp
  5. 7
      Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp
  6. 5
      Marlin/src/lcd/extui/ui_api.cpp
  7. 3
      Marlin/src/lcd/menu/menu_temperature.cpp
  8. 8
      Marlin/src/module/temperature.h

3
Marlin/src/gcode/control/M80_M81.cpp

@ -74,13 +74,12 @@
* This code should ALWAYS be available for FULL SHUTDOWN!
*/
void GcodeSuite::M81() {
thermalManager.disable_all_heaters();
planner.finish_and_disable();
thermalManager.cooldown();
print_job_timer.stop();
#if HAS_FAN
thermalManager.zero_fan_speeds();
#if ENABLED(PROBING_FANS_OFF)
thermalManager.fans_paused = false;
ZERO(thermalManager.saved_fan_speed);

10
Marlin/src/lcd/e3v2/creality/dwin.cpp

@ -2735,6 +2735,7 @@ void HMI_Prepare() {
queue.inject_P(G28_STR); // G28 will set home_flag
Popup_Window_Home();
break;
#if HAS_ZOFFSET_ITEM
case PREPARE_CASE_ZOFF:
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
@ -2750,6 +2751,7 @@ void HMI_Prepare() {
#endif
break;
#endif
#if HAS_PREHEAT
case PREPARE_CASE_PLA: ui.preheat_all(0); break;
#if PREHEAT_COUNT > 1
@ -2758,18 +2760,14 @@ void HMI_Prepare() {
#endif
#if HAS_HOTEND || HAS_HEATED_BED
case PREPARE_CASE_COOL:
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
#if HAS_HOTEND || HAS_HEATED_BED
thermalManager.disable_all_heaters();
#endif
break;
case PREPARE_CASE_COOL: thermalManager.cooldown(); break;
#endif
case PREPARE_CASE_LANG:
HMI_ToggleLanguage();
Draw_Prepare_Menu();
break;
default: break;
}
}

13
Marlin/src/lcd/e3v2/enhanced/dwin.cpp

@ -1787,8 +1787,7 @@ void DWIN_Print_Started(const bool sd) {
// Ended print job
void DWIN_Print_Finished() {
if (checkkey == PrintProcess || printingIsActive()) {
thermalManager.disable_all_heaters();
thermalManager.zero_fan_speeds();
thermalManager.cooldown();
HMI_flag.print_finish = true;
}
}
@ -2116,17 +2115,13 @@ void SetHome() {
#endif
#if HAS_PREHEAT
void SetCoolDown() {
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
#if HAS_HOTEND || HAS_HEATED_BED
thermalManager.disable_all_heaters();
#endif
}
void DoPreheat0() { ui.preheat_all(0); }
void DoPreheat1() { ui.preheat_all(1); }
void DoPreheat2() { ui.preheat_all(2); }
#endif
void DoCoolDown() { thermalManager.cooldown(); }
void SetLanguage() {
HMI_ToggleLanguage();
CurrentMenu = nullptr; // Invalidate menu to full redraw
@ -3126,8 +3121,8 @@ void Draw_Prepare_Menu() {
#if PREHEAT_COUNT > 2
ADDMENUITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, DoPreheat2);
#endif
ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, SetCoolDown);
#endif
ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown);
ADDMENUITEM(ICON_Language, PSTR("UI Language"), onDrawLanguage, SetLanguage);
}
CurrentMenu->draw();

23
Marlin/src/lcd/e3v2/jyersui/dwin.cpp

@ -1030,7 +1030,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
#define PREPARE_MANUALLEVEL (PREPARE_HOME + 1)
#define PREPARE_ZOFFSET (PREPARE_MANUALLEVEL + ENABLED(HAS_ZOFFSET_ITEM))
#define PREPARE_PREHEAT (PREPARE_ZOFFSET + ENABLED(HAS_PREHEAT))
#define PREPARE_COOLDOWN (PREPARE_PREHEAT + ENABLED(HAS_PREHEAT))
#define PREPARE_COOLDOWN (PREPARE_PREHEAT + EITHER(HAS_HOTEND, HAS_HEATED_BED))
#define PREPARE_CHANGEFIL (PREPARE_COOLDOWN + ENABLED(ADVANCED_PAUSE_FEATURE))
#define PREPARE_TOTAL PREPARE_CHANGEFIL
@ -1096,13 +1096,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
else
Draw_Menu(Preheat);
break;
#endif
#if HAS_HOTEND || HAS_HEATED_BED
case PREPARE_COOLDOWN:
if (draw)
Draw_Menu_Item(row, ICON_Cool, F("Cooldown"));
else {
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
thermalManager.disable_all_heaters();
}
else
thermalManager.cooldown();
break;
#endif
@ -1597,8 +1598,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
#define PREHEAT_TOTAL PREHEAT_5
auto do_preheat = [](const uint8_t m) {
thermalManager.disable_all_heaters();
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
thermalManager.cooldown();
if (preheatmode == 0 || preheatmode == 1) { ui.preheat_hotend_and_fan(m); }
if (preheatmode == 0 || preheatmode == 2) ui.preheat_bed(m);
};
@ -4496,8 +4496,7 @@ void CrealityDWINClass::Popup_Control() {
TERN_(HAS_HOTEND, pausetemp = thermalManager.temp_hotend[0].target);
TERN_(HAS_HEATED_BED, pausebed = thermalManager.temp_bed.target);
TERN_(HAS_FAN, pausefan = thermalManager.fan_speed[0]);
thermalManager.disable_all_heaters();
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
thermalManager.cooldown();
#endif
}
else {
@ -4510,8 +4509,7 @@ void CrealityDWINClass::Popup_Control() {
if (selection == 0) {
if (sdprint) {
ui.abort_print();
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
thermalManager.disable_all_heaters();
thermalManager.cooldown();
}
else {
TERN_(HOST_ACTION_COMMANDS, hostui.cancel());
@ -4741,8 +4739,7 @@ void CrealityDWINClass::Start_Print(bool sd) {
void CrealityDWINClass::Stop_Print() {
printing = false;
sdprint = false;
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
thermalManager.disable_all_heaters();
thermalManager.cooldown();
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(100 * (PROGRESS_SCALE)));
TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
Draw_Print_confirm();

7
Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp

@ -626,14 +626,11 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
default:
switch (var.VP) {
default: return;
case VP_E0_BED_PREHEAT: TERN_(HAS_HOTEND, ui.preheat_all(0)); break;
case VP_E0_BED_PREHEAT: TERN_(HAS_HOTEND, ui.preheat_all(0)); break;
case VP_E1_BED_PREHEAT: TERN_(HAS_MULTI_HOTEND, ui.preheat_all(1)); break;
}
case 7: break; // Custom preheat
case 9: // Cool down
thermalManager.zero_fan_speeds();
thermalManager.disable_all_heaters();
break;
case 9: thermalManager.cooldown(); break; // Cool down
}
// Go to the preheat screen to show the heating progress

5
Marlin/src/lcd/extui/ui_api.cpp

@ -1034,10 +1034,7 @@ namespace ExtUI {
void setFeedrate_percent(const_float_t value) { feedrate_percentage = constrain(value, 10, 500); }
void coolDown() {
thermalManager.disable_all_heaters();
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
}
void coolDown() { thermalManager.cooldown(); }
bool awaitingUserConfirm() {
return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || getHostKeepaliveIsPaused();

3
Marlin/src/lcd/menu/menu_temperature.cpp

@ -143,8 +143,7 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i
#if HAS_TEMP_HOTEND || HAS_HEATED_BED
void lcd_cooldown() {
thermalManager.zero_fan_speeds();
thermalManager.disable_all_heaters();
thermalManager.cooldown();
ui.return_to_status();
}

8
Marlin/src/module/temperature.h

@ -848,6 +848,14 @@ class Temperature {
*/
static void disable_all_heaters();
/**
* Cooldown, as from the LCD. Disables all heaters and fans.
*/
static inline void cooldown() {
zero_fan_speeds();
disable_all_heaters();
}
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
* Methods to check if heaters are enabled, indicating an active job

Loading…
Cancel
Save