Skip to content

Commit

Permalink
Improve compliance to Marlin standards
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 5, 2022
1 parent ede0922 commit 3b90b74
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 65 deletions.
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion Marlin/src/lcd/e3v2/common/dwin_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 11 additions & 17 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@

#include "lockscreen.h"

#ifndef CORP_WEBSITE
#define CORP_WEBSITE WEBSITE_URL
#endif

#define PAUSE_HEAT

#define MENU_CHAR_LIMIT 24
Expand Down Expand Up @@ -330,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -339,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -348,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -357,7 +353,7 @@ void ICON_Control() {
//
void ICON_StartInfo() {
constexpr frame_rect_t ico = { 145, 226, 110, 100 };
constexpr text_info_t txt = { 91, { 405, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO));
}

Expand All @@ -366,7 +362,7 @@ void ICON_StartInfo() {
//
void ICON_Leveling() {
constexpr frame_rect_t ico = { 145, 226, 110, 100 };
constexpr text_info_t txt = { 211, { 405, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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_LEV_ADV, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL));
}

Expand All @@ -375,7 +371,7 @@ void ICON_Leveling() {
//
void ICON_AdvSettings() {
constexpr frame_rect_t ico = { 145, 226, 110, 100 };
constexpr text_info_t txt = { 91, { 405, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_ADVANCED));
}

Expand All @@ -384,7 +380,7 @@ void ICON_AdvSettings() {
//
void ICON_Tune() {
constexpr frame_rect_t ico = { 8, 232, 80, 100 };
constexpr text_info_t txt = { 121, { 405, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -393,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -402,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand All @@ -411,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, TERN(USE_UNIFIED_DWIN_SET, 447, 446) }, 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));
}

Expand Down Expand Up @@ -1138,7 +1134,7 @@ void Draw_Info_Menu() {
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 " " STRING_DISTRIBUTION_TIME));
DWINUI::Draw_CenteredString(268, F(STRING_DISTRIBUTION_DATE));
}
DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE));
DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION));
Expand Down Expand Up @@ -1501,8 +1497,6 @@ void HMI_Popup() {

void HMI_Init() {
HMI_SDCardInit();
DWINUI::Draw_Box(1, Color_Black, { 5, 220, DWIN_WIDTH - 5, DWINUI::fontHeight() });
DWINUI::Draw_CenteredString(Color_White, 220, F("Professional Firmware "));
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);
Expand Down
31 changes: 0 additions & 31 deletions Marlin/src/lcd/e3v2/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,8 @@
#define Def_Indicator_Color Color_White
#define Def_Coordinate_Color Color_White

#define X_BED_MIN 150
#define Y_BED_MIN 150
#define DEF_X_BED_SIZE 230
#define DEF_Y_BED_SIZE 230
#define DEF_X_MAX_POS 248
#define DEF_Y_MAX_POS 231
#define DEF_Z_MAX_POS 250
#define DEF_FIL_RUNOUT1_STATE LOW
#define DEF_NOZZLE_PARK_POINT {240, 220, 20}
#define SOUND_MENU_ITEM
#if HAS_MESH
#define DEF_GRID_MAX_POINTS 5
#define GRID_LIMIT 9
#endif

//#define HAS_GCODE_PREVIEW 1
#define HAS_ESDIAG 1
#ifndef INDIVIDUAL_AXIS_HOMING_SUBMENU
#define INDIVIDUAL_AXIS_HOMING_SUBMENU
#endif
#ifndef LCD_SET_PROGRESS_MANUALLY
#define LCD_SET_PROGRESS_MANUALLY
#endif
#ifndef STATUS_MESSAGE_SCROLLING
#define STATUS_MESSAGE_SCROLLING
#endif
#ifndef BAUD_RATE_GCODE
#define BAUD_RATE_GCODE
#endif
#ifndef HAS_LCD_BRIGHTNESS
#define HAS_LCD_BRIGHTNESS 1
#endif
#define LCD_BRIGHTNESS_DEFAULT 127

#if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS)
#define Def_Leds_Color LEDColorWhite()
Expand Down
8 changes: 0 additions & 8 deletions Marlin/src/lcd/e3v2/proui/dwinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@
#include "../common/dwin_font.h"
#include "../common/dwin_color.h"

// ICON ID

//#define USE_UNIFIED_DWIN_SET // Official Marlin DWIN_SET
#ifndef USE_UNIFIED_DWIN_SET
#undef ICON
#define ICON 0x09 // Default Creality DWIN_SET
#endif

// Extra Icons
#define ICON_AdvSet ICON_Language
#define ICON_BedSizeX ICON_PrintSize
Expand Down
2 changes: 1 addition & 1 deletion buildroot/tests/STM32F103RE_creality
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3b90b74

Please sign in to comment.