Browse Source

🚸 Fix and update ProUI (#24477)

Miguel Risco-Castillo 1 year ago
parent
commit
8fb54d4621
No account linked to committer's email address

+ 2
- 0
Marlin/src/lcd/e3v2/common/dwin_font.h View File

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+typedef uint8_t fontid_t;
25
+
24 26
 /**
25 27
  * 3-.0:The font size, 0x00-0x09, corresponds to the font size below:
26 28
  * 0x00=6*12   0x01=8*16   0x02=10*20  0x03=12*24  0x04=14*28

Marlin/src/lcd/e3v2/proui/ubl_tools.cpp → Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp View File

@@ -21,19 +21,20 @@
21 21
  */
22 22
 
23 23
 /**
24
- * UBL Tools and Mesh Viewer for Pro UI
25
- * Version: 1.0.0
26
- * Date: 2022/04/13
24
+ * Bed Level Tools for Pro UI
25
+ * Extended by: Miguel A. Risco-Castillo (MRISCOC)
26
+ * Version: 2.0.0
27
+ * Date: 2022/05/23
27 28
  *
28
- * Original Author: Henri-J-Norden
29
- * Original Source: https://github.com/Jyers/Marlin/pull/126
29
+ * Based on the original work of: Henri-J-Norden
30
+ * https://github.com/Jyers/Marlin/pull/126
30 31
  */
31 32
 
32 33
 #include "../../../inc/MarlinConfigPre.h"
34
+#include "bedlevel_tools.h"
33 35
 
34
-#if BOTH(DWIN_LCD_PROUI, AUTO_BED_LEVELING_UBL)
36
+#if BOTH(DWIN_LCD_PROUI, HAS_LEVELING)
35 37
 
36
-#include "ubl_tools.h"
37 38
 #include "../../marlinui.h"
38 39
 #include "../../../core/types.h"
39 40
 #include "dwin.h"
@@ -47,27 +48,29 @@
47 48
 #include "../../../libs/least_squares_fit.h"
48 49
 #include "../../../libs/vector_3.h"
49 50
 
50
-UBLMeshToolsClass ubl_tools;
51
+BedLevelToolsClass BedLevelTools;
51 52
 
52
-#if ENABLED(USE_UBL_VIEWER)
53
-  bool UBLMeshToolsClass::viewer_asymmetric_range = false;
54
-  bool UBLMeshToolsClass::viewer_print_value = false;
53
+#if USE_UBL_VIEWER
54
+  bool BedLevelToolsClass::viewer_asymmetric_range = false;
55
+  bool BedLevelToolsClass::viewer_print_value = false;
55 56
 #endif
56
-bool UBLMeshToolsClass::goto_mesh_value = false;
57
-uint8_t UBLMeshToolsClass::tilt_grid = 1;
57
+bool BedLevelToolsClass::goto_mesh_value = false;
58
+uint8_t BedLevelToolsClass::mesh_x = 0;
59
+uint8_t BedLevelToolsClass::mesh_y = 0;
60
+uint8_t BedLevelToolsClass::tilt_grid = 1;
58 61
 
59 62
 bool drawing_mesh = false;
60 63
 char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16];
61 64
 
62 65
 #if ENABLED(AUTO_BED_LEVELING_UBL)
63 66
 
