|
45 | 45 |
|
46 | 46 | #if HAS_PREHEAT
|
47 | 47 |
|
48 |
| - /** |
49 |
| - * @fn Temperature::lcd_preheat |
50 |
| - * @brief Apply the "preheat" parameters for a material preset to the |
51 |
| - * hotend (or laser), bed, chamber, or all of the above. |
52 |
| - * @param m Material index |
53 |
| - * @param targets Bit mask of targets to "preheat" (or turn off) |
54 |
| - * @param e Extruder index (if needed) |
55 |
| - */ |
56 |
| - void Temperature::lcd_preheat(const uint8_t m, const uint8_t targets, const uint8_t e/*=0*/) { |
57 |
| - UNUSED(e); |
58 |
| - #if HAS_HOTEND |
59 |
| - if (targets & PreheatTarget::HOTEND) setTargetHotend(ui.material_preset[m].hotend_temp, e); |
60 |
| - #endif |
61 |
| - #if HAS_HEATED_BED |
62 |
| - if (targets & PreheatTarget::BED) setTargetBed(ui.material_preset[m].bed_temp); |
63 |
| - #endif |
64 |
| - #if HAS_HEATED_CHAMBER |
65 |
| - if (targets & PreheatTarget::CHAMBER) setTargetChamber(ui.material_preset[m].chamber_temp); |
66 |
| - #endif |
67 |
| - #if HAS_FAN |
68 |
| - if (targets & PreheatTarget::HOTEND) { |
69 |
| - const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0; |
70 |
| - if (true |
71 |
| - #if REDUNDANT_PART_COOLING_FAN |
72 |
| - && fan_index != REDUNDANT_PART_COOLING_FAN |
73 |
| - #endif |
74 |
| - ) set_fan_speed(fan_index, ui.material_preset[m].fan_speed); |
75 |
| - } |
76 |
| - #endif |
77 |
| - ui.return_to_status(); |
78 |
| - } |
79 |
| - |
80 | 48 | #if HAS_TEMP_HOTEND
|
81 |
| - inline void _preheat_end(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::HOTEND, e); } |
82 |
| - void do_preheat_end_m() { _preheat_end(0, editable.int8); } |
| 49 | + inline void _preheat_end(const uint8_t m, const uint8_t e) { ui.preheat_hotend(m, e); ui.return_to_status(); } |
| 50 | + void do_preheat_end_m() { _preheat_end(editable.int8, 0); } |
83 | 51 | #endif
|
84 | 52 | #if HAS_HEATED_BED
|
85 |
| - inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::BED); } |
| 53 | + inline void _preheat_bed(const uint8_t m) { ui.preheat_bed(m); ui.return_to_status(); } |
86 | 54 | #endif
|
87 | 55 | #if HAS_HEATED_CHAMBER
|
88 |
| - inline void _preheat_chamber(const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::CHAMBER); } |
| 56 | + inline void _preheat_chamber(const uint8_t m) { ui.preheat_chamber(m); ui.return_to_status(); } |
89 | 57 | #endif
|
90 | 58 | #if HAS_COOLER
|
91 |
| - inline void _precool_laser(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::HOTEND, e); } |
92 |
| - void do_precool_laser_m() { _precool_laser(thermalManager.temp_cooler.target, editable.int8); } |
| 59 | + inline void _precool_laser(const uint8_t m, const uint8_t e) { ui.preheat_hotend(m, e); ui.return_to_status(); } |
| 60 | + void do_precool_laser_m() { _precool_laser(editable.int8, thermalManager.temp_cooler.target); } |
93 | 61 | #endif
|
94 | 62 |
|
95 | 63 | #if HAS_TEMP_HOTEND && (HAS_HEATED_BED || HAS_HEATED_CHAMBER)
|
96 |
| - inline void _preheat_all(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::ALL, e); } |
| 64 | + inline void _preheat_all(const uint8_t m, const uint8_t e) { ui.preheat_all(m, e); ui.return_to_status(); } |
97 | 65 |
|
98 | 66 | // Indexed "Preheat ABC" and "Heat Bed" items
|
99 | 67 | #define PREHEAT_ITEMS(M,E) do{ \
|
100 |
| - ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_all(MenuItemBase::itemIndex, M); }); \ |
101 |
| - ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(MenuItemBase::itemIndex, M); }); \ |
| 68 | + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_all(M, MenuItemBase::itemIndex); }); \ |
| 69 | + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \ |
102 | 70 | }while(0)
|
103 | 71 |
|
104 | 72 | #elif HAS_MULTI_HOTEND
|
105 | 73 |
|
106 | 74 | // No heated bed, so just indexed "Preheat ABC" items
|
107 |
| - #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(MenuItemBase::itemIndex, M); }) |
| 75 | + #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) |
108 | 76 |
|
109 | 77 | #endif
|
110 | 78 |
|
|
121 | 89 | #if HOTENDS == 1
|
122 | 90 |
|
123 | 91 | #if HAS_HEATED_BED || HAS_HEATED_CHAMBER
|
124 |
| - ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_all(0, editable.int8); }); |
| 92 | + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_all(editable.int8, 0); }); |
125 | 93 | ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m);
|
126 | 94 | #else
|
127 | 95 | ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m);
|
|
0 commit comments