Browse Source

🚸 Fix up E3V2 Enhanced (#23100)

Miguel Risco-Castillo 3 years ago
parent
commit
589a6d7f6b
No account linked to committer's email address

+ 0
- 1
Marlin/src/feature/pause.cpp View File

254
 
254
 
255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
256
     TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
256
     TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
257
-    TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
258
     wait_for_user = true; // A click or M108 breaks the purge_length loop
257
     wait_for_user = true; // A click or M108 breaks the purge_length loop
259
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
258
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
260
       unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
259
       unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);

+ 53
- 53
Marlin/src/lcd/e3v2/enhanced/dwin.cpp View File

23
 /**
23
 /**
24
  * DWIN UI Enhanced implementation
24
  * DWIN UI Enhanced implementation
25
  * Author: Miguel A. Risco-Castillo
25
  * Author: Miguel A. Risco-Castillo
26
- * Version: 3.6.3
27
- * Date: 2021/09/10
26
+ * Version: 3.7.1
27
+ * Date: 2021/11/09
28
  */
28
  */
29
 
29
 
30
 #include "../../../inc/MarlinConfigPre.h"
30
 #include "../../../inc/MarlinConfigPre.h"
142
 
142
 
143
 millis_t dwin_heat_time = 0;
143
 millis_t dwin_heat_time = 0;
144
 
144
 
145
-uint8_t checkkey = MainMenu, last_checkkey = MainMenu;
145
+uint8_t checkkey = 255, last_checkkey = MainMenu;
146
 
146
 
147
 enum SelectItem : uint8_t {
147
 enum SelectItem : uint8_t {
148
   PAGE_PRINT = 0,
148
   PAGE_PRINT = 0,
387
   ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt);
387
   ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt);
388
 }
388
 }
389
 
389
 
390
-void Draw_Menu_Cursor(const uint8_t line) {
390
+void Draw_Menu_Cursor(const int8_t line) {
391
   DWIN_Draw_Rectangle(1, HMI_data.Cursor_color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20);
391
   DWIN_Draw_Rectangle(1, HMI_data.Cursor_color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20);
392
 }
392
 }
393
 
393
 
394
-void Erase_Menu_Cursor(const uint8_t line) {
394
+void Erase_Menu_Cursor(const int8_t line) {
395
   DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20);
395
   DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20);
396
 }
396
 }
397
 
397
 
398
-void Move_Highlight(const int16_t from, const uint16_t newline) {
398
+void Move_Highlight(const int8_t from, const int8_t newline) {
399
   Erase_Menu_Cursor(newline - from);
399
   Erase_Menu_Cursor(newline - from);
400
   Draw_Menu_Cursor(newline);
400
   Draw_Menu_Cursor(newline);
401
 }
401
 }
578
     DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
578
     DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
579
   }
579
   }
580
   Draw_Select_Highlight(true);
580
   Draw_Select_Highlight(true);
581
+  DWIN_UpdateLCD();
581
 }
582
 }
582
 
583
 
583
 #if HAS_HOTEND || HAS_HEATED_BED
584
 #if HAS_HOTEND || HAS_HEATED_BED
608
       }
609
       }
609
     }
610
     }
610
   }
611
   }
611
-
612
 #endif
612
 #endif
613
 
613
 
614
 // Draw status line
614
 // Draw status line
752
 }
752
 }
753
 
753
 
754
 void Goto_PrintProcess() {
754
 void Goto_PrintProcess() {
755
+  if (checkkey == PrintProcess) return;
755
   checkkey = PrintProcess;
756
   checkkey = PrintProcess;
756
   Draw_PrintProcess();
757
   Draw_PrintProcess();
757
 }
758
 }
793
 }
794
 }
794
 
795
 
795
 void Goto_Main_Menu() {
796
 void Goto_Main_Menu() {
797
+  if (checkkey == MainMenu) return;
796
   checkkey = MainMenu;
798
   checkkey = MainMenu;
797
   ui.reset_status(true);
799
   ui.reset_status(true);
798
   Draw_Main_Menu();
800
   Draw_Main_Menu();
1239
 
1241
 
1240
       case PAGE_INFO_LEVELING:
1242
       case PAGE_INFO_LEVELING:
1241
         #if HAS_ONESTEP_LEVELING
1243
         #if HAS_ONESTEP_LEVELING
1242
-          queue.inject(F("G28XYO\nG28Z\nG29"));  // TODO: 'G29' should be homing when needed. Does it make sense for every LCD to do this differently?
1244
+          queue.inject(F("G28Z\nG29"));  // Force to get the current Z home position
1243
         #else
1245
         #else
1244
-          checkkey = Info;
1245
-          Draw_Info_Menu();
1246
+          last_checkkey = MainMenu;
1247
+          Goto_InfoMenu();
1246
         #endif
1248
         #endif
1247
         break;
1249
         break;
1248
     }
1250
     }
1327
     }
1329
     }
1328
   }
1330
   }
