Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DWIN MarlinUI status screen issues #25502

Merged
merged 10 commits into from
Mar 16, 2023
10 changes: 5 additions & 5 deletions Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,

void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) {
const uint8_t scale = value >= 100000.0f ? 10 : 1; // show cm after 99,999mm
const bool e_redraw = !ui.did_first_redraw || old_is_printing != print_job_timer.isRunning();

#if ENABLED(DWIN_MARLINUI_PORTRAIT)

if (!ui.did_first_redraw) {
if (e_redraw) {
// Extra spaces to erase previous value
dwin_string.set(F("E "));
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string()));
Expand All @@ -127,7 +128,7 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,

#else // !DWIN_MARLINUI_PORTRAIT

if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) {
if (e_redraw) {
dwin_string.set(F("E "));
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string()));
}
Expand All @@ -147,11 +148,10 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
//
FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) {
const uint16_t fanx = (4 * STATUS_CHR_WIDTH - STATUS_FAN_WIDTH) / 2;
const uint8_t fan_pct = thermalManager.scaledFanSpeedPercent(0);
const bool fan_on = !!fan_pct;
const bool fan_on = !!thermalManager.scaledFanSpeed(0);
if (fan_on) {
DWIN_ICON_Animation(0, fan_on, ICON, ICON_Fan0, ICON_Fan3, x + fanx, y, 25);
dwin_string.set(i8tostr3rj(fan_pct));
dwin_string.set(i8tostr3rj(thermalManager.scaledFanSpeedPercent(0)));
dwin_string.add('%');
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string()));
}
Expand Down