🚸 Enhanced UI => Professional UI - with updates (#23624)

This commit is contained in:
Scott Lahteine 2022-02-05 10:30:17 -06:00 committed by Scott Lahteine
parent ac76ed7ece
commit 1b2715ccf2
46 changed files with 319 additions and 178 deletions

View File

@ -75,7 +75,7 @@
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "lcd/e3v2/creality/dwin.h" #include "lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "lcd/e3v2/enhanced/dwin.h" #include "lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "lcd/e3v2/jyersui/dwin.h" #include "lcd/e3v2/jyersui/dwin.h"
#endif #endif

View File

@ -58,7 +58,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#endif #endif
#include "../lcd/marlinui.h" #include "../lcd/marlinui.h"

View File

@ -69,7 +69,7 @@ bool FilamentMonitorBase::enabled = true,
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#endif #endif
void event_filament_runout(const uint8_t extruder) { void event_filament_runout(const uint8_t extruder) {

View File

@ -61,7 +61,7 @@
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h" #include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../../lcd/e3v2/enhanced/dwin.h" #include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if HAS_MULTI_HOTEND #if HAS_MULTI_HOTEND

View File

@ -41,7 +41,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../../lcd/e3v2/enhanced/dwin.h" #include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)

View File

@ -34,7 +34,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../../lcd/e3v2/enhanced/dwin.h" #include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**

View File

@ -52,7 +52,7 @@
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../lcd/e3v2/creality/dwin.h" #include "../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if HAS_L64XX // set L6470 absolute position registers to counts #if HAS_L64XX // set L6470 absolute position registers to counts

View File

@ -25,7 +25,7 @@
#if ENABLED(PLATFORM_M997_SUPPORT) #if ENABLED(PLATFORM_M997_SUPPORT)
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) #if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**

View File

@ -34,7 +34,7 @@
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h" #include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../../lcd/e3v2/enhanced/dwin.h" #include "../../../lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented
#endif #endif

View File

@ -36,8 +36,8 @@
#elif ENABLED(EXTENSIBLE_UI) #elif ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin_popup.h" #include "../../lcd/e3v2/proui/dwin_popup.h"
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)

View File

@ -29,7 +29,7 @@
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) #if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**

View File

@ -50,7 +50,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)

View File

@ -30,7 +30,7 @@
#include "../../MarlinCore.h" // for startOrResumeJob #include "../../MarlinCore.h" // for startOrResumeJob
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) #if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**

View File

@ -31,7 +31,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../../lcd/e3v2/enhanced/dwin.h" #include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**

View File

@ -494,6 +494,9 @@
#endif #endif
#define HAS_LCD_BRIGHTNESS 1 #define HAS_LCD_BRIGHTNESS 1
#define LCD_BRIGHTNESS_MAX 250 #define LCD_BRIGHTNESS_MAX 250
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#define LCD_BRIGHTNESS_DEFAULT 127
#endif
#endif #endif
#if IS_ULTRA_LCD #if IS_ULTRA_LCD

View File

@ -607,6 +607,8 @@
#error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180." #error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180."
#elif defined(LCD_SCREEN_ROT_270) #elif defined(LCD_SCREEN_ROT_270)
#error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 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 #endif
constexpr float arm[] = AXIS_RELATIVE_MODES; constexpr float arm[] = AXIS_RELATIVE_MODES;

View File

@ -25,7 +25,16 @@
#define Language_English 1 #define Language_English 1
#define Language_Chinese 2 #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_LOGO 0
#define ICON_Print_0 1 #define ICON_Print_0 1

View File

@ -91,9 +91,6 @@
#ifndef MACHINE_SIZE #ifndef MACHINE_SIZE
#define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS)
#endif #endif
#ifndef CORP_WEBSITE
#define CORP_WEBSITE WEBSITE_URL
#endif
#define PAUSE_HEAT #define PAUSE_HEAT

View File

@ -82,10 +82,6 @@
#define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #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_MENU font8x16
#define DWIN_FONT_STAT font10x20 #define DWIN_FONT_STAT font10x20
#define DWIN_FONT_HEAD font10x20 #define DWIN_FONT_HEAD font10x20

View File