1329
   else if (encoder_diffState == ENCODER_DIFF_ENTER) {
1331
   else if (encoder_diffState == ENCODER_DIFF_ENTER) {
1330
-    if (select_file.now == 0) {
1332
+    if (select_file.now == 0) { // Back
1331
       select_page.set(PAGE_PRINT);
1333
       select_page.set(PAGE_PRINT);
1332
       Goto_Main_Menu();
1334
       Goto_Main_Menu();
1333
     }
1335
     }
1523
 void HMI_ReturnScreen() {
1525
 void HMI_ReturnScreen() {
1524
   checkkey = last_checkkey;
1526
   checkkey = last_checkkey;
1525
   Draw_Main_Area();
1527
   Draw_Main_Area();
1526
-  DWIN_UpdateLCD();
1527
   return;
1528
   return;
1528
 }
1529
 }
1529
 
1530
 
2230
 void SetMoveZto0() {
2231
 void SetMoveZto0() {
2231
   char cmd[48] = "";
2232
   char cmd[48] = "";
2232
   char str_1[5] = "", str_2[5] = "";
2233
   char str_1[5] = "", str_2[5] = "";
2233
-  sprintf_P(cmd, PSTR("G28OXY\nG28Z\nG0X%sY%sF5000\nG0Z0F300"),
2234
+  sprintf_P(cmd, PSTR("G28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300"),
2234
     #if ENABLED(MESH_BED_LEVELING)
2235
     #if ENABLED(MESH_BED_LEVELING)
2235
       dtostrf(0, 1, 1, str_1),
2236
       dtostrf(0, 1, 1, str_1),
2236
       dtostrf(0, 1, 1, str_2)
2237
       dtostrf(0, 1, 1, str_2)
2413
     float xpos = 0, ypos = 0, zval = 0;
2414
     float xpos = 0, ypos = 0, zval = 0;
2414
     float margin = PROBING_MARGIN;
2415
     float margin = PROBING_MARGIN;
2415
   #else
2416
   #else
2416
-    #define fmt "M420 S0\nG28O\nG90\nG0 Z5 F300\nG0 X%i Y%i F5000\nG0 Z0 F300"
2417
+    #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"
2417
     int16_t xpos = 0, ypos = 0;
2418
     int16_t xpos = 0, ypos = 0;
2418
     int16_t margin = 30;
2419
     int16_t margin = 30;
2419
   #endif
2420
   #endif
2469
 
2470
 
2470
   void ManualMeshStart(){
2471
   void ManualMeshStart(){
2471
     LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU);
2472
     LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU);
2472
-    gcode.process_subcommands_now(F("G28 XYO\nG28 Z\nM211 S0\nG29S1"));
2473
+    gcode.process_subcommands_now(F("G28Z\nM211S0\nG29S1"));
2473
     planner.synchronize();
2474
     planner.synchronize();
2474
     #ifdef MANUAL_PROBE_START_Z
2475
     #ifdef MANUAL_PROBE_START_Z
2475
       const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos);
2476
       const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos);
2494
 
2495
 
2495
   void ManualMeshSave(){
2496
   void ManualMeshSave(){
2496
     LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU);
2497
     LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU);
2497
-    queue.inject(F("M211 S1\nM500"));
2498
+    queue.inject(F("M211S1\nM500"));
2498
   }
2499
   }
2499
 
2500
 
2500
 #endif // MESH_BED_LEVELING
2501
 #endif // MESH_BED_LEVELING
2810
 #if ENABLED(MESH_BED_LEVELING)
2811
 #if ENABLED(MESH_BED_LEVELING)
2811
   void onDrawMMeshMoveZ(MenuItemClass* menuitem, int8_t line) {
2812
   void onDrawMMeshMoveZ(MenuItemClass* menuitem, int8_t line) {
2812
     if (HMI_IsChinese()) menuitem->SetFrame(1, 160, 118, 209, 132);
2813
     if (HMI_IsChinese()) menuitem->SetFrame(1, 160, 118, 209, 132);
2813
-    onDrawPFloatMenu(menuitem, line);
2814
+    onDrawPFloat2Menu(menuitem, line);
2814
   }
2815
   }
2815
 #endif
2816
 #endif
2816
 
2817
 
3096
 // Set an integer pointer variable using the encoder
3097
 // Set an integer pointer variable using the encoder
3097
 void HMI_SetPInt() {
3098
 void HMI_SetPInt() {
3098
   int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue);
3099
   int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue);
3099
-  if (!val) return;
3100
-  else if (val == 2) {  // Apply
3101
-    *HMI_value.P_Int = HMI_value.Value;
3102
-    if (HMI_value.Apply != nullptr) HMI_value.Apply();
3103
-  } else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate();
3100
+  switch (val) {
3101
+    case 0: return;
3102
+    case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break;
3103
+    case 2: *HMI_value.P_Int = HMI_value.Value; if (HMI_value.Apply != nullptr) HMI_value.Apply(); break;
3104
+  }
3104
 }
3105
 }
3105
 
3106
 
3106
 // Get a scaled float value using the encoder
3107
 // Get a scaled float value using the encoder
3140
 // Set a scaled float pointer variable using the encoder
3141
 // Set a scaled float pointer variable using the encoder
3141
 void HMI_SetPFloat() {
3142
 void HMI_SetPFloat() {
3142
   const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue);
3143
   const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue);
3143
-  if (!val) return;
3144
-  if (val == 2) {  // Apply
3145
-    *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp);
3146
-    if (HMI_value.Apply != nullptr) HMI_value.Apply();
3144
+  switch (val) {
3145
+    case 0: return;
3146
+    case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break;
3147
+    case 2: *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); if (HMI_value.Apply != nullptr) HMI_value.Apply(); break;
3147
   }
3148
   }
3148
-  else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate();
3149
 }
3149
 }
3150
 
3150
 
3151
 // Menu Creation and Drawing functions ======================================================
3151
 // Menu Creation and Drawing functions ======================================================
3152
 
3152
 
3153
-void SetMenuTitle(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) {
3153
+void SetMenuTitle(frame_rect_t cn, const __FlashStringHelper* fstr) {
3154
   if (HMI_IsChinese() && (cn.w != 0))
3154
   if (HMI_IsChinese() && (cn.w != 0))
3155
     CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h);
3155
     CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h);
3156
   else
3156
   else
3162
   if (PrepareMenu == nullptr) PrepareMenu = new MenuClass();
3162
   if (PrepareMenu == nullptr) PrepareMenu = new MenuClass();
