M141 Heated Chamber, Temperature rework (#12201)
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
#include "../../module/configuration_store.h"
|
||||
#endif
|
||||
|
||||
#if WATCH_HOTENDS || WATCH_THE_BED || ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
#if WATCH_HOTENDS || WATCH_BED || ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
#include "../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
@ -405,39 +405,6 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
||||
|
||||
#endif // BABYSTEP_ZPROBE_OFFSET
|
||||
|
||||
/**
|
||||
* Watch temperature callbacks
|
||||
*/
|
||||
#if HAS_TEMP_HOTEND
|
||||
#if WATCH_HOTENDS
|
||||
#define _WATCH_FUNC(N) thermalManager.start_watching_heater(N)
|
||||
#else
|
||||
#define _WATCH_FUNC(N) NOOP
|
||||
#endif
|
||||
void watch_temp_callback_E0() { _WATCH_FUNC(0); }
|
||||
#if HOTENDS > 1
|
||||
void watch_temp_callback_E1() { _WATCH_FUNC(1); }
|
||||
#if HOTENDS > 2
|
||||
void watch_temp_callback_E2() { _WATCH_FUNC(2); }
|
||||
#if HOTENDS > 3
|
||||
void watch_temp_callback_E3() { _WATCH_FUNC(3); }
|
||||
#if HOTENDS > 4
|
||||
void watch_temp_callback_E4() { _WATCH_FUNC(4); }
|
||||
#if HOTENDS > 5
|
||||
void watch_temp_callback_E5() { _WATCH_FUNC(5); }
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
#endif // HOTENDS > 1
|
||||
#endif // HAS_TEMP_HOTEND
|
||||
|
||||
void watch_temp_callback_bed() {
|
||||
#if WATCH_THE_BED
|
||||
thermalManager.start_watching_bed();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
|
||||
void lcd_enqueue_command(const char * const cmd) {
|
||||
|
@ -340,14 +340,6 @@ void menu_move();
|
||||
void lcd_move_z();
|
||||
void _lcd_draw_homing();
|
||||
|
||||
void watch_temp_callback_E0();
|
||||
void watch_temp_callback_E1();
|
||||
void watch_temp_callback_E2();
|
||||
void watch_temp_callback_E3();
|
||||
void watch_temp_callback_E4();
|
||||
void watch_temp_callback_E5();
|
||||
void watch_temp_callback_bed();
|
||||
|
||||
#define HAS_LINE_TO_Z (ENABLED(DELTA) || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) || ENABLED(LEVEL_BED_CORNERS))
|
||||
|
||||
#if HAS_LINE_TO_Z
|
||||
|
@ -61,7 +61,7 @@ static void _change_filament_temp(const uint16_t temperature) {
|
||||
}
|
||||
inline void _lcd_change_filament_temp_1_func() { _change_filament_temp(ui.preheat_hotend_temp[0]); }
|
||||
inline void _lcd_change_filament_temp_2_func() { _change_filament_temp(ui.preheat_hotend_temp[1]); }
|
||||
inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); }
|
||||
inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.temp_hotend[_change_filament_temp_extruder].target); }
|
||||
|
||||
static PGM_P change_filament_header(const AdvancedPauseMode mode) {
|
||||
switch (mode) {
|
||||
@ -101,7 +101,7 @@ void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder)
|
||||
#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_cb);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_temp_extruder].target, EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb);
|
||||
END_MENU();
|
||||
}
|
||||
#if E_STEPPERS
|
||||
|
@ -353,9 +353,9 @@ void menu_temperature() {
|
||||
// Nozzle [1-5]:
|
||||
//
|
||||
#if HOTENDS == 1
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0);
|
||||
#else // HOTENDS > 1
|
||||
#define EDIT_TARGET(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.target_temperature[N], 0, HEATER_##N##_MAXTEMP - 15, watch_temp_callback_E##N)
|
||||
#define EDIT_TARGET(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N)
|
||||
EDIT_TARGET(0);
|
||||
EDIT_TARGET(1);
|
||||
#if HOTENDS > 2
|
||||
@ -380,7 +380,14 @@ void menu_temperature() {
|
||||
// Bed:
|
||||
//
|
||||
#if HAS_HEATED_BED
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 5, thermalManager.start_watching_bed);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Chamber:
|
||||
//
|
||||
#if HAS_HEATED_CHAMBER
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 5, thermalManager.start_watching_chamber);
|
||||
#endif
|
||||
|
||||
//
|
||||
@ -413,9 +420,9 @@ void menu_temperature() {
|
||||
// Cooldown
|
||||
//
|
||||
bool has_heat = false;
|
||||
HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; }
|
||||
HOTEND_LOOP() if (thermalManager.temp_hotend[HOTEND_INDEX].target) { has_heat = true; break; }
|
||||
#if HAS_TEMP_BED
|
||||
if (thermalManager.target_temperature_bed) has_heat = true;
|
||||
if (thermalManager.temp_bed.target) has_heat = true;
|
||||
#endif
|
||||
if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
|
||||
|
||||
|
@ -116,9 +116,9 @@ void menu_tune() {
|
||||
// Nozzle [1-4]:
|
||||
//
|
||||
#if HOTENDS == 1
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0);
|
||||
#else // HOTENDS > 1
|
||||
#define EDIT_NOZZLE(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.target_temperature[N], 0, HEATER_##N##_MAXTEMP - 15, watch_temp_callback_E##N)
|
||||
#define EDIT_NOZZLE(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N)
|
||||
EDIT_NOZZLE(0);
|
||||
EDIT_NOZZLE(1);
|
||||
#if HOTENDS > 2
|
||||
@ -143,7 +143,7 @@ void menu_tune() {
|
||||
// Bed:
|
||||
//
|
||||
#if HAS_HEATED_BED
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 15, thermalManager.start_watching_bed);
|
||||
#endif
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user