64
-  void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) {
67
+  void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) {
65 68
     sprintf_P(cmd, PSTR("M421 I%i J%i Z%s %s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1), undefined ? "N" : "");
66 69
     gcode.process_subcommands_now(cmd);
67 70
     planner.synchronize();
68 71
   }
69 72
 
70
-  bool UBLMeshToolsClass::create_plane_from_mesh() {
73
+  bool BedLevelToolsClass::create_plane_from_mesh() {
71 74
     struct linear_fit_data lsf_results;
72 75
     incremental_LSF_reset(&lsf_results);
73 76
     GRID_LOOP(x, y) {
@@ -119,7 +122,7 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16];
119 122
 
120 123
 #else
121 124
 
122
-  void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) {
125
+  void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) {
123 126
     sprintf_P(cmd, PSTR("G29 I%i J%i Z%s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1));
124 127
     gcode.process_subcommands_now(cmd);
125 128
     planner.synchronize();
@@ -127,7 +130,8 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16];
127 130
 
128 131
 #endif
129 132
 
130
-void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) {
133
+void BedLevelToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) {
134
+  gcode.process_subcommands_now(F("G28O"));
131 135
   if (zmove) {
132 136
     planner.synchronize();
133 137
     current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES;
@@ -149,8 +153,28 @@ void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y,
149 153
   }
150 154
 }
151 155
 
152
-float UBLMeshToolsClass::get_max_value() {
153
-  float max = __FLT_MIN__;
156
+void BedLevelToolsClass::MoveToXYZ() {
157
+  BedLevelTools.goto_mesh_value = true;
158
+  BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false);
159
+}
160
+void BedLevelToolsClass::MoveToXY() {
161
+  BedLevelTools.goto_mesh_value = false;
162
+  BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false);
163
+}
164
+void BedLevelToolsClass::MoveToZ() {
165
+  BedLevelTools.goto_mesh_value = true;
166
+  BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, true);
167
+}
168
+void BedLevelToolsClass::ProbeXY() {
169
+  sprintf_P(cmd, PSTR("G30X%sY%s"),
170
+    dtostrf(bedlevel.get_mesh_x(BedLevelTools.mesh_x), 1, 2, str_1),
171
+    dtostrf(bedlevel.get_mesh_y(BedLevelTools.mesh_y), 1, 2, str_2)
172
+  );
173
+  gcode.process_subcommands_now(cmd);
174
+}
175
+
176
+float BedLevelToolsClass::get_max_value() {
177
+  float max = __FLT_MAX__ * -1;
154 178
   GRID_LOOP(x, y) {
155 179
     if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max)
156 180
       max = bedlevel.z_values[x][y];
@@ -158,7 +182,7 @@ float UBLMeshToolsClass::get_max_value() {
158 182
   return max;
159 183
 }
160 184
 
161
-float UBLMeshToolsClass::get_min_value() {
185
+float BedLevelToolsClass::get_min_value() {
162 186
   float min = __FLT_MAX__;
163 187
   GRID_LOOP(x, y) {
164 188
     if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min)
@@ -167,19 +191,20 @@ float UBLMeshToolsClass::get_min_value() {
167 191
   return min;
168 192
 }
169 193
 
170
-bool UBLMeshToolsClass::validate() {
171
-  float min = __FLT_MAX__, max = __FLT_MIN__;
194
+bool BedLevelToolsClass::meshvalidate() {
195
+  float min = __FLT_MAX__, max = __FLT_MAX__ * -1;
172 196
 
173 197
   GRID_LOOP(x, y) {
174 198
     if (isnan(bedlevel.z_values[x][y])) return false;
175 199
     if (bedlevel.z_values[x][y] < min) min = bedlevel.z_values[x][y];
176 200
     if (bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y];
177 201
   }
178
-  return max <= UBL_Z_OFFSET_MAX && min >= UBL_Z_OFFSET_MIN;
202
+  return WITHIN(max, MESH_Z_OFFSET_MIN, MESH_Z_OFFSET_MAX);
179 203
 }
180 204
 
181
-#if ENABLED(USE_UBL_VIEWER)
182
-  void UBLMeshToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) {
205
+#if USE_UBL_VIEWER
206
+
207
+  void BedLevelToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) {
183 208
     drawing_mesh = true;
184 209
     const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x;
185 210
     const uint16_t cell_width_px  = total_width_px / (GRID_MAX_POINTS_X);
@@ -237,7 +262,7 @@ bool UBLMeshToolsClass::validate() {
237 262
     }
238 263
   }
239 264
 
240
-  void UBLMeshToolsClass::Set_Mesh_Viewer_Status() { // TODO: draw gradient with values as a legend instead
265
+  void BedLevelToolsClass::Set_Mesh_Viewer_Status() { // TODO: draw gradient with values as a legend instead
241 266
     float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max);
242 267
     if (v_min > 3e+10F) v_min = 0.0000001;
243 268
     if (v_max > 3e+10F) v_max = 0.0000001;
@@ -255,6 +280,7 @@ bool UBLMeshToolsClass::validate() {
255 280
     ui.set_status(msg);
256 281
     drawing_mesh = false;
257 282
   }
258
-#endif
259 283
 
260
-#endif // DWIN_LCD_PROUI && AUTO_BED_LEVELING_UBL
284
+#endif // USE_UBL_VIEWER
285
+
286
+#endif // DWIN_LCD_PROUI && HAS_LEVELING

Marlin/src/lcd/e3v2/proui/ubl_tools.h → Marlin/src/lcd/e3v2/proui/bedlevel_tools.h View File

@@ -1,10 +1,9 @@
1
-/**
2
- * UBL Tools and Mesh Viewer for Pro UI
3
- * Version: 1.0.0
4
- * Date: 2022/04/13
1
+/*
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5 4
  *
6
- * Original Author: Henri-J-Norden (https://github.com/Henri-J-Norden)
7
- * Original Source: https://github.com/Jyers/Marlin/pull/135
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
8 7
  *
9 8
  * This program is free software: you can redistribute it and/or modify
10 9
  * it under the terms of the GNU General Public License as published by
@@ -20,22 +19,37 @@
20 19
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
21 20
  *
22 21
  */
22
+
23
+/**
24
+ * Bed Level Tools for Pro UI
25
+ * Extended by: Miguel A. Risco-Castillo (MRISCOC)
26
+ * Version: 2.0.0
27
+ * Date: 2022/05/23
28
+ *
29
+ * Based on the original work of: Henri-J-Norden
30
+ * https://github.com/Jyers/Marlin/pull/126
31
+ */
32
+
23 33
 #pragma once
24 34
 
25 35
 #include "../../../inc/MarlinConfigPre.h"
26 36
 
27
-//#define USE_UBL_VIEWER 1
37
+#if ENABLED(AUTO_BED_LEVELING_UBL)
38
+  //#define USE_UBL_VIEWER 1
39
+#endif
28 40
 
29
-#define UBL_Z_OFFSET_MIN -3.0
30
-#define UBL_Z_OFFSET_MAX  3.0
41
+#define MESH_Z_OFFSET_MIN -3.0
42
+#define MESH_Z_OFFSET_MAX  3.0
31 43
 
32
-class UBLMeshToolsClass {
44
+class BedLevelToolsClass {
33 45
 public:
34
-  #if ENABLED(USE_UBL_VIEWER)
46
+  #if USE_UBL_VIEWER
35 47
     static bool viewer_asymmetric_range;
36 48
     static bool viewer_print_value;
37 49
   #endif
38 50
   static bool goto_mesh_value;
51
+  static uint8_t mesh_x;
52
+  static uint8_t mesh_y;
39 53
   static uint8_t tilt_grid;
40 54
 
41 55
   #if ENABLED(AUTO_BED_LEVELING_UBL)
@@ -45,15 +59,19 @@ public:
45 59
     static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y);
46 60
   #endif
47 61
   static void manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove=false);
62
+  static void MoveToXYZ();
63
+  static void MoveToXY();
64
+  static void MoveToZ();
65
+  static void ProbeXY();
48 66
   static float get_max_value();
49 67
   static float get_min_value();
50
-  static bool validate();
51
-  #if ENABLED(USE_UBL_VIEWER)
68
+  static bool meshvalidate();
69
+  #if USE_UBL_VIEWER
52 70
     static void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7);
53 71
     static void Set_Mesh_Viewer_Status();
54 72
   #endif
55 73
 };
56 74
 
57
-extern UBLMeshToolsClass ubl_tools;
75
+extern BedLevelToolsClass BedLevelTools;
58 76
 
59 77
 void Goto_MeshViewer();

+ 114
- 109
Marlin/src/lcd/e3v2/proui/dwin.cpp View File

@@ -101,17 +101,18 @@
101 101
 
102 102
 #if HAS_MESH || HAS_ONESTEP_LEVELING
103 103
   #include "../../../feature/bedlevel/bedlevel.h"
104
+  #include "bedlevel_tools.h"
104 105
 #endif
105 106
 
106 107
 #if HAS_BED_PROBE
107 108
   #include "../../../module/probe.h"
108 109
 #endif
109 110
 
110
-#ifdef BLTOUCH_HS_MODE
111
+#if ENABLED(BLTOUCH)
111 112
   #include "../../../feature/bltouch.h"
112 113
 #endif
113 114
 
114
-#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET)
115
+#if EITHER(BABYSTEPPING, HAS_BED_PROBE)
115 116
   #define HAS_ZOFFSET_ITEM 1
116 117
   #if ENABLED(BABYSTEPPING)
117 118
     #include "../../../feature/babystep.h"
@@ -141,10 +142,6 @@
141 142
   #include "meshviewer.h"
142 143
 #endif
143 144
 
144
-#if ENABLED(AUTO_BED_LEVELING_UBL)
145
-  #include "ubl_tools.h"
146
-#endif
147
-
148 145
 #if ENABLED(PRINTCOUNTER)
149 146
   #include "printstats.h"
150 147
 #endif
@@ -157,16 +154,14 @@
157 154
   #include "../../../feature/leds/leds.h"
158 155
 #endif
159 156
 
160
-#include <WString.h>
161
-#include <stdio.h>
162
-#include <string.h>
157
+#if HAS_LOCKSCREEN
158
+  #include "lockscreen.h"
159
+#endif
163 160
 
164 161
 #ifndef MACHINE_SIZE
165 162
   #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS)
166 163
 #endif
167 164
 
168
-#include "lockscreen.h"
169
-
170 165
 #define PAUSE_HEAT
171 166
 
172 167
 #define MENU_CHAR_LIMIT  24
@@ -251,6 +246,7 @@ constexpr float max_feedrate_edit_values[] =
251 246
     { 1000, 1000, 10, 50 }
252 247
   #endif
253 248
 ;
249
+
254 250
 constexpr float max_acceleration_edit_values[] =
255 251
   #ifdef MAX_ACCEL_EDIT_VALUES
256 252
     MAX_ACCEL_EDIT_VALUES
@@ -258,6 +254,7 @@ constexpr float max_acceleration_edit_values[] =
258 254
     { 1000, 1000, 200, 2000 }
259 255
   #endif
260 256
 ;
257
+
261 258
 #if HAS_CLASSIC_JERK
262 259
   constexpr float max_jerk_edit_values[] =
263 260
     #ifdef MAX_JERK_EDIT_VALUES
@@ -305,7 +302,9 @@ MenuClass *FilamentMenu = nullptr;
305 302
 MenuClass *TemperatureMenu = nullptr;
306 303
 MenuClass *MaxSpeedMenu = nullptr;
307 304
 MenuClass *MaxAccelMenu = nullptr;
308
-MenuClass *MaxJerkMenu = nullptr;
305
+#if HAS_CLASSIC_JERK
306
+  MenuClass *MaxJerkMenu = nullptr;
307
+#endif
309 308
 MenuClass *StepsMenu = nullptr;
310 309
 MenuClass *HotendPIDMenu = nullptr;
311 310
 MenuClass *BedPIDMenu = nullptr;
@@ -552,14 +551,9 @@ void Popup_window_PauseOrStop() {
552 551
 #endif
553 552
 
554 553
 // Draw status line
555
-void DWIN_DrawStatusLine(const char *text) {
556
-  DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
557
-  if (text) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, text);
558
-}
559
-
560
-void DWIN_DrawStatusLine(FSTR_P fstr) {
554
+void DWIN_DrawStatusLine() {
561 555
   DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
562
-  if (fstr) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, fstr);
556
+  DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, ui.status_message);
563 557
 }
564 558
 
565 559
 // Clear & reset status line
@@ -588,7 +582,7 @@ void DWIN_DrawStatusMessage() {
588 582
     // If the string fits the status line do not scroll it
589 583
     if (slen <= LCD_WIDTH) {
590 584
        if (hash_changed) {
591
-         DWIN_DrawStatusLine(ui.status_message);
585
+         DWIN_DrawStatusLine();
592 586
          hash_changed = false;
593 587
        }
594 588
     }
@@ -620,7 +614,7 @@ void DWIN_DrawStatusMessage() {
620 614
 
621 615
     if (hash_changed) {
622 616
       ui.status_message[LCD_WIDTH] = 0;
623
-      DWIN_DrawStatusLine(ui.status_message);
617
+      DWIN_DrawStatusLine();
624 618
       hash_changed = false;
625 619
     }
626 620
 
@@ -663,7 +657,7 @@ void ICON_ResumeOrPause() {
663 657
 }
664 658
 
665 659
 // Update filename on print
666
-void DWIN_Print_Header(const char *text = nullptr) {
660
+void DWIN_Print_Header(const char *text=nullptr) {
667 661
   static char headertxt[31] = "";  // Print header text
668 662
   if (text) {
669 663
     const int8_t size = _MIN(30U, strlen_P(text));
@@ -1099,7 +1093,7 @@ void DWIN_Draw_Dashboard() {
1099 1093
     DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 195 + 2 * STAT_CHR_W, 384, thermalManager.fan_speed[0]);
1100 1094
   #endif
1101 1095
 
1102
-  #if BOTH(BABYSTEPPING, HAS_BED_PROBE)
1096
+  #if HAS_ZOFFSET_ITEM
1103 1097
     DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416);
1104 1098
   #endif
1105 1099
 
@@ -1370,13 +1364,15 @@ void Draw_Main_Area() {
1370 1364
       case ESDiagProcess:        Draw_EndStopDiag(); break;
1371 1365
     #endif
1372 1366
     case Popup:                  popupDraw(); break;
1373
-    case Locked:                 lockScreen.draw(); break;
1367
+    #if HAS_LOCKSCREEN
1368
+      case Locked:               lockScreen.draw(); break;
1369
+    #endif
1374 1370
     case Menu:
1375 1371
     case SetInt:
1376 1372
     case SetPInt:
1377 1373
     case SetIntNoDraw:
1378 1374
     case SetFloat:
1379
-    case SetPFloat:              ReDrawMenu(); break;
1375
+    case SetPFloat:              ReDrawMenu(true); break;
1380 1376
     default: break;
1381 1377
   }
1382 1378
 }
@@ -1567,7 +1563,9 @@ void DWIN_HandleScreen() {
1567 1563
     case PrintProcess:    HMI_Printing(); break;
1568 1564
     case Popup:           HMI_Popup(); break;
1569 1565
     case Leveling:        break;
1570
-    case Locked:          HMI_LockScreen(); break;
1566
+    #if HAS_LOCKSCREEN
1567
+      case Locked:        HMI_LockScreen(); break;
1568
+    #endif
1571 1569
     case PrintDone:
1572 1570
     TERN_(HAS_ESDIAG, case ESDiagProcess:)
1573 1571
     case WaitResponse:    HMI_WaitForUser(); break;
@@ -1769,7 +1767,7 @@ void DWIN_Print_Aborted() {
1769 1767
   Goto_PrintDone();
1770 1768
 }
1771 1769
 
1772
-// Progress Bar update
1770
+// Progress and remaining time update
1773 1771
 void DWIN_M73() {
1774 1772
   if (parser.seenval('P')) {
1775 1773
     _percent_done = parser.value_byte();
@@ -1843,11 +1841,6 @@ void DWIN_CopySettingsFrom(const char * const buff) {
1843 1841
   TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT());
1844 1842
   feedrate_percentage = 100;
1845 1843
   TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate());
1846
-  #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)
1847
-    // Apply Case light brightness
1848
-    caselight.brightness = HMI_data.CaseLight_Brightness;
1849
-    caselight.update_brightness();
1850
-  #endif
1851 1844
   #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
1852 1845
     leds.set_color(
1853 1846
       (HMI_data.LED_Color >> 16) & 0xFF,
@@ -1880,7 +1873,7 @@ void DWIN_InitScreen() {
1880 1873
   index_file = MROWS;
1881 1874
   hash_changed = true;
1882 1875
   last_E = 0;
1883
-  DWIN_DrawStatusLine(FSTR_P(nullptr));
1876
+  DWIN_DrawStatusLine();
1884 1877
   DWIN_Draw_Dashboard();
1885 1878
   Goto_Main_Menu();
1886 1879
 }
@@ -1935,7 +1928,7 @@ void DWIN_RedrawScreen() {
1935 1928
       case PAUSE_MESSAGE_PARKING:  DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING));    break;                                     // M125
1936 1929
       case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT));   break;                                     // pause_print (M125, M600)
1937 1930
       case PAUSE_MESSAGE_WAITING:  DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break;
1938
-      case PAUSE_MESSAGE_INSERT:   DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
1931
+      case PAUSE_MESSAGE_INSERT:   DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break;
1939 1932
       case PAUSE_MESSAGE_LOAD:     DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD));   break;
1940 1933
       case PAUSE_MESSAGE_UNLOAD:   DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break;                                     // Unload of pause and Unload of M702
1941 1934
       case PAUSE_MESSAGE_PURGE:
@@ -1988,28 +1981,32 @@ void DWIN_RedrawScreen() {
1988 1981
   }
1989 1982
 #endif // HAS_MESH
1990 1983
 
1991
-void DWIN_LockScreen() {
1992
-  if (checkkey != Locked) {
1993
-    lockScreen.rprocess = checkkey;
1994
-    checkkey = Locked;
1995
-    lockScreen.init();
1984
+
1985
+#if HAS_LOCKSCREEN
1986
+
1987
+  void DWIN_LockScreen() {
1988
+    if (checkkey != Locked) {
1989
+      lockScreen.rprocess = checkkey;
1990
+      checkkey = Locked;
1991
+      lockScreen.init();
1992
+    }
1996 1993
   }
1997
-}
1998 1994
 
1999
-void DWIN_UnLockScreen() {
2000
-  if (checkkey == Locked) {
2001
-    checkkey = lockScreen.rprocess;
2002
-    Draw_Main_Area();
1995
+  void DWIN_UnLockScreen() {
1996
+    if (checkkey == Locked) {
1997
+      checkkey = lockScreen.rprocess;
1998
+      Draw_Main_Area();
1999
+    }
2003 2000
   }
2004
-}
2005 2001
 
2006
-void HMI_LockScreen() {
2007
-  EncoderState encoder_diffState = get_encoder_state();
2008
-  if (encoder_diffState == ENCODER_DIFF_NO) return;
2009
-  lockScreen.onEncoder(encoder_diffState);
2010
-  if (lockScreen.isUnlocked()) DWIN_UnLockScreen();
2011
-}
2002
+  void HMI_LockScreen() {
2003
+    EncoderState encoder_diffState = get_encoder_state();
2004
+    if (encoder_diffState == ENCODER_DIFF_NO) return;
2005
+    lockScreen.onEncoder(encoder_diffState);
2006
+    if (lockScreen.isUnlocked()) DWIN_UnLockScreen();
2007
+  }
2012 2008
 
2009
+#endif //  HAS_LOCKSCREEN
2013 2010
 
2014 2011
 #if HAS_GCODE_PREVIEW
2015 2012
 
@@ -2051,7 +2048,8 @@ void HMI_LockScreen() {
2051 2048
 
2052 2049
 #if ENABLED(EEPROM_SETTINGS)
2053 2050
   void WriteEeprom() {
2054
-    DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM));
2051
+    ui.set_status(GET_TEXT_F(MSG_STORE_EEPROM));
2052
+    DWIN_DrawStatusLine();
2055 2053
     DWIN_UpdateLCD();
2056 2054
     DONE_BUZZ(settings.save());
2057 2055
   }
@@ -2106,11 +2104,13 @@ void HomeX() { queue.inject(F("G28X")); }
2106 2104
 void HomeY() { queue.inject(F("G28Y")); }
2107 2105
 void HomeZ() { queue.inject(F("G28Z")); }
2108 2106
 
2109
-void SetHome() {
2107
+#if HAS_HOME_OFFSET
2110 2108
   // Apply workspace offset, making the current position 0,0,0
2109
+  void SetHome() {
2111 2110
   queue.inject(F("G92X0Y0Z0"));
2112 2111
   DONE_BUZZ(true);
2113
-}
2112
+  }
2113
+#endif
2114 2114
 
2115 2115
 #if HAS_ZOFFSET_ITEM
2116 2116
 
@@ -2132,22 +2132,25 @@ void SetHome() {
2132 2132
   void SetMoveZto0() {
2133 2133
     #if ENABLED(Z_SAFE_HOMING)
2134 2134
       char cmd[54], str_1[5], str_2[5];
2135
-      sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300\nM400"),
2135
+      sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nG0Z0F300\nM400"),
2136 2136
         dtostrf(Z_SAFE_HOMING_X_POINT, 1, 1, str_1),
2137 2137
         dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 1, str_2)
2138 2138
       );
2139 2139
       gcode.process_subcommands_now(cmd);
2140 2140
     #else
2141
-      gcode.process_subcommands_now(F("G28O\nM420S0\nG0Z0F300\nM400"));
2141
+      set_bed_leveling_enabled(false);
2142
+      gcode.process_subcommands_now(F("G28O\nG0Z0F300\nM400"));
2142 2143
     #endif
2143 2144
     ui.reset_status();
2144 2145
     DONE_BUZZ(true);
2145 2146
   }
2146 2147
 
2147
-  void HomeZandDisable() {
2148
-    SetMoveZto0();
2149
-    DisableMotors();
2150
-  }
2148
+  #if !HAS_BED_PROBE
2149
+    void HomeZandDisable() {
2150
+      SetMoveZto0();
2151
+      DisableMotors();
2152
+    }
2153
+  #endif
2151 2154
 
2152 2155
 #endif // HAS_ZOFFSET_ITEM
2153 2156
 
@@ -2840,9 +2843,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) {
2840 2843
   DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240);
2841 2844
 }
2842 2845
 
2843
-#if HAS_FILAMENT_SENSOR
2844
-  void onDrawRunoutEnable(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, runout.enabled); }
2845
-#endif
2846 2846
 
2847 2847
 void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); }