3163
   if (CurrentMenu != PrepareMenu) {
3163
   if (CurrentMenu != PrepareMenu) {
3164
     CurrentMenu = PrepareMenu;
3164
     CurrentMenu = PrepareMenu;
3165
-    SetMenuTitle({133, 1, 28, 13}, {179, 0, 48, 14}, GET_TEXT_F(MSG_PREPARE));
3165
+    SetMenuTitle({133, 1, 28, 13}, GET_TEXT_F(MSG_PREPARE));
3166
     DWINUI::MenuItemsPrepare(13);
3166
     DWINUI::MenuItemsPrepare(13);
3167
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3167
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3168
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
3168
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
3203
   if (LevBedMenu == nullptr) LevBedMenu = new MenuClass();
3203
   if (LevBedMenu == nullptr) LevBedMenu = new MenuClass();
3204
   if (CurrentMenu != LevBedMenu) {
3204
   if (CurrentMenu != LevBedMenu) {
3205
     CurrentMenu = LevBedMenu;
3205
     CurrentMenu = LevBedMenu;
3206
-    SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG
3206
+    SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG
3207
     DWINUI::MenuItemsPrepare(6);
3207
     DWINUI::MenuItemsPrepare(6);
3208
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3208
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3209
     ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL);
3209
     ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL);
3220
   if (ControlMenu == nullptr) ControlMenu = new MenuClass();
3220
   if (ControlMenu == nullptr) ControlMenu = new MenuClass();
3221
   if (CurrentMenu != ControlMenu) {
3221
   if (CurrentMenu != ControlMenu) {
3222
     CurrentMenu = ControlMenu;
3222
     CurrentMenu = ControlMenu;
3223
-    SetMenuTitle({103, 1, 28, 14}, {128, 2, 49, 11}, GET_TEXT_F(MSG_CONTROL));
3223
+    SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL));
3224
     DWINUI::MenuItemsPrepare(9);
3224
     DWINUI::MenuItemsPrepare(9);
3225
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3225
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3226
     ADDMENUITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu);
3226
     ADDMENUITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu);
3242
   if (AdvancedSettings == nullptr) AdvancedSettings = new MenuClass();
3242
   if (AdvancedSettings == nullptr) AdvancedSettings = new MenuClass();
3243
   if (CurrentMenu != AdvancedSettings) {
3243
   if (CurrentMenu != AdvancedSettings) {
3244
     CurrentMenu = AdvancedSettings;
3244
     CurrentMenu = AdvancedSettings;
3245
-    SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG
3246
-    DWINUI::MenuItemsPrepare(11);
3245
+    SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG
3246
+    DWINUI::MenuItemsPrepare(12);
3247
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3247
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3248
     #if HAS_HOME_OFFSET
3248
     #if HAS_HOME_OFFSET
3249
       ADDMENUITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu);
3249
       ADDMENUITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu);
3283
   if (MoveMenu == nullptr) MoveMenu = new MenuClass();
3283
   if (MoveMenu == nullptr) MoveMenu = new MenuClass();
