Browse Source

Add custom preheat temp to filament change (#11475)

pull/1/head
Marcio Teixeira 6 years ago
committed by Scott Lahteine
parent
commit
2ebfe90be9
  1. 3
      Marlin/src/lcd/language/language_en.h
  2. 26
      Marlin/src/lcd/ultralcd.cpp

3
Marlin/src/lcd/language/language_en.h

@ -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

26
Marlin/src/lcd/ultralcd.cpp

@ -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); }

Loading…
Cancel
Save