2848 2848
 void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); }
@@ -3249,7 +3249,9 @@ void Draw_AdvancedSettings_Menu() {
3249 3249
       MENU_ITEM_F(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, Goto_PrintStats);
3250 3250
       MENU_ITEM_F(ICON_PrintStatsReset, MSG_INFO_PRINT_COUNT_RESET, onDrawSubMenu, PrintStats.Reset);
3251 3251
     #endif
3252
-    MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen);
3252
+    #if HAS_LOCKSCREEN
3253
+      MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen);
3254
+    #endif
3253 3255
   }
3254 3256
   ui.reset_status(true);
3255 3257
   UpdateMenu(AdvancedSettings);
@@ -3295,12 +3297,15 @@ void Draw_Move_Menu() {
3295 3297
       EDIT_ITEM_F(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
3296 3298
       EDIT_ITEM_F(ICON_ProbeOffsetY, MSG_ZPROBE_YOFFSET, onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y);
3297 3299
       EDIT_ITEM_F(ICON_ProbeOffsetZ, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z);
3298
-      #ifdef BLTOUCH_HS_MODE
3299
-        EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode);
3300
+      #if ENABLED(BLTOUCH)
3301
+        MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow);
3302
+        MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy);
3303
+        MENU_ITEM_F(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset);
3304
+        #ifdef BLTOUCH_HS_MODE
3305
+          EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode);
3306
+        #endif
3300 3307
       #endif
3301 3308
       MENU_ITEM_F(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, ProbeTest);
3302
-      MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow);
3303
-      MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy);
3304 3309
     }
3305 3310
     UpdateMenu(ProbeSetMenu);
3306 3311
   }