3284
   if (CurrentMenu != MoveMenu) {
3284
   if (CurrentMenu != MoveMenu) {
3285
     CurrentMenu = MoveMenu;
3285
     CurrentMenu = MoveMenu;
3286
-    SetMenuTitle({192, 1, 42, 14}, {231, 2, 35, 11}, GET_TEXT_F(MSG_MOVE_AXIS));
3286
+    SetMenuTitle({192, 1, 42, 14}, GET_TEXT_F(MSG_MOVE_AXIS));
3287
     DWINUI::MenuItemsPrepare(5);
3287
     DWINUI::MenuItemsPrepare(5);
3288
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3288
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3289
     ADDMENUITEM_P(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, &current_position.x);
3289
     ADDMENUITEM_P(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, &current_position.x);
3303
     if (HomeOffMenu == nullptr) HomeOffMenu = new MenuClass();
3303
     if (HomeOffMenu == nullptr) HomeOffMenu = new MenuClass();
3304
     if (CurrentMenu != HomeOffMenu) {
3304
     if (CurrentMenu != HomeOffMenu) {
3305
       CurrentMenu = HomeOffMenu;
3305
       CurrentMenu = HomeOffMenu;
3306
-      SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG
3306
+      SetMenuTitle({0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG
3307
       DWINUI::MenuItemsPrepare(4);
3307
       DWINUI::MenuItemsPrepare(4);
3308
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3308
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3309
       ADDMENUITEM_P(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]);
3309
       ADDMENUITEM_P(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]);
3320
     if (ProbeSetMenu == nullptr) ProbeSetMenu = new MenuClass();
3320
     if (ProbeSetMenu == nullptr) ProbeSetMenu = new MenuClass();
3321
     if (CurrentMenu != ProbeSetMenu) {
3321
     if (CurrentMenu != ProbeSetMenu) {
3322
       CurrentMenu = ProbeSetMenu;
3322
       CurrentMenu = ProbeSetMenu;
3323
-      SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG
3323
+      SetMenuTitle({0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG
3324
       DWINUI::MenuItemsPrepare(5);
3324
       DWINUI::MenuItemsPrepare(5);
3325
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3325
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3326
       ADDMENUITEM_P(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
3326
       ADDMENUITEM_P(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
3364
   if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass();
3364
   if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass();
3365
   if (CurrentMenu != SelectColorMenu) {
3365
   if (CurrentMenu != SelectColorMenu) {
3366
     CurrentMenu = SelectColorMenu;
3366
     CurrentMenu = SelectColorMenu;
3367
-    SetMenuTitle({0}, {0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG
3367
+    SetMenuTitle({0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG
3368
     DWINUI::MenuItemsPrepare(20);
3368
     DWINUI::MenuItemsPrepare(20);
3369
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3369
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3370
     ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors);
3370
     ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors);
3395
   if (GetColorMenu == nullptr) GetColorMenu = new MenuClass();
3395
   if (GetColorMenu == nullptr) GetColorMenu = new MenuClass();
3396
   if (CurrentMenu != GetColorMenu) {
3396
   if (CurrentMenu != GetColorMenu) {
3397
     CurrentMenu = GetColorMenu;
3397
     CurrentMenu = GetColorMenu;
3398
-    SetMenuTitle({0}, {0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG
3398
+    SetMenuTitle({0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG
3399
     DWINUI::MenuItemsPrepare(5);
3399
     DWINUI::MenuItemsPrepare(5);
3400
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor);
3400
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor);
3401
     ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu);
3401
     ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu);
3412
   if (TuneMenu == nullptr) TuneMenu = new MenuClass();
3412
   if (TuneMenu == nullptr) TuneMenu = new MenuClass();
3413
   if (CurrentMenu != TuneMenu) {
3413
   if (CurrentMenu != TuneMenu) {
3414
     CurrentMenu = TuneMenu;
3414
     CurrentMenu = TuneMenu;
3415
-    SetMenuTitle({73, 2, 28, 12}, {94, 2, 33, 11}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG
3415
+    SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG
3416
     DWINUI::MenuItemsPrepare(10);
3416
     DWINUI::MenuItemsPrepare(10);
3417
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess);
3417
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess);
3418
     ADDMENUITEM_P(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage);
3418
     ADDMENUITEM_P(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage);
3445
   if (MotionMenu == nullptr) MotionMenu = new MenuClass();
3445
   if (MotionMenu == nullptr) MotionMenu = new MenuClass();
3446
   if (CurrentMenu != MotionMenu) {
3446
   if (CurrentMenu != MotionMenu) {
3447
     CurrentMenu = MotionMenu;
3447
     CurrentMenu = MotionMenu;
3448
-    SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG
3448
+    SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG
3449
     DWINUI::MenuItemsPrepare(6);
3449
     DWINUI::MenuItemsPrepare(6);
3450
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3450
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3451
     ADDMENUITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu);
3451
     ADDMENUITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu);
3465
     if (FilamentMenu == nullptr) FilamentMenu = new MenuClass();
3465
     if (FilamentMenu == nullptr) FilamentMenu = new MenuClass();
3466
     if (CurrentMenu != FilamentMenu) {
3466
     if (CurrentMenu != FilamentMenu) {
3467
       CurrentMenu = FilamentMenu;
3467
       CurrentMenu = FilamentMenu;
3468
-      SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG
3468
+      SetMenuTitle({0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG
3469
       DWINUI::MenuItemsPrepare(5);
3469
       DWINUI::MenuItemsPrepare(5);
3470
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3470
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3471
       ADDMENUITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead);
3471
       ADDMENUITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead);
3485
     if (ManualMesh == nullptr) ManualMesh = new MenuClass();
3485
     if (ManualMesh == nullptr) ManualMesh = new MenuClass();
3486
     if (CurrentMenu != ManualMesh) {
3486
     if (CurrentMenu != ManualMesh) {
3487
       CurrentMenu = ManualMesh;
3487
       CurrentMenu = ManualMesh;
3488
-      SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG
3489
-      DWINUI::MenuItemsPrepare(5);
3488
+      SetMenuTitle({0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG
3489
+      DWINUI::MenuItemsPrepare(6);
3490
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3490
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3491
       ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart);
3491
       ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart);
3492
       MMeshMoveZItem = ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, &current_position.z);
3492
       MMeshMoveZItem = ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, &current_position.z);
3500
 
3500
 
3501
 #if HAS_PREHEAT
3501
 #if HAS_PREHEAT
3502
 
3502
 
3503
-  void Draw_Preheat_Menu(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) {
3503
+  void Draw_Preheat_Menu(frame_rect_t cn, const __FlashStringHelper* fstr) {
3504
     checkkey = Menu;
3504
     checkkey = Menu;
3505
     if (CurrentMenu != PreheatMenu) {
3505
     if (CurrentMenu != PreheatMenu) {
3506
       CurrentMenu = PreheatMenu;
3506
       CurrentMenu = PreheatMenu;
3507
-      SetMenuTitle(cn, en, fstr);
3507
+      SetMenuTitle(cn, fstr);
3508
       DWINUI::MenuItemsPrepare(5);
3508
       DWINUI::MenuItemsPrepare(5);
3509
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu);
3509
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu);
3510
       #if HAS_HOTEND
3510
       #if HAS_HOTEND
3526
   void Draw_Preheat1_Menu() {
3526
   void Draw_Preheat1_Menu() {
3527
     HMI_value.Preheat = 0;
3527
     HMI_value.Preheat = 0;
3528
     if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3528
     if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3529
-    Draw_Preheat_Menu({59, 16, 81, 14}, {56, 15, 85, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG
3529
+    Draw_Preheat_Menu({59, 16, 81, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG
3530
   }
3530
   }
3531
 
3531
 
3532
   void Draw_Preheat2_Menu() {
3532
   void Draw_Preheat2_Menu() {
3533
     HMI_value.Preheat = 1;
3533
     HMI_value.Preheat = 1;
3534
     if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3534
     if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3535
-    Draw_Preheat_Menu({142, 16, 82, 14}, {56, 15, 85, 14}, F(PREHEAT_2_LABEL " Preheat Settings"));  // TODO: English "ABS Settings" JPG
3535
+    Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings"));  // TODO: English "ABS Settings" JPG
3536
   }
3536
   }
3537
 
3537
 
3538
   #ifdef PREHEAT_3_LABEL
3538
   #ifdef PREHEAT_3_LABEL
3540
       HMI_value.Preheat = 2;
3540
       HMI_value.Preheat = 2;
3541
       if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3541
       if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3542
       #define PREHEAT_3_TITLE PREHEAT_3_LABEL " Preheat Set."
3542
       #define PREHEAT_3_TITLE PREHEAT_3_LABEL " Preheat Set."
3543
-      Draw_Preheat_Menu({0}, {0}, F(PREHEAT_3_TITLE));  // TODO: Chinese, English "Custom Preheat Settings" JPG
3543
+      Draw_Preheat_Menu({0}, F(PREHEAT_3_TITLE));  // TODO: Chinese, English "Custom Preheat Settings" JPG
3544
     }
3544
     }
3545
   #endif
3545
   #endif
3546
 
3546
 
3551
   if (TemperatureMenu == nullptr) TemperatureMenu = new MenuClass();
3551
   if (TemperatureMenu == nullptr) TemperatureMenu = new MenuClass();
3552
   if (CurrentMenu != TemperatureMenu) {
3552
   if (CurrentMenu != TemperatureMenu) {
3553
     CurrentMenu = TemperatureMenu;
3553
     CurrentMenu = TemperatureMenu;
3554
-    SetMenuTitle({236, 2, 28, 12}, {56, 15, 85, 14}, GET_TEXT_F(MSG_TEMPERATURE));
3554
+    SetMenuTitle({236, 2, 28, 12}, GET_TEXT_F(MSG_TEMPERATURE));
3555
     DWINUI::MenuItemsPrepare(7);
3555
     DWINUI::MenuItemsPrepare(7);
3556
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3556
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3557
     #if HAS_HOTEND
3557
     #if HAS_HOTEND
3579
   if (MaxSpeedMenu == nullptr) MaxSpeedMenu = new MenuClass();
3579
   if (MaxSpeedMenu == nullptr) MaxSpeedMenu = new MenuClass();
3580
   if (CurrentMenu != MaxSpeedMenu) {
3580
   if (CurrentMenu != MaxSpeedMenu) {
3581
     CurrentMenu = MaxSpeedMenu;
3581
     CurrentMenu = MaxSpeedMenu;
3582
-    SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_MAXSPEED));
3582
+    SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED));
3583
     DWINUI::MenuItemsPrepare(5);
3583
     DWINUI::MenuItemsPrepare(5);
3584
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3584
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3585
     ADDMENUITEM_P(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]);
3585
     ADDMENUITEM_P(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]);
3597
   if (MaxAccelMenu == nullptr) MaxAccelMenu = new MenuClass();
3597
   if (MaxAccelMenu == nullptr) MaxAccelMenu = new MenuClass();
3598
   if (CurrentMenu != MaxAccelMenu) {
3598
   if (CurrentMenu != MaxAccelMenu) {
3599
     CurrentMenu = MaxAccelMenu;
3599
     CurrentMenu = MaxAccelMenu;
3600
-    SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_ACCELERATION));
3600
+    SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_ACCELERATION));
3601
     DWINUI::MenuItemsPrepare(5);
3601
     DWINUI::MenuItemsPrepare(5);
3602
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3602
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3603
     ADDMENUITEM_P(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]);
3603
     ADDMENUITEM_P(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]);
3616
     if (MaxJerkMenu == nullptr) MaxJerkMenu = new MenuClass();
3616
     if (MaxJerkMenu == nullptr) MaxJerkMenu = new MenuClass();
3617
     if (CurrentMenu != MaxJerkMenu) {
3617
     if (CurrentMenu != MaxJerkMenu) {
3618
       CurrentMenu = MaxJerkMenu;
3618
       CurrentMenu = MaxJerkMenu;
3619
-      SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_JERK));
3619
+      SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK));
3620
       DWINUI::MenuItemsPrepare(5);
3620
       DWINUI::MenuItemsPrepare(5);
3621
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3621
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3622
       ADDMENUITEM_P(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]);
3622
       ADDMENUITEM_P(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]);
3635
   if (StepsMenu == nullptr) StepsMenu = new MenuClass();
3635
   if (StepsMenu == nullptr) StepsMenu = new MenuClass();
3636
   if (CurrentMenu != StepsMenu) {
3636
   if (CurrentMenu != StepsMenu) {
3637
     CurrentMenu = StepsMenu;
3637
     CurrentMenu = StepsMenu;
3638
-    SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_STEPS_PER_MM));
3638
+    SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_STEPS_PER_MM));
3639
     DWINUI::MenuItemsPrepare(5);
3639
     DWINUI::MenuItemsPrepare(5);
3640
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3640
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3641
     ADDMENUITEM_P(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]);
3641
     ADDMENUITEM_P(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]);

+ 3
- 2
Marlin/src/lcd/e3v2/enhanced/dwin.h View File

24
 /**
24
 /**
25
  * DWIN UI Enhanced implementation
25
  * DWIN UI Enhanced implementation
26
  * Author: Miguel A. Risco-Castillo
26
  * Author: Miguel A. Risco-Castillo
27
- * Version: 3.6.3
28
- * Date: 2021/09/08
27
+ * Version: 3.7.1
28
+ * Date: 2021/11/09
29
  */
29
  */
30
 
30
 
31
 #include "../../../inc/MarlinConfigPre.h"
31
 #include "../../../inc/MarlinConfigPre.h"
154
 // Other
154
 // Other
155
 void Goto_PrintProcess();
155
 void Goto_PrintProcess();
156
 void Goto_Main_Menu();
156
 void Goto_Main_Menu();
157
+void Goto_InfoMenu();
157
 void Draw_Select_Highlight(const bool sel);
158
 void Draw_Select_Highlight(const bool sel);
158
 void Draw_Status_Area(const bool with_update); // Status Area
159
 void Draw_Status_Area(const bool with_update); // Status Area
159
 void Draw_Main_Area();      // Redraw main area;
160
 void Draw_Main_Area();      // Redraw main area;

+ 2
- 2
Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp View File

23
 /**
23
 /**
24
  * DWIN UI Enhanced implementation
24
  * DWIN UI Enhanced implementation
25
  * Author: Miguel A. Risco-Castillo
25
  * Author: Miguel A. Risco-Castillo
26
- * Version: 3.6.3
27
- * Date: 2021/09/08
26
+ * Version: 3.7.1
27
+ * Date: 2021/11/09
28
  */
28
  */
29
 
29
 
30
 #include "../../../inc/MarlinConfigPre.h"
30
 #include "../../../inc/MarlinConfigPre.h"

+ 2
- 9
Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h View File

24
 /**
24
 /**
25
  * DWIN UI Enhanced implementation
25
  * DWIN UI Enhanced implementation
26
  * Author: Miguel A. Risco-Castillo
26
  * Author: Miguel A. Risco-Castillo
27
- * Version: 3.6.3
28
- * Date: 2021/09/08
27
+ * Version: 3.7.1
28
+ * Date: 2021/11/09
29
  */
29
  */
30
 
30
 
31
 #include "../common/dwin_api.h"
31
 #include "../common/dwin_api.h"
48
 //  x/y: Screen paste point
48
 //  x/y: Screen paste point
49
 void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y);
49
 void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y);
50
 
50
 
51
-// Copy area from virtual display area to current screen
52
-//  cacheID: virtual area number
53
-//  xStart/yStart: Upper-left of virtual area
54
-//  xEnd/yEnd: Lower-right of virtual area
55
-//  x/y: Screen paste point
56
-void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y);
57
-
58
 // Copy area from current virtual display area to current screen
51
 // Copy area from current virtual display area to current screen
59
 //  xStart/yStart: Upper-left of virtual area
52
 //  xStart/yStart: Upper-left of virtual area
60
 //  xEnd/yEnd: Lower-right of virtual area
53
 //  xEnd/yEnd: Lower-right of virtual area

+ 9
- 9
Marlin/src/lcd/e3v2/enhanced/dwinui.cpp View File

23
 /**
23
 /**
24
  * DWIN UI Enhanced implementation
24
  * DWIN UI Enhanced implementation
25
  * Author: Miguel A. Risco-Castillo
25
  * Author: Miguel A. Risco-Castillo
26
- * Version: 3.6.3
27
- * Date: 2021/09/08
26
+ * Version: 3.7.1
27
+ * Date: 2021/11/09
28
  */
28
  */
29
 
29
 
30
 #include "../../../inc/MarlinConfigPre.h"
30
 #include "../../../inc/MarlinConfigPre.h"
38
 //#define DEBUG_OUT 1
38
 //#define DEBUG_OUT 1
39
 #include "../../../core/debug_out.h"
39
 #include "../../../core/debug_out.h"
40
 
40
 
41
-uint8_t MenuItemTotal = 0;
42
-uint8_t MenuItemCount = 0;
41
+int8_t MenuItemTotal = 0;
42
+int8_t MenuItemCount = 0;
43
 MenuItemClass** MenuItems = nullptr;
43
 MenuItemClass** MenuItems = nullptr;
44
 MenuClass *CurrentMenu = nullptr;
44
 MenuClass *CurrentMenu = nullptr;
45
 MenuClass *PreviousMenu = nullptr;
45
 MenuClass *PreviousMenu = nullptr;
50
 uint16_t DWINUI::backcolor = Def_Background_Color;
50
 uint16_t DWINUI::backcolor = Def_Background_Color;
51
 uint8_t  DWINUI::font = font8x16;
51
 uint8_t  DWINUI::font = font8x16;
52
 
52
 
53
-void (*DWINUI::onCursorErase)(uint8_t line)=nullptr;
54
-void (*DWINUI::onCursorDraw)(uint8_t line)=nullptr;
53
+void (*DWINUI::onCursorErase)(const int8_t line)=nullptr;
54
+void (*DWINUI::onCursorDraw)(const int8_t line)=nullptr;
55
 void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr;
55
 void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr;
56
 void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr;
56
 void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr;
57
 
57
 
304
 
304
 
305
 void DWINUI::MenuItemsClear() {
305
 void DWINUI::MenuItemsClear() {
306
   if (MenuItems == nullptr) return;
306
   if (MenuItems == nullptr) return;
307
-  for (uint8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i];
307
+  for (int8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i];
308
   delete[] MenuItems;
308
   delete[] MenuItems;
309
   MenuItems = nullptr;
309
   MenuItems = nullptr;
310
   MenuItemCount = 0;
310
   MenuItemCount = 0;
311
   MenuItemTotal = 0;
311
   MenuItemTotal = 0;
312
 }
312
 }
313
 
313
 
314
-void DWINUI::MenuItemsPrepare(uint8_t totalitems) {
314
+void DWINUI::MenuItemsPrepare(int8_t totalitems) {
315
   MenuItemsClear();
315
   MenuItemsClear();
316
   MenuItemTotal = totalitems;
316
   MenuItemTotal = totalitems;
317
   MenuItems = new MenuItemClass*[totalitems];
317
   MenuItems = new MenuItemClass*[totalitems];
379
 void MenuClass::draw() {
379
 void MenuClass::draw() {
380
   MenuTitle.draw();
380
   MenuTitle.draw();
381
   if (DWINUI::onMenuDraw != nullptr) (*DWINUI::onMenuDraw)(this);
381
   if (DWINUI::onMenuDraw != nullptr) (*DWINUI::onMenuDraw)(this);
382
-  for (uint8_t i = 0; i < MenuItemCount; i++)
382
+  for (int8_t i = 0; i < MenuItemCount; i++)
383
     MenuItems[i]->draw(i - topline);
383
     MenuItems[i]->draw(i - topline);
384
   if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line());
384
   if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line());
385
   DWIN_UpdateLCD();
385
   DWIN_UpdateLCD();

+ 21
- 16
Marlin/src/lcd/e3v2/enhanced/dwinui.h View File

24
 /**
24
 /**
25
  * DWIN UI Enhanced implementation
25
  * DWIN UI Enhanced implementation
26
  * Author: Miguel A. Risco-Castillo
26
  * Author: Miguel A. Risco-Castillo
27
- * Version: 3.6.3
28
- * Date: 2021/09/08
27
+ * Version: 3.7.1
28
+ * Date: 2021/11/09
29
  */
29
  */
30
 
30
 
31
-#include "../../../core/types.h"
32
 #include "dwin_lcd.h"
31
 #include "dwin_lcd.h"
33
 #include "../common/dwin_set.h"
32
 #include "../common/dwin_set.h"
34
 #include "../common/dwin_font.h"
33
 #include "../common/dwin_font.h"
138
 class MenuItemClass {
137
 class MenuItemClass {
139
 protected:
138
 protected:
140
 public:
139
 public:
141
-  uint8_t pos = 0;
140
+  int8_t pos = 0;
142
   uint8_t icon = 0;
141
   uint8_t icon = 0;
143
   char caption[32] = "";
142
   char caption[32] = "";
144
   uint8_t frameid = 0;
143
   uint8_t frameid = 0;
185
   extern uint16_t backcolor;
184
   extern uint16_t backcolor;
186
   extern uint8_t  font;
185
   extern uint8_t  font;
187
 
186
 
188
-  extern void (*onCursorErase)(uint8_t line);
189
-  extern void (*onCursorDraw)(uint8_t line);
187
+  extern void (*onCursorErase)(const int8_t line);
188
+  extern void (*onCursorDraw)(const int8_t line);
190
   extern void (*onTitleDraw)(TitleClass* title);
189
   extern void (*onTitleDraw)(TitleClass* title);
191
   extern void (*onMenuDraw)(MenuClass* menu);
190
   extern void (*onMenuDraw)(MenuClass* menu);
192
 
191
 
342
   //  rlimit: For draw less chars than string length use rlimit
341
   //  rlimit: For draw less chars than string length use rlimit
343
   void Draw_String(const char * const string, uint16_t rlimit = 0xFFFF);
342
   void Draw_String(const char * const string, uint16_t rlimit = 0xFFFF);
344
   void Draw_String(uint16_t color, const char * const string, uint16_t rlimit = 0xFFFF);
343
   void Draw_String(uint16_t color, const char * const string, uint16_t rlimit = 0xFFFF);
344
+  inline void Draw_String(FSTR_P  string, uint16_t rlimit = 0xFFFF) {
345
+    Draw_String(FTOP(string), rlimit);
346
+  }
347
+  inline void Draw_String(uint16_t color, FSTR_P string, uint16_t rlimit = 0xFFFF) {
348
+    Draw_String(color, FTOP(string), rlimit);
349
+  }
345
 
350
 
346
   // Draw a string
351
   // Draw a string
347
   //  size: Font size
352
   //  size: Font size
353
     DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string);
358
     DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string);
354
   }
359
   }
355
   inline void Draw_String(uint16_t x, uint16_t y, FSTR_P title) {
360
   inline void Draw_String(uint16_t x, uint16_t y, FSTR_P title) {
356
-    DWIN_Draw_String(false, font, textcolor, backcolor, x, y, (char *)title);
361
+    DWIN_Draw_String(false, font, textcolor, backcolor, x, y, FTOP(title));
357
   }
362
   }
358
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) {
363
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) {
359
     DWIN_Draw_String(false, font, color, backcolor, x, y, string);
364
     DWIN_Draw_String(false, font, color, backcolor, x, y, string);
360
   }
365
   }
361
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, FSTR_P title) {
366
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, FSTR_P title) {
362
-    DWIN_Draw_String(false, font, color, backcolor, x, y, (char *)title);
367
+    DWIN_Draw_String(false, font, color, backcolor, x, y, title);
363
   }
368
   }
364
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
369
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
365
     DWIN_Draw_String(true, font, color, bgcolor, x, y, string);
370
     DWIN_Draw_String(true, font, color, bgcolor, x, y, string);
366
   }
371
   }