@ -21,10 +21,12 @@
*/ */
/** /**
* DWIN UI Enhanced implementation * Enhanced DWIN implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.9.1 * Version: 3.11.2
* Date: 2021/11/21 * date: 2022/01/19
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
@ -83,6 +85,10 @@
#include "../../../feature/powerloss.h" #include "../../../feature/powerloss.h"
#endif #endif
#if HAS_GCODE_PREVIEW
#include "gcode_preview.h"
#endif
#if HAS_ESDIAG #if HAS_ESDIAG
#include "endstop_diag.h" #include "endstop_diag.h"
#endif #endif
@ -113,10 +119,6 @@
#include "lockscreen.h" #include "lockscreen.h"
#ifndef CORP_WEBSITE
#define CORP_WEBSITE WEBSITE_URL
#endif
#define PAUSE_HEAT #define PAUSE_HEAT
#define MENU_CHAR_LIMIT 24 #define MENU_CHAR_LIMIT 24
@ -169,7 +171,7 @@ enum SelectItem : uint8_t {
PAGE_PRINT = 0, PAGE_PRINT = 0,
PAGE_PREPARE, PAGE_PREPARE,
PAGE_CONTROL, PAGE_CONTROL,
PAGE_INFO_LEVELING, PAGE_INFO_LEV_ADV,
PAGE_COUNT, PAGE_COUNT,
PRINT_SETUP = 0, 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); 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 (selected) DWINUI::Draw_Box(0, HMI_data.Highlight_Color, ico);
if (HMI_IsChinese()) { 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 { else {
const uint16_t x = ico.x + (ico.w - strlen_P(FTOP(caption)) * DWINUI::fontWidth()) / 2, 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); 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() { void ICON_Print() {
constexpr frame_rect_t ico = { 17, 110, 110, 100 }; 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)); 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() { void ICON_Prepare() {
constexpr frame_rect_t ico = { 145, 110, 110, 100 }; 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)); 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() { void ICON_Control() {
constexpr frame_rect_t ico = { 17, 226, 110, 100 }; 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)); 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() { void ICON_StartInfo() {
constexpr frame_rect_t ico = { 145, 226, 110, 100 }; constexpr frame_rect_t ico = { 145, 226, 110, 100 };
constexpr text_info_t txt = { 91, { 405, 447 }, 27, 15 }; constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 };
ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); 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() { void ICON_Leveling() {
constexpr frame_rect_t ico = { 145, 226, 110, 100 }; constexpr frame_rect_t ico = { 145, 226, 110, 100 };
constexpr text_info_t txt = { 211, { 405, 447 }, 27, 15 }; constexpr text_info_t txt = { 211, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 };
ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); 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() { void ICON_Tune() {
constexpr frame_rect_t ico = { 8, 232, 80, 100 }; 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)); 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() { void ICON_Pause() {
constexpr frame_rect_t ico = { 96, 232, 80, 100 }; 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)); 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() { void ICON_Resume() {
constexpr frame_rect_t ico = { 96, 232, 80, 100 }; 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)); 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() { void ICON_Stop() {
constexpr frame_rect_t ico = { 184, 232, 80, 100 }; 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)); 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); 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 // Draw "Back" line at the top
void Draw_Back_First(const bool is_sel=true) { void Draw_Back_First(const bool is_sel=true) {
Draw_Menu_Line(0, ICON_Back); 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); if (is_sel) Draw_Menu_Cursor(0);
} }
@ -494,8 +500,8 @@ void Popup_window_PauseOrStop() {
if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); 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); 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); DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150);
DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); DWINUI::Draw_IconWB(ICON_Confirm_C, 26, 280);
DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); DWINUI::Draw_IconWB(ICON_Cancel_C, 146, 280);
Draw_Select_Highlight(true); Draw_Select_Highlight(true);
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
@ -513,7 +519,7 @@ void Popup_window_PauseOrStop() {
DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105); DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105);
DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240);
DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 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(); DWIN_UpdateLCD();
} }
else else
@ -637,7 +643,7 @@ void Draw_Print_Labels() {
} }
void Draw_Print_ProgressBar() { 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); 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_Int(HMI_data.PercentTxt_Color, HMI_data.Background_Color, 3, 117, 133, _percent_done);
DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%")); DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%"));
@ -707,7 +713,7 @@ void Draw_PrintDone() {
Draw_Print_ProgressElapsed(); Draw_Print_ProgressElapsed();
Draw_Print_ProgressRemain(); Draw_Print_ProgressRemain();
// show print done confirm // 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(); DWIN_UpdateLCD();
} }
@ -721,7 +727,7 @@ void Draw_Main_Menu() {
ICON_Print(); ICON_Print();
ICON_Prepare(); ICON_Prepare();
ICON_Control(); ICON_Control();
TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); ICON_AdvSettings();
DWIN_UpdateLCD(); 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 (force || changed || draw_qmark || draw_empty) {
if (blink && draw_qmark) 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) else if (blink && draw_empty)
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 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); } void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); }
#endif #endif
#define ICON_Folder ICON_More
#if ENABLED(SCROLL_LONG_FILENAMES) #if ENABLED(SCROLL_LONG_FILENAMES)
char shift_name[LONG_FILENAME_LENGTH + 1]; char shift_name[LONG_FILENAME_LENGTH + 1];
@ -1115,25 +1119,25 @@ void HMI_StartFrame(const bool with_update) {
void Draw_Info_Menu() { void Draw_Info_Menu() {
DWINUI::ClearMenuArea(); DWINUI::ClearMenuArea();
Draw_Back_First(); Draw_Back_First();
if (HMI_IsChinese())
DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE)); Title.FrameCopy(30, 17, 28, 13); // "Info"
DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION)); else
Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN));
if (HMI_IsChinese()) { 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, 197, 149, 252, 161, 108, 102); // "Size"
DWIN_Frame_AreaCopy(1, 1, 164, 56, 176, 108, 175); // "Firmware Version" DWIN_Frame_AreaCopy(1, 1, 164, 56, 176, 108, 175); // "Firmware Version"
DWIN_Frame_AreaCopy(1, 58, 164, 113, 176, 105, 248); // "Contact Details" DWIN_Frame_AreaCopy(1, 58, 164, 113, 176, 105, 248); // "Contact Details"
DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE));
} }
else { else {
Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); DWINUI::Draw_CenteredString(102, F("Size"));
DWINUI::Draw_CenteredString(175, F("Firmware version"));
DWIN_Frame_AreaCopy(1, 120, 150, 146, 161, 124, 102); // "Size" DWINUI::Draw_CenteredString(248, F("Build Datetime"));
DWIN_Frame_AreaCopy(1, 146, 151, 254, 161, 82, 175); // "Firmware Version" DWINUI::Draw_CenteredString(268, F(STRING_DISTRIBUTION_DATE));
DWIN_Frame_AreaCopy(1, 1, 164, 96, 175, 89, 248); // "Contact details"
} }
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) { LOOP_L_N(i, 3) {
DWINUI::Draw_Icon(ICON_PrintSize + i, ICOX, 99 + i * 73); 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_PRINT: ICON_Print(); break;
case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break; case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break;
case PAGE_CONTROL: ICON_Prepare(); ICON_Control(); 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) { switch (select_page.now) {
case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break; case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break;
case PAGE_PREPARE: ICON_Prepare(); ICON_Control(); 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_CONTROL: ICON_Control(); ICON_AdvSettings(); break;
case PAGE_INFO_LEVELING: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; case PAGE_INFO_LEV_ADV: ICON_AdvSettings(); break;
} }
} }
} }
@ -1180,6 +1184,7 @@ void HMI_MainMenu() {
switch (select_page.now) { switch (select_page.now) {
case PAGE_PRINT: case PAGE_PRINT:
checkkey = SelectFile; checkkey = SelectFile;
card.mount();
Draw_Print_File_Menu(); Draw_Print_File_Menu();
break; break;
@ -1187,14 +1192,7 @@ void HMI_MainMenu() {
case PAGE_CONTROL: Draw_Control_Menu(); break; case PAGE_CONTROL: Draw_Control_Menu(); break;
case PAGE_INFO_LEVELING: case PAGE_INFO_LEV_ADV: Draw_AdvancedSettings_Menu(); break;
#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;
} }
} }
DWIN_UpdateLCD(); DWIN_UpdateLCD();
@ -1469,6 +1467,9 @@ void Draw_Main_Area() {
case FilamentPurge: Draw_Popup_FilamentPurge(); break; case FilamentPurge: Draw_Popup_FilamentPurge(); break;
#endif #endif
case Locked: lockScreen.draw(); break; case Locked: lockScreen.draw(); break;
#if HAS_GCODE_PREVIEW
case ConfirmToPrint: Draw_PreviewFromSD(); break;
#endif
case Menu: case Menu:
case SetInt: case SetInt:
case SetPInt: case SetPInt:
@ -1496,14 +1497,12 @@ void HMI_Popup() {
void HMI_Init() { void HMI_Init() {
HMI_SDCardInit(); HMI_SDCardInit();
for (uint16_t t = 0; t <= 100; t += 2) { for (uint16_t t = 0; t <= 100; t += 2) {
DWINUI::Draw_Icon(ICON_Bar, 15, 260); DWINUI::Draw_Icon(ICON_Bar, 15, 260);
DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280); DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280);
DWIN_UpdateLCD(); DWIN_UpdateLCD();
delay(20); delay(20);
} }
HMI_SetLanguage(); HMI_SetLanguage();
} }
@ -1623,15 +1622,15 @@ void EachMomentUpdate() {
if (HMI_IsChinese()) { if (HMI_IsChinese()) {
DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115); DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115);
DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 167); DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 167);
DWINUI::Draw_Icon(ICON_Cancel_C, 26, 280); DWINUI::Draw_IconWB(ICON_Cancel_C, 26, 280);
DWINUI::Draw_Icon(ICON_Continue_C, 146, 280); DWINUI::Draw_IconWB(ICON_Continue_C, 146, 280);
} }
else { else {
DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 70, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); 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, 147, F("It looks like the last"));
DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted.")); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted."));
DWINUI::Draw_Icon(ICON_Cancel_E, 26, 280); DWINUI::Draw_IconWB(ICON_Cancel_E, 26, 280);
DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280);
} }
SdFile *dir = nullptr; SdFile *dir = nullptr;
const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename);
@ -1698,6 +1697,9 @@ void DWIN_HandleScreen() {
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
case PwrlossRec: HMI_PowerlossRecovery(); break; case PwrlossRec: HMI_PowerlossRecovery(); break;
#endif #endif
#if HAS_GCODE_PREVIEW
case ConfirmToPrint: HMI_ConfirmToPrint(); break;
#endif
#if HAS_ESDIAG #if HAS_ESDIAG
case ESDiagProcess: HMI_Popup(); break; case ESDiagProcess: HMI_Popup(); break;
#endif #endif
@ -1747,7 +1749,7 @@ void DWIN_MeshLevelingStart() {
#if HAS_ONESTEP_LEVELING #if HAS_ONESTEP_LEVELING
HMI_SaveProcessID(Leveling); HMI_SaveProcessID(Leveling);
Title.ShowCaption(GET_TEXT_F(MSG_BED_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) #elif ENABLED(MESH_BED_LEVELING)
Draw_ManualMesh_Menu(); Draw_ManualMesh_Menu();
#endif #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) { 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(); DWIN_UpdateLCD();
} }
@ -1969,8 +1972,8 @@ void DWIN_Redraw_screen() {
void Draw_Popup_FilamentPurge() { void Draw_Popup_FilamentPurge() {
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); 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_IconWB(ICON_Confirm_E, 26, 280);
DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280);
Draw_Select_Highlight(true); Draw_Select_Highlight(true);
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
@ -2037,6 +2040,41 @@ void HMI_LockScreen() {
if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); 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 #if HAS_ESDIAG
void Draw_EndStopDiag() { void Draw_EndStopDiag() {
HMI_SaveProcessID(ESDiagProcess); HMI_SaveProcessID(ESDiagProcess);
@ -2308,8 +2346,9 @@ void SetPID(celsius_t t, heater_id_t h) {
#endif #endif
#if HAS_LCD_BRIGHTNESS #if HAS_LCD_BRIGHTNESS
void LiveBrightness() { ui.set_brightness(HMI_value.Value); } void ApplyBrightness() { ui.set_brightness(HMI_value.Value); }
void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, nullptr, LiveBrightness); } void LiveBrightness() { DWIN_LCD_Brightness(HMI_value.Value); }
void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); }
#endif #endif
#if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASE_LIGHT_MENU)
@ -2382,6 +2421,12 @@ void SetPID(celsius_t t, heater_id_t h) {
#endif #endif
#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 #if HAS_FILAMENT_SENSOR
void SetRunoutEnable() { void SetRunoutEnable() {
runout.reset(); runout.reset();
@ -2490,9 +2535,11 @@ void Tram(uint8_t point) {
static bool inLev = false; static bool inLev = false;
if (inLev) return; if (inLev) return;
char str_1[6] = "", str_2[6] = "", str_3[6] = ""; 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 xpos = 0, ypos = 0, zval = 0;
float margin = PROBING_MARGIN; float margin = PROBING_MARGIN;
#else #else
#define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"
int16_t xpos = 0, ypos = 0; int16_t xpos = 0, ypos = 0;
int16_t margin = 30; int16_t margin = 30;
#endif #endif
@ -2527,7 +2574,7 @@ void Tram(uint8_t point) {
planner.synchronize(); planner.synchronize();
inLev = true; inLev = true;
zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); 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(xpos, 1, 1, str_1),
dtostrf(ypos, 1, 1, str_2), dtostrf(ypos, 1, 1, str_2),
dtostrf(zval, 1, 2, str_3) dtostrf(zval, 1, 2, str_3)
@ -2536,7 +2583,7 @@ void Tram(uint8_t point) {
inLev = false; inLev = false;
#else #else
planner.synchronize(); 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); queue.inject(cmd);
#endif #endif
} }
@ -3286,6 +3333,9 @@ void Draw_Prepare_Menu() {
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu);
#endif #endif
#if HAS_ONESTEP_LEVELING
MENU_ITEM(ICON_Level, GET_TEXT_F(MSG_AUTO_MESH), onDrawMenuItem, AutoLev);
#endif
#if HAS_ZOFFSET_ITEM #if HAS_ZOFFSET_ITEM
#if HAS_BED_PROBE #if HAS_BED_PROBE
MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu);
@ -3334,7 +3384,7 @@ void Draw_Control_Menu() {
if (CurrentMenu != ControlMenu) { if (CurrentMenu != ControlMenu) {
CurrentMenu = ControlMenu; CurrentMenu = ControlMenu;
SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); 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); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
#if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASE_LIGHT_MENU)
#if ENABLED(CASELIGHT_USES_BRIGHTNESS) #if ENABLED(CASELIGHT_USES_BRIGHTNESS)
@ -3354,7 +3404,6 @@ void Draw_Control_Menu() {
MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom);
#endif #endif
MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); 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); MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu);
} }
CurrentMenu->draw(); CurrentMenu->draw();
@ -3367,7 +3416,7 @@ void Draw_AdvancedSettings_Menu() {
CurrentMenu = AdvancedSettings; CurrentMenu = AdvancedSettings;
SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG
DWINUI::MenuItemsPrepare(15); 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 #if HAS_HOME_OFFSET
MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu);
#endif #endif

View File

@ -22,10 +22,12 @@
#pragma once #pragma once
/** /**
* DWIN UI Enhanced implementation * Enhanced DWIN implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.9.1 * Version: 3.9.2
* Date: 2021/11/21 * date: 2021/11/21
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
@ -62,6 +64,7 @@ enum processID : uint8_t {
PwrlossRec, PwrlossRec,
Reboot, Reboot,
Info, Info,
ConfirmToPrint,
// Popup Windows // Popup Windows
Homing, Homing,
@ -90,6 +93,8 @@ enum pidresult_t : uint8_t {
typedef struct { typedef struct {
int8_t Color[3]; // Color components 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 int8_t Preheat = 0; // Material Select 0: PLA, 1: ABS, 2: Custom
AxisEnum axis = X_AXIS; // Axis Select AxisEnum axis = X_AXIS; // Axis Select
int32_t MaxValue = 0; // Auxiliar max integer/scaled float value int32_t MaxValue = 0; // Auxiliar max integer/scaled float value
@ -137,6 +142,7 @@ void Goto_PrintProcess();
void Goto_Main_Menu(); void Goto_Main_Menu();
void Goto_Info_Menu(); void Goto_Info_Menu();
void Goto_PowerLossRecovery(); void Goto_PowerLossRecovery();
void Goto_ConfirmToPrint();
void Draw_Status_Area(const bool with_update); // Status Area void Draw_Status_Area(const bool with_update); // Status Area
void Draw_Main_Area(); // Redraw main area; void Draw_Main_Area(); // Redraw main area;
void DWIN_Redraw_screen(); // Redraw all screen elements void DWIN_Redraw_screen(); // Redraw all screen elements
@ -191,6 +197,9 @@ void HMI_LockScreen();
#if HAS_MESH #if HAS_MESH
void DWIN_MeshViewer(); void DWIN_MeshViewer();
#endif #endif
#if HAS_GCODE_PREVIEW
void HMI_ConfirmToPrint();
#endif
#if HAS_ESDIAG #if HAS_ESDIAG
void Draw_EndStopDiag(); void Draw_EndStopDiag();
#endif #endif
@ -221,6 +230,10 @@ void Draw_Tramming_Menu();
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
void Draw_FilSet_Menu(); void Draw_FilSet_Menu();
#endif #endif
#if ENABLED(NOZZLE_PARK_FEATURE)
void Draw_ParkPos_Menu();
#endif
void Draw_PhySet_Menu();
void Draw_SelectColors_Menu(); void Draw_SelectColors_Menu();
void Draw_GetColor_Menu(); void Draw_GetColor_Menu();
#if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)

View File

@ -23,11 +23,16 @@
/** /**
* DWIN general defines and data structs * DWIN general defines and data structs
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.9.1 * Version: 3.9.2
* Date: 2021/11/21 * 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 "../../../core/types.h"
#include "../common/dwin_color.h" #include "../common/dwin_color.h"
#if ENABLED(LED_CONTROL_MENU) #if ENABLED(LED_CONTROL_MENU)
@ -53,8 +58,8 @@
#define Def_Indicator_Color Color_White #define Def_Indicator_Color Color_White
#define Def_Coordinate_Color Color_White #define Def_Coordinate_Color Color_White
//#define HAS_GCODE_PREVIEW 1
#define HAS_ESDIAG 1 #define HAS_ESDIAG 1
#define DEFAULT_LCD_BRIGHTNESS 127
#if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) #if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS)
#define Def_Leds_Color LEDColorWhite() #define Def_Leds_Color LEDColorWhite()

View File

@ -22,9 +22,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.8.1
* Date: 2021/11/09 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"

View File

@ -23,9 +23,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.8.1
* Date: 2021/11/09 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../common/dwin_api.h" #include "../common/dwin_api.h"

View File

@ -22,9 +22,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.10.1
* Date: 2021/11/06 * Date: 2022/01/21
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #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) { void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) {
DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2); DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2);
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280);
DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); DWINUI::Draw_IconWB(ICON_Cancel_E, 146, 280);
Draw_Select_Highlight(true); Draw_Select_Highlight(true);
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }

View File

@ -23,9 +23,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.10.1
* Date: 2021/11/06 * Date: 2022/01/21
*
* Based on the original code provided by Creality under GPL
*/ */
#include "dwinui.h" #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 (icon) DWINUI::Draw_Icon(icon, 101, 105);
if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1);
if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2); 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<typename T, typename U>
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<typename T, typename U> template<typename T, typename U>