@@ -3384,14 +3389,24 @@ void Draw_GetColor_Menu() {
3384 3389
 #endif
3385 3390
 
3386 3391
 #if ENABLED(LED_CONTROL_MENU)
3387
-    void Draw_LedControl_Menu() {
3388
-      checkkey = Menu;
3389
-      if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) {
3390
-        BACK_ITEM(Draw_Control_Menu);
3391
-        #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL)
3392
-          EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on);
3393
-        #endif
3394
-        #if HAS_COLOR_LEDS
3392
+  void Draw_LedControl_Menu() {
3393
+    checkkey = Menu;
3394
+    if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) {
3395
+      BACK_ITEM(Draw_Control_Menu);
3396
+      #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL)
3397
+        EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on);
3398
+      #endif
3399
+      #if HAS_COLOR_LEDS
3400
+        #if ENABLED(LED_COLOR_PRESETS)
3401
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_WHITE, onDrawMenuItem,  leds.set_white);
3402
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_RED, onDrawMenuItem,    leds.set_red);
3403
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_ORANGE, onDrawMenuItem, leds.set_orange);
3404
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_YELLOW, onDrawMenuItem, leds.set_yellow);
3405
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_GREEN, onDrawMenuItem,  leds.set_green);
3406
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_BLUE, onDrawMenuItem,   leds.set_blue);
3407
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_INDIGO, onDrawMenuItem, leds.set_indigo);
3408
+          MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_VIOLET, onDrawMenuItem, leds.set_violet);
3409
+        #else
3395 3410
           EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_RED, onDrawPInt8Menu, SetLEDColorR, &leds.color.r);
3396 3411
           EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g);
3397 3412
           EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b);
@@ -3399,9 +3414,10 @@ void Draw_GetColor_Menu() {
3399 3414
             EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLedColorW, &leds.color.w);
3400 3415
           #endif
3401 3416
         #endif
3402
-      }
3403
-      UpdateMenu(LedControlMenu);
3417
+      #endif
3404 3418
     }
3419
+    UpdateMenu(LedControlMenu);
3420
+  }
3405 3421
 #endif
3406 3422
 
3407 3423
 void Draw_Tune_Menu() {
@@ -3432,7 +3448,9 @@ void Draw_Tune_Menu() {
3432 3448
     #if ENABLED(FWRETRACT)
3433 3449
       MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu);
3434 3450
     #endif
3435
-    MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen);
3451
+    #if HAS_LOCKSCREEN
3452
+      MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen);
3453
+    #endif
3436 3454
     #if HAS_LCD_BRIGHTNESS
3437 3455
       EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness);
3438 3456
       MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight);
@@ -3750,15 +3768,14 @@ void Draw_Steps_Menu() {
3750 3768
   #endif
3751 3769
 
3752 3770
   #if ENABLED(MESH_EDIT_MENU)
3753
-    uint8_t mesh_x = 0, mesh_y = 0;
3754 3771
     #define Z_OFFSET_MIN -3
3755 3772
     #define Z_OFFSET_MAX  3
3756 3773
 
3757
-    void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); }
3758
-    void ApplyEditMeshX() { mesh_x = MenuData.Value; }
3759
-    void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); }
3760
-    void ApplyEditMeshY() { mesh_y = MenuData.Value; }
3761
-    void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); }
3774
+    void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? BedLevelTools.mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : BedLevelTools.mesh_y]; EditZValueItem->redraw(); }
3775
+    void ApplyEditMeshX() { BedLevelTools.mesh_x = MenuData.Value; }
3776
+    void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, BedLevelTools.mesh_x, ApplyEditMeshX, LiveEditMesh); }
3777
+    void ApplyEditMeshY() { BedLevelTools.mesh_y = MenuData.Value; }
3778
+    void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, BedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); }
3762 3779
     void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); }
3763 3780
   #endif
3764 3781
 #endif
@@ -3772,14 +3789,14 @@ void Draw_Steps_Menu() {
3772 3789
     onDrawIntMenu(menuitem, line, bedlevel.storage_slot);
3773 3790
   }
3774 3791
 
3775
-  void ApplyUBLTiltGrid() { ubl_tools.tilt_grid = MenuData.Value; }
3776
-  void SetUBLTiltGrid() { SetIntOnClick(1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); }
3792
+  void ApplyUBLTiltGrid() { BedLevelTools.tilt_grid = MenuData.Value; }
3793
+  void SetUBLTiltGrid() { SetIntOnClick(1, 3, BedLevelTools.tilt_grid, ApplyUBLTiltGrid); }
3777 3794
 
3778 3795
   void UBLTiltMesh() {
3779 3796
     if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0;
3780 3797
     char buf[15];
3781
-    if (ubl_tools.tilt_grid > 1) {
3782
-      sprintf_P(buf, PSTR("G28O\nG29 J%i"), ubl_tools.tilt_grid);
3798
+    if (BedLevelTools.tilt_grid > 1) {
3799
+      sprintf_P(buf, PSTR("G28O\nG29 J%i"), BedLevelTools.tilt_grid);
3783 3800
       gcode.process_subcommands_now(buf);
3784 3801
     }
3785 3802
     else
@@ -3788,16 +3805,10 @@ void Draw_Steps_Menu() {
3788 3805
   }
3789 3806
 
3790 3807
   void UBLSmartFillMesh() {
3791
-    bedlevel.smart_fill_mesh();
3808
+    LOOP_L_N(x, GRID_MAX_POINTS_Y) bedlevel.smart_fill_mesh();
3792 3809
     LCD_MESSAGE(MSG_UBL_MESH_FILLED);
3793 3810
   }
3794 3811
 
3795
-  bool UBLValidMesh() {
3796
-    const bool valid = ubl_tools.validate();
3797
-    if (!valid) bedlevel.invalidate();
3798
-    return valid;
3799
-  }
3800
-
3801 3812
   void UBLSaveMesh() {
3802 3813
     if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0;
3803 3814
     settings.store_mesh(bedlevel.storage_slot);
@@ -3808,14 +3819,6 @@ void Draw_Steps_Menu() {
3808 3819
   void UBLLoadMesh() {
3809 3820
     if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0;
3810 3821
     settings.load_mesh(bedlevel.storage_slot);
3811
-    if (UBLValidMesh()) {
3812
-      ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), bedlevel.storage_slot);
3813
-      DONE_BUZZ(true);
3814
-    }
3815
-    else {
3816
-      LCD_MESSAGE_F("Invalid Mesh Loaded");
3817
-      DONE_BUZZ(false);
3818
-    }
3819 3822
   }
3820 3823
 
3821 3824
 #endif // AUTO_BED_LEVELING_UBL
@@ -3837,7 +3840,7 @@ void Draw_Steps_Menu() {
3837 3840
         EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot);
3838 3841
         MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh);
3839 3842
         MENU_ITEM_F(ICON_UBLActive, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh);
3840
-        EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &ubl_tools.tilt_grid);
3843
+        EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &BedLevelTools.tilt_grid);
3841 3844
         MENU_ITEM_F(ICON_UBLActive, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh);
3842 3845
         MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh);
3843 3846
       #endif
@@ -3851,13 +3854,15 @@ void Draw_Steps_Menu() {
3851 3854
 
3852 3855
   #if ENABLED(MESH_EDIT_MENU)
3853 3856
     void Draw_EditMesh_Menu() {
3857
+      if (!leveling_is_valid()) { LCD_MESSAGE(MSG_UBL_MESH_INVALID); return; }
3858
+      set_bed_leveling_enabled(false);
3854 3859
       checkkey = Menu;
3855 3860
       if (SetMenu(EditMeshMenu, GET_TEXT_F(MSG_EDIT_MESH), 4)) {
3856
-        mesh_x = mesh_y = 0;
3861
+        BedLevelTools.mesh_x = BedLevelTools.mesh_y = 0;
3857 3862
         BACK_ITEM(Draw_MeshSet_Menu);
3858
-        EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX, &mesh_x);
3859
-        EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY, &mesh_y);
3860
-        EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[mesh_x][mesh_y]);
3863
+        EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX,&BedLevelTools.mesh_x);
3864
+        EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY,&BedLevelTools.mesh_y);
3865
+        EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[BedLevelTools.mesh_x][BedLevelTools.mesh_y]);
3861 3866
       }
3862 3867
       UpdateMenu(EditMeshMenu);
3863 3868
     }

+ 6
- 5
Marlin/src/lcd/e3v2/proui/dwin.h View File

@@ -160,8 +160,7 @@ void Goto_PowerLossRecovery();
160 160
 void Goto_ConfirmToPrint();
161 161
 void DWIN_Draw_Dashboard(const bool with_update); // Status Area
162 162
 void Draw_Main_Area();      // Redraw main area
163
-void DWIN_DrawStatusLine(const char *text); // Draw simple status text
164
-void DWIN_DrawStatusLine(FSTR_P fstr);
163
+void DWIN_DrawStatusLine(); // Draw simple status text
165 164
 void DWIN_RedrawDash();     // Redraw Dash and Status line
166 165
 void DWIN_RedrawScreen();   // Redraw all screen elements
167 166
 void HMI_MainMenu();        // Main process screen
@@ -210,9 +209,11 @@ void DWIN_RebootScreen();
210 209
 #endif
211 210
 
212 211
 // Utility and extensions
213
-void DWIN_LockScreen();
214
-void DWIN_UnLockScreen();
215
-void HMI_LockScreen();
212
+#if HAS_LOCKSCREEN
213
+  void DWIN_LockScreen();
214
+  void DWIN_UnLockScreen();
215
+  void HMI_LockScreen();
216
+#endif
216 217
 #if HAS_MESH
217 218
   void DWIN_MeshViewer();
218 219
 #endif

+ 5
- 10
Marlin/src/lcd/e3v2/proui/dwin_defines.h View File

@@ -28,23 +28,21 @@
28 28
  * Date: 2022/02/28
29 29
  */
30 30
 
31
+#define HAS_GCODE_PREVIEW 1
32
+#define HAS_PIDPLOT 1
33
+#define HAS_ESDIAG 1
34
+#define HAS_LOCKSCREEN 1
31 35
 //#define DEBUG_DWIN 1
