Display chamber with HAS_TEMP_CHAMBER (#15194)

This commit is contained in:
Luu Lac 2019-09-08 02:20:18 -05:00 committed by Scott Lahteine
parent ca0f47985b
commit 8bca3fcf2c
4 changed files with 40 additions and 37 deletions

View File

@ -1044,7 +1044,8 @@
// Shorthand for common combinations // Shorthand for common combinations
#define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED) #define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED)
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER) #define BED_OR_CHAMBER (HAS_HEATED_BED || HAS_TEMP_CHAMBER)
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || BED_OR_CHAMBER)
// PID heating // PID heating
#if !HAS_HEATED_BED #if !HAS_HEATED_BED

View File

@ -671,10 +671,8 @@
#define STATUS_BED_WIDTH 0 #define STATUS_BED_WIDTH 0
#endif #endif
#if !STATUS_CHAMBER_WIDTH && HAS_HEATED_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED)) #if !STATUS_CHAMBER_WIDTH && HAS_TEMP_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED))
#define STATUS_CHAMBER_WIDTH 21 #define STATUS_CHAMBER_WIDTH 21
#if STATUS_HEATERS_WIDTH #if STATUS_HEATERS_WIDTH
#if ENABLED(STATUS_COMBINE_HEATERS) #if ENABLED(STATUS_COMBINE_HEATERS)
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8) #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8)
@ -703,7 +701,6 @@
B00011111,B11111111,B11111000, B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000 B00011111,B11111111,B11111000
}; };
const unsigned char status_chamber_on_bmp[] PROGMEM = { const unsigned char status_chamber_on_bmp[] PROGMEM = {
B00011111,B11111111,B11111000, B00011111,B11111111,B11111000,
B00010000,B00000000,B00001000, B00010000,B00000000,B00001000,
@ -741,13 +738,12 @@
#define STATUS_CHAMBER_WIDTH 0 #define STATUS_CHAMBER_WIDTH 0
#endif #endif
#define BED_CHAM (HAS_HEATED_BED || HAS_HEATED_CHAMBER) #define BED_OR_CHAMBER_OR_FAN (BED_OR_CHAMBER || HAS_FAN0)
#define BED_CHAM_FAN (BED_CHAM || HAS_FAN0)
// Can also be overridden in Configuration_adv.h // Can also be overridden in Configuration_adv.h
// If you can afford it, try the 3-frame fan animation! // If you can afford it, try the 3-frame fan animation!
// Don't compile in the fan animation with no fan // Don't compile in the fan animation with no fan
#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_CHAM) || (ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_CHAMBER)) #if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || (ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_CHAMBER))
#undef STATUS_FAN_FRAMES #undef STATUS_FAN_FRAMES
#elif !STATUS_FAN_FRAMES #elif !STATUS_FAN_FRAMES
#define STATUS_FAN_FRAMES 2 #define STATUS_FAN_FRAMES 2
@ -1203,7 +1199,7 @@
#undef STATUS_LOGO_WIDTH #undef STATUS_LOGO_WIDTH
#endif #endif
#if (HOTENDS > 1 && STATUS_LOGO_WIDTH && BED_CHAM_FAN) || ( HOTENDS >= 3 && !BED_CHAM_FAN) #if (HOTENDS > 1 && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)
#define _STATUS_HEATERS_X(H,S,N) (((LCD_PIXEL_WIDTH - (H * (S + N)) - STATUS_LOGO_WIDTH - STATUS_BED_WIDTH - STATUS_CHAMBER_WIDTH - STATUS_FAN_WIDTH) / 2) + STATUS_LOGO_WIDTH) #define _STATUS_HEATERS_X(H,S,N) (((LCD_PIXEL_WIDTH - (H * (S + N)) - STATUS_LOGO_WIDTH - STATUS_BED_WIDTH - STATUS_CHAMBER_WIDTH - STATUS_FAN_WIDTH) / 2) + STATUS_LOGO_WIDTH)
#if STATUS_HOTEND1_WIDTH #if STATUS_HOTEND1_WIDTH
#if HOTENDS > 2 #if HOTENDS > 2

View File

@ -65,7 +65,7 @@
#define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) #define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE))
#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 4) #define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 4)
#define DO_DRAW_CHAMBER (HAS_HEATED_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4) #define DO_DRAW_CHAMBER (HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4)
#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)) #define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES))
#define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM)) #define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM))
@ -252,12 +252,16 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin
const float temp = 10 + (millis() >> 8) % CHAMBER_MAXTEMP, const float temp = 10 + (millis() >> 8) % CHAMBER_MAXTEMP,
target = CHAMBER_MAXTEMP; target = CHAMBER_MAXTEMP;
#else #else
const float temp = thermalManager.degChamber(), const float temp = thermalManager.degChamber();
target = thermalManager.degTargetChamber(); #if HAS_HEATED_CHAMBER
const float target = thermalManager.degTargetChamber();
#endif #endif
#endif
#if !HEATER_IDLE_HANDLER #if !HEATER_IDLE_HANDLER
UNUSED(blink); UNUSED(blink);
#endif #endif
if (PAGE_UNDER(7)) { if (PAGE_UNDER(7)) {
#if HEATER_IDLE_HANDLER #if HEATER_IDLE_HANDLER
const bool is_idle = false, // thermalManager.chamber_idle.timed_out, const bool is_idle = false, // thermalManager.chamber_idle.timed_out,
@ -265,13 +269,15 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin
#else #else
constexpr bool dodraw = true; constexpr bool dodraw = true;
#endif #endif
#if HAS_HEATED_CHAMBER
if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7); if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7);
#endif
} }
if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1))
_draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28); _draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28);
} }
#endif #endif // DO_DRAW_CHAMBER
// //
// Before homing, blink '123' <-> '???'. // Before homing, blink '123' <-> '???'.
@ -324,7 +330,7 @@ void MarlinUI::draw_status_screen() {
#if ANIM_BED #if ANIM_BED
if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(new_bits, 7); if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(new_bits, 7);
#endif #endif
#if DO_DRAW_CHAMBER #if DO_DRAW_CHAMBER && HAS_HEATED_CHAMBER
if (thermalManager.isHeatingChamber() ^ SHOW_ON_STATE) SBI(new_bits, 6); if (thermalManager.isHeatingChamber() ^ SHOW_ON_STATE) SBI(new_bits, 6);
#endif #endif
heat_bits = new_bits; heat_bits = new_bits;

View File

@ -623,25 +623,6 @@ class Temperature {
start_watching_hotend(ee); start_watching_hotend(ee);
} }
#if WATCH_CHAMBER
static void start_watching_chamber();
#else
static inline void start_watching_chamber() {}
#endif
#if HAS_HEATED_CHAMBER
static void setTargetChamber(const int16_t celsius) {
temp_chamber.target =
#ifdef CHAMBER_MAXTEMP
_MIN(celsius, CHAMBER_MAXTEMP)
#else
celsius
#endif
;
start_watching_chamber();
}
#endif // HAS_HEATED_CHAMBER
FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { FORCE_INLINE static bool isHeatingHotend(const uint8_t e) {
E_UNUSED(); E_UNUSED();
return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].current; return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].current;
@ -660,6 +641,10 @@ class Temperature {
); );
#endif #endif
FORCE_INLINE static bool still_heating(const uint8_t e) {
return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS;
}
#if HAS_HEATED_BED #if HAS_HEATED_BED
#if ENABLED(SHOW_TEMP_ADC_VALUES) #if ENABLED(SHOW_TEMP_ADC_VALUES)
@ -712,9 +697,24 @@ class Temperature {
#endif #endif
#endif // HAS_TEMP_CHAMBER #endif // HAS_TEMP_CHAMBER
FORCE_INLINE static bool still_heating(const uint8_t e) { #if WATCH_CHAMBER
return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; static void start_watching_chamber();
#else
static inline void start_watching_chamber() {}
#endif
#if HAS_HEATED_CHAMBER
static void setTargetChamber(const int16_t celsius) {
temp_chamber.target =
#ifdef CHAMBER_MAXTEMP
_MIN(celsius, CHAMBER_MAXTEMP)
#else
celsius
#endif
;
start_watching_chamber();
} }
#endif // HAS_HEATED_CHAMBER
/** /**
* The software PWM power for a heater * The software PWM power for a heater