367
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
372
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
368
-    DWIN_Draw_String(true, font, color, bgcolor, x, y, (char *)title);
373
+    DWIN_Draw_String(true, font, color, bgcolor, x, y, title);
369
   }
374
   }
370
   inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
375
   inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
371
     DWIN_Draw_String(true, size, color, bgcolor, x, y, string);
376
     DWIN_Draw_String(true, size, color, bgcolor, x, y, string);
372
   }
377
   }
373
   inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
378
   inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
374
-    DWIN_Draw_String(true, size, color, bgcolor, x, y, (char *)title);
379
+    DWIN_Draw_String(true, size, color, bgcolor, x, y, title);
375
   }
380
   }
376
 
381
 
377
   // Draw a centered string using DWIN_WIDTH
382
   // Draw a centered string using DWIN_WIDTH
382
   //  y: Upper coordinate of the string
387
   //  y: Upper coordinate of the string
383
   //  *string: The string
388
   //  *string: The string
384
   void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string);
389
   void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string);
385
-  inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P title) {
386
-    Draw_CenteredString(bShow, size, color, bColor, y, (char *)title);
390
+  inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) {
391
+    Draw_CenteredString(bShow, size, color, bColor, y, FTOP(string));
387
   }
392
   }
388
   inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) {
393
   inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) {
389
     Draw_CenteredString(true, font, color, bcolor, y, string);
394
     Draw_CenteredString(true, font, color, bcolor, y, string);
392
     Draw_CenteredString(false, size, color, backcolor, y, string);
397
     Draw_CenteredString(false, size, color, backcolor, y, string);
393
   }
