From be7bbadabeb49c5e57d61fb2367cc5c994a5a6db Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 28 Sep 2020 04:39:29 -0500 Subject: [PATCH] Default E3 V2 to English --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 120 +++++++++++++++--------------- Marlin/src/lcd/dwin/e3v2/dwin.h | 9 ++- 2 files changed, 66 insertions(+), 63 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index c0096d379d..2aaf66854c 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -151,7 +151,7 @@ constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, // Total rows, and other /* Value Init */ HMI_value_t HMI_ValueStruct; -HMI_Flag HMI_flag{0}; +HMI_Flag_t HMI_flag{0}; millis_t dwin_heat_time = 0; @@ -173,7 +173,6 @@ select_t select_page{0}, select_file{0}, select_print{0}, select_prepare{0} , select_acc{0} , select_jerk{0} , select_step{0} - // , select_leveling{0} ; uint8_t index_file = MROWS, @@ -208,22 +207,24 @@ uint16_t remain_time = 0; #define DWIN_LANGUAGE_EEPROM_ADDRESS 0x01 // Between 0x01 and 0x63 (EEPROM_OFFSET-1) // BL24CXX::check() uses 0x00 +inline bool HMI_IsChinese() { return HMI_flag.language == DWIN_CHINESE; } + void HMI_SetLanguageCache() { - DWIN_JPG_CacheTo1(HMI_flag.language_chinese ? Language_Chinese : Language_English); + DWIN_JPG_CacheTo1(HMI_IsChinese() ? Language_Chinese : Language_English); } void HMI_SetLanguage() { #if ENABLED(EEPROM_SETTINGS) - BL24CXX::read(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language_chinese, sizeof(HMI_flag.language_chinese)); + BL24CXX::read(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif HMI_SetLanguageCache(); } void HMI_ToggleLanguage() { - HMI_flag.language_chinese ^= true; + HMI_flag.language = HMI_IsChinese() ? DWIN_ENGLISH : DWIN_CHINESE; HMI_SetLanguageCache(); #if ENABLED(EEPROM_SETTINGS) - BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language_chinese, sizeof(HMI_flag.language_chinese)); + BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif } @@ -242,14 +243,14 @@ void ICON_Print() { if (select_page.now == 0) { DWIN_ICON_Show(ICON, ICON_Print_1, 17, 130); DWIN_Draw_Rectangle(0, Color_White, 17, 130, 126, 229); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 1, 447, 28, 460, 58, 201); else DWIN_Frame_AreaCopy(1, 1, 451, 31, 463, 57, 201); } else { DWIN_ICON_Show(ICON, ICON_Print_0, 17, 130); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 1, 405, 28, 420, 58, 201); else DWIN_Frame_AreaCopy(1, 1, 423, 31, 435, 57, 201); @@ -260,14 +261,14 @@ void ICON_Prepare() { if (select_page.now == 1) { DWIN_ICON_Show(ICON, ICON_Prepare_1, 145, 130); DWIN_Draw_Rectangle(0, Color_White, 145, 130, 254, 229); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 31, 447, 58, 460, 186, 201); else DWIN_Frame_AreaCopy(1, 33, 451, 82, 466, 175, 201); } else { DWIN_ICON_Show(ICON, ICON_Prepare_0, 145, 130); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 31, 405, 58, 420, 186, 201); else DWIN_Frame_AreaCopy(1, 33, 423, 82, 438, 175, 201); @@ -278,14 +279,14 @@ void ICON_Control() { if (select_page.now == 2) { DWIN_ICON_Show(ICON, ICON_Control_1, 17, 246); DWIN_Draw_Rectangle(0, Color_White, 17, 246, 126, 345); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 61, 447, 88, 460, 58, 318); else DWIN_Frame_AreaCopy(1, 85, 451, 132, 463, 48, 318); } else { DWIN_ICON_Show(ICON, ICON_Control_0, 17, 246); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 61, 405, 88, 420, 58, 318); else DWIN_Frame_AreaCopy(1, 85, 423, 132, 434, 48, 318); @@ -296,14 +297,14 @@ void ICON_StartInfo(bool show) { if (show) { DWIN_ICON_Show(ICON, ICON_Info_1, 145, 246); DWIN_Draw_Rectangle(0, Color_White, 145, 246, 254, 345); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 91, 447, 118, 460, 186, 318); else DWIN_Frame_AreaCopy(1, 132, 451, 159, 466, 186, 318); } else { DWIN_ICON_Show(ICON, ICON_Info_0, 145, 246); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 91, 405, 118, 420, 186, 318); else DWIN_Frame_AreaCopy(1, 132, 423, 159, 435, 186, 318); @@ -314,14 +315,14 @@ void ICON_Leveling(bool show) { if (show) { DWIN_ICON_Show(ICON, ICON_Leveling_1, 145, 246); DWIN_Draw_Rectangle(0, Color_White, 145, 246, 254, 345); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 211, 447, 238, 460, 186, 318); else DWIN_Frame_AreaCopy(1, 84, 437, 120, 449, 182, 318); } else { DWIN_ICON_Show(ICON, ICON_Leveling_0, 145, 246); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 211, 405, 238, 420, 186, 318); else DWIN_Frame_AreaCopy(1, 84, 465, 120, 478, 182, 318); @@ -332,14 +333,14 @@ void ICON_Tune() { if (select_print.now == 0) { DWIN_ICON_Show(ICON, ICON_Setup_1, 8, 252); DWIN_Draw_Rectangle(0, Color_White, 8, 252, 87, 351); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 121, 447, 148, 458, 34, 325); else DWIN_Frame_AreaCopy(1, 0, 466, 34, 476, 31, 325); } else { DWIN_ICON_Show(ICON, ICON_Setup_0, 8, 252); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 121, 405, 148, 420, 34, 325); else DWIN_Frame_AreaCopy(1, 0, 438, 32, 448, 31, 325); @@ -350,14 +351,14 @@ void ICON_Pause() { if (select_print.now == 1) { DWIN_ICON_Show(ICON, ICON_Pause_1, 96, 252); DWIN_Draw_Rectangle(0, Color_White, 96, 252, 175, 351); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 181, 447, 208, 459, 124, 325); else DWIN_Frame_AreaCopy(1, 177, 451, 216, 462, 116, 325); } else { DWIN_ICON_Show(ICON, ICON_Pause_0, 96, 252); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 181, 405, 208, 420, 124, 325); else DWIN_Frame_AreaCopy(1, 177, 423, 215, 433, 116, 325); @@ -368,14 +369,14 @@ void ICON_Continue() { if (select_print.now == 1) { DWIN_ICON_Show(ICON, ICON_Continue_1, 96, 252); DWIN_Draw_Rectangle(0, Color_White, 96, 252, 175, 351); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 1, 447, 28, 460, 124, 325); else DWIN_Frame_AreaCopy(1, 1, 452, 32, 464, 121, 325); } else { DWIN_ICON_Show(ICON, ICON_Continue_0, 96, 252); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 1, 405, 28, 420, 124, 325); else DWIN_Frame_AreaCopy(1, 1, 424, 31, 434, 121, 325); @@ -386,14 +387,14 @@ void ICON_Stop() { if (select_print.now == 2) { DWIN_ICON_Show(ICON, ICON_Stop_1, 184, 252); DWIN_Draw_Rectangle(0, Color_White, 184, 252, 263, 351); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 151, 447, 178, 459, 210, 325); else DWIN_Frame_AreaCopy(1, 218, 452, 249, 466, 209, 325); } else { DWIN_ICON_Show(ICON, ICON_Stop_0, 184, 252); - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 151, 405, 178, 420, 210, 325); else DWIN_Frame_AreaCopy(1, 218, 423, 247, 436, 209, 325); @@ -481,7 +482,7 @@ inline void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char // The "Back" label is always on the first line inline void Draw_Back_Label() { - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); else DWIN_Frame_AreaCopy(1, 226, 179, 256, 189, LBLX, MBASE(0)); @@ -563,7 +564,7 @@ inline void draw_move_en(const uint16_t line) { inline void DWIN_Frame_TitleCopy(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { DWIN_Frame_AreaCopy(id, x1, y1, x2, y2, 14, 8); } inline void Item_Prepare_Move(const uint8_t row) { - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 159, 70, 200, 84, LBLX, MBASE(row)); else draw_move_en(MBASE(row)); // "Move >" @@ -572,7 +573,7 @@ inline void Item_Prepare_Move(const uint8_t row) { } inline void Item_Prepare_Disable(const uint8_t row) { - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 204, 70, 259, 82, LBLX, MBASE(row)); else DWIN_Frame_AreaCopy(1, 103, 59, 200, 74, LBLX, MBASE(row)); // "Disable Stepper" @@ -580,7 +581,7 @@ inline void Item_Prepare_Disable(const uint8_t row) { } inline void Item_Prepare_Home(const uint8_t row) { - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 0, 89, 41, 101, LBLX, MBASE(row)); else DWIN_Frame_AreaCopy(1, 202, 61, 271, 71, LBLX, MBASE(row)); // "Auto Home" @@ -590,7 +591,7 @@ inline void Item_Prepare_Home(const uint8_t row) { #if HAS_ZOFFSET_ITEM inline void Item_Prepare_Offset(const uint8_t row) { - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { #if HAS_BED_PROBE DWIN_Frame_AreaCopy(1, 174, 164, 223, 177, LBLX, MBASE(row)); DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), BABY_Z_VAR * 100); @@ -613,7 +614,7 @@ inline void Item_Prepare_Home(const uint8_t row) { #if HAS_HOTEND inline void Item_Prepare_PLA(const uint8_t row) { - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 100, 89, 151, 101, LBLX, MBASE(row)); } else { @@ -624,7 +625,7 @@ inline void Item_Prepare_Home(const uint8_t row) { } inline void Item_Prepare_ABS(const uint8_t row) { - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 180, 89, 233, 100, LBLX, MBASE(row)); } else { @@ -637,7 +638,7 @@ inline void Item_Prepare_Home(const uint8_t row) { #if HAS_PREHEAT inline void Item_Prepare_Cool(const uint8_t row) { - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 1, 104, 56, 117, LBLX, MBASE(row)); else DWIN_Frame_AreaCopy(1, 200, 76, 264, 86, LBLX, MBASE(row)); // "Cooldown" @@ -646,7 +647,7 @@ inline void Item_Prepare_Home(const uint8_t row) { #endif inline void Item_Prepare_Lang(const uint8_t row) { - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 239, 134, 266, 146, LBLX, MBASE(row)); DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, 226, MBASE(row), F("CN")); } @@ -664,7 +665,7 @@ inline void Draw_Prepare_Menu() { #define PSCROL(L) (scroll + (L)) #define PVISI(L) WITHIN(PSCROL(L), 0, MROWS) - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 133, 1, 160, 13); // "Prepare" } else { @@ -708,7 +709,7 @@ inline void Draw_Control_Menu() { if (CVISI(0)) Draw_Back_First(select_control.now == 0); // < Back - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 103, 1, 130, 14); // "Control" DWIN_Frame_AreaCopy(1, 57, 104, 84, 116, LBLX, CLINE(CONTROL_CASE_TEMP)); // Temperature > @@ -775,7 +776,7 @@ inline void Draw_Control_Menu() { inline void Draw_Tune_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 73, 2, 100, 13, 14, 9); DWIN_Frame_AreaCopy(1, 116, 164, 171, 176, LBLX, MBASE(TUNE_CASE_SPEED)); #if HAS_HOTEND @@ -881,7 +882,7 @@ inline void say_e(const uint16_t inset, const uint16_t line) { inline void Draw_Motion_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Motion" DWIN_Frame_AreaCopy(1, 173, 133, 228, 147, LBLX, MBASE(MOTION_CASE_RATE)); // Max speed DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX, MBASE(MOTION_CASE_ACCEL)); // Max... @@ -936,7 +937,7 @@ inline void Draw_Motion_Menu() { Draw_Popup_Bkgd_105(); if (toohigh) { DWIN_ICON_Show(ICON, ICON_TempTooHigh, 102, 165); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { 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); @@ -948,7 +949,7 @@ inline void Draw_Motion_Menu() { } else { DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 165); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 103, 371, 270, 386, 52, 285); DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); } @@ -971,7 +972,7 @@ inline void Draw_Popup_Bkgd_60() { Clear_Main_Window(); Draw_Popup_Bkgd_60(); DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 105); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 240); DWIN_ICON_Show(ICON, ICON_Confirm_C, 86, 280); @@ -987,7 +988,7 @@ inline void Draw_Popup_Bkgd_60() { void Popup_Window_Resume() { Clear_Popup_Area(); Draw_Popup_Bkgd_105(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 135); DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 192); DWIN_ICON_Show(ICON, ICON_Continue_C, 26, 307); @@ -1006,7 +1007,7 @@ void Popup_Window_Home(const bool parking/*=false*/) { Clear_Main_Window(); Draw_Popup_Bkgd_60(); DWIN_ICON_Show(ICON, ICON_BLTouch, 101, 105); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 0, 371, 33, 386, 85, 240); DWIN_Frame_AreaCopy(1, 203, 286, 271, 302, 118, 240); DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280); @@ -1023,7 +1024,7 @@ void Popup_Window_Home(const bool parking/*=false*/) { Clear_Main_Window(); Draw_Popup_Bkgd_60(); DWIN_ICON_Show(ICON, ICON_AutoLeveling, 101, 105); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 0, 371, 100, 386, 84, 240); DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280); } @@ -1048,7 +1049,7 @@ void Draw_Select_Highlight(const bool sel) { void Popup_window_PauseOrStop() { Clear_Main_Window(); Draw_Popup_Bkgd_60(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { if (select_print.now == 1) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); else if (select_print.now == 2) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); @@ -1065,7 +1066,7 @@ void Popup_window_PauseOrStop() { } void Draw_Printing_Screen() { - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 30, 1, 71, 14, 14, 9); // Tune DWIN_Frame_AreaCopy(1, 0, 72, 63, 86, 41, 188); // Pause DWIN_Frame_AreaCopy(1, 65, 72, 128, 86, 176, 188); // Stop @@ -1125,7 +1126,7 @@ void Goto_MainMenu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 2, 2, 27, 14, 14, 9); // "Home" } else { @@ -1864,7 +1865,7 @@ inline void Draw_Info_Menu() { DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(MACHINE_SIZE) * MENU_CHR_W) / 2, 122, (char*)MACHINE_SIZE); DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(SHORT_BUILD_VERSION) * MENU_CHR_W) / 2, 195, (char*)SHORT_BUILD_VERSION); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 30, 17, 57, 29); // "Info" DWIN_Frame_AreaCopy(1, 197, 149, 252, 161, 108, 102); @@ -1895,7 +1896,7 @@ inline void Draw_Info_Menu() { inline void Draw_Print_File_Menu() { Clear_Title_Bar(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 0, 31, 55, 44); // "Print file" } else { @@ -2226,9 +2227,8 @@ void HMI_PauseOrStop() { dwin_abort_flag = true; #endif } - else { + else Goto_PrintProcess(); // cancel stop - } } } DWIN_UpdateLCD(); @@ -2237,7 +2237,7 @@ void HMI_PauseOrStop() { inline void Draw_Move_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 192, 1, 233, 14); // "Move" DWIN_Frame_AreaCopy(1, 58, 118, 106, 132, LBLX, MBASE(1)); DWIN_Frame_AreaCopy(1, 109, 118, 157, 132, LBLX, MBASE(2)); @@ -2409,7 +2409,7 @@ void HMI_Prepare() { void Draw_Temperature_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 236, 2, 263, 13); // "Temperature" #if HAS_HOTEND DWIN_Frame_AreaCopy(1, 1, 134, 56, 146, LBLX, MBASE(TEMP_CASE_TEMP)); @@ -2508,7 +2508,7 @@ void HMI_Control() { Draw_More_Icon(CONTROL_CASE_MOVE + MROWS - index_control); // Motion > if (index_control > MROWS) { Draw_More_Icon(CONTROL_CASE_INFO + MROWS - index_control); // Info > - if (HMI_flag.language_chinese) + if (HMI_IsChinese()) DWIN_Frame_AreaCopy(1, 231, 104, 258, 116, LBLX, MBASE(CONTROL_CASE_INFO - 1)); else DWIN_Frame_AreaCopy(1, 0, 104, 24, 114, LBLX, MBASE(CONTROL_CASE_INFO - 1)); @@ -2718,7 +2718,7 @@ void HMI_Temperature() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 59, 16, 139, 29); // "PLA Settings" DWIN_Frame_AreaCopy(1, 100, 89, 124, 101, LBLX, MBASE(PREHEAT_CASE_TEMP)); DWIN_Frame_AreaCopy(1, 1, 134, 56, 146, LBLX + 24, MBASE(PREHEAT_CASE_TEMP)); // PLA nozzle temp @@ -2792,7 +2792,7 @@ void HMI_Temperature() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 142, 16, 223, 29); // "ABS Settings" DWIN_Frame_AreaCopy(1, 180, 89, 204, 100, LBLX, MBASE(PREHEAT_CASE_TEMP)); @@ -2872,7 +2872,7 @@ void HMI_Temperature() { inline void Draw_Max_Speed_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Max Speed (mm/s)" auto say_max_speed = [](const uint16_t row) { @@ -2934,7 +2934,7 @@ inline void Draw_Max_Speed_Menu() { inline void Draw_Max_Accel_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Acceleration" DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX, MBASE(1)); @@ -2985,7 +2985,7 @@ inline void Draw_Max_Accel_Menu() { inline void Draw_Max_Jerk_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Jerk" DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(1)); @@ -3055,7 +3055,7 @@ inline void Draw_Max_Jerk_Menu() { inline void Draw_Steps_Menu() { Clear_Main_Window(); - if (HMI_flag.language_chinese) { + if (HMI_IsChinese()) { DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Steps per mm" DWIN_Frame_AreaCopy(1, 153, 148, 194, 161, LBLX, MBASE(1)); @@ -3528,7 +3528,7 @@ void EachMomentUpdate() { // show print done confirm DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 250, DWIN_WIDTH - 1, STATUS_Y); - DWIN_ICON_Show(ICON, HMI_flag.language_chinese ? ICON_Confirm_C : ICON_Confirm_E, 86, 283); + DWIN_ICON_Show(ICON, HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 283); } else if (HMI_flag.pause_flag != printingIsPaused()) { // print status update diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.h b/Marlin/src/lcd/dwin/e3v2/dwin.h index 1b2cb273e3..5bff2e9f78 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.h +++ b/Marlin/src/lcd/dwin/e3v2/dwin.h @@ -252,8 +252,11 @@ typedef struct { char show_mode = 0; // -1: Temperature control 0: Printing temperature } HMI_value_t; +#define DWIN_CHINESE 123 +#define DWIN_ENGLISH 0 + typedef struct { - bool language_chinese; // 0: EN, 1: CN + uint8_t language; bool pause_flag:1; bool pause_action:1; bool print_finish:1; @@ -271,10 +274,10 @@ typedef struct { AxisEnum feedspeed_axis; #endif AxisEnum acc_axis, jerk_axis, step_axis; -} HMI_Flag; +} HMI_Flag_t; extern HMI_value_t HMI_ValueStruct; -extern HMI_Flag HMI_flag; +extern HMI_Flag_t HMI_flag; // Show ICO void ICON_Print(bool show);