From 1b2715ccf2722182ef787fa4639619b282647b1b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Feb 2022 10:30:17 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Enhanced=20UI=20=3D>=20Professio?= =?UTF-8?q?nal=20UI=20-=20with=20updates=20(#23624)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/pause.cpp | 2 +- Marlin/src/feature/runout.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/ubl/M421.cpp | 2 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/control/M997.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M1000.cpp | 2 +- Marlin/src/gcode/lcd/M0_M1.cpp | 4 +- Marlin/src/gcode/lcd/M73.cpp | 2 +- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/gcode/stats/M75-M78.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 3 + Marlin/src/inc/SanityCheck.h | 2 + Marlin/src/lcd/e3v2/common/dwin_set.h | 11 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 3 - Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 - .../src/lcd/e3v2/{enhanced => proui}/dwin.cpp | 247 +++++++++++------- .../src/lcd/e3v2/{enhanced => proui}/dwin.h | 21 +- .../e3v2/{enhanced => proui}/dwin_defines.h | 11 +- .../lcd/e3v2/{enhanced => proui}/dwin_lcd.cpp | 4 +- .../lcd/e3v2/{enhanced => proui}/dwin_lcd.h | 4 +- .../e3v2/{enhanced => proui}/dwin_popup.cpp | 12 +- .../lcd/e3v2/{enhanced => proui}/dwin_popup.h | 16 +- .../lcd/e3v2/{enhanced => proui}/dwinui.cpp | 6 +- .../src/lcd/e3v2/{enhanced => proui}/dwinui.h | 41 ++- .../e3v2/{enhanced => proui}/endstop_diag.cpp | 8 +- .../e3v2/{enhanced => proui}/endstop_diag.h | 4 +- .../e3v2/{enhanced => proui}/lockscreen.cpp | 4 +- .../lcd/e3v2/{enhanced => proui}/lockscreen.h | 4 +- .../e3v2/{enhanced => proui}/meshviewer.cpp | 10 +- .../lcd/e3v2/{enhanced => proui}/meshviewer.h | 8 +- .../e3v2/{enhanced => proui}/printstats.cpp | 8 +- .../lcd/e3v2/{enhanced => proui}/printstats.h | 8 +- Marlin/src/lcd/marlinui.cpp | 4 +- Marlin/src/lcd/marlinui.h | 6 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/settings.cpp | 4 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- buildroot/tests/STM32F103RE_creality | 2 +- ini/features.ini | 2 +- platformio.ini | 2 +- 46 files changed, 319 insertions(+), 178 deletions(-) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin.cpp (95%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin.h (93%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_defines.h (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_lcd.cpp (98%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_lcd.h (96%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_popup.cpp (88%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_popup.h (83%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwinui.cpp (99%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwinui.h (92%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/endstop_diag.cpp (93%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/endstop_diag.h (90%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/lockscreen.cpp (95%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/lockscreen.h (92%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/meshviewer.cpp (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/meshviewer.h (87%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/printstats.cpp (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/printstats.h (87%) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 302e94494e..02cf6d28d3 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -75,7 +75,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "lcd/e3v2/enhanced/dwin.h" + #include "lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "lcd/e3v2/jyersui/dwin.h" #endif diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 147164c166..69c25cbe33 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -58,7 +58,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #include "../lcd/marlinui.h" diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 9317e3489a..8b78b53848 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -69,7 +69,7 @@ bool FilamentMonitorBase::enabled = true, #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif void event_filament_runout(const uint8_t extruder) { diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 51d658b20e..9ec43fe49d 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -61,7 +61,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif #if HAS_MULTI_HOTEND diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index eec89f73ac..090c15b057 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -41,7 +41,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index e6f0ef1f89..ac6f97b00a 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -34,7 +34,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index df58992519..a38c567939 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -52,7 +52,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if HAS_L64XX // set L6470 absolute position registers to counts diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 73d795bcef..359172faad 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -25,7 +25,7 @@ #if ENABLED(PLATFORM_M997_SUPPORT) #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index b7fa45e2d0..6fb99226ce 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -34,7 +34,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #endif diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 2bf3c94f1c..a9223dda47 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -36,8 +36,8 @@ #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin_popup.h" - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin_popup.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_PROMPT_SUPPORT) diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index b7a9b3459e..c2c5485072 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -29,7 +29,7 @@ #include "../../sd/cardreader.h" #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index ad549946f0..1579efd555 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -50,7 +50,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 7d16899fd3..368edb65d9 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -30,7 +30,7 @@ #include "../../MarlinCore.h" // for startOrResumeJob #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index a43575933b..7b56eb2d6b 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -31,7 +31,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 7bc64d169b..34a160fc5c 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -494,6 +494,9 @@ #endif #define HAS_LCD_BRIGHTNESS 1 #define LCD_BRIGHTNESS_MAX 250 + #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #define LCD_BRIGHTNESS_DEFAULT 127 + #endif #endif #if IS_ULTRA_LCD diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8e1a5a55d8..38c2866ca1 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -607,6 +607,8 @@ #error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180." #elif defined(LCD_SCREEN_ROT_270) #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270." +#elif defined(DEFAULT_LCD_BRIGHTNESS) + #error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index 4fedd7a584..7f44386954 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -25,7 +25,16 @@ #define Language_English 1 #define Language_Chinese 2 -#define ICON 7 // Icon set file 7.ICO +//#define USE_STOCK_DWIN_SET // Use the Creality stock DWIN_SET instead of Marlin's unified DWIN_SET by The-EG & thinkyhead +#ifdef USE_STOCK_DWIN_SET + #define ICON 9 // 9.ICO +#else + #define ICON 7 // 7.ICO +#endif + +#ifndef CORP_WEBSITE + #define CORP_WEBSITE WEBSITE_URL +#endif #define ICON_LOGO 0 #define ICON_Print_0 1 diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index f17d97cc7c..f20260e43d 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -91,9 +91,6 @@ #ifndef MACHINE_SIZE #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL -#endif #define PAUSE_HEAT diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 1356c0e475..0eedddb500 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -82,10 +82,6 @@ #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL - #endif - #define DWIN_FONT_MENU font8x16 #define DWIN_FONT_STAT font10x20 #define DWIN_FONT_HEAD font10x20 diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp similarity index 95% rename from Marlin/src/lcd/e3v2/enhanced/dwin.cpp rename to Marlin/src/lcd/e3v2/proui/dwin.cpp index 58885e1c21..4d7f38171d 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -21,10 +21,12 @@ */ /** - * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Enhanced DWIN implementation + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.11.2 + * date: 2022/01/19 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -83,6 +85,10 @@ #include "../../../feature/powerloss.h" #endif +#if HAS_GCODE_PREVIEW + #include "gcode_preview.h" +#endif + #if HAS_ESDIAG #include "endstop_diag.h" #endif @@ -113,10 +119,6 @@ #include "lockscreen.h" -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL -#endif - #define PAUSE_HEAT #define MENU_CHAR_LIMIT 24 @@ -169,7 +171,7 @@ enum SelectItem : uint8_t { PAGE_PRINT = 0, PAGE_PREPARE, PAGE_CONTROL, - PAGE_INFO_LEVELING, + PAGE_INFO_LEV_ADV, PAGE_COUNT, PRINT_SETUP = 0, @@ -310,11 +312,11 @@ void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, DWIN_ICON_Show(true, false, false, ICON, iconid + selected, ico.x, ico.y); if (selected) DWINUI::Draw_Box(0, HMI_data.Highlight_Color, ico); if (HMI_IsChinese()) { - DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 28) - txt.h/2); + DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 25) - txt.h/2); } else { const uint16_t x = ico.x + (ico.w - strlen_P(FTOP(caption)) * DWINUI::fontWidth()) / 2, - y = (ico.y + ico.h - 28) - DWINUI::fontHeight() / 2; + y = (ico.y + ico.h - 20) - DWINUI::fontHeight() / 2; DWINUI::Draw_String(x, y, caption); } } @@ -324,7 +326,7 @@ void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, // void ICON_Print() { constexpr frame_rect_t ico = { 17, 110, 110, 100 }; - constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 1, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_PRINT, ICON_Print_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PRINT)); } @@ -333,7 +335,7 @@ void ICON_Print() { // void ICON_Prepare() { constexpr frame_rect_t ico = { 145, 110, 110, 100 }; - constexpr text_info_t txt = { 31, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 31, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_PREPARE, ICON_Prepare_0, ico, txt, GET_TEXT_F(MSG_PREPARE)); } @@ -342,7 +344,7 @@ void ICON_Prepare() { // void ICON_Control() { constexpr frame_rect_t ico = { 17, 226, 110, 100 }; - constexpr text_info_t txt = { 61, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 61, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt, GET_TEXT_F(MSG_CONTROL)); } @@ -351,8 +353,8 @@ void ICON_Control() { // void ICON_StartInfo() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 91, { 405, 447 }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); + constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); } // @@ -360,8 +362,17 @@ void ICON_StartInfo() { // void ICON_Leveling() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 211, { 405, 447 }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); + constexpr text_info_t txt = { 211, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); +} + +// +// Main Menu: "Advanced Settings" +// +void ICON_AdvSettings() { + constexpr frame_rect_t ico = { 145, 226, 110, 100 }; + constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_ADVANCED)); } // @@ -369,7 +380,7 @@ void ICON_Leveling() { // void ICON_Tune() { constexpr frame_rect_t ico = { 8, 232, 80, 100 }; - constexpr text_info_t txt = { 121, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 121, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_SETUP, ICON_Setup_0, ico, txt, GET_TEXT_F(MSG_TUNE)); } @@ -378,7 +389,7 @@ void ICON_Tune() { // void ICON_Pause() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt = { 181, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 181, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Pause_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PAUSE)); } @@ -387,7 +398,7 @@ void ICON_Pause() { // void ICON_Resume() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 1, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Continue_0, ico, txt, GET_TEXT_F(MSG_BUTTON_RESUME)); } @@ -396,7 +407,7 @@ void ICON_Resume() { // void ICON_Stop() { constexpr frame_rect_t ico = { 184, 232, 80, 100 }; - constexpr text_info_t txt = { 151, { 405, 447 }, 27, 12 }; + constexpr text_info_t txt = { 151, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 12 }; ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt, GET_TEXT_F(MSG_BUTTON_STOP)); } @@ -453,18 +464,13 @@ void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const DWINUI::Draw_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value); } -// The "Back" label is always on the first line -void Draw_Back_Label() { - if (HMI_IsChinese()) - DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); - else - DWIN_Frame_AreaCopy(1, 223, 179, 254, 189, LBLX, MBASE(0)); -} - // Draw "Back" line at the top void Draw_Back_First(const bool is_sel=true) { Draw_Menu_Line(0, ICON_Back); - Draw_Back_Label(); + if (HMI_IsChinese()) + DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); + else + DWINUI::Draw_String(LBLX, MBASE(0), GET_TEXT_F(MSG_BACK)); if (is_sel) Draw_Menu_Cursor(0); } @@ -489,15 +495,15 @@ inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { //PopUps void Popup_window_PauseOrStop() { if (HMI_IsChinese()) { - DWINUI::ClearMenuArea(); + DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); - DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_C, 26, 280); + DWINUI::Draw_IconWB(ICON_Cancel_C, 146, 280); Draw_Select_Highlight(true); - DWIN_UpdateLCD(); + DWIN_UpdateLCD(); } else DWIN_Popup_ConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); @@ -513,7 +519,7 @@ void Popup_window_PauseOrStop() { DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105); DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 240); - DWINUI::Draw_Icon(ICON_Confirm_C, 86, 280); + DWINUI::Draw_IconWB(ICON_Confirm_C, 86, 280); DWIN_UpdateLCD(); } else @@ -527,8 +533,8 @@ void Popup_window_PauseOrStop() { DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); if (HMI_IsChinese()) { - if (toohigh) { - DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); + if (toohigh) { + DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); DWIN_Frame_AreaCopy(1, 103, 371, 237, 386, 52, 285); DWIN_Frame_AreaCopy(1, 151, 389, 185, 402, 187, 285); DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); @@ -637,7 +643,7 @@ void Draw_Print_Labels() { } void Draw_Print_ProgressBar() { - DWINUI::Draw_Icon(ICON_Bar, 15, 93); + DWINUI::Draw_IconWB(ICON_Bar, 15, 93); DWIN_Draw_Rectangle(1, HMI_data.Barfill_Color, 16 + _percent_done * 240 / 100, 93, 256, 113); DWINUI::Draw_Int(HMI_data.PercentTxt_Color, HMI_data.Background_Color, 3, 117, 133, _percent_done); DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%")); @@ -707,7 +713,7 @@ void Draw_PrintDone() { Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); // show print done confirm - DWINUI::Draw_Icon(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); + DWINUI::Draw_IconWB(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); DWIN_UpdateLCD(); } @@ -721,7 +727,7 @@ void Draw_Main_Menu() { ICON_Print(); ICON_Prepare(); ICON_Control(); - TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); + ICON_AdvSettings(); DWIN_UpdateLCD(); } @@ -745,11 +751,11 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, if (force || changed || draw_qmark || draw_empty) { if (blink && draw_qmark) - DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F("--?--")); + DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" - ? -")); else if (blink && draw_empty) DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" ")); else - DWINUI::Draw_Signed_Float(HMI_data.Coordinate_Color, HMI_data.Background_Color, 3, 1, x, y, p); + DWINUI::Draw_Signed_Float(HMI_data.Coordinate_Color, HMI_data.Background_Color, 3, 2, x, y, p); } } @@ -911,8 +917,6 @@ void MarlinUI::refresh() { /* Nothing to see here */ } void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); } #endif -#define ICON_Folder ICON_More - #if ENABLED(SCROLL_LONG_FILENAMES) char shift_name[LONG_FILENAME_LENGTH + 1]; @@ -1115,25 +1119,25 @@ void HMI_StartFrame(const bool with_update) { void Draw_Info_Menu() { DWINUI::ClearMenuArea(); Draw_Back_First(); - - DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE)); - DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION)); + if (HMI_IsChinese()) + Title.FrameCopy(30, 17, 28, 13); // "Info" + else + Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); if (HMI_IsChinese()) { - Title.FrameCopy(30, 17, 28, 13); // "Info" - DWIN_Frame_AreaCopy(1, 197, 149, 252, 161, 108, 102); // "Size" DWIN_Frame_AreaCopy(1, 1, 164, 56, 176, 108, 175); // "Firmware Version" DWIN_Frame_AreaCopy(1, 58, 164, 113, 176, 105, 248); // "Contact Details" + DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE)); } else { - Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); - - DWIN_Frame_AreaCopy(1, 120, 150, 146, 161, 124, 102); // "Size" - DWIN_Frame_AreaCopy(1, 146, 151, 254, 161, 82, 175); // "Firmware Version" - DWIN_Frame_AreaCopy(1, 1, 164, 96, 175, 89, 248); // "Contact details" + DWINUI::Draw_CenteredString(102, F("Size")); + DWINUI::Draw_CenteredString(175, F("Firmware version")); + DWINUI::Draw_CenteredString(248, F("Build Datetime")); + DWINUI::Draw_CenteredString(268, F(STRING_DISTRIBUTION_DATE)); } - DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE)); + DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE)); + DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION)); LOOP_L_N(i, 3) { DWINUI::Draw_Icon(ICON_PrintSize + i, ICOX, 99 + i * 73); @@ -1162,7 +1166,7 @@ void HMI_MainMenu() { case PAGE_PRINT: ICON_Print(); break; case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break; case PAGE_CONTROL: ICON_Prepare(); ICON_Control(); break; - case PAGE_INFO_LEVELING: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; + case PAGE_INFO_LEV_ADV: ICON_Control(); ICON_AdvSettings(); break; } } } @@ -1171,8 +1175,8 @@ void HMI_MainMenu() { switch (select_page.now) { case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break; case PAGE_PREPARE: ICON_Prepare(); ICON_Control(); break; - case PAGE_CONTROL: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; - case PAGE_INFO_LEVELING: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; + case PAGE_CONTROL: ICON_Control(); ICON_AdvSettings(); break; + case PAGE_INFO_LEV_ADV: ICON_AdvSettings(); break; } } } @@ -1180,6 +1184,7 @@ void HMI_MainMenu() { switch (select_page.now) { case PAGE_PRINT: checkkey = SelectFile; + card.mount(); Draw_Print_File_Menu(); break; @@ -1187,14 +1192,7 @@ void HMI_MainMenu() { case PAGE_CONTROL: Draw_Control_Menu(); break; - case PAGE_INFO_LEVELING: - #if HAS_ONESTEP_LEVELING - queue.inject(F("G28Z\nG29")); // Force to get the current Z home position - #else - last_checkkey = MainMenu; - Goto_Info_Menu(); - #endif - break; + case PAGE_INFO_LEV_ADV: Draw_AdvancedSettings_Menu(); break; } } DWIN_UpdateLCD(); @@ -1469,6 +1467,9 @@ void Draw_Main_Area() { case FilamentPurge: Draw_Popup_FilamentPurge(); break; #endif case Locked: lockScreen.draw(); break; + #if HAS_GCODE_PREVIEW + case ConfirmToPrint: Draw_PreviewFromSD(); break; + #endif case Menu: case SetInt: case SetPInt: @@ -1496,14 +1497,12 @@ void HMI_Popup() { void HMI_Init() { HMI_SDCardInit(); - for (uint16_t t = 0; t <= 100; t += 2) { DWINUI::Draw_Icon(ICON_Bar, 15, 260); DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280); DWIN_UpdateLCD(); delay(20); } - HMI_SetLanguage(); } @@ -1623,15 +1622,15 @@ void EachMomentUpdate() { if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115); DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 167); - DWINUI::Draw_Icon(ICON_Cancel_C, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_C, 146, 280); + DWINUI::Draw_IconWB(ICON_Cancel_C, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_C, 146, 280); } else { DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 70, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 147, F("It looks like the last")); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted.")); - DWINUI::Draw_Icon(ICON_Cancel_E, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Cancel_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); } SdFile *dir = nullptr; const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); @@ -1698,6 +1697,9 @@ void DWIN_HandleScreen() { #if ENABLED(POWER_LOSS_RECOVERY) case PwrlossRec: HMI_PowerlossRecovery(); break; #endif + #if HAS_GCODE_PREVIEW + case ConfirmToPrint: HMI_ConfirmToPrint(); break; + #endif #if HAS_ESDIAG case ESDiagProcess: HMI_Popup(); break; #endif @@ -1747,7 +1749,7 @@ void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); - DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); + DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT), ICON_Cancel_E); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif @@ -1924,7 +1926,8 @@ void DWIN_LoadSettings(const char *buff) { } void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { - DWIN_Draw_Popup(ICON_BLTouch, lcd_error, lcd_component); + DWIN_Draw_Popup(ICON_BLTouch, F("Printer killed:"), lcd_error); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, F("Turn off the printer")); DWIN_UpdateLCD(); } @@ -1969,8 +1972,8 @@ void DWIN_Redraw_screen() { void Draw_Popup_FilamentPurge() { DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); - DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); Draw_Select_Highlight(true); DWIN_UpdateLCD(); } @@ -2037,6 +2040,41 @@ void HMI_LockScreen() { if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } +#if HAS_GCODE_PREVIEW + + void HMI_ConfirmToPrint() { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + if (encoder_diffState == ENCODER_DIFF_CW) + Draw_Select_Highlight(false); + else if (encoder_diffState == ENCODER_DIFF_CCW) + Draw_Select_Highlight(true); + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + if (HMI_flag.select_flag) { // Confirm + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + } + else { // Cancel + DWIN_ResetStatusLine(); + checkkey = SelectFile; + Draw_Print_File_Menu(); + } + } + DWIN_UpdateLCD(); + } + +#endif + +void Goto_ConfirmToPrint() { + #if HAS_GCODE_PREVIEW + HMI_SaveProcessID(ConfirmToPrint); + Draw_PreviewFromSD(); + #else + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + #endif +} + #if HAS_ESDIAG void Draw_EndStopDiag() { HMI_SaveProcessID(ESDiagProcess); @@ -2308,8 +2346,9 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if HAS_LCD_BRIGHTNESS - void LiveBrightness() { ui.set_brightness(HMI_value.Value); } - void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, nullptr, LiveBrightness); } + void ApplyBrightness() { ui.set_brightness(HMI_value.Value); } + void LiveBrightness() { DWIN_LCD_Brightness(HMI_value.Value); } + void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); } #endif #if ENABLED(CASE_LIGHT_MENU) @@ -2382,6 +2421,12 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void SetParkPosX() { SetPIntOnClick(0, X_MAX_POS); } + void SetParkPosY() { SetPIntOnClick(0, Y_MAX_POS); } + void SetParkZRaise() { SetPIntOnClick(0, 50); } +#endif + #if HAS_FILAMENT_SENSOR void SetRunoutEnable() { runout.reset(); @@ -2490,9 +2535,11 @@ void Tram(uint8_t point) { static bool inLev = false; if (inLev) return; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; + #define fmt "X:%s, Y:%s, Z:%s" float xpos = 0, ypos = 0, zval = 0; float margin = PROBING_MARGIN; #else + #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2527,7 +2574,7 @@ void Tram(uint8_t point) { planner.synchronize(); inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); - sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), + sprintf_P(cmd, PSTR(fmt), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2), dtostrf(zval, 1, 2, str_3) @@ -2536,7 +2583,7 @@ void Tram(uint8_t point) { inLev = false; #else planner.synchronize(); - sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); + sprintf_P(cmd, PSTR(fmt), xpos, ypos); queue.inject(cmd); #endif } @@ -2957,7 +3004,7 @@ void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedX(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 58, MBASE(line)); // X + DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 58, MBASE(line)); // X } onDrawPFloatMenu(menuitem, line); } @@ -2965,7 +3012,7 @@ void onDrawMaxSpeedX(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedY(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 58, MBASE(line)); // Y + DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 58, MBASE(line)); // Y } onDrawPFloatMenu(menuitem, line); } @@ -2973,7 +3020,7 @@ void onDrawMaxSpeedY(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 58, MBASE(line) + 3); // Z + DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 58, MBASE(line) + 3); // Z } onDrawPFloatMenu(menuitem, line); } @@ -2982,7 +3029,7 @@ void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 58, MBASE(line)); // E + DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 58, MBASE(line)); // E } onDrawPFloatMenu(menuitem, line); } @@ -2991,7 +3038,7 @@ void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { void onDrawAcc(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration } onDrawSubMenu(menuitem, line); } @@ -3000,7 +3047,7 @@ void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 71, MBASE(line)); // X + DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 71, MBASE(line)); // X } onDrawPInt32Menu(menuitem, line); } @@ -3008,8 +3055,8 @@ void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 71, MBASE(line)); // Y + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 71, MBASE(line)); // Y } onDrawPInt32Menu(menuitem, line); } @@ -3017,8 +3064,8 @@ void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 71, MBASE(line)); // Z + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 71, MBASE(line)); // Z } onDrawPInt32Menu(menuitem, line); } @@ -3027,8 +3074,8 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 71, MBASE(line)); // E + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 71, MBASE(line)); // E } onDrawPInt32Menu(menuitem, line); } @@ -3039,7 +3086,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { void onDrawJerk(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ... + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ... DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 54, MBASE(line)); // ...Jerk } onDrawSubMenu(menuitem, line); @@ -3286,6 +3333,9 @@ void Draw_Prepare_Menu() { #if ENABLED(MESH_BED_LEVELING) MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); #endif + #if HAS_ONESTEP_LEVELING + MENU_ITEM(ICON_Level, GET_TEXT_F(MSG_AUTO_MESH), onDrawMenuItem, AutoLev); + #endif #if HAS_ZOFFSET_ITEM #if HAS_BED_PROBE MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); @@ -3334,12 +3384,12 @@ void Draw_Control_Menu() { if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - DWINUI::MenuItemsPrepare(11); + DWINUI::MenuItemsPrepare(8); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASELIGHT_USES_BRIGHTNESS) MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawSubMenu, Draw_CaseLight_Menu); - #else + #else MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); #endif #endif @@ -3354,7 +3404,6 @@ void Draw_Control_Menu() { MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); #endif MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); - MENU_ITEM(ICON_AdvSet, GET_TEXT_F(MSG_ADVANCED_SETTINGS), onDrawSubMenu, Draw_AdvancedSettings_Menu); MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu); } CurrentMenu->draw(); @@ -3367,7 +3416,7 @@ void Draw_AdvancedSettings_Menu() { CurrentMenu = AdvancedSettings; SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG DWINUI::MenuItemsPrepare(15); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if HAS_HOME_OFFSET MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); #endif @@ -3601,7 +3650,7 @@ void Draw_Tune_Menu() { MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); - #endif + #endif EDIT_ITEM(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h similarity index 93% rename from Marlin/src/lcd/e3v2/enhanced/dwin.h rename to Marlin/src/lcd/e3v2/proui/dwin.h index bbbe00aa9f..04ac1590eb 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -22,10 +22,12 @@ #pragma once /** - * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Enhanced DWIN implementation + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.2 + * date: 2021/11/21 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -62,6 +64,7 @@ enum processID : uint8_t { PwrlossRec, Reboot, Info, + ConfirmToPrint, // Popup Windows Homing, @@ -90,6 +93,8 @@ enum pidresult_t : uint8_t { typedef struct { int8_t Color[3]; // Color components + uint16_t pidgrphpoints = 0; + pidresult_t pidresult = PID_DONE; int8_t Preheat = 0; // Material Select 0: PLA, 1: ABS, 2: Custom AxisEnum axis = X_AXIS; // Axis Select int32_t MaxValue = 0; // Auxiliar max integer/scaled float value @@ -137,6 +142,7 @@ void Goto_PrintProcess(); void Goto_Main_Menu(); void Goto_Info_Menu(); void Goto_PowerLossRecovery(); +void Goto_ConfirmToPrint(); void Draw_Status_Area(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; void DWIN_Redraw_screen(); // Redraw all screen elements @@ -191,6 +197,9 @@ void HMI_LockScreen(); #if HAS_MESH void DWIN_MeshViewer(); #endif +#if HAS_GCODE_PREVIEW + void HMI_ConfirmToPrint(); +#endif #if HAS_ESDIAG void Draw_EndStopDiag(); #endif @@ -221,6 +230,10 @@ void Draw_Tramming_Menu(); #if HAS_FILAMENT_SENSOR void Draw_FilSet_Menu(); #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void Draw_ParkPos_Menu(); +#endif +void Draw_PhySet_Menu(); void Draw_SelectColors_Menu(); void Draw_GetColor_Menu(); #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/dwin_defines.h rename to Marlin/src/lcd/e3v2/proui/dwin_defines.h index 907177ab32..3dc2408f4a 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -23,11 +23,16 @@ /** * DWIN general defines and data structs - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.2 * Date: 2021/11/21 + * + * Based on the original code provided by Creality under GPL */ +//#define NEED_HEX_PRINT 1 +//#define DEBUG_DWIN 1 + #include "../../../core/types.h" #include "../common/dwin_color.h" #if ENABLED(LED_CONTROL_MENU) @@ -53,8 +58,8 @@ #define Def_Indicator_Color Color_White #define Def_Coordinate_Color Color_White +//#define HAS_GCODE_PREVIEW 1 #define HAS_ESDIAG 1 -#define DEFAULT_LCD_BRIGHTNESS 127 #if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define Def_Leds_Color LEDColorWhite() diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp similarity index 98% rename from Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp rename to Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 83cbc20718..105f1aaf1c 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 3.8.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h similarity index 96% rename from Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h rename to Marlin/src/lcd/e3v2/proui/dwin_lcd.h index fc1b6d6756..623a94f09e 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 3.8.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../common/dwin_api.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp similarity index 88% rename from Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp rename to Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index cf1ab8c0ad..34b05328d7 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.10.1 + * Date: 2022/01/21 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -52,8 +54,8 @@ void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fm void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) { DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2); - DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Cancel_E, 146, 280); Draw_Select_Highlight(true); DWIN_UpdateLCD(); } diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h similarity index 83% rename from Marlin/src/lcd/e3v2/enhanced/dwin_popup.h rename to Marlin/src/lcd/e3v2/proui/dwin_popup.h index 65784a8c9f..2e952cc1b9 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.10.1 + * Date: 2022/01/21 + * + * Based on the original code provided by Creality under GPL */ #include "dwinui.h" @@ -47,7 +49,13 @@ void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8 if (icon) DWINUI::Draw_Icon(icon, 101, 105); if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2); - if (button) DWINUI::Draw_Icon(button, 86, 280); + if (button) DWINUI::Draw_IconWB(button, 86, 280); +} + +template +void DWIN_Show_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) { + DWIN_Draw_Popup(icon, amsg1, amsg2, button); + DWIN_UpdateLCD(); } template diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp similarity index 99% rename from Marlin/src/lcd/e3v2/enhanced/dwinui.cpp rename to Marlin/src/lcd/e3v2/proui/dwinui.cpp index 5017253740..d3cfc9a3e4 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.8.2 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h similarity index 92% rename from Marlin/src/lcd/e3v2/enhanced/dwinui.h rename to Marlin/src/lcd/e3v2/proui/dwinui.h index 4f0dadc909..595c534356 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.11.1 + * Date: 2022/01/19 + * + * Based on the original code provided by Creality under GPL */ #include "dwin_lcd.h" @@ -34,6 +36,10 @@ #include "../common/dwin_color.h" // Extra Icons +#define ICON_AdvSet ICON_Language +#define ICON_BedSizeX ICON_PrintSize +#define ICON_BedSizeY ICON_PrintSize +#define ICON_Binary ICON_Contact #define ICON_Brightness ICON_Motion #define ICON_Cancel ICON_StockConfiguration #define ICON_CustomPreheat ICON_SetEndTemp @@ -45,6 +51,7 @@ #define ICON_FilSet ICON_ResumeEEPROM #define ICON_FilUnload ICON_ReadEEPROM #define ICON_Flow ICON_StepE +#define ICON_Folder ICON_More #define ICON_FWRetLength ICON_StepE #define ICON_FWRetSpeed ICON_Setspeed #define ICON_FWRetZRaise ICON_MoveZ @@ -52,28 +59,49 @@ #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ +#define ICON_HomeOffset ICON_AdvSet +#define ICON_HomeOffsetX ICON_StepX +#define ICON_HomeOffsetY ICON_StepY +#define ICON_HomeOffsetZ ICON_StepZ #define ICON_HSMode ICON_StockConfiguration +#define ICON_InvertE0 ICON_StepE #define ICON_Tram ICON_SetEndTemp +#define ICON_Level ICON_HotendTemp #define ICON_Lock ICON_Cool #define ICON_ManualMesh ICON_HotendTemp +#define ICON_MaxPosX ICON_MoveX +#define ICON_MaxPosY ICON_MoveY +#define ICON_MaxPosZ ICON_MoveZ #define ICON_MeshNext ICON_Axis +#define ICON_MeshPoints ICON_SetEndTemp #define ICON_MeshSave ICON_WriteEEPROM #define ICON_MeshViewer ICON_HotendTemp #define ICON_MoveZ0 ICON_HotendTemp #define ICON_Park ICON_Motion +#define ICON_ParkPos ICON_AdvSet +#define ICON_ParkPosX ICON_StepX +#define ICON_ParkPosY ICON_StepY +#define ICON_ParkPosZ ICON_StepZ +#define ICON_PhySet ICON_PrintSize #define ICON_PIDbed ICON_SetBedTemp #define ICON_PIDcycles ICON_ResumeEEPROM #define ICON_PIDValue ICON_Contact #define ICON_PrintStats ICON_PrintTime #define ICON_PrintStatsReset ICON_RemainTime #define ICON_ProbeDeploy ICON_SetEndTemp +#define ICON_ProbeMargin ICON_PrintSize +#define ICON_ProbeOffsetX ICON_StepX +#define ICON_ProbeOffsetY ICON_StepY +#define ICON_ProbeOffsetZ ICON_StepZ #define ICON_ProbeSet ICON_SetEndTemp #define ICON_ProbeStow ICON_SetEndTemp #define ICON_ProbeTest ICON_SetEndTemp +#define ICON_ProbeZSpeed ICON_MaxSpeedZ #define ICON_Pwrlossr ICON_Motion #define ICON_Reboot ICON_ResumeEEPROM #define ICON_Runout ICON_MaxAccE #define ICON_Scolor ICON_MaxSpeed +#define ICON_SetBaudRate ICON_Setspeed #define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_Sound ICON_Cool #define ICON_CaseLight ICON_Motion @@ -247,6 +275,13 @@ namespace DWINUI { DWIN_ICON_Show(ICON, icon, x, y); } + // Draw an Icon from the library ICON with its background + // icon: Icon ID + // x/y: Upper-left point + inline void Draw_IconWB(uint8_t icon, uint16_t x, uint16_t y) { + DWIN_ICON_Show(true, false, false, ICON, icon, x, y); + } + // Draw a positive integer // bShow: true=display background color; false=don't display background color // zeroFill: true=zero fill; false=no zero fill diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp similarity index 93% rename from Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp rename to Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 0f982c3a36..6232c89534 100644 --- a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -22,9 +22,11 @@ /** * DWIN End Stops diagnostic page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.0.2 * Date: 2021/11/06 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -106,4 +108,4 @@ void ESDiagClass::Update() { DWIN_UpdateLCD(); } -#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH +#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_ESDIAG diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h b/Marlin/src/lcd/e3v2/proui/endstop_diag.h similarity index 90% rename from Marlin/src/lcd/e3v2/enhanced/endstop_diag.h rename to Marlin/src/lcd/e3v2/proui/endstop_diag.h index 1864b95723..4694ddb141 100644 --- a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.h @@ -23,9 +23,11 @@ /** * DWIN End Stops diagnostic page - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 1.0 * Date: 2021/11/06 + * + * Based on the original code provided by Creality under GPL */ class ESDiagClass { diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp similarity index 95% rename from Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp rename to Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 8dc84dcc46..3f8339ad48 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -22,9 +22,11 @@ /** * Lock screen implementation for DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h similarity index 92% rename from Marlin/src/lcd/e3v2/enhanced/lockscreen.h rename to Marlin/src/lcd/e3v2/proui/lockscreen.h index a51c82f34e..bf2fdb3f4b 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -23,9 +23,11 @@ /** * Lock screen implementation for DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../common/encoder.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp rename to Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 1ecbbff0aa..0f63f77b99 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -22,9 +22,11 @@ /** * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.1 + * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -56,7 +58,7 @@ void MeshViewerClass::Draw() { #define DrawMeshHLine(yp) DWIN_Draw_HLine(HMI_data.SplitLine_Color, px(0), py(yp), DWIN_WIDTH - 2 * mx) #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(GRID_MAX_POINTS_Y - 1), DWIN_WIDTH - 2 * my) GRID_LOOP(x, y) { - const float v = Z_VALUES(x,y) * 100; + const float v = isnan(Z_VALUES(x,y)) ? 0 : round(Z_VALUES(x,y) * 100); zmesh[x][y] = v; NOLESS(maxz, v); NOMORE(minz, v); diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h similarity index 87% rename from Marlin/src/lcd/e3v2/enhanced/meshviewer.h rename to Marlin/src/lcd/e3v2/proui/meshviewer.h index 6e7fe6fd82..acd5f0d5c4 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -23,9 +23,11 @@ /** * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.1 + * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ class MeshViewerClass { diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/printstats.cpp rename to Marlin/src/lcd/e3v2/proui/printstats.cpp index a32d698b96..ec14ebb8bf 100644 --- a/Marlin/src/lcd/e3v2/enhanced/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -22,9 +22,11 @@ /** * DWIN Print Stats page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.1 + * Date: 2022/01/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.h b/Marlin/src/lcd/e3v2/proui/printstats.h similarity index 87% rename from Marlin/src/lcd/e3v2/enhanced/printstats.h rename to Marlin/src/lcd/e3v2/proui/printstats.h index 5f62a4c268..f17e4dc9dd 100644 --- a/Marlin/src/lcd/e3v2/enhanced/printstats.h +++ b/Marlin/src/lcd/e3v2/proui/printstats.h @@ -23,9 +23,11 @@ /** * DWIN Print Stats page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.1 + * Date: 2022/01/09 + * + * Based on the original code provided by Creality under GPL */ class PrintStatsClass { diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index fcd9357ef7..d0cc2a25b8 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -49,7 +49,7 @@ MarlinUI ui; #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #include "fontutils.h" - #include "e3v2/enhanced/dwin.h" + #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" #endif @@ -104,7 +104,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if HAS_LCD_BRIGHTNESS - uint8_t MarlinUI::brightness = DEFAULT_LCD_BRIGHTNESS; + uint8_t MarlinUI::brightness = LCD_BRIGHTNESS_DEFAULT; bool MarlinUI::backlight = true; void MarlinUI::set_brightness(const uint8_t value) { diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index e08cf27dc5..17c2468737 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -58,7 +58,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "e3v2/enhanced/dwin.h" + #include "e3v2/proui/dwin.h" #endif #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) @@ -265,8 +265,8 @@ public: #ifndef LCD_BRIGHTNESS_MAX #define LCD_BRIGHTNESS_MAX 255 #endif - #ifndef DEFAULT_LCD_BRIGHTNESS - #define DEFAULT_LCD_BRIGHTNESS LCD_BRIGHTNESS_MAX + #ifndef LCD_BRIGHTNESS_DEFAULT + #define LCD_BRIGHTNESS_DEFAULT LCD_BRIGHTNESS_MAX #endif static uint8_t brightness; static bool backlight; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index cc3851597b..fdd6897192 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -80,7 +80,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index db9fc7eb2f..bcbe8fa985 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -75,7 +75,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../lcd/e3v2/jyersui/dwin.h" #endif @@ -3038,7 +3038,7 @@ void MarlinSettings::reset() { // // LCD Brightness // - TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = DEFAULT_LCD_BRIGHTNESS); + TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT); // // Controller Fan diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 34ea7c2f3a..4ccd984b0d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -52,7 +52,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(EXTENSIBLE_UI) diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 59fdc4a3c9..ac11bd8b38 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -157,7 +157,7 @@ #if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1) #define HAS_LCD_BRIGHTNESS 1 - #define DEFAULT_LCD_BRIGHTNESS TFT_BACKLIGHT_PWM + #define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM #endif #if ENABLED(SDIO_SUPPORT) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 8c1d08a460..9966773418 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -34,7 +34,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #include "../module/planner.h" // for synchronize diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 27fc26f0a0..257616ddd1 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -15,7 +15,7 @@ exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD -opt_enable DWIN_CREALITY_LCD_ENHANCED BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING +opt_enable DWIN_CREALITY_LCD_ENHANCED BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE exec_test $1 $2 "Ender 3 v2 with Enhanced UI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" diff --git a/ini/features.ini b/ini/features.ini index c1ff3ef294..7f9fd1c338 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -46,7 +46,7 @@ SOFT_I2C_EEPROM = SlowSoftI2CMaster, SlowSoftWire=https:/ SPI_EEPROM = src_filter=+ HAS_DWIN_E3V2|IS_DWIN_MARLINUI = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ -DWIN_CREALITY_LCD_ENHANCED = src_filter=+ +DWIN_CREALITY_LCD_ENHANCED = src_filter=+ DWIN_CREALITY_LCD_JYERSUI = src_filter=+ IS_DWIN_MARLINUI = src_filter=+ HAS_GRAPHICAL_TFT = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 43c7e2be6b..3a02b5ab18 100644 --- a/platformio.ini +++ b/platformio.ini @@ -52,7 +52,7 @@ lib_deps = default_src_filter = + - - + - - - - - - - - - - - - - + - - - - - - - - - - -