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,7 +254,6 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
254 254
 
255 255
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
256 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 257
     wait_for_user = true; // A click or M108 breaks the purge_length loop
259 258
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
260 259
       unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);

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

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * DWIN UI Enhanced implementation
25 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 30
 #include "../../../inc/MarlinConfigPre.h"
@@ -142,7 +142,7 @@ HMI_data_t HMI_data;
142 142
 
143 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 147
 enum SelectItem : uint8_t {
148 148
   PAGE_PRINT = 0,
@@ -387,15 +387,15 @@ void ICON_Stop() {
387 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 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 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 399
   Erase_Menu_Cursor(newline - from);
400 400
   Draw_Menu_Cursor(newline);
401 401
 }
@@ -578,6 +578,7 @@ void Popup_window_PauseOrStop() {
578 578
     DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
579 579
   }
580 580
   Draw_Select_Highlight(true);
581
+  DWIN_UpdateLCD();
581 582
 }
582 583
 
583 584
 #if HAS_HOTEND || HAS_HEATED_BED
@@ -608,7 +609,6 @@ void Popup_window_PauseOrStop() {
608 609
       }
609 610
     }
610 611
   }
611
-
612 612
 #endif
613 613
 
614 614
 // Draw status line
@@ -752,6 +752,7 @@ void Draw_PrintProcess() {
752 752
 }
753 753
 
754 754
 void Goto_PrintProcess() {
755
+  if (checkkey == PrintProcess) return;
755 756
   checkkey = PrintProcess;
756 757
   Draw_PrintProcess();
757 758
 }
@@ -793,6 +794,7 @@ void Draw_Main_Menu() {
793 794
 }
794 795
 
795 796
 void Goto_Main_Menu() {
797
+  if (checkkey == MainMenu) return;
796 798
   checkkey = MainMenu;
797 799
   ui.reset_status(true);
798 800
   Draw_Main_Menu();
@@ -1239,10 +1241,10 @@ void HMI_MainMenu() {
1239 1241
 
1240 1242
       case PAGE_INFO_LEVELING:
1241 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 1245
         #else
1244
-          checkkey = Info;
1245
-          Draw_Info_Menu();
1246
+          last_checkkey = MainMenu;
1247
+          Goto_InfoMenu();
1246 1248
         #endif
1247 1249
         break;
1248 1250
     }
@@ -1327,7 +1329,7 @@ void HMI_SelectFile() {
1327 1329
     }
1328 1330
   }
