浏览代码

Print/display ABL current probe point (#14788)

InsanityAutomation 5 年前
父节点
当前提交
f59a7e8b07

+ 10
- 8
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp 查看文件

@@ -752,17 +752,19 @@
752 752
       save_ubl_active_state_and_disable();  // No bed level correction so only raw data is obtained
753 753
       DEPLOY_PROBE();
754 754
 
755
-      uint16_t count = GRID_MAX_POINTS, current = 1;
755
+      uint8_t count = GRID_MAX_POINTS, current = 1;
756 756
 
757 757
       do {
758 758
         current = (GRID_MAX_POINTS) - count + 1;
759 759
 
760 760
         if (do_ubl_mesh_map) display_map(g29_map_type);
761 761
 
762
-        SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", GRID_MAX_POINTS, ".\n");
763
-        #if HAS_LCD_MENU
764
-          ui.status_printf_P(0, PSTR(MSG_LCD_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS));
762
+        SERIAL_ECHOLNPAIR("\nProbing mesh point ", int(current), "/", int(GRID_MAX_POINTS), ".\n");
763
+        #if HAS_DISPLAY
764
+          ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(current), int(GRID_MAX_POINTS));
765
+        #endif
765 766
 
767
+        #if HAS_LCD_MENU
766 768
           if (ui.button_pressed()) {
767 769
             ui.quick_feedback(false); // Preserve button state for click-and-hold
768 770
             SERIAL_ECHOLNPGM("\nMesh only partially populated.\n");
@@ -1405,7 +1407,7 @@
1405 1407
 
1406 1408
       if (do_3_pt_leveling) {
1407 1409
         SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
1408
-        #if HAS_LCD_MENU
1410
+        #if HAS_DISPLAY
1409 1411
           ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3"));
1410 1412
         #endif
1411 1413
 
@@ -1424,7 +1426,7 @@
1424 1426
 
1425 1427
         if (!abort_flag) {
1426 1428
           SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
1427
-          #if HAS_LCD_MENU
1429
+          #if HAS_DISPLAY
1428 1430
             ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3"));
1429 1431
           #endif
1430 1432
 
@@ -1444,7 +1446,7 @@
1444 1446
 
1445 1447
         if (!abort_flag) {
1446 1448
           SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
1447
-          #if HAS_LCD_MENU
1449
+          #if HAS_DISPLAY
1448 1450
             ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3"));
1449 1451
           #endif
1450 1452
 
@@ -1485,7 +1487,7 @@
1485 1487
 
1486 1488
             if (!abort_flag) {
1487 1489
               SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n");
1488
-              #if HAS_LCD_MENU
1490
+              #if HAS_DISPLAY
1489 1491
                 ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points);
1490 1492
               #endif
1491 1493
 

+ 23
- 7
Marlin/src/gcode/bedlevel/abl/G29.cpp 查看文件

@@ -36,7 +36,7 @@
36 36
 #include "../../../module/probe.h"
37 37
 #include "../../queue.h"
38 38
 
39
-#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
39
+#if HAS_DISPLAY
40 40
   #include "../../../lcd/ultralcd.h"
41 41
 #endif
42 42
 
@@ -254,8 +254,8 @@ G29_TYPE GcodeSuite::G29() {
254 254
 
255 255
       ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
256 256
 
257
-      ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations
258
-                    eqnBVector[GRID_MAX_POINTS],     // "B" vector of Z points
257
+      ABL_VAR float eqnAMatrix[(GRID_MAX_POINTS) * 3], // "A" matrix of the linear system of equations
258
+                    eqnBVector[GRID_MAX_POINTS],       // "B" vector of Z points
259 259
                     mean;
260 260
     #endif
261 261
 
@@ -311,8 +311,7 @@ G29_TYPE GcodeSuite::G29() {
311 311
 
312 312
         const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
313 313
                     ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
314
-        int8_t i = parser.byteval('I', -1),
315
-               j = parser.byteval('J', -1);
314
+        int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
316 315
 
317 316
         if (!isnan(rx) && !isnan(ry)) {
318 317
           // Get nearest i / j from rx / ry
@@ -689,8 +688,11 @@ G29_TYPE GcodeSuite::G29() {
689 688
 
690 689
         zig ^= true; // zag
691 690
 
691
+        // An index to print current state
692
+        uint8_t pt_index = (PR_OUTER_VAR) * (PR_INNER_END) + 1;
693
+
692 694
         // Inner loop is Y with PROBE_Y_FIRST enabled
693
-        for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) {
695
+        for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {
694 696
 
695 697
           const float xBase = left_probe_bed_position + xGridSpacing * xCount,
696 698
                       yBase = front_probe_bed_position + yGridSpacing * yCount;
@@ -707,11 +709,16 @@ G29_TYPE GcodeSuite::G29() {
707 709
             if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
708 710
           #endif
709 711
 
712
+          if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), ".");
713
+          #if HAS_DISPLAY
714
+            ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(pt_index), int(GRID_MAX_POINTS));
715
+          #endif
716
+
710 717
           measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
711 718
 
712 719
           if (isnan(measured_z)) {
713 720
             set_bed_leveling_enabled(abl_should_enable);
714
-            break;
721
+            break; // Breaks out of both loops
715 722
           }
716 723
 
717 724
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
@@ -744,6 +751,11 @@ G29_TYPE GcodeSuite::G29() {
744 751
       // Probe at 3 arbitrary points
745 752
 
746 753
       for (uint8_t i = 0; i < 3; ++i) {
754
+        if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3.");
755
+        #if HAS_DISPLAY
756
+          ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/3"), int(i));
757
+        #endif
758
+
747 759
         // Retain the last probe position
748 760
         xProbe = points[i].x;
749 761
         yProbe = points[i].y;
@@ -770,6 +782,10 @@ G29_TYPE GcodeSuite::G29() {
770 782
 
771 783
     #endif // AUTO_BED_LEVELING_3POINT
772 784
 
785
+    #if HAS_DISPLAY
786
+      ui.reset_status();
787
+    #endif
788
+
773 789
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
774 790
     if (STOW_PROBE()) {
775 791
       set_bed_leveling_enabled(abl_should_enable);

+ 1
- 1
Marlin/src/lcd/language/language_de.h 查看文件

@@ -95,6 +95,7 @@
95 95
 #define MSG_LEVEL_CORNERS                   _UxGT("Ecken nivellieren")
96 96
 #define MSG_NEXT_CORNER                     _UxGT("Nächste Ecke")
97 97
 #define MSG_EDITING_STOPPED                 _UxGT("Netzbearb. angeh.")
98
+#define MSG_PROBING_MESH                    _UxGT("Messpunkt")
98 99
 #define MSG_MESH_X                          _UxGT("Index X")
99 100
 #define MSG_MESH_Y                          _UxGT("Index Y")
100 101
 #define MSG_MESH_EDIT_Z                     _UxGT("Z-Wert")
@@ -103,7 +104,6 @@
103 104
 #define MSG_UBL_UNHOMED                     _UxGT("Home XYZ zuerst")
104 105
 #define MSG_UBL_TOOLS                       _UxGT("UBL-Werkzeuge")
105 106
 #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
106
-#define MSG_LCD_PROBING_MESH                _UxGT("Messpunkt")
107 107
 #define MSG_LCD_TILTING_MESH                _UxGT("Berührungspunkt")
108 108
 #define MSG_IDEX_MENU                       _UxGT("IDEX-Modus")
109 109
 #define MSG_OFFSETS_MENU                    _UxGT("Werkzeugversätze")

+ 3
- 3
Marlin/src/lcd/language/language_en.h 查看文件

@@ -235,6 +235,9 @@
235 235
 #ifndef MSG_EDITING_STOPPED
236 236
   #define MSG_EDITING_STOPPED                 _UxGT("Mesh Editing Stopped")
237 237
 #endif
238
+#ifndef MSG_PROBING_MESH
239
+  #define MSG_PROBING_MESH                    _UxGT("Probing point")
240
+#endif
238 241
 #ifndef MSG_MESH_X
239 242
   #define MSG_MESH_X                          _UxGT("Index X")
240 243
 #endif
@@ -259,9 +262,6 @@
259 262
 #ifndef MSG_UBL_LEVEL_BED
260 263
   #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
261 264
 #endif
262
-#ifndef MSG_LCD_PROBING_MESH
263
-  #define MSG_LCD_PROBING_MESH                _UxGT("Probing point")
264
-#endif
265 265
 #ifndef MSG_LCD_TILTING_MESH
266 266
   #define MSG_LCD_TILTING_MESH                _UxGT("Tilting point")
267 267
 #endif

+ 1
- 1
Marlin/src/lcd/language/language_fr.h 查看文件

@@ -90,6 +90,7 @@
90 90
 #define MSG_LEVEL_CORNERS                   _UxGT("Niveau coins")
91 91
 #define MSG_NEXT_CORNER                     _UxGT("Coin suivant")
92 92
 #define MSG_EDITING_STOPPED                 _UxGT("Arrêt édit. maillage")
93
+#define MSG_PROBING_MESH                    _UxGT("Mesure point")
93 94
 #define MSG_MESH_X                          _UxGT("Index X")
94 95
 #define MSG_MESH_Y                          _UxGT("Index Y")
95 96
 #define MSG_MESH_EDIT_Z                     _UxGT("Valeur Z")
@@ -99,7 +100,6 @@
99 100
 #define MSG_UBL_UNHOMED                     _UxGT("Origine XYZ requise")
100 101
 #define MSG_UBL_TOOLS                       _UxGT("Outils UBL")
101 102
 #define MSG_UBL_LEVEL_BED                   _UxGT("Niveau lit unifié")
102
-#define MSG_LCD_PROBING_MESH                _UxGT("Mesure point")
103 103
 #define MSG_LCD_TILTING_MESH                _UxGT("Touche point")
104 104
 #define MSG_M48_TEST                        _UxGT("Ecart sonde Z M48")
105 105
 #define MSG_M48_DEVIATION                   _UxGT("Ecart")

+ 1
- 1
Marlin/src/lcd/language/language_it.h 查看文件

@@ -93,6 +93,7 @@
93 93
 #define MSG_LEVEL_CORNERS                   _UxGT("Livella spigoli")
94 94
 #define MSG_NEXT_CORNER                     _UxGT("Prossimo spigolo")
95 95
 #define MSG_EDITING_STOPPED                 _UxGT("Modif. Mesh Fermata")
96
+#define MSG_PROBING_MESH                    _UxGT("Punto sondato")
96 97
 #define MSG_MESH_X                          _UxGT("Indice X")
97 98
 #define MSG_MESH_Y                          _UxGT("Indice Y")
98 99
 #define MSG_MESH_EDIT_Z                     _UxGT("Valore di Z")
@@ -101,7 +102,6 @@
101 102
 #define MSG_UBL_UNHOMED                     _UxGT("Home XYZ prima")
102 103
 #define MSG_UBL_TOOLS                       _UxGT("Strumenti UBL")
103 104
 #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
104
-#define MSG_LCD_PROBING_MESH                _UxGT("Punto sondato")
105 105
 #define MSG_LCD_TILTING_MESH                _UxGT("Punto inclinaz.")
106 106
 #define MSG_M48_TEST                        _UxGT("Test sonda M48")
107 107
 #define MSG_M48_DEVIATION                   _UxGT("Deviazione")

+ 1
- 1
Marlin/src/lcd/language/language_sk.h 查看文件

@@ -101,6 +101,7 @@
101 101
 #define MSG_LEVEL_CORNERS                   _UxGT("Vyrovnať rohy")
102 102
 #define MSG_NEXT_CORNER                     _UxGT("Ďalší roh")
103 103
 #define MSG_EDITING_STOPPED                 _UxGT("Koniec úprav siete")
104
+#define MSG_PROBING_MESH                    _UxGT("Skúšam bod")
104 105
 #define MSG_MESH_X                          _UxGT("Index X")
105 106
 #define MSG_MESH_Y                          _UxGT("Index Y")
106 107
 #define MSG_MESH_EDIT_Z                     _UxGT("Hodnota Z")
@@ -110,7 +111,6 @@
110 111
 #define MSG_UBL_UNHOMED                     _UxGT("Prejdite domov")
111 112
 #define MSG_UBL_TOOLS                       _UxGT("Nástroje UBL")
112 113
 #define MSG_UBL_LEVEL_BED                   _UxGT("UBL rovnanie")
113
-#define MSG_LCD_PROBING_MESH                _UxGT("Skúšam bod")
114 114
 #define MSG_LCD_TILTING_MESH                _UxGT("Vyrovnávam bod")
115 115
 #define MSG_IDEX_MENU                       _UxGT("IDEX režim")
116 116
 #define MSG_OFFSETS_MENU                    _UxGT("Ofset nástrojov")

正在加载...
取消
保存