32 36
 //#define NEED_HEX_PRINT 1
33 37
 
34 38
 #include "../../../inc/MarlinConfigPre.h"
39
+#include "../common/dwin_color.h"
35 40
 #include <stddef.h>
36 41
 
37
-#define HAS_ESDIAG 1
38
-#define HAS_PIDPLOT 1
39
-#define HAS_GCODE_PREVIEW 1
40 42
 #if defined(__STM32F1__) || defined(STM32F1)
41 43
   #define DASH_REDRAW 1
42 44
 #endif
43 45
 
44
-#include "../common/dwin_color.h"
45
-#if ENABLED(LED_CONTROL_MENU)
46
-  #include "../../../feature/leds/leds.h"
47
-#endif
48 46
 
49 47
 #define Def_Background_Color  RGB( 1, 12,  8)
50 48
 #define Def_Cursor_color      RGB(20, 49, 31)
@@ -65,9 +63,6 @@
65 63
 #define Def_Indicator_Color   Color_White
66 64
 #define Def_Coordinate_Color  Color_White
67 65
 #define Def_Button_Color      RGB( 0, 23, 16)
68
-
69
-#define HAS_ESDIAG 1
70
-
71 66
 #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
72 67
   #define Def_Leds_Color 0xFFFFFFFF
73 68
 #endif

+ 27
- 33
Marlin/src/lcd/e3v2/proui/dwinui.cpp View File

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * DWIN Enhanced implementation for PRO UI
25 25
  * Author: Miguel A. Risco-Castillo (MRISCOC)
26
- * Version: 3.17.1
27
- * Date: 2022/04/12
26
+ * Version: 3.18.1
27
+ * Date: 2022/07/05
28 28
  */
29 29
 
30 30
 #include "../../../inc/MarlinConfigPre.h"
@@ -44,7 +44,7 @@ uint16_t DWINUI::pencolor = Color_White;
44 44
 uint16_t DWINUI::textcolor = Def_Text_Color;
45 45
 uint16_t DWINUI::backcolor = Def_Background_Color;
46 46
 uint16_t DWINUI::buttoncolor = Def_Button_Color;
47
-uint8_t  DWINUI::font = font8x16;
47
+uint8_t  DWINUI::fontid = font8x16;
48 48
 FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR);
49 49
 
50 50
 void (*DWINUI::onTitleDraw)(TitleClass* title) = nullptr;
@@ -62,17 +62,15 @@ void DWINUI::init() {
62 62
   textcolor = Def_Text_Color;
63 63
   backcolor = Def_Background_Color;
64 64
   buttoncolor = Def_Button_Color;
65
-  font = font8x16;
65
+  fontid = font8x16;
66 66
 }
67 67
 
68 68
 // Set text/number font
69
-void DWINUI::setFont(uint8_t cfont) {
70
-  font = cfont;
71
-}
69
+void DWINUI::setFont(fontid_t fid) { fontid = fid; }
72 70
 
73 71
 // Get font character width