View File

@ -22,9 +22,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.8.2
* Date: 2021/11/09 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"

View File

@ -23,9 +23,11 @@
/** /**
* DWIN UI Enhanced implementation * DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.9.1 * Version: 3.11.1
* Date: 2021/11/21 * Date: 2022/01/19
*
* Based on the original code provided by Creality under GPL
*/ */
#include "dwin_lcd.h" #include "dwin_lcd.h"
@ -34,6 +36,10 @@
#include "../common/dwin_color.h" #include "../common/dwin_color.h"
// Extra Icons // 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_Brightness ICON_Motion
#define ICON_Cancel ICON_StockConfiguration #define ICON_Cancel ICON_StockConfiguration
#define ICON_CustomPreheat ICON_SetEndTemp #define ICON_CustomPreheat ICON_SetEndTemp
@ -45,6 +51,7 @@
#define ICON_FilSet ICON_ResumeEEPROM #define ICON_FilSet ICON_ResumeEEPROM
#define ICON_FilUnload ICON_ReadEEPROM #define ICON_FilUnload ICON_ReadEEPROM
#define ICON_Flow ICON_StepE #define ICON_Flow ICON_StepE
#define ICON_Folder ICON_More
#define ICON_FWRetLength ICON_StepE #define ICON_FWRetLength ICON_StepE
#define ICON_FWRetSpeed ICON_Setspeed #define ICON_FWRetSpeed ICON_Setspeed
#define ICON_FWRetZRaise ICON_MoveZ #define ICON_FWRetZRaise ICON_MoveZ
@ -52,28 +59,49 @@
#define ICON_HomeX ICON_MoveX #define ICON_HomeX ICON_MoveX
#define ICON_HomeY ICON_MoveY #define ICON_HomeY ICON_MoveY
#define ICON_HomeZ ICON_MoveZ #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_HSMode ICON_StockConfiguration
#define ICON_InvertE0 ICON_StepE
#define ICON_Tram ICON_SetEndTemp #define ICON_Tram ICON_SetEndTemp
#define ICON_Level ICON_HotendTemp
#define ICON_Lock ICON_Cool #define ICON_Lock ICON_Cool
#define ICON_ManualMesh ICON_HotendTemp #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_MeshNext ICON_Axis
#define ICON_MeshPoints ICON_SetEndTemp
#define ICON_MeshSave ICON_WriteEEPROM #define ICON_MeshSave ICON_WriteEEPROM
#define ICON_MeshViewer ICON_HotendTemp #define ICON_MeshViewer ICON_HotendTemp
#define ICON_MoveZ0 ICON_HotendTemp #define ICON_MoveZ0 ICON_HotendTemp
#define ICON_Park ICON_Motion #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_PIDbed ICON_SetBedTemp
#define ICON_PIDcycles ICON_ResumeEEPROM #define ICON_PIDcycles ICON_ResumeEEPROM
#define ICON_PIDValue ICON_Contact #define ICON_PIDValue ICON_Contact
#define ICON_PrintStats ICON_PrintTime #define ICON_PrintStats ICON_PrintTime
#define ICON_PrintStatsReset ICON_RemainTime #define ICON_PrintStatsReset ICON_RemainTime
#define ICON_ProbeDeploy ICON_SetEndTemp #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_ProbeSet ICON_SetEndTemp
#define ICON_ProbeStow ICON_SetEndTemp #define ICON_ProbeStow ICON_SetEndTemp
#define ICON_ProbeTest ICON_SetEndTemp #define ICON_ProbeTest ICON_SetEndTemp
#define ICON_ProbeZSpeed ICON_MaxSpeedZ
#define ICON_Pwrlossr ICON_Motion #define ICON_Pwrlossr ICON_Motion
#define ICON_Reboot ICON_ResumeEEPROM #define ICON_Reboot ICON_ResumeEEPROM
#define ICON_Runout ICON_MaxAccE #define ICON_Runout ICON_MaxAccE
#define ICON_Scolor ICON_MaxSpeed #define ICON_Scolor ICON_MaxSpeed
#define ICON_SetBaudRate ICON_Setspeed
#define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_SetCustomPreheat ICON_SetEndTemp
#define ICON_Sound ICON_Cool #define ICON_Sound ICON_Cool
#define ICON_CaseLight ICON_Motion #define ICON_CaseLight ICON_Motion
@ -247,6 +275,13 @@ namespace DWINUI {
DWIN_ICON_Show(ICON, icon, x, y); 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 // Draw a positive integer
// bShow: true=display background color; false=don't display background color // bShow: true=display background color; false=don't display background color
// zeroFill: true=zero fill; false=no zero fill // zeroFill: true=zero fill; false=no zero fill

View File

@ -22,9 +22,11 @@
/** /**
* DWIN End Stops diagnostic page * DWIN End Stops diagnostic page
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.0 * Version: 1.0.2
* Date: 2021/11/06 * Date: 2021/11/06
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
@ -106,4 +108,4 @@ void ESDiagClass::Update() {
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH #endif // DWIN_CREALITY_LCD_ENHANCED && HAS_ESDIAG

View File

@ -23,9 +23,11 @@
/** /**
* DWIN End Stops diagnostic page * DWIN End Stops diagnostic page
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.0 * Version: 1.0
* Date: 2021/11/06 * Date: 2021/11/06
*
* Based on the original code provided by Creality under GPL
*/ */
class ESDiagClass { class ESDiagClass {

View File

@ -22,9 +22,11 @@
/** /**
* Lock screen implementation for DWIN UI Enhanced implementation * Lock screen implementation for DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.1 * Version: 2.1
* Date: 2021/11/09 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"

View File

@ -23,9 +23,11 @@
/** /**
* Lock screen implementation for DWIN UI Enhanced implementation * Lock screen implementation for DWIN UI Enhanced implementation
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.1 * Version: 2.1
* Date: 2021/11/09 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../common/encoder.h" #include "../common/encoder.h"

View File

@ -22,9 +22,11 @@
/** /**
* DWIN Mesh Viewer * DWIN Mesh Viewer
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.9.1
* Date: 2021/11/06 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #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 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) #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) { 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; zmesh[x][y] = v;
NOLESS(maxz, v); NOLESS(maxz, v);
NOMORE(minz, v); NOMORE(minz, v);

View File

@ -23,9 +23,11 @@
/** /**
* DWIN Mesh Viewer * DWIN Mesh Viewer
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.8.1 * Version: 3.9.1
* Date: 2021/11/06 * Date: 2021/11/09
*
* Based on the original code provided by Creality under GPL
*/ */
class MeshViewerClass { class MeshViewerClass {

View File

@ -22,9 +22,11 @@
/** /**
* DWIN Print Stats page * DWIN Print Stats page
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.0 * Version: 1.1
* Date: 2021/11/21 * Date: 2022/01/09
*
* Based on the original code provided by Creality under GPL
*/ */
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"

View File

@ -23,9 +23,11 @@
/** /**
* DWIN Print Stats page * DWIN Print Stats page
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.0 * Version: 1.1
* Date: 2021/11/21 * Date: 2022/01/09
*
* Based on the original code provided by Creality under GPL
*/ */
class PrintStatsClass { class PrintStatsClass {

View File

@ -49,7 +49,7 @@ MarlinUI ui;
#include "e3v2/creality/dwin.h" #include "e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "fontutils.h" #include "fontutils.h"
#include "e3v2/enhanced/dwin.h" #include "e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "e3v2/jyersui/dwin.h" #include "e3v2/jyersui/dwin.h"
#endif #endif
@ -104,7 +104,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#endif #endif
#if HAS_LCD_BRIGHTNESS #if HAS_LCD_BRIGHTNESS
uint8_t MarlinUI::brightness = DEFAULT_LCD_BRIGHTNESS; uint8_t MarlinUI::brightness = LCD_BRIGHTNESS_DEFAULT;
bool MarlinUI::backlight = true; bool MarlinUI::backlight = true;
void MarlinUI::set_brightness(const uint8_t value) { void MarlinUI::set_brightness(const uint8_t value) {

View File

@ -58,7 +58,7 @@
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "e3v2/creality/dwin.h" #include "e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "e3v2/enhanced/dwin.h" #include "e3v2/proui/dwin.h"
#endif #endif
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
@ -265,8 +265,8 @@ public:
#ifndef LCD_BRIGHTNESS_MAX #ifndef LCD_BRIGHTNESS_MAX
#define LCD_BRIGHTNESS_MAX 255 #define LCD_BRIGHTNESS_MAX 255
#endif #endif
#ifndef DEFAULT_LCD_BRIGHTNESS #ifndef LCD_BRIGHTNESS_DEFAULT
#define DEFAULT_LCD_BRIGHTNESS LCD_BRIGHTNESS_MAX #define LCD_BRIGHTNESS_DEFAULT LCD_BRIGHTNESS_MAX
#endif #endif
static uint8_t brightness; static uint8_t brightness;
static bool backlight; static bool backlight;

View File

@ -80,7 +80,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)

View File

@ -75,7 +75,7 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "../lcd/e3v2/jyersui/dwin.h" #include "../lcd/e3v2/jyersui/dwin.h"
#endif #endif
@ -3038,7 +3038,7 @@ void MarlinSettings::reset() {
// //
// LCD Brightness // LCD Brightness
// //
TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = DEFAULT_LCD_BRIGHTNESS); TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT);
// //
// Controller Fan // Controller Fan

View File

@ -52,7 +52,7 @@
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "../lcd/e3v2/creality/dwin.h" #include "../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)

View File

@ -157,7 +157,7 @@
#if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1) #if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1)
#define HAS_LCD_BRIGHTNESS 1 #define HAS_LCD_BRIGHTNESS 1
#define DEFAULT_LCD_BRIGHTNESS TFT_BACKLIGHT_PWM #define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM
#endif #endif
#if ENABLED(SDIO_SUPPORT) #if ENABLED(SDIO_SUPPORT)

View File

@ -34,7 +34,7 @@
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "../lcd/e3v2/creality/dwin.h" #include "../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
#include "../lcd/e3v2/enhanced/dwin.h" #include "../lcd/e3v2/proui/dwin.h"
#endif #endif
#include "../module/planner.h" // for synchronize #include "../module/planner.h" // for synchronize

View File

@ -15,7 +15,7 @@ exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3"
use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI"
opt_disable DWIN_CREALITY_LCD 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" exec_test $1 $2 "Ender 3 v2 with Enhanced UI" "$3"
use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI"

View File

@ -46,7 +46,7 @@ SOFT_I2C_EEPROM = SlowSoftI2CMaster, SlowSoftWire=https:/
SPI_EEPROM = src_filter=+<src/HAL/shared/eeprom_if_spi.cpp> SPI_EEPROM = src_filter=+<src/HAL/shared/eeprom_if_spi.cpp>
HAS_DWIN_E3V2|IS_DWIN_MARLINUI = src_filter=+<src/lcd/e3v2/common> HAS_DWIN_E3V2|IS_DWIN_MARLINUI = src_filter=+<src/lcd/e3v2/common>
DWIN_CREALITY_LCD = src_filter=+<src/lcd/e3v2/creality> DWIN_CREALITY_LCD = src_filter=+<src/lcd/e3v2/creality>
DWIN_CREALITY_LCD_ENHANCED = src_filter=+<src/lcd/e3v2/enhanced> DWIN_CREALITY_LCD_ENHANCED = src_filter=+<src/lcd/e3v2/proui>
DWIN_CREALITY_LCD_JYERSUI = src_filter=+<src/lcd/e3v2/jyersui> DWIN_CREALITY_LCD_JYERSUI = src_filter=+<src/lcd/e3v2/jyersui>
IS_DWIN_MARLINUI = src_filter=+<src/lcd/e3v2/marlinui> IS_DWIN_MARLINUI = src_filter=+<src/lcd/e3v2/marlinui>
HAS_GRAPHICAL_TFT = src_filter=+<src/lcd/tft> HAS_GRAPHICAL_TFT = src_filter=+<src/lcd/tft>

View File

@ -52,7 +52,7 @@ lib_deps =
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/lcd/HD44780> -<src/lcd/TFTGLCD> -<src/lcd/dogm> -<src/lcd/tft> -<src/lcd/tft_io> -<src/lcd/HD44780> -<src/lcd/TFTGLCD> -<src/lcd/dogm> -<src/lcd/tft> -<src/lcd/tft_io>
-<src/HAL/STM32/tft> -<src/HAL/STM32F1/tft> -<src/HAL/STM32/tft> -<src/HAL/STM32F1/tft>
-<src/lcd/e3v2/common> -<src/lcd/e3v2/creality> -<src/lcd/e3v2/enhanced> -<src/lcd/e3v2/jyersui> -<src/lcd/e3v2/marlinui> -<src/lcd/e3v2/common> -<src/lcd/e3v2/creality> -<src/lcd/e3v2/proui> -<src/lcd/e3v2/jyersui> -<src/lcd/e3v2/marlinui>
-<src/lcd/menu> -<src/lcd/menu>
-<src/lcd/menu/game/game.cpp> -<src/lcd/menu/game/brickout.cpp> -<src/lcd/menu/game/invaders.cpp> -<src/lcd/menu/game/game.cpp> -<src/lcd/menu/game/brickout.cpp> -<src/lcd/menu/game/invaders.cpp>
-<src/lcd/menu/game/maze.cpp> -<src/lcd/menu/game/snake.cpp> -<src/lcd/menu/game/maze.cpp> -<src/lcd/menu/game/snake.cpp>