398
   }
394
   inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, FSTR_P title) {
399
   inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, FSTR_P title) {
395
-    Draw_CenteredString(false, size, color, backcolor, y, (char *)title);
400
+    Draw_CenteredString(false, size, color, backcolor, y, title);
396
   }
401
   }
397
   inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) {
402
   inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) {
398
     Draw_CenteredString(false, font, color, backcolor, y, string);
403
     Draw_CenteredString(false, font, color, backcolor, y, string);
399
   }
404
   }
400
   inline void Draw_CenteredString(uint16_t color, uint16_t y, FSTR_P title) {
405
   inline void Draw_CenteredString(uint16_t color, uint16_t y, FSTR_P title) {
401
-    Draw_CenteredString(false, font, color, backcolor, y, (char *)title);
406
+    Draw_CenteredString(false, font, color, backcolor, y, title);
402
   }
407
   }
403
   inline void Draw_CenteredString(uint16_t y, const char * const string) {
408
   inline void Draw_CenteredString(uint16_t y, const char * const string) {
404
     Draw_CenteredString(false, font, textcolor, backcolor, y, string);
409
     Draw_CenteredString(false, font, textcolor, backcolor, y, string);
405
   }
410
   }
406
   inline void Draw_CenteredString(uint16_t y, FSTR_P title) {
411
   inline void Draw_CenteredString(uint16_t y, FSTR_P title) {
407
-    Draw_CenteredString(false, font, textcolor, backcolor, y, (char *)title);
412
+    Draw_CenteredString(false, font, textcolor, backcolor, y, title);
408
   }
413
   }
409
 
414
 
410
   // Draw a circle
415
   // Draw a circle
477
   void MenuItemsClear();
482
   void MenuItemsClear();
478
 
483
 
479
   // Prepare MenuItems array
484
   // Prepare MenuItems array
480
-  void MenuItemsPrepare(uint8_t totalitems);
485
+  void MenuItemsPrepare(int8_t totalitems);
481
 
486
 
482
   // Add elements to the MenuItems array
487
   // Add elements to the MenuItems array
483
   MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem);
488
   MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem);

+ 34
- 7
Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp View File

1
 /**
1
 /**
2
  * DWIN Mesh Viewer
2
  * DWIN Mesh Viewer
3
  * Author: Miguel A. Risco-Castillo
3
  * Author: Miguel A. Risco-Castillo
4
- * version: 2.5
5
- * Date: 2021/09/27
4
+ * version: 3.8.1
5
+ * Date: 2021/11/06
6
  *
6
  *
7
  * This program is free software: you can redistribute it and/or modify
7
  * This program is free software: you can redistribute it and/or modify
8
  * it under the terms of the GNU Lesser General Public License as
8
  * it under the terms of the GNU Lesser General Public License as
35
 MeshViewerClass MeshViewer;
35
 MeshViewerClass MeshViewer;
36
 
36
 
37
 void MeshViewerClass::Draw() {
37
 void MeshViewerClass::Draw() {
38
-  const int8_t mx = 30, my = 30;  // Margins
38
+  const int8_t mx = 25, my = 25;  // Margins
39
   const int16_t stx = (DWIN_WIDTH - 2 * mx) / (GRID_MAX_POINTS_X - 1),  // Steps
39
   const int16_t stx = (DWIN_WIDTH - 2 * mx) / (GRID_MAX_POINTS_X - 1),  // Steps
40
                 sty = (DWIN_WIDTH - 2 * my) / (GRID_MAX_POINTS_Y - 1);
40
                 sty = (DWIN_WIDTH - 2 * my) / (GRID_MAX_POINTS_Y - 1);
41
-  int8_t zmesh[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], maxz =-127, minz = 127;
41
+  const int8_t rmax = _MIN(mx - 2, stx / 2);
42
+  const int8_t rmin = 7;
43
+  int16_t zmesh[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], maxz =-32000, minz = 32000;
42
   #define px(xp) (mx + (xp) * stx)
44
   #define px(xp) (mx + (xp) * stx)
43
   #define py(yp) (30 + DWIN_WIDTH - my - (yp) * sty)
45
   #define py(yp) (30 + DWIN_WIDTH - my - (yp) * sty)
44
-  #define rm(z) ((((z) - minz) * 10 / _MAX(1, (maxz - minz))) + 10)
46
+  #define rm(z) ((z - minz) * (rmax - rmin) / _MAX(1, (maxz - minz)) + rmin)
45
   #define DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 12, py(yp) - 6, zv)
47
   #define DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 12, py(yp) - 6, zv)
46
   #define DrawMeshHLine(yp) DWIN_Draw_HLine(HMI_data.SplitLine_Color, px(0), py(yp), DWIN_WIDTH - 2 * mx)
48
   #define DrawMeshHLine(yp) DWIN_Draw_HLine(HMI_data.SplitLine_Color, px(0), py(yp), DWIN_WIDTH - 2 * mx)
47
   #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(GRID_MAX_POINTS_Y - 1), DWIN_WIDTH - 2 * my)
49
   #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(GRID_MAX_POINTS_Y - 1), DWIN_WIDTH - 2 * my)
61
     watchdog_refresh();
63
     watchdog_refresh();
62
     LOOP_L_N(x, GRID_MAX_POINTS_X) {
64
     LOOP_L_N(x, GRID_MAX_POINTS_X) {
63
       uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz));
65
       uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz));
64
-      DWINUI::Draw_FillCircle(color, px(x), py(y), rm(zmesh[x][y]));
65
-      DrawMeshValue(x, y, Z_VALUES(x,y));
66
+      uint8_t radius = rm(zmesh[x][y]);
67
+      DWINUI::Draw_FillCircle(color, px(x), py(y), radius);
68
+      if (GRID_MAX_POINTS_X < 9)
69
+        DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(x) - 12, py(y) - 6, Z_VALUES(x,y));
70
+      else {
71
+        char str_1[9];
72
+        str_1[0] = 0;
73
+        switch (zmesh[x][y]) {
74
+          case -999 ... -100:
75
+            DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 12, py(y) - 6, Z_VALUES(x,y));
76
+            break;
77
+          case -99 ... -1:
78
+            sprintf_P(str_1, PSTR("-.%02i"), -zmesh[x][y]);
79
+            break;
80
+          case 0:
81
+            DWIN_Draw_String(false, font6x12, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - 6, "0");;
82
+            break;
83
+          case 1 ... 99:
84
+            sprintf_P(str_1, PSTR(".%02i"), zmesh[x][y]);
85
+            break;
86
+          case 100 ... 999:
87
+            DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 12, py(y) - 6, Z_VALUES(x,y));
88
+            break;
89
+        }
90
+        if (str_1[0])
91
+          DWIN_Draw_String(false, font6x12, DWINUI::textcolor, DWINUI::backcolor, px(x) - 12, py(y) - 6, str_1);
92
+      }
66
     }
93
     }
67
   }
94
   }
68
   char str_1[6], str_2[6] = "";
95
   char str_1[6], str_2[6] = "";

+ 2
- 2
Marlin/src/lcd/e3v2/enhanced/meshviewer.h View File

1
 /**
1
 /**
2
  * DWIN Mesh Viewer
2
  * DWIN Mesh Viewer
3
  * Author: Miguel A. Risco-Castillo
3
  * Author: Miguel A. Risco-Castillo
4
- * version: 2.5
5
- * Date: 2021/09/27
4
+ * Version: 3.8.1
5
+ * Date: 2021/11/06
6
  *
6
  *
7
  * This program is free software: you can redistribute it and/or modify
7
  * This program is free software: you can redistribute it and/or modify
8
  * it under the terms of the GNU Lesser General Public License as
8
  * it under the terms of the GNU Lesser General Public License as

+ 0
- 2
Marlin/src/module/settings.cpp View File

3044
   postprocess();
3044
   postprocess();
3045
 
3045
 
3046
   DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded");
3046
   DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded");
3047
-
3048
-  TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
3049
 }
3047
 }
3050
 
3048
 
3051
 #if DISABLED(DISABLE_M503)
3049
 #if DISABLED(DISABLE_M503)

+ 2
- 1
Marlin/src/module/temperature.cpp View File

3731
           HMI_flag.heat_flag = 0;
3731
           HMI_flag.heat_flag = 0;
3732
           duration_t elapsed = print_job_timer.duration();  // print timer
3732
           duration_t elapsed = print_job_timer.duration();  // print timer
3733
           dwin_heat_time = elapsed.value;
3733
           dwin_heat_time = elapsed.value;
3734
+        #else
3735
+          ui.reset_status();
3734
         #endif
3736
         #endif
3735
-        ui.reset_status();
3736
         TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone());
3737
         TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone());
3737
         return true;
3738
         return true;
3738
       }
3739
       }

Loading…
Cancel
Save