74
-uint8_t DWINUI::fontWidth(uint8_t cfont) {
75
-  switch (cfont) {
72
+uint8_t DWINUI::fontWidth(fontid_t fid) {
73
+  switch (fid) {
76 74
     case font6x12 : return 6;
77 75
     case font8x16 : return 8;
78 76
     case font10x20: return 10;
@@ -88,8 +86,8 @@ uint8_t DWINUI::fontWidth(uint8_t cfont) {
88 86
 }
89 87
 
90 88
 // Get font character height
91
-uint8_t DWINUI::fontHeight(uint8_t cfont) {
92
-  switch (cfont) {
89
+uint8_t DWINUI::fontHeight(fontid_t fid) {
90
+  switch (fid) {
93 91
     case font6x12 : return 12;
94 92
     case font8x16 : return 16;
95 93
     case font10x20: return 20;
@@ -105,14 +103,10 @@ uint8_t DWINUI::fontHeight(uint8_t cfont) {
105 103
 }
106 104
 
107 105
 // Get screen x coordinates from text column
108
-uint16_t DWINUI::ColToX(uint8_t col) {
109
-  return col * fontWidth(font);
110
-}
106
+uint16_t DWINUI::ColToX(uint8_t col) { return col * fontWidth(fontid); }
111 107
 
112 108
 // Get screen y coordinates from text row
113
-uint16_t DWINUI::RowToY(uint8_t row) {
114
-  return row * fontHeight(font);
115
-}
109
+uint16_t DWINUI::RowToY(uint8_t row) { return row * fontHeight(fontid); }
116 110
 
117 111
 // Set text/number color
118 112
 void DWINUI::SetColors(uint16_t fgcolor, uint16_t bgcolor, uint16_t alcolor) {
@@ -152,9 +146,9 @@ void DWINUI::MoveBy(xy_int_t point) {
152 146
 }
153 147
 
154 148
 // Draw a Centered string using arbitrary x1 and x2 margins
155
-void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string) {
156
-  const uint16_t x = _MAX(0U, x2 + x1 - strlen_P(string) * fontWidth(size)) / 2 - 1;
157
-  DWIN_Draw_String(bShow, size, color, bColor, x, y, string);
149
+void DWINUI::Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string) {
150
+  const uint16_t x = _MAX(0U, x2 + x1 - strlen_P(string) * fontWidth(fid)) / 2 - 1;
151
+  DWIN_Draw_String(bShow, fid, color, bColor, x, y, string);
158 152
 }
159 153
 
160 154
 // Draw a char
@@ -164,13 +158,13 @@ void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint1
164 158
 //  c: ASCII code of char
165 159
 void DWINUI::Draw_Char(uint16_t color, uint16_t x, uint16_t y, const char c) {
166 160
   const char string[2] = { c, 0};
167
-  DWIN_Draw_String(false, font, color, backcolor, x, y, string, 1);
161
+  DWIN_Draw_String(false, fontid, color, backcolor, x, y, string, 1);
168 162
 }
169 163
 
170 164
 // Draw a char at cursor position and increment cursor
171 165
 void DWINUI::Draw_Char(uint16_t color, const char c) {
172 166
   Draw_Char(color, cursor.x, cursor.y, c);
173
-  MoveBy(fontWidth(font), 0);
167
+  MoveBy(fontWidth(fontid), 0);
174 168
 }
175 169
 
176 170
 // Draw a string at cursor position
@@ -178,49 +172,49 @@ void DWINUI::Draw_Char(uint16_t color, const char c) {
178 172
 //  *string: The string
179 173
 //  rlimit: For draw less chars than string length use rlimit
180 174
 void DWINUI::Draw_String(const char * const string, uint16_t rlimit) {
181
-  DWIN_Draw_String(false, font, textcolor, backcolor, cursor.x, cursor.y, string, rlimit);
182
-  MoveBy(strlen(string) * fontWidth(font), 0);
175
+  DWIN_Draw_String(false, fontid, textcolor, backcolor, cursor.x, cursor.y, string, rlimit);
176
+  MoveBy(strlen(string) * fontWidth(fontid), 0);
183 177
 }
184 178
 void DWINUI::Draw_String(uint16_t color, const char * const string, uint16_t rlimit) {
185
-  DWIN_Draw_String(false, font, color, backcolor, cursor.x, cursor.y, string, rlimit);
186
-  MoveBy(strlen(string) * fontWidth(font), 0);
179
+  DWIN_Draw_String(false, fontid, color, backcolor, cursor.x, cursor.y, string, rlimit);
180
+  MoveBy(strlen(string) * fontWidth(fontid), 0);
187 181
 }
188 182
 
189 183
 // Draw a numeric integer value
190 184
 //  bShow: true=display background color; false=don't display background color
191 185
 //  signedMode: 1=signed; 0=unsigned
192
-//  size: Font size
186
+//  fid: Font ID
193 187
 //  color: Character color
194 188
 //  bColor: Background color
195 189
 //  iNum: Number of digits
196 190
 //  x/y: Upper-left coordinate
197 191
 //  value: Integer value
198
-void DWINUI::Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value) {
192
+void DWINUI::Draw_Int(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value) {
199 193
   char nstr[10];
200 194
   sprintf_P(nstr, PSTR("%*li"), (signedMode ? iNum + 1 : iNum), value);
201
-  DWIN_Draw_String(bShow, size, color, bColor, x, y, nstr);
195
+  DWIN_Draw_String(bShow, fid, color, bColor, x, y, nstr);
202 196
 }
203 197
 
204 198
 // Draw a numeric float value
205 199
 //  bShow: true=display background color; false=don't display background color
206 200
 //  signedMode: 1=signed; 0=unsigned
207
-//  size: Font size
201
+//  fid: Font ID
208 202
 //  color: Character color
209 203
 //  bColor: Background color
210 204
 //  iNum: Number of digits
211 205
 //  fNum: Number of decimal digits
212 206
 //  x/y: Upper-left coordinate
213 207
 //  value: float value
214
-void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
208
+void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
215 209
   char nstr[10];
216
-  DWIN_Draw_String(bShow, size, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr));
210
+  DWIN_Draw_String(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr));
217 211
 }
218 212
 
219 213
 // ------------------------- Buttons ------------------------------//
220 214
 
221 215
 void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) {
222 216
   DWIN_Draw_Rectangle(1, bcolor, x1, y1, x2, y2);
223
-  Draw_CenteredString(0, font, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption);
217
+  Draw_CenteredString(0, fontid, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption);
224 218
 }
225 219
 
226 220
 void DWINUI::Draw_Button(uint8_t id, uint16_t x, uint16_t y) {

+ 79
- 78
Marlin/src/lcd/e3v2/proui/dwinui.h View File

@@ -24,8 +24,8 @@
24 24
 /**
25 25
  * DWIN Enhanced implementation for PRO UI
26 26
  * Author: Miguel A. Risco-Castillo (MRISCOC)
27
- * Version: 3.17.1
28
- * Date: 2022/04/12
27
+ * Version: 3.18.1
28
+ * Date: 2022/07/05
29 29
  */
30 30
 
31 31
 #include "dwin_lcd.h"
@@ -39,6 +39,7 @@
39 39
 #define ICON_BedSizeY             ICON_PrintSize
40 40
 #define ICON_BedTramming          ICON_SetHome
41 41
 #define ICON_Binary               ICON_Contact
42
+#define ICON_BltouchReset         ICON_StockConfiguration
42 43
 #define ICON_Brightness           ICON_Motion
43 44
 #define ICON_Cancel               ICON_StockConfiguration
44 45
 #define ICON_CustomPreheat        ICON_SetEndTemp
@@ -145,7 +146,7 @@
145 146
 #define DWIN_FONT_HEAD font10x20
146 147
 #define DWIN_FONT_ALERT font10x20
147 148
 #define STATUS_Y 354
148
-#define LCD_WIDTH (DWIN_WIDTH / 8)  // only if the default font is font8x16
149
+#define LCD_WIDTH (DWIN_WIDTH / 8)  // only if the default fontid is font8x16
149 150
 
150 151
 // Minimum unit (0.1) : multiple (10)
151 152
 #define UNITFDIGITS 1
@@ -156,7 +157,7 @@ constexpr uint8_t  TITLE_HEIGHT = 30,                          // Title bar heig
156 157
                    TROWS = (STATUS_Y - TITLE_HEIGHT) / MLINE,  // Total rows
157 158
                    MROWS = TROWS - 1,                          // Other-than-Back
158 159
                    ICOX = 26,                                  // Menu item icon X position
159
-                   LBLX = 60,                                  // Menu item label X position
160
+                   LBLX = 55,                                  // Menu item label X position
160 161
                    VALX = 210,                                 // Menu item value X position
161 162
                    MENU_CHR_W = 8, MENU_CHR_H = 16,            // Menu font 8x16
162 163
                    STAT_CHR_W = 10;
@@ -196,7 +197,7 @@ namespace DWINUI {
196 197
   extern uint16_t textcolor;
197 198
   extern uint16_t backcolor;
198 199
   extern uint16_t buttoncolor;
199
-  extern uint8_t  font;
200
+  extern fontid_t fontid;
200 201
   extern FSTR_P const Author;
201 202
 
202 203
   extern void (*onTitleDraw)(TitleClass* title);
@@ -205,15 +206,15 @@ namespace DWINUI {
205 206
   void init();
206 207
 
207 208
   // Set text/number font
208
-  void setFont(uint8_t cfont);
209
+  void setFont(fontid_t cfont);
209 210
 
210 211
   // Get font character width
211
-  uint8_t fontWidth(uint8_t cfont);
212
-  inline uint8_t fontWidth() { return fontWidth(font); };
212
+  uint8_t fontWidth(fontid_t cfont);
213
+  inline uint8_t fontWidth() { return fontWidth(fontid); };
213 214
 
214 215
   // Get font character height
215
-  uint8_t fontHeight(uint8_t cfont);
216
-  inline uint8_t fontHeight() { return fontHeight(font); };
216
+  uint8_t fontHeight(fontid_t cfont);
217
+  inline uint8_t fontHeight() { return fontHeight(fontid); };
217 218
 
218 219
   // Get screen x coordinates from text column
219 220
   uint16_t ColToX(uint8_t col);
@@ -278,108 +279,108 @@ namespace DWINUI {
278 279
   // Draw a numeric integer value
279 280
   //  bShow: true=display background color; false=don't display background color
280 281
   //  signedMode: 1=signed; 0=unsigned
281
-  //  size: Font size
282
+  //  fid: Font ID
282 283
   //  color: Character color
283 284
   //  bColor: Background color
284 285
   //  iNum: Number of digits
285 286
   //  x/y: Upper-left coordinate
286 287
   //  value: Integer value
287
-  void Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value);
288
+  void Draw_Int(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value);
288 289
 
289 290
   // Draw a positive integer
290
-  inline void Draw_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
291
-    Draw_Int(bShow, 0, size, color, bColor, iNum, x, y, value);
291
+  inline void Draw_Int(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
292
+    Draw_Int(bShow, 0, fid, color, bColor, iNum, x, y, value);
292 293
   }
293 294
   inline void Draw_Int(uint8_t iNum, long value) {
294
-    Draw_Int(false, 0, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value);
295
-    MoveBy(iNum * fontWidth(font), 0);
295
+    Draw_Int(false, 0, fontid, textcolor, backcolor, iNum, cursor.x, cursor.y, value);
296
+    MoveBy(iNum * fontWidth(fontid), 0);
296 297
   }
297 298
   inline void Draw_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) {
298
-    Draw_Int(false, 0, font, textcolor, backcolor, iNum, x, y, value);
299
+    Draw_Int(false, 0, fontid, textcolor, backcolor, iNum, x, y, value);
299 300
   }
300 301
   inline void Draw_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) {
301
-    Draw_Int(false, 0, font, color, backcolor, iNum, x, y, value);
302
+    Draw_Int(false, 0, fontid, color, backcolor, iNum, x, y, value);
302 303
   }
303 304
   inline void Draw_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
304
-    Draw_Int(true, 0, font, color, bColor, iNum, x, y, value);
305
+    Draw_Int(true, 0, fontid, color, bColor, iNum, x, y, value);
305 306
   }
306
-  inline void Draw_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
307
-    Draw_Int(true, 0, size, color, bColor, iNum, x, y, value);
307
+  inline void Draw_Int(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
308
+    Draw_Int(true, 0, fid, color, bColor, iNum, x, y, value);
308 309
   }
309 310
 
310 311
   // Draw a signed integer
311
-  inline void Draw_Signed_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
312
-    Draw_Int(bShow, 1, size, color, bColor, iNum, x, y, value);
312
+  inline void Draw_Signed_Int(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
313
+    Draw_Int(bShow, 1, fid, color, bColor, iNum, x, y, value);
313 314
   }
314 315
   inline void Draw_Signed_Int(uint8_t iNum, long value) {
315
-    Draw_Int(false, 1, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value);
316
-    MoveBy(iNum * fontWidth(font), 0);
316
+    Draw_Int(false, 1, fontid, textcolor, backcolor, iNum, cursor.x, cursor.y, value);
317
+    MoveBy(iNum * fontWidth(fontid), 0);
317 318
   }
318 319
   inline void Draw_Signed_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) {
319
-    Draw_Int(false, 1, font, textcolor, backcolor, iNum, x, y, value);
320
+    Draw_Int(false, 1, fontid, textcolor, backcolor, iNum, x, y, value);
320 321
   }
321 322
   inline void Draw_Signed_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) {
322
-    Draw_Int(false, 1, font, color, backcolor, iNum, x, y, value);
323
+    Draw_Int(false, 1, fontid, color, backcolor, iNum, x, y, value);
323 324
   }
324 325
   inline void Draw_Signed_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
325
-    Draw_Int(true, 1, font, color, bColor, iNum, x, y, value);
326
+    Draw_Int(true, 1, fontid, color, bColor, iNum, x, y, value);
326 327
   }
327
-  inline void Draw_Signed_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
328
-    Draw_Int(true, 1, size, color, bColor, iNum, x, y, value);
328
+  inline void Draw_Signed_Int(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) {
329
+    Draw_Int(true, 1, fid, color, bColor, iNum, x, y, value);
329 330
   }
330 331
 
331 332
   // Draw a numeric float value
332 333
   //  bShow: true=display background color; false=don't display background color
333 334
   //  signedMode: 1=signed; 0=unsigned
334
-  //  size: Font size
335
+  //  fid: Font ID
335 336
   //  color: Character color
336 337
   //  bColor: Background color
337 338
   //  iNum: Number of digits
338 339
   //  fNum: Number of decimal digits
339 340
   //  x/y: Upper-left coordinate
340 341
   //  value: float value
341
-  void Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value);
342
+  void Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value);
342 343
 
343 344
   // Draw a positive floating point number
344
-  inline void Draw_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
345
-    Draw_Float(bShow, 0, size, color, bColor, iNum, fNum, x, y, value);
345
+  inline void Draw_Float(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
346
+    Draw_Float(bShow, 0, fid, color, bColor, iNum, fNum, x, y, value);
346 347
   }
347 348
   inline void Draw_Float(uint8_t iNum, uint8_t fNum, float value) {
348
-    Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value);
349
-    MoveBy((iNum + fNum + 1) * fontWidth(font), 0);
349
+    Draw_Float(false, 0, fontid, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value);
350
+    MoveBy((iNum + fNum + 1) * fontWidth(fontid), 0);
350 351
   }
351 352
   inline void Draw_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
352
-    Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, x, y, value);
353
+    Draw_Float(false, 0, fontid, textcolor, backcolor, iNum, fNum, x, y, value);
353 354
   }
354
-  inline void Draw_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
355
-    Draw_Float(false, 0, size, textcolor, backcolor, iNum, fNum, x, y, value);
355
+  inline void Draw_Float(fontid_t fid, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
356
+    Draw_Float(false, 0, fid, textcolor, backcolor, iNum, fNum, x, y, value);
356 357
   }
357 358
   inline void Draw_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
358
-    Draw_Float(true, 0, font, color, bColor, iNum, fNum, x, y, value);
359
+    Draw_Float(true, 0, fontid, color, bColor, iNum, fNum, x, y, value);
359 360
   }
360
-  inline void Draw_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
361
-    Draw_Float(true, 0, size, color, bColor, iNum, fNum, x, y, value);
361
+  inline void Draw_Float(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
362
+    Draw_Float(true, 0, fid, color, bColor, iNum, fNum, x, y, value);
362 363
   }
363 364
 
364 365
   // Draw a signed floating point number
365
-  inline void Draw_Signed_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
366
-    Draw_Float(bShow, 1, size, color, bColor, iNum, fNum, x, y, value);
366
+  inline void Draw_Signed_Float(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
367
+    Draw_Float(bShow, 1, fid, color, bColor, iNum, fNum, x, y, value);
367 368
   }
368 369
   inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, float value) {
369
-    Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value);
370
-    MoveBy((iNum + fNum + 1) * fontWidth(font), 0);
370
+    Draw_Float(false, 1, fontid, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value);
371
+    MoveBy((iNum + fNum + 1) * fontWidth(fontid), 0);
371 372
   }
372 373
   inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
373
-    Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, x, y, value);
374
+    Draw_Float(false, 1, fontid, textcolor, backcolor, iNum, fNum, x, y, value);
374 375
   }
375
-  inline void Draw_Signed_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
376
-    Draw_Float(false, 1, size, textcolor, backcolor, iNum, fNum, x, y, value);
376
+  inline void Draw_Signed_Float(fontid_t fid, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
377
+    Draw_Float(false, 1, fid, textcolor, backcolor, iNum, fNum, x, y, value);
377 378
   }
378 379
   inline void Draw_Signed_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
379
-    Draw_Float(true, 1, font, color, bColor, iNum, fNum, x, y, value);
380
+    Draw_Float(true, 1, fontid, color, bColor, iNum, fNum, x, y, value);
380 381
   }
381
-  inline void Draw_Signed_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
382
-    Draw_Float(true, 1, size, color, bColor, iNum, fNum, x, y, value);
382
+  inline void Draw_Signed_Float(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) {
383
+    Draw_Float(true, 1, fid, color, bColor, iNum, fNum, x, y, value);
383 384
   }
384 385
 
385 386
   // Draw a char
@@ -407,70 +408,70 @@ namespace DWINUI {
407 408
   }
408 409
 
409 410
   // Draw a string
410
-  //  size: Font size
411
+  //  fid: Font ID
411 412
   //  color: Character color
412 413
   //  bColor: Background color
413 414
   //  x/y: Upper-left coordinate of the string
414 415
   //  *string: The string
415 416
   inline void Draw_String(uint16_t x, uint16_t y, const char * const string) {
416
-    DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string);
417
+    DWIN_Draw_String(false, fontid, textcolor, backcolor, x, y, string);
417 418
   }
418 419
   inline void Draw_String(uint16_t x, uint16_t y, FSTR_P title) {
419
-    DWIN_Draw_String(false, font, textcolor, backcolor, x, y, FTOP(title));
420
+    DWIN_Draw_String(false, fontid, textcolor, backcolor, x, y, FTOP(title));
420 421
   }
421 422
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) {
422
-    DWIN_Draw_String(false, font, color, backcolor, x, y, string);
423
+    DWIN_Draw_String(false, fontid, color, backcolor, x, y, string);
423 424
   }
424 425
   inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, FSTR_P title) {
425
-    DWIN_Draw_String(false, font, color, backcolor, x, y, title);
426
+    DWIN_Draw_String(false, fontid, color, backcolor, x, y, title);
426 427
   }
427 428
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
428
-    DWIN_Draw_String(true, font, color, bgcolor, x, y, string);
429
+    DWIN_Draw_String(true, fontid, color, bgcolor, x, y, string);
429 430
   }
430 431
   inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
431
-    DWIN_Draw_String(true, font, color, bgcolor, x, y, title);
432
+    DWIN_Draw_String(true, fontid, color, bgcolor, x, y, title);
432 433
   }
433
-  inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
434
-    DWIN_Draw_String(true, size, color, bgcolor, x, y, string);
434
+  inline void Draw_String(fontid_t fid, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) {
435
+    DWIN_Draw_String(true, fid, color, bgcolor, x, y, string);
435 436
   }
436
-  inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
437
-    DWIN_Draw_String(true, size, color, bgcolor, x, y, title);
437
+  inline void Draw_String(fontid_t fid, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) {
438
+    DWIN_Draw_String(true, fid, color, bgcolor, x, y, title);
438 439
   }
439 440
 
440 441
   // Draw a centered string using DWIN_WIDTH
441 442
   //  bShow: true=display background color; false=don't display background color
442
-  //  size: Font size
443
+  //  fid: Font ID
443 444
   //  color: Character color
444 445
   //  bColor: Background color
445 446
   //  y: Upper coordinate of the string
446 447
   //  *string: The string
447
-  void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string);
448
-  inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) {
449
-    Draw_CenteredString(bShow, size, color, bColor, 0, DWIN_WIDTH, y, string);
448
+  void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string);
449
+  inline void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) {
450
+    Draw_CenteredString(bShow, fid, color, bColor, 0, DWIN_WIDTH, y, string);
450 451
   }
451
-  inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) {
452
-    Draw_CenteredString(bShow, size, color, bColor, y, FTOP(string));
452
+  inline void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) {
453
+    Draw_CenteredString(bShow, fid, color, bColor, y, FTOP(string));
453 454
   }
454 455
   inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) {
455
-    Draw_CenteredString(true, font, color, bcolor, y, string);
456
+    Draw_CenteredString(true, fontid, color, bcolor, y, string);
456 457
   }
457
-  inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, const char * const string) {
458
-    Draw_CenteredString(false, size, color, backcolor, y, string);
458
+  inline void Draw_CenteredString(fontid_t fid, uint16_t color, uint16_t y, const char * const string) {
459
+    Draw_CenteredString(false, fid, color, backcolor, y, string);
459 460
   }
460
-  inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, FSTR_P title) {
461
-    Draw_CenteredString(false, size, color, backcolor, y, title);
461
+  inline void Draw_CenteredString(fontid_t fid, uint16_t color, uint16_t y, FSTR_P title) {
462
+    Draw_CenteredString(false, fid, color, backcolor, y, title);
462 463
   }
463 464
   inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) {
464
-    Draw_CenteredString(false, font, color, backcolor, y, string);
465
+    Draw_CenteredString(false, fontid, color, backcolor, y, string);
465 466
   }
466 467
   inline void Draw_CenteredString(uint16_t color, uint16_t y, FSTR_P title) {
467
-    Draw_CenteredString(false, font, color, backcolor, y, title);
468
+    Draw_CenteredString(false, fontid, color, backcolor, y, title);
468 469
   }
469 470
   inline void Draw_CenteredString(uint16_t y, const char * const string) {
470
-    Draw_CenteredString(false, font, textcolor, backcolor, y, string);
471
+    Draw_CenteredString(false, fontid, textcolor, backcolor, y, string);
471 472
   }
472 473
   inline void Draw_CenteredString(uint16_t y, FSTR_P title) {
473
-    Draw_CenteredString(false, font, textcolor, backcolor, y, title);
474
+    Draw_CenteredString(false, fontid, textcolor, backcolor, y, title);
474 475
   }
475 476
 
476 477
   // Draw a box

+ 6
- 2
Marlin/src/lcd/e3v2/proui/lockscreen.cpp View File

@@ -31,8 +31,10 @@
31 31
 
32 32
 #if ENABLED(DWIN_LCD_PROUI)
33 33
 
34
-#include "../../../core/types.h"
35
-#include "dwin_lcd.h"
34
+#include "dwin_defines.h"
35
+
36
+#if HAS_LOCKSCREEN
37
+
36 38
 #include "dwinui.h"
37 39
 #include "dwin.h"
38 40
 #include "lockscreen.h"
@@ -73,4 +75,6 @@ void LockScreenClass::onEncoder(EncoderState encoder_diffState) {
73 75
   DWIN_UpdateLCD();
74 76
 }
75 77
 
78
+#endif // HAS_LOCKSCREEN
79
+
76 80
 #endif // DWIN_LCD_PROUI

+ 20
- 6
Marlin/src/lcd/e3v2/proui/menus.cpp View File

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * Menu functions for ProUI
25 25
  * Author: Miguel A. Risco-Castillo
26
- * Version: 1.4.1
27
- * Date: 2022/04/14
26
+ * Version: 1.5.1
27
+ * Date: 2022/05/23
28 28
  *
29 29
  * This program is free software: you can redistribute it and/or modify
30 30
  * it under the terms of the GNU Lesser General Public License as
@@ -166,6 +166,17 @@ void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line) {
166 166
   onDrawChkbMenu(menuitem, line, val);
167 167
 }
168 168
 
169
+void DrawItemEdit() {
170
+  switch (checkkey) {
171
+    case SetIntNoDraw:  if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
172
+    case SetInt:
173
+    case SetPInt:       DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break;
174
+    case SetFloat:
175
+    case SetPFloat:     DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, MenuData.dp, VALX - MenuData.dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break;
176
+    default: break;
177
+  }
178
+}
179
+
169 180
 //-----------------------------------------------------------------------------
170 181
 // On click functions
171 182
 //-----------------------------------------------------------------------------
@@ -307,7 +318,7 @@ int8_t HMI_GetInt(const int32_t lo, const int32_t hi) {
307 318
       return 2;
308 319
     }
309 320
     LIMIT(MenuData.Value, lo, hi);
310
-    DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value);
321
+    DrawItemEdit();
311 322
     return 1;
312 323
   }
313 324
   return 0;
@@ -361,7 +372,7 @@ int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) {
361 372
       return 2;
362 373
     }
363 374
     LIMIT(MenuData.Value, lo, hi);
364
-    DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp));
375
+    DrawItemEdit();
365 376
     return 1;
366 377
   }
367 378
   return 0;
@@ -469,7 +480,7 @@ void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2,
469 480
 }
470 481
 
471 482
 void MenuItemClass::draw(int8_t line) {
472
-  if (line < 0 || line >= TROWS) return;
483
+  if (!WITHIN(line, 0, TROWS - 1)) return;
473 484
   if (onDraw != nullptr) (*onDraw)(this, line);
474 485
 };
475 486
 
@@ -547,6 +558,9 @@ void UpdateMenu(MenuClass* &menu) {
547 558
   menu->draw();
548 559
 }
549 560
 
550
-void ReDrawMenu() { if (CurrentMenu && checkkey==Menu) CurrentMenu->draw(); }
561
+void ReDrawMenu(const bool force/*=false*/) {
562
+  if (CurrentMenu && (force || checkkey == Menu)) CurrentMenu->draw();
563
+  if (force) DrawItemEdit();
564
+}
551 565
 
552 566
 #endif // DWIN_LCD_PROUI

+ 3
- 3
Marlin/src/lcd/e3v2/proui/menus.h View File

@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * Menu functions for ProUI
25 25
  * Author: Miguel A. Risco-Castillo
26
- * Version: 1.4.1
27
- * Date: 2022/04/14
26
+ * Version: 1.5.1
27
+ * Date: 2022/05/23
28 28
  *
29 29
  * This program is free software: you can redistribute it and/or modify
30 30
  * it under the terms of the GNU Lesser General Public License as
@@ -168,7 +168,7 @@ bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems);
168 168
 void UpdateMenu(MenuClass* &menu);
169 169
 
170 170
 //Redraw the current Menu if it is valid
171
-void ReDrawMenu();
171
+void ReDrawMenu(const bool force=false);
172 172
 
173 173
 // Clear MenuItems array and free MenuItems elements
174 174
 void MenuItemsClear();

+ 7
- 8
Marlin/src/lcd/e3v2/proui/meshviewer.cpp View File

@@ -31,8 +31,6 @@
31 31
 
32 32
 #if BOTH(DWIN_LCD_PROUI, HAS_MESH)
33 33
 
34
-#include "meshviewer.h"
35
-
36 34
 #include "../../../core/types.h"
37 35
 #include "../../marlinui.h"
38 36
 #include "dwin_lcd.h"
@@ -40,9 +38,10 @@
40 38
 #include "dwin.h"
41 39
 #include "dwin_popup.h"
42 40
 #include "../../../feature/bedlevel/bedlevel.h"
41
+#include "meshviewer.h"
43 42
 
44 43
 #if ENABLED(AUTO_BED_LEVELING_UBL)
45
-  #include "ubl_tools.h"
44
+  #include "bedlevel_tools.h"
46 45
 #endif
47 46
 
48 47
 MeshViewerClass MeshViewer;
@@ -112,10 +111,10 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8
112 111
 
113 112
 void MeshViewerClass::Draw(bool withsave /*= false*/) {
114 113
   Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER));
115
-  #if ENABLED(USE_UBL_VIEWER)
114
+  #if USE_UBL_VIEWER
116 115
     DWINUI::ClearMainArea();
117
-    ubl_tools.viewer_print_value = true;
118
-    ubl_tools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT);
116
+    BedLevelTools.viewer_print_value = true;
117
+    BedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT);
119 118
   #else
120 119
     DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y);
121 120
   #endif
@@ -127,8 +126,8 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) {
127 126
   else
128 127
     DWINUI::Draw_Button(BTN_Continue, 86, 305);
129 128
 
130
-  #if ENABLED(USE_UBL_VIEWER)
131
-    ubl_tools.Set_Mesh_Viewer_Status();
129
+  #if USE_UBL_VIEWER
130
+    BedLevelTools.Set_Mesh_Viewer_Status();
132 131
   #else
133 132
     char str_1[6], str_2[6] = "";
134 133
     ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"),

+ 0
- 3
Marlin/src/lcd/e3v2/proui/meshviewer.h View File

@@ -21,9 +21,6 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#include "../../../core/types.h"
25
-#include "../../../feature/bedlevel/bedlevel.h"
26
-
27 24
 /**
28 25
  * Mesh Viewer for PRO UI
29 26
  * Author: Miguel A. Risco-Castillo (MRISCOC)

+ 7
- 2
Marlin/src/lcd/e3v2/proui/plot.cpp View File

@@ -46,13 +46,16 @@
46 46
 
47 47
 #ifdef DWIN_LCD_PROUI
48 48
 
49
+#include "dwin_defines.h"
50
+
51
+#if HAS_PIDPLOT
52
+
49 53
 #include "plot.h"
50 54
 
51 55
 #include "../../../core/types.h"
52 56
 #include "../../marlinui.h"
53 57
 #include "dwin_lcd.h"
54 58
 #include "dwinui.h"
55
-#include "dwin_popup.h"
56 59
 #include "dwin.h"
57 60
 
58 61
 #define Plot_Bg_Color RGB( 1, 12,  8)
@@ -71,7 +74,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref)
71 74
   y2 = frame.y + frame.h - 1;
72 75
   r = round((y2) - ref * scale);
73 76
   DWINUI::Draw_Box(1, Plot_Bg_Color, frame);
74
-  for (uint8_t i = 1; i < 4; i++)  if (i*50 < frame.w) DWIN_Draw_VLine(Line_Color, i*50 + frame.x, frame.y, frame.h);
77
+  for (uint8_t i = 1; i < 4; i++)  if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h);
75 78
   DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1));
76 79
   DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w);
77 80
 }
@@ -91,4 +94,6 @@ void PlotClass::Update(const float value) {
91 94
   grphpoints++;
92 95
 }
93 96
 
97
+#endif // HAS_PIDPLOT
98
+
94 99
 #endif // DWIN_LCD_PROUI

+ 1
- 0
Marlin/src/lcd/language/language_en.h View File

@@ -254,6 +254,7 @@ namespace Language_en {
254 254
   LSTR MSG_UBL_SMART_FILLIN               = _UxGT("Smart Fill-in");
255 255
   LSTR MSG_UBL_FILLIN_MESH                = _UxGT("Fill-in Mesh");
256 256
   LSTR MSG_UBL_MESH_FILLED                = _UxGT("Missing Points Filled");
257
+  LSTR MSG_UBL_MESH_INVALID               = _UxGT("Invalid Mesh");
257 258
   LSTR MSG_UBL_INVALIDATE_ALL             = _UxGT("Invalidate All");
258 259
   LSTR MSG_UBL_INVALIDATE_CLOSEST         = _UxGT("Invalidate Closest");
259 260
   LSTR MSG_UBL_FINE_TUNE_ALL              = _UxGT("Fine Tune All");

+ 1
- 1
Marlin/src/module/planner.h View File

@@ -188,7 +188,7 @@ typedef struct {
188 188
  * The "nominal" values are as-specified by G-code, and
189 189
  * may never actually be reached due to acceleration limits.
190 190
  */
191
-typedef struct block_t {
191
+typedef struct PlannerBlock {
192 192
 
193 193
   volatile block_flags_t flag;              // Block flags
194 194
 

+ 12
- 1
Marlin/src/module/settings.cpp View File

@@ -76,6 +76,7 @@
76 76
   #include "../lcd/extui/ui_api.h"
77 77
 #elif ENABLED(DWIN_LCD_PROUI)
78 78
   #include "../lcd/e3v2/proui/dwin.h"
79
+  #include "../lcd/e3v2/proui/bedlevel_tools.h"
79 80
 #endif
80 81
 
81 82
 #if ENABLED(HOST_PROMPT_SUPPORT)
@@ -2756,7 +2757,7 @@ void MarlinSettings::postprocess() {
2756 2757
         #endif
2757 2758
 
2758 2759
         persistentStore.access_start();
2759
-        const uint16_t status = persistentStore.read_data(pos, dest, MESH_STORE_SIZE, &crc);
2760
+        uint16_t status = persistentStore.read_data(pos, dest, MESH_STORE_SIZE, &crc);
2760 2761
         persistentStore.access_finish();
2761 2762
 
2762 2763
         #if ENABLED(OPTIMIZED_MESH_STORAGE)
@@ -2769,6 +2770,16 @@ void MarlinSettings::postprocess() {
2769 2770
             bedlevel.set_mesh_from_store(z_mesh_store, bedlevel.z_values);
2770 2771
         #endif
2771 2772
 
2773
+        #if ENABLED(DWIN_LCD_PROUI)
2774
+          status = !BedLevelTools.meshvalidate();
2775
+          if (status) {
2776
+            bedlevel.invalidate();
2777
+            LCD_MESSAGE(MSG_UBL_MESH_INVALID);
2778
+          }
2779
+          else
2780
+            ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), bedlevel.storage_slot);
2781
+        #endif
2782
+
2772 2783
         if (status) SERIAL_ECHOLNPGM("?Unable to load mesh data.");
2773 2784
         else        DEBUG_ECHOLNPGM("Mesh loaded from slot ", slot);
2774 2785
 

Loading…
Cancel
Save