1329 1331
   else if (encoder_diffState == ENCODER_DIFF_ENTER) {
1330
-    if (select_file.now == 0) {
1332
+    if (select_file.now == 0) { // Back
1331 1333
       select_page.set(PAGE_PRINT);
1332 1334
       Goto_Main_Menu();
1333 1335
     }
@@ -1523,7 +1525,6 @@ void Draw_Main_Area() {
1523 1525
 void HMI_ReturnScreen() {
1524 1526
   checkkey = last_checkkey;
1525 1527
   Draw_Main_Area();
1526
-  DWIN_UpdateLCD();
1527 1528
   return;
1528 1529
 }
1529 1530
 
@@ -2230,7 +2231,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS
2230 2231
 void SetMoveZto0() {
2231 2232
   char cmd[48] = "";
2232 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 2235
     #if ENABLED(MESH_BED_LEVELING)
2235 2236
       dtostrf(0, 1, 1, str_1),
2236 2237
       dtostrf(0, 1, 1, str_2)
@@ -2413,7 +2414,7 @@ void LevBed(uint8_t point) {
2413 2414
     float xpos = 0, ypos = 0, zval = 0;
2414 2415
     float margin = PROBING_MARGIN;
2415 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 2418
     int16_t xpos = 0, ypos = 0;
2418 2419
     int16_t margin = 30;
2419 2420
   #endif
@@ -2469,7 +2470,7 @@ void LevBedC () { LevBed(4); }
2469 2470
 
2470 2471
   void ManualMeshStart(){
2471 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 2474
     planner.synchronize();
2474 2475
     #ifdef MANUAL_PROBE_START_Z
2475 2476
       const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos);
@@ -2494,7 +2495,7 @@ void LevBedC () { LevBed(4); }
2494 2495
 
2495 2496
   void ManualMeshSave(){
2496 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 2501
 #endif // MESH_BED_LEVELING
@@ -2810,7 +2811,7 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) {
2810 2811
 #if ENABLED(MESH_BED_LEVELING)
2811 2812
   void onDrawMMeshMoveZ(MenuItemClass* menuitem, int8_t line) {
2812 2813
     if (HMI_IsChinese()) menuitem->SetFrame(1, 160, 118, 209, 132);
2813
-    onDrawPFloatMenu(menuitem, line);
2814
+    onDrawPFloat2Menu(menuitem, line);
2814 2815
   }
2815 2816
 #endif
2816 2817
 
@@ -3096,11 +3097,11 @@ void HMI_SetIntNoDraw() {
3096 3097
 // Set an integer pointer variable using the encoder
3097 3098
 void HMI_SetPInt() {
3098 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 3107
 // Get a scaled float value using the encoder
@@ -3140,17 +3141,16 @@ void HMI_SetFloat() {
3140 3141
 // Set a scaled float pointer variable using the encoder
3141 3142
 void HMI_SetPFloat() {
3142 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 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 3154
   if (HMI_IsChinese() && (cn.w != 0))
3155 3155
     CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h);
3156 3156
   else
@@ -3162,7 +3162,7 @@ void Draw_Prepare_Menu() {
3162 3162
   if (PrepareMenu == nullptr) PrepareMenu = new MenuClass();
3163 3163
   if (CurrentMenu != PrepareMenu) {
3164 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 3166
     DWINUI::MenuItemsPrepare(13);
3167 3167
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3168 3168
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
@@ -3203,7 +3203,7 @@ void Draw_LevBedCorners_Menu() {
3203 3203
   if (LevBedMenu == nullptr) LevBedMenu = new MenuClass();
3204 3204
   if (CurrentMenu != LevBedMenu) {
3205 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 3207
     DWINUI::MenuItemsPrepare(6);
3208 3208
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3209 3209
     ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL);
@@ -3220,7 +3220,7 @@ void Draw_Control_Menu() {
3220 3220
   if (ControlMenu == nullptr) ControlMenu = new MenuClass();
3221 3221
   if (CurrentMenu != ControlMenu) {
3222 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 3224
     DWINUI::MenuItemsPrepare(9);
3225 3225
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu);
3226 3226
     ADDMENUITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu);
@@ -3242,8 +3242,8 @@ void Draw_AdvancedSettings_Menu() {
3242 3242
   if (AdvancedSettings == nullptr) AdvancedSettings = new MenuClass();
3243 3243
   if (CurrentMenu != AdvancedSettings) {
3244 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 3247
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3248 3248
     #if HAS_HOME_OFFSET
3249 3249
       ADDMENUITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu);
@@ -3283,7 +3283,7 @@ void Draw_Move_Menu() {
3283 3283
   if (MoveMenu == nullptr) MoveMenu = new MenuClass();
3284 3284
   if (CurrentMenu != MoveMenu) {
3285 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 3287
     DWINUI::MenuItemsPrepare(5);
3288 3288
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3289 3289
     ADDMENUITEM_P(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, &current_position.x);
@@ -3303,7 +3303,7 @@ void Draw_Move_Menu() {
3303 3303
     if (HomeOffMenu == nullptr) HomeOffMenu = new MenuClass();
3304 3304
     if (CurrentMenu != HomeOffMenu) {
3305 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 3307
       DWINUI::MenuItemsPrepare(4);
3308 3308
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3309 3309
       ADDMENUITEM_P(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]);
@@ -3320,7 +3320,7 @@ void Draw_Move_Menu() {
3320 3320
     if (ProbeSetMenu == nullptr) ProbeSetMenu = new MenuClass();
3321 3321
     if (CurrentMenu != ProbeSetMenu) {
3322 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 3324
       DWINUI::MenuItemsPrepare(5);
3325 3325
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3326 3326
       ADDMENUITEM_P(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
@@ -3364,7 +3364,7 @@ void Draw_SelectColors_Menu() {
3364 3364
   if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass();
3365 3365
   if (CurrentMenu != SelectColorMenu) {
3366 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 3368
     DWINUI::MenuItemsPrepare(20);
3369 3369
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
3370 3370
     ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors);
@@ -3395,7 +3395,7 @@ void Draw_GetColor_Menu() {
3395 3395
   if (GetColorMenu == nullptr) GetColorMenu = new MenuClass();
3396 3396
   if (CurrentMenu != GetColorMenu) {
3397 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 3399
     DWINUI::MenuItemsPrepare(5);
3400 3400
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor);
3401 3401
     ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu);
@@ -3412,7 +3412,7 @@ void Draw_Tune_Menu() {
3412 3412
   if (TuneMenu == nullptr) TuneMenu = new MenuClass();
3413 3413
   if (CurrentMenu != TuneMenu) {
3414 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 3416
     DWINUI::MenuItemsPrepare(10);
3417 3417
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess);
3418 3418
     ADDMENUITEM_P(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage);
@@ -3445,7 +3445,7 @@ void Draw_Motion_Menu() {
3445 3445
   if (MotionMenu == nullptr) MotionMenu = new MenuClass();
3446 3446
   if (CurrentMenu != MotionMenu) {
3447 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 3449
     DWINUI::MenuItemsPrepare(6);
3450 3450
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3451 3451
     ADDMENUITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu);
@@ -3465,7 +3465,7 @@ void Draw_Motion_Menu() {
3465 3465
     if (FilamentMenu == nullptr) FilamentMenu = new MenuClass();
3466 3466
     if (CurrentMenu != FilamentMenu) {
3467 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 3469
       DWINUI::MenuItemsPrepare(5);
3470 3470
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3471 3471
       ADDMENUITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead);
@@ -3485,8 +3485,8 @@ void Draw_Motion_Menu() {
3485 3485
     if (ManualMesh == nullptr) ManualMesh = new MenuClass();
3486 3486
     if (CurrentMenu != ManualMesh) {
3487 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 3490
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3491 3491
       ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart);
3492 3492
       MMeshMoveZItem = ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, &current_position.z);
@@ -3500,11 +3500,11 @@ void Draw_Motion_Menu() {
3500 3500
 
3501 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 3504
     checkkey = Menu;
3505 3505
     if (CurrentMenu != PreheatMenu) {
3506 3506
       CurrentMenu = PreheatMenu;
3507
-      SetMenuTitle(cn, en, fstr);
3507
+      SetMenuTitle(cn, fstr);
3508 3508
       DWINUI::MenuItemsPrepare(5);
3509 3509
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu);
3510 3510
       #if HAS_HOTEND
@@ -3526,13 +3526,13 @@ void Draw_Motion_Menu() {
3526 3526
   void Draw_Preheat1_Menu() {
3527 3527
     HMI_value.Preheat = 0;
3528 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 3532
   void Draw_Preheat2_Menu() {
3533 3533
     HMI_value.Preheat = 1;
3534 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 3538
   #ifdef PREHEAT_3_LABEL
@@ -3540,7 +3540,7 @@ void Draw_Motion_Menu() {
3540 3540
       HMI_value.Preheat = 2;
3541 3541
       if (PreheatMenu == nullptr) PreheatMenu = new MenuClass();
3542 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 3545
   #endif
3546 3546
 
@@ -3551,7 +3551,7 @@ void Draw_Temperature_Menu() {
3551 3551
   if (TemperatureMenu == nullptr) TemperatureMenu = new MenuClass();
3552 3552
   if (CurrentMenu != TemperatureMenu) {
3553 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 3555
     DWINUI::MenuItemsPrepare(7);
3556 3556
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu);
3557 3557
     #if HAS_HOTEND
@@ -3579,7 +3579,7 @@ void Draw_MaxSpeed_Menu() {
3579 3579
   if (MaxSpeedMenu == nullptr) MaxSpeedMenu = new MenuClass();
3580 3580
   if (CurrentMenu != MaxSpeedMenu) {
3581 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 3583
     DWINUI::MenuItemsPrepare(5);
3584 3584
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3585 3585
     ADDMENUITEM_P(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]);
@@ -3597,7 +3597,7 @@ void Draw_MaxAccel_Menu() {
3597 3597
   if (MaxAccelMenu == nullptr) MaxAccelMenu = new MenuClass();
3598 3598
   if (CurrentMenu != MaxAccelMenu) {
3599 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 3601
     DWINUI::MenuItemsPrepare(5);
3602 3602
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3603 3603
     ADDMENUITEM_P(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]);
@@ -3616,7 +3616,7 @@ void Draw_MaxAccel_Menu() {
3616 3616
     if (MaxJerkMenu == nullptr) MaxJerkMenu = new MenuClass();
3617 3617
     if (CurrentMenu != MaxJerkMenu) {
3618 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 3620
       DWINUI::MenuItemsPrepare(5);
3621 3621
       ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3622 3622
       ADDMENUITEM_P(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]);
@@ -3635,7 +3635,7 @@ void Draw_Steps_Menu() {
3635 3635
   if (StepsMenu == nullptr) StepsMenu = new MenuClass();
3636 3636
   if (CurrentMenu != StepsMenu) {
3637 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 3639
     DWINUI::MenuItemsPrepare(5);
3640 3640
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu);
3641 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,8 +24,8 @@
24 24
 /**
25 25
  * DWIN UI Enhanced implementation
26 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 31
 #include "../../../inc/MarlinConfigPre.h"
@@ -154,6 +154,7 @@ void HMI_SDCardUpdate();
154 154
 // Other
155 155
 void Goto_PrintProcess();
156 156
 void Goto_Main_Menu();
157
+void Goto_InfoMenu();
157 158
 void Draw_Select_Highlight(const bool sel);
158 159
 void Draw_Status_Area(const bool with_update); // Status Area
159 160
 void Draw_Main_Area();      // Redraw main area;

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

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * DWIN UI Enhanced implementation
25 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 30
 #include "../../../inc/MarlinConfigPre.h"

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

@@ -24,8 +24,8 @@
24 24
 /**
25 25
  * DWIN UI Enhanced implementation
26 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 31
 #include "../common/dwin_api.h"
@@ -48,13 +48,6 @@ inline void DWIN_Draw_QR(uint8_t QR_Pixel, uint16_t x, uint16_t y, FSTR_P title)
48 48
 //  x/y: Screen paste point
49 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 51
 // Copy area from current virtual display area to current screen
59 52
 //  xStart/yStart: Upper-left of virtual area
60 53
 //  xEnd/yEnd: Lower-right of virtual area

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

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * DWIN UI Enhanced implementation
25 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 30
 #include "../../../inc/MarlinConfigPre.h"
@@ -38,8 +38,8 @@
38 38
 //#define DEBUG_OUT 1
39 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 43
 MenuItemClass** MenuItems = nullptr;
44 44
 MenuClass *CurrentMenu = nullptr;
45 45
 MenuClass *PreviousMenu = nullptr;
@@ -50,8 +50,8 @@ uint16_t DWINUI::textcolor = Def_Text_Color;
50 50
 uint16_t DWINUI::backcolor = Def_Background_Color;
51 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 55
 void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr;
56 56
 void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr;
57 57
 
@@ -304,14 +304,14 @@ void DWINUI::ClearMenuArea() {
304 304
 
305 305
 void DWINUI::MenuItemsClear() {
306 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 308
   delete[] MenuItems;
309 309
   MenuItems = nullptr;
310 310
   MenuItemCount = 0;
311 311
   MenuItemTotal = 0;
312 312
 }
313 313
 
314
-void DWINUI::MenuItemsPrepare(uint8_t totalitems) {
314
+void DWINUI::MenuItemsPrepare(int8_t totalitems) {
315 315
   MenuItemsClear();
316 316
   MenuItemTotal = totalitems;
317 317
   MenuItems = new MenuItemClass*[totalitems];
@@ -379,7 +379,7 @@ MenuClass::MenuClass() {
379 379
 void MenuClass::draw() {
380 380
   MenuTitle.draw();
381 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 383
     MenuItems[i]->draw(i - topline);
384 384
   if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line());
385 385
   DWIN_UpdateLCD();

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

@@ -24,11 +24,10 @@
24 24
 /**
25 25
  * DWIN UI Enhanced implementation
26 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 31
 #include "dwin_lcd.h"
33 32
 #include "../common/dwin_set.h"
34 33
 #include "../common/dwin_font.h"
@@ -138,7 +137,7 @@ extern TitleClass Title;
138 137
 class MenuItemClass {
139 138
 protected:
140 139
 public:
141
-  uint8_t pos = 0;
140
+  int8_t pos = 0;
142 141
   uint8_t icon = 0;
143 142
   char caption[32] = "";
144 143
   uint8_t frameid = 0;
@@ -185,8 +184,8 @@ namespace DWINUI {
185 184
   extern uint16_t backcolor;
186 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 189
   extern void (*onTitleDraw)(TitleClass* title);
191 190
   extern void (*onMenuDraw)(MenuClass* menu);
192 191
 
@@ -342,6 +341,12 @@ namespace DWINUI {
342 341
   //  rlimit: For draw less chars than string length use rlimit
343 342
   void Draw_String(const char * const string, uint16_t rlimit = 0xFFFF);
344 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 351
   // Draw a string
347 352
   //  size: Font size
@@ -353,25 +358,25 @@ namespace DWINUI {
353 358
     DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string);
354 359
   }
355 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 363
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) {
359 364
     DWIN_Draw_String(false, font, color, backcolor, x, y, string);
360 365
   }
361 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 369
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
365 370
     DWIN_Draw_String(true, font, color, bgcolor, x, y, string);
366 371
   }
367 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 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 376
     DWIN_Draw_String(true, size, color, bgcolor, x, y, string);
372 377
   }
373 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 382
   // Draw a centered string using DWIN_WIDTH
@@ -382,8 +387,8 @@ namespace DWINUI {
382 387
   //  y: Upper coordinate of the string
383 388
   //  *string: The string
384 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 393
   inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) {
389 394
     Draw_CenteredString(true, font, color, bcolor, y, string);
@@ -392,19 +397,19 @@ namespace DWINUI {
392 397
     Draw_CenteredString(false, size, color, backcolor, y, string);
393 398
   }
394 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 402
   inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) {
398 403
     Draw_CenteredString(false, font, color, backcolor, y, string);
399 404
   }
400 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 408
   inline void Draw_CenteredString(uint16_t y, const char * const string) {
404 409
     Draw_CenteredString(false, font, textcolor, backcolor, y, string);
405 410
   }
406 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 415
   // Draw a circle
@@ -477,7 +482,7 @@ namespace DWINUI {
477 482
   void MenuItemsClear();
478 483
 
479 484
   // Prepare MenuItems array
480
-  void MenuItemsPrepare(uint8_t totalitems);
485
+  void MenuItemsPrepare(int8_t totalitems);
481 486
 
482 487
   // Add elements to the MenuItems array
483 488
   MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem);

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

@@ -1,8 +1,8 @@
1 1
 /**
2 2
  * DWIN Mesh Viewer
3 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 7
  * This program is free software: you can redistribute it and/or modify
8 8
  * it under the terms of the GNU Lesser General Public License as
@@ -35,13 +35,15 @@
35 35
 MeshViewerClass MeshViewer;
36 36
 
37 37
 void MeshViewerClass::Draw() {
38
-  const int8_t mx = 30, my = 30;  // Margins
38
+  const int8_t mx = 25, my = 25;  // Margins
39 39
   const int16_t stx = (DWIN_WIDTH - 2 * mx) / (GRID_MAX_POINTS_X - 1),  // Steps
40 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 44
   #define px(xp) (mx + (xp) * stx)
43 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 47
   #define DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 12, py(yp) - 6, zv)
46 48
   #define DrawMeshHLine(yp) DWIN_Draw_HLine(HMI_data.SplitLine_Color, px(0), py(yp), DWIN_WIDTH - 2 * mx)
47 49
   #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(GRID_MAX_POINTS_Y - 1), DWIN_WIDTH - 2 * my)
@@ -61,8 +63,33 @@ void MeshViewerClass::Draw() {
61 63
     watchdog_refresh();
62 64
     LOOP_L_N(x, GRID_MAX_POINTS_X) {
63 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 95
   char str_1[6], str_2[6] = "";

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

@@ -1,8 +1,8 @@
1 1
 /**
2 2
  * DWIN Mesh Viewer
3 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 7
  * This program is free software: you can redistribute it and/or modify
8 8
  * it under the terms of the GNU Lesser General Public License as

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

@@ -3044,8 +3044,6 @@ void MarlinSettings::reset() {
3044 3044
   postprocess();
3045 3045
 
3046 3046
   DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded");
3047
-
3048
-  TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
3049 3047
 }
3050 3048
 
3051 3049
 #if DISABLED(DISABLE_M503)

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

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

Loading…
Cancel
Save