M141 Heated Chamber, Temperature rework (#12201)

This commit is contained in:
3dlabsio
2019-03-07 00:09:39 -08:00
committed by Scott Lahteine
parent 44571775bd
commit 645ca7af7a
196 changed files with 2183 additions and 676 deletions

View File

@ -544,9 +544,9 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co
#else
const bool is_idle = (
#if HAS_HEATED_BED
isBed ? thermalManager.is_bed_idle() :
isBed ? thermalManager.bed_idle.timed_out :
#endif
thermalManager.is_heater_idle(heater)
thermalManager.hotend_idle[heater].timed_out
);
if (!blink && is_idle) {

View File

@ -208,7 +208,7 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const bool blink) {
if (PAGE_UNDER(7)) {
#if HEATER_IDLE_HANDLER
const bool is_idle = IFBED(thermalManager.is_bed_idle(), thermalManager.is_heater_idle(heater)),
const bool is_idle = IFBED(thermalManager.bed_idle.timed_out, thermalManager.hotend_idle[heater].timed_out),
dodraw = (blink || !is_idle);
#else
constexpr bool dodraw = true;

View File

@ -261,7 +261,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
lcd_put_u8str(i16tostr3(thermalManager.degHotend(extruder)));
lcd_put_wchar('/');
if (get_blink() || !thermalManager.is_heater_idle(extruder))
if (get_blink() || !thermalManager.hotend_idle[extruder].timed_out)
lcd_put_u8str(i16tostr3(thermalManager.degTargetHotend(extruder)));
}

View File

@ -537,6 +537,9 @@
#ifndef MSG_BED
#define MSG_BED _UxGT("Bed")
#endif
#ifndef MSG_CHAMBER
#define MSG_CHAMBER _UxGT("Enclosure")
#endif
#ifndef MSG_FAN_SPEED
#define MSG_FAN_SPEED _UxGT("Fan speed")
#endif
@ -921,6 +924,12 @@
#ifndef MSG_ERR_MINTEMP_BED
#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED")
#endif
#ifndef MSG_ERR_MAXTEMP_CHAMBER
#define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err: MAXTEMP CHAMBER")
#endif
#ifndef MSG_ERR_MINTEMP_CHAMBER
#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: MINTEMP CHAMBER")
#endif
#ifndef MSG_ERR_Z_HOMING
#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST
#endif

View File

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

View File

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

View File

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

View File

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

View File

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