🧑💻 Preheat menu improvements (#24017)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
27b1484428
commit
01c9c26661
@ -1884,7 +1884,7 @@
|
|||||||
// @section temperature
|
// @section temperature
|
||||||
|
|
||||||
//
|
//
|
||||||
// Preheat Constants - Up to 5 are supported without changes
|
// Preheat Constants - Up to 6 are supported without changes
|
||||||
//
|
//
|
||||||
#define PREHEAT_1_LABEL "PLA"
|
#define PREHEAT_1_LABEL "PLA"
|
||||||
#define PREHEAT_1_TEMP_HOTEND 180
|
#define PREHEAT_1_TEMP_HOTEND 180
|
||||||
|
@ -1012,10 +1012,62 @@ void CrealityDWINClass::Update_Status_Bar(bool refresh/*=false*/) {
|
|||||||
/* Menu Item Config */
|
/* Menu Item Config */
|
||||||
|
|
||||||
void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/*=true*/) {
|
void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/*=true*/) {
|
||||||
uint8_t row = item - scrollpos;
|
const uint8_t row = item - scrollpos;
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
static bool level_state;
|
static bool level_state;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAS_PREHEAT
|
||||||
|
|
||||||
|
#define PREHEAT_BACK 0
|
||||||
|
#define PREHEAT_SUBMENU_HOTEND (PREHEAT_BACK + ENABLED(HAS_HOTEND))
|
||||||
|
#define PREHEAT_SUBMENU_BED (PREHEAT_SUBMENU_HOTEND + ENABLED(HAS_HEATED_BED))
|
||||||
|
#define PREHEAT_SUBMENU_FAN (PREHEAT_SUBMENU_BED + ENABLED(HAS_FAN))
|
||||||
|
#define PREHEAT_SUBMENU_TOTAL PREHEAT_SUBMENU_FAN
|
||||||
|
|
||||||
|
auto preheat_submenu = [&](const int index, const uint8_t item, const uint8_t sel) {
|
||||||
|
switch (item) {
|
||||||
|
case PREHEAT_BACK:
|
||||||
|
if (draw)
|
||||||
|
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
||||||
|
else
|
||||||
|
Draw_Menu(TempMenu, sel);
|
||||||
|
break;
|
||||||
|
#if HAS_HOTEND
|
||||||
|
case PREHEAT_SUBMENU_HOTEND:
|
||||||
|
if (draw) {
|
||||||
|
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
||||||
|
Draw_Float(ui.material_preset[index].hotend_temp, row, false, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Modify_Value(ui.material_preset[index].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
#if HAS_HEATED_BED
|
||||||
|
case PREHEAT_SUBMENU_BED:
|
||||||
|
if (draw) {
|
||||||
|
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
||||||
|
Draw_Float(ui.material_preset[index].bed_temp, row, false, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Modify_Value(ui.material_preset[index].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
#if HAS_FAN
|
||||||
|
case PREHEAT_SUBMENU_FAN:
|
||||||
|
if (draw) {
|
||||||
|
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
||||||
|
Draw_Float(ui.material_preset[index].fan_speed, row, false, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Modify_Value(ui.material_preset[index].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (menu) {
|
switch (menu) {
|
||||||
case Prepare:
|
case Prepare:
|
||||||
|
|
||||||
@ -1584,7 +1636,6 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
|
|
||||||
#if HAS_PREHEAT
|
#if HAS_PREHEAT
|
||||||
case Preheat: {
|
case Preheat: {
|
||||||
#define PREHEAT_BACK 0
|
|
||||||
#define PREHEAT_MODE (PREHEAT_BACK + 1)
|
#define PREHEAT_MODE (PREHEAT_BACK + 1)
|
||||||
#define PREHEAT_1 (PREHEAT_MODE + 1)
|
#define PREHEAT_1 (PREHEAT_MODE + 1)
|
||||||
#define PREHEAT_2 (PREHEAT_1 + (PREHEAT_COUNT >= 2))
|
#define PREHEAT_2 (PREHEAT_1 + (PREHEAT_COUNT >= 2))
|
||||||
@ -1606,6 +1657,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
else
|
else
|
||||||
Draw_Menu(Prepare, PREPARE_PREHEAT);
|
Draw_Menu(Prepare, PREPARE_PREHEAT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PREHEAT_MODE:
|
case PREHEAT_MODE:
|
||||||
if (draw) {
|
if (draw) {
|
||||||
Draw_Menu_Item(row, ICON_Homing, F("Preheat Mode"));
|
Draw_Menu_Item(row, ICON_Homing, F("Preheat Mode"));
|
||||||
@ -1615,50 +1667,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
Modify_Option(preheatmode, preheat_modes, 2);
|
Modify_Option(preheatmode, preheat_modes, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 1
|
#define _PREHEAT_CASE(N) \
|
||||||
case PREHEAT_1:
|
case PREHEAT_##N: { \
|
||||||
if (draw)
|
if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL));
|
else do_preheat(N - 1); \
|
||||||
else
|
} break;
|
||||||
do_preheat(0);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 2
|
REPEAT_1(PREHEAT_COUNT, _PREHEAT_CASE)
|
||||||
case PREHEAT_2:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL));
|
|
||||||
else
|
|
||||||
do_preheat(1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case PREHEAT_3:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL));
|
|
||||||
else
|
|
||||||
do_preheat(2);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case PREHEAT_4:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL));
|
|
||||||
else
|
|
||||||
do_preheat(3);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case PREHEAT_5:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL));
|
|
||||||
else
|
|
||||||
do_preheat(4);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
#endif // HAS_PREHEAT
|
#endif // HAS_PREHEAT
|
||||||
@ -1871,46 +1886,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
Draw_Menu(PID);
|
Draw_Menu(PID);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if PREHEAT_COUNT >= 1
|
|
||||||
case TEMP_PREHEAT1:
|
#define _TEMP_PREHEAT_CASE(N) \
|
||||||
if (draw)
|
case TEMP_PREHEAT##N: { \
|
||||||
Draw_Menu_Item(row, ICON_Step, F(PREHEAT_1_LABEL), nullptr, true);
|
if (draw) Draw_Menu_Item(row, ICON_Step, F(PREHEAT_## N ##_LABEL), nullptr, true); \
|
||||||
else
|
else Draw_Menu(Preheat##N); \
|
||||||
Draw_Menu(Preheat1);
|
} break;
|
||||||
break;
|
|
||||||
#endif
|
REPEAT_1(PREHEAT_COUNT, _TEMP_PREHEAT_CASE)
|
||||||
#if PREHEAT_COUNT >= 2
|
|
||||||
case TEMP_PREHEAT2:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Step, F(PREHEAT_2_LABEL), nullptr, true);
|
|
||||||
else
|
|
||||||
Draw_Menu(Preheat2);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case TEMP_PREHEAT3:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Step, F(PREHEAT_3_LABEL), nullptr, true);
|
|
||||||
else
|
|
||||||
Draw_Menu(Preheat3);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case TEMP_PREHEAT4:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Step, F(PREHEAT_4_LABEL), nullptr, true);
|
|
||||||
else
|
|
||||||
Draw_Menu(Preheat4);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case TEMP_PREHEAT5:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Step, F(PREHEAT_5_LABEL), nullptr, true);
|
|
||||||
else
|
|
||||||
Draw_Menu(Preheat5);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2095,255 +2078,10 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
break;
|
break;
|
||||||
#endif // HAS_HEATED_BED
|
#endif // HAS_HEATED_BED
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 1
|
#if HAS_PREHEAT
|
||||||
case Preheat1:
|
#define _PREHEAT_SUBMENU_CASE(N) case Preheat##N: preheat_submenu(N, item, TEMP_PREHEAT##N); break;
|
||||||
|
REPEAT_1(PREHEAT_COUNT, _PREHEAT_SUBMENU_CASE)
|
||||||
#define PREHEAT1_BACK 0
|
|
||||||
#define PREHEAT1_HOTEND (PREHEAT1_BACK + ENABLED(HAS_HOTEND))
|
|
||||||
#define PREHEAT1_BED (PREHEAT1_HOTEND + ENABLED(HAS_HEATED_BED))
|
|
||||||
#define PREHEAT1_FAN (PREHEAT1_BED + ENABLED(HAS_FAN))
|
|
||||||
#define PREHEAT1_TOTAL PREHEAT1_FAN
|
|
||||||
|
|
||||||
switch (item) {
|
|
||||||
case PREHEAT1_BACK:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
|
||||||
else
|
|
||||||
Draw_Menu(TempMenu, TEMP_PREHEAT1);
|
|
||||||
break;
|
|
||||||
#if HAS_HOTEND
|
|
||||||
case PREHEAT1_HOTEND:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
|
||||||
Draw_Float(ui.material_preset[0].hotend_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[0].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#if HAS_HEATED_BED
|
|
||||||
case PREHEAT1_BED:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
|
||||||
Draw_Float(ui.material_preset[0].bed_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[0].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_FAN
|
|
||||||
case PREHEAT1_FAN:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
|
||||||
Draw_Float(ui.material_preset[0].fan_speed, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[0].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // PREHEAT_COUNT >= 1
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 2
|
|
||||||
case Preheat2:
|
|
||||||
|
|
||||||
#define PREHEAT2_BACK 0
|
|
||||||
#define PREHEAT2_HOTEND (PREHEAT2_BACK + ENABLED(HAS_HOTEND))
|
|
||||||
#define PREHEAT2_BED (PREHEAT2_HOTEND + ENABLED(HAS_HEATED_BED))
|
|
||||||
#define PREHEAT2_FAN (PREHEAT2_BED + ENABLED(HAS_FAN))
|
|
||||||
#define PREHEAT2_TOTAL PREHEAT2_FAN
|
|
||||||
|
|
||||||
switch (item) {
|
|
||||||
case PREHEAT2_BACK:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
|
||||||
else
|
|
||||||
Draw_Menu(TempMenu, TEMP_PREHEAT2);
|
|
||||||
break;
|
|
||||||
#if HAS_HOTEND
|
|
||||||
case PREHEAT2_HOTEND:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
|
||||||
Draw_Float(ui.material_preset[1].hotend_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[1].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_HEATED_BED
|
|
||||||
case PREHEAT2_BED:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
|
||||||
Draw_Float(ui.material_preset[1].bed_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[1].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_FAN
|
|
||||||
case PREHEAT2_FAN:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
|
||||||
Draw_Float(ui.material_preset[1].fan_speed, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[1].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // PREHEAT_COUNT >= 2
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case Preheat3:
|
|
||||||
|
|
||||||
#define PREHEAT3_BACK 0
|
|
||||||
#define PREHEAT3_HOTEND (PREHEAT3_BACK + ENABLED(HAS_HOTEND))
|
|
||||||
#define PREHEAT3_BED (PREHEAT3_HOTEND + ENABLED(HAS_HEATED_BED))
|
|
||||||
#define PREHEAT3_FAN (PREHEAT3_BED + ENABLED(HAS_FAN))
|
|
||||||
#define PREHEAT3_TOTAL PREHEAT3_FAN
|
|
||||||
|
|
||||||
switch (item) {
|
|
||||||
case PREHEAT3_BACK:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
|
||||||
else
|
|
||||||
Draw_Menu(TempMenu, TEMP_PREHEAT3);
|
|
||||||
break;
|
|
||||||
#if HAS_HOTEND
|
|
||||||
case PREHEAT3_HOTEND:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
|
||||||
Draw_Float(ui.material_preset[2].hotend_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[2].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_HEATED_BED
|
|
||||||
case PREHEAT3_BED:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
|
||||||
Draw_Float(ui.material_preset[2].bed_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[2].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_FAN
|
|
||||||
case PREHEAT3_FAN:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
|
||||||
Draw_Float(ui.material_preset[2].fan_speed, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[2].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // PREHEAT_COUNT >= 3
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case Preheat4:
|
|
||||||
|
|
||||||
#define PREHEAT4_BACK 0
|
|
||||||
#define PREHEAT4_HOTEND (PREHEAT4_BACK + ENABLED(HAS_HOTEND))
|
|
||||||
#define PREHEAT4_BED (PREHEAT4_HOTEND + ENABLED(HAS_HEATED_BED))
|
|
||||||
#define PREHEAT4_FAN (PREHEAT4_BED + ENABLED(HAS_FAN))
|
|
||||||
#define PREHEAT4_TOTAL PREHEAT4_FAN
|
|
||||||
|
|
||||||
switch (item) {
|
|
||||||
case PREHEAT4_BACK:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
|
||||||
else
|
|
||||||
Draw_Menu(TempMenu, TEMP_PREHEAT4);
|
|
||||||
break;
|
|
||||||
#if HAS_HOTEND
|
|
||||||
case PREHEAT4_HOTEND:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
|
||||||
Draw_Float(ui.material_preset[3].hotend_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[3].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_HEATED_BED
|
|
||||||
case PREHEAT4_BED:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
|
||||||
Draw_Float(ui.material_preset[3].bed_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[3].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_FAN
|
|
||||||
case PREHEAT4_FAN:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
|
||||||
Draw_Float(ui.material_preset[3].fan_speed, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[3].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // PREHEAT_COUNT >= 4
|
|
||||||
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case Preheat5:
|
|
||||||
|
|
||||||
#define PREHEAT5_BACK 0
|
|
||||||
#define PREHEAT5_HOTEND (PREHEAT5_BACK + ENABLED(HAS_HOTEND))
|
|
||||||
#define PREHEAT5_BED (PREHEAT5_HOTEND + ENABLED(HAS_HEATED_BED))
|
|
||||||
#define PREHEAT5_FAN (PREHEAT5_BED + ENABLED(HAS_FAN))
|
|
||||||
#define PREHEAT5_TOTAL PREHEAT5_FAN
|
|
||||||
|
|
||||||
switch (item) {
|
|
||||||
case PREHEAT5_BACK:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Back, F("Back"));
|
|
||||||
else
|
|
||||||
Draw_Menu(TempMenu, TEMP_PREHEAT5);
|
|
||||||
break;
|
|
||||||
#if HAS_HOTEND
|
|
||||||
case PREHEAT5_HOTEND:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend"));
|
|
||||||
Draw_Float(ui.material_preset[4].hotend_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[4].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_HEATED_BED
|
|
||||||
case PREHEAT5_BED:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed"));
|
|
||||||
Draw_Float(ui.material_preset[4].bed_temp, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[4].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if HAS_FAN
|
|
||||||
case PREHEAT5_FAN:
|
|
||||||
if (draw) {
|
|
||||||
Draw_Menu_Item(row, ICON_FanSpeed, F("Fan"));
|
|
||||||
Draw_Float(ui.material_preset[4].fan_speed, row, false, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Modify_Value(ui.material_preset[4].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // PREHEAT_COUNT >= 5
|
|
||||||
|
|
||||||
case Motion:
|
case Motion:
|
||||||
|
|
||||||
@ -3855,6 +3593,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if HAS_PREHEAT && HAS_HOTEND
|
||||||
|
|
||||||
case PreheatHotend:
|
case PreheatHotend:
|
||||||
|
|
||||||
#define PREHEATHOTEND_BACK 0
|
#define PREHEATHOTEND_BACK 0
|
||||||
@ -3918,46 +3658,16 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if PREHEAT_COUNT >= 1
|
|
||||||
case PREHEATHOTEND_1:
|
|
||||||
if (draw)
|
#define _PREHEAT_HOTEND_CASE(N) \
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL));
|
case PREHEATHOTEND_##N: \
|
||||||
else
|
if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \
|
||||||
ui.preheat_hotend_and_fan(0);
|
else ui.preheat_hotend_and_fan((N) - 1); \
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 2
|
REPEAT_1(PREHEAT_COUNT, _PREHEAT_HOTEND_CASE)
|
||||||
case PREHEATHOTEND_2:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL));
|
|
||||||
else
|
|
||||||
ui.preheat_hotend_and_fan(1);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case PREHEATHOTEND_3:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL));
|
|
||||||
else
|
|
||||||
ui.preheat_hotend_and_fan(2);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case PREHEATHOTEND_4:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL));
|
|
||||||
else
|
|
||||||
ui.preheat_hotend_and_fan(3);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case PREHEATHOTEND_5:
|
|
||||||
if (draw)
|
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL));
|
|
||||||
else
|
|
||||||
ui.preheat_hotend_and_fan(4);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case PREHEATHOTEND_CUSTOM:
|
case PREHEATHOTEND_CUSTOM:
|
||||||
if (draw) {
|
if (draw) {
|
||||||
Draw_Menu_Item(row, ICON_Temperature, F("Custom"));
|
Draw_Menu_Item(row, ICON_Temperature, F("Custom"));
|
||||||
@ -3968,6 +3678,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#endif // HAS_PREHEAT && HAS_HOTEND
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3998,20 +3710,9 @@ FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) {
|
|||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
case BedPID: return F("Bed PID Settings");
|
case BedPID: return F("Bed PID Settings");
|
||||||
#endif
|
#endif
|
||||||
#if PREHEAT_COUNT >= 1
|
#if HAS_PREHEAT
|
||||||
case Preheat1: return F(PREHEAT_1_LABEL " Settings");
|
#define _PREHEAT_TITLE_CASE(N) case Preheat##N: return F(PREHEAT_## N ##_LABEL " Settings");
|
||||||
#endif
|
REPEAT_1(PREHEAT_COUNT, _PREHEAT_TITLE_CASE)
|
||||||
#if PREHEAT_COUNT >= 2
|
|
||||||
case Preheat2: return F(PREHEAT_2_LABEL " Settings");
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case Preheat3: return F(PREHEAT_3_LABEL " Settings");
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case Preheat4: return F(PREHEAT_4_LABEL " Settings");
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case Preheat5: return F(PREHEAT_5_LABEL " Settings");
|
|
||||||
#endif
|
#endif
|
||||||
case Motion: return F("Motion Settings");
|
case Motion: return F("Motion Settings");
|
||||||
case HomeOffsets: return F("Home Offsets");
|
case HomeOffsets: return F("Home Offsets");
|
||||||
@ -4074,20 +3775,9 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) {
|
|||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
case BedPID: return BEDPID_TOTAL;
|
case BedPID: return BEDPID_TOTAL;
|
||||||
#endif
|
#endif
|
||||||
#if PREHEAT_COUNT >= 1
|
#if HAS_PREHEAT
|
||||||
case Preheat1: return PREHEAT1_TOTAL;
|
case Preheat1 ... CAT(Preheat, PREHEAT_COUNT):
|
||||||
#endif
|
return PREHEAT_SUBMENU_TOTAL;
|
||||||
#if PREHEAT_COUNT >= 2
|
|
||||||
case Preheat2: return PREHEAT2_TOTAL;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 3
|
|
||||||
case Preheat3: return PREHEAT3_TOTAL;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 4
|
|
||||||
case Preheat4: return PREHEAT4_TOTAL;
|
|
||||||
#endif
|
|
||||||
#if PREHEAT_COUNT >= 5
|
|
||||||
case Preheat5: return PREHEAT5_TOTAL;
|
|
||||||
#endif
|
#endif
|
||||||
case Motion: return MOTION_TOTAL;
|
case Motion: return MOTION_TOTAL;
|
||||||
case HomeOffsets: return HOMEOFFSETS_TOTAL;
|
case HomeOffsets: return HOMEOFFSETS_TOTAL;
|
||||||
@ -4118,7 +3808,11 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) {
|
|||||||
case LevelManual: return LEVELING_M_TOTAL;
|
case LevelManual: return LEVELING_M_TOTAL;
|
||||||
#endif
|
#endif
|
||||||
case Tune: return TUNE_TOTAL;
|
case Tune: return TUNE_TOTAL;
|
||||||
|
|
||||||
|
#if HAS_PREHEAT && HAS_HOTEND
|
||||||
case PreheatHotend: return PREHEATHOTEND_TOTAL;
|
case PreheatHotend: return PREHEATHOTEND_TOTAL;
|
||||||
|
#endif
|
||||||
|
|
||||||
case ColorSettings: return COLORSETTINGS_TOTAL;
|
case ColorSettings: return COLORSETTINGS_TOTAL;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -60,11 +60,10 @@ enum menuID : uint8_t {
|
|||||||
PID,
|
PID,
|
||||||
HotendPID,
|
HotendPID,
|
||||||
BedPID,
|
BedPID,
|
||||||
Preheat1,
|
#if HAS_PREHEAT
|
||||||
Preheat2,
|
#define _PREHEAT_ID(N) Preheat##N,
|
||||||
Preheat3,
|
REPEAT_1(PREHEAT_COUNT, _PREHEAT_ID)
|
||||||
Preheat4,
|
#endif
|
||||||
Preheat5,
|
|
||||||
Motion,
|
Motion,
|
||||||
HomeOffsets,
|
HomeOffsets,
|
||||||
MaxSpeed,
|
MaxSpeed,
|
||||||
|
@ -211,26 +211,13 @@ void _lcd_ubl_edit_mesh() {
|
|||||||
#if HAS_PREHEAT
|
#if HAS_PREHEAT
|
||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
||||||
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M)))
|
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M)));
|
||||||
#else
|
#else
|
||||||
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
#define VALIDATE_MESH_GCODE_ITEM(M) \
|
||||||
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M)))
|
GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M)));
|
||||||
#endif
|
#endif
|
||||||
|
REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM)
|
||||||
VALIDATE_MESH_GCODE_ITEM(0);
|
|
||||||
#if PREHEAT_COUNT > 1
|
|
||||||
VALIDATE_MESH_GCODE_ITEM(1);
|
|
||||||
#if PREHEAT_COUNT > 2
|
|
||||||
VALIDATE_MESH_GCODE_ITEM(2);
|
|
||||||
#if PREHEAT_COUNT > 3
|
|
||||||
VALIDATE_MESH_GCODE_ITEM(3);
|
|
||||||
#if PREHEAT_COUNT > 4
|
|
||||||
VALIDATE_MESH_GCODE_ITEM(4);
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif // HAS_PREHEAT
|
|
||||||
ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh);
|
ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh);
|
||||||
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
|
||||||
END_MENU();
|
END_MENU();
|
||||||
|
Loading…
Reference in New Issue
Block a user