瀏覽代碼

Print/display ABL current probe point (#14788)

InsanityAutomation 5 年之前
父節點
當前提交
f59a7e8b07

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

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

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

36
 #include "../../../module/probe.h"
36
 #include "../../../module/probe.h"
37
 #include "../../queue.h"
37
 #include "../../queue.h"
38
 
38
 
39
-#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
39
+#if HAS_DISPLAY
40
   #include "../../../lcd/ultralcd.h"
40
   #include "../../../lcd/ultralcd.h"
41
 #endif
41
 #endif
42
 
42
 
254
 
254
 
255
       ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
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
                     mean;
259
                     mean;
260
     #endif
260
     #endif
261
 
261
 
311
 
311
 
312
         const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
312
         const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
313
                     ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
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
         if (!isnan(rx) && !isnan(ry)) {
316
         if (!isnan(rx) && !isnan(ry)) {
318
           // Get nearest i / j from rx / ry
317
           // Get nearest i / j from rx / ry
689
 
688
 
690
         zig ^= true; // zag
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
         // Inner loop is Y with PROBE_Y_FIRST enabled
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
           const float xBase = left_probe_bed_position + xGridSpacing * xCount,
697
           const float xBase = left_probe_bed_position + xGridSpacing * xCount,
696
                       yBase = front_probe_bed_position + yGridSpacing * yCount;
698
                       yBase = front_probe_bed_position + yGridSpacing * yCount;
707
             if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
709
             if (!position_is_reachable_by_probe(xProbe, yProbe)) continue;
708
           #endif
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
           measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
717
           measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
711
 
718
 
712
           if (isnan(measured_z)) {
719
           if (isnan(measured_z)) {
713
             set_bed_leveling_enabled(abl_should_enable);
720
             set_bed_leveling_enabled(abl_should_enable);
714
-            break;
721
+            break; // Breaks out of both loops
715
           }
722
           }
716
 
723
 
717
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
724
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
744
       // Probe at 3 arbitrary points
751
       // Probe at 3 arbitrary points
745
 
752
 
746
       for (uint8_t i = 0; i < 3; ++i) {
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
         // Retain the last probe position
759
         // Retain the last probe position
748
         xProbe = points[i].x;
760
         xProbe = points[i].x;
749
         yProbe = points[i].y;
761
         yProbe = points[i].y;
770
 
782
 
771
     #endif // AUTO_BED_LEVELING_3POINT
783
     #endif // AUTO_BED_LEVELING_3POINT
772
 
784
 
785
+    #if HAS_DISPLAY
786
+      ui.reset_status();
787
+    #endif
788
+
773
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
789
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
774
     if (STOW_PROBE()) {
790
     if (STOW_PROBE()) {
775
       set_bed_leveling_enabled(abl_should_enable);
791
       set_bed_leveling_enabled(abl_should_enable);

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

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

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

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

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

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

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

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

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

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

Loading…
取消
儲存