Add custom preheat temp to filament change (#11475)

This commit is contained in:
Marcio Teixeira 2018-09-10 01:51:46 -06:00 committed by Scott Lahteine
parent 69d0ed5791
commit 2ebfe90be9
2 changed files with 25 additions and 4 deletions

View File

@ -154,6 +154,9 @@
#ifndef MSG_PREHEAT_2_SETTINGS
#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf")
#endif
#ifndef MSG_PREHEAT_CUSTOM
#define MSG_PREHEAT_CUSTOM _UxGT("Preheat Custom")
#endif
#ifndef MSG_COOLDOWN
#define MSG_COOLDOWN _UxGT("Cooldown")
#endif

View File

@ -4330,14 +4330,15 @@ void lcd_quick_feedback(const bool clear_buttons) {
return PSTR(MSG_FILAMENTCHANGE);
}
void _change_filament_temp(const uint8_t index) {
void _change_filament_temp(const uint16_t temperature) {
char cmd[11];
sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder);
thermalManager.setTargetHotend(index == 1 ? PREHEAT_1_TEMP_HOTEND : PREHEAT_2_TEMP_HOTEND, _change_filament_temp_extruder);
thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder);
lcd_enqueue_command(cmd);
}
void _lcd_change_filament_temp_1_menu() { _change_filament_temp(1); }
void _lcd_change_filament_temp_2_menu() { _change_filament_temp(2); }
void _lcd_change_filament_temp_1_menu() { _change_filament_temp(PREHEAT_1_TEMP_HOTEND); }
void _lcd_change_filament_temp_2_menu() { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
void _lcd_change_filament_temp_custom_menu() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); }
static const char* change_filament_header(const AdvancedPauseMode mode) {
switch (mode) {
@ -4358,6 +4359,23 @@ void lcd_quick_feedback(const bool clear_buttons) {
MENU_BACK(MSG_FILAMENTCHANGE);
MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu);
MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu);
uint16_t max_temp;
switch (extruder) {
default: max_temp = HEATER_0_MAXTEMP;
#if HOTENDS > 1
case 1: max_temp = HEATER_1_MAXTEMP; break;
#if HOTENDS > 2
case 2: max_temp = HEATER_2_MAXTEMP; break;
#if HOTENDS > 3
case 3: max_temp = HEATER_3_MAXTEMP; break;
#if HOTENDS > 4
case 4: max_temp = HEATER_4_MAXTEMP; break;
#endif
#endif
#endif
#endif
}
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_menu);
END_MENU();
}
void lcd_temp_menu_e0_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); }