Browse Source

UBL: Log and display G29 progress (#14036)

GUEST.it 6 years ago
parent
commit
62ef54cb81
2 changed files with 39 additions and 3 deletions
  1. 33
    3
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  2. 6
    0
      Marlin/src/lcd/language/language_en.h

+ 33
- 3
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -411,7 +411,6 @@
411 411
           restore_ubl_active_state_and_leave();
412 412
         }
413 413
         else { // grid_size == 0 : A 3-Point leveling has been requested
414
-
415 414
           save_ubl_active_state_and_disable();
416 415
           tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ );
417 416
           restore_ubl_active_state_and_leave();
@@ -738,12 +737,17 @@
738 737
       save_ubl_active_state_and_disable();  // No bed level correction so only raw data is obtained
739 738
       DEPLOY_PROBE();
740 739
 
741
-      uint16_t count = GRID_MAX_POINTS;
740
+      uint16_t count = GRID_MAX_POINTS, current = 1;
742 741
 
743 742
       do {
743
+        current = (GRID_MAX_POINTS) - count + 1;
744
+
744 745
         if (do_ubl_mesh_map) display_map(g29_map_type);
745 746
 
747
+        SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", GRID_MAX_POINTS, ".\n");
746 748
         #if HAS_LCD_MENU
749
+          ui.status_printf_P(0, PSTR(MSG_LCD_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS));
750
+
747 751
           if (ui.button_pressed()) {
748 752
             ui.quick_feedback(false); // Preserve button state for click-and-hold
749 753
             SERIAL_ECHOLNPGM("\nMesh only partially populated.\n");
@@ -771,6 +775,7 @@
771 775
           #endif
772 776
         }
773 777
         SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
778
+
774 779
       } while (location.x_index >= 0 && --count);
775 780
 
776 781
       STOW_PROBE();
@@ -1401,6 +1406,11 @@
1401 1406
       incremental_LSF_reset(&lsf_results);
1402 1407
 
1403 1408
       if (do_3_pt_leveling) {
1409
+        SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
1410
+        #if HAS_LCD_MENU
1411
+          ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3"));
1412
+        #endif
1413
+
1404 1414
         measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_Y, PROBE_PT_RAISE, g29_verbose_level);
1405 1415
         if (isnan(measured_z))
1406 1416
           abort_flag = true;
@@ -1415,6 +1425,11 @@
1415 1425
         }
1416 1426
 
1417 1427
         if (!abort_flag) {
1428
+          SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
1429
+          #if HAS_LCD_MENU
1430
+            ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3"));
1431
+          #endif
1432
+
1418 1433
           measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level);
1419 1434
           //z2 = measured_z;
1420 1435
           if (isnan(measured_z))
@@ -1430,6 +1445,11 @@
1430 1445
         }
1431 1446
 
1432 1447
         if (!abort_flag) {
1448
+          SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
1449
+          #if HAS_LCD_MENU
1450
+            ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3"));
1451
+          #endif
1452
+          
1433 1453
           measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level);
1434 1454
           //z3 = measured_z;
1435 1455
           if (isnan(measured_z))
@@ -1450,19 +1470,27 @@
1450 1470
         #endif
1451 1471
 
1452 1472
         if (abort_flag) {
1453
-          SERIAL_ECHOLNPGM("?Error probing point.  Aborting operation.");
1473
+          SERIAL_ECHOLNPGM("?Error probing point. Aborting operation.");
1454 1474
           return;
1455 1475
         }
1456 1476
       }
1457 1477
       else { // !do_3_pt_leveling
1458 1478
 
1459 1479
         bool zig_zag = false;
1480
+        
1481
+        uint16_t total_points = g29_grid_size * g29_grid_size, current = 1;
1482
+
1460 1483
         for (uint8_t ix = 0; ix < g29_grid_size; ix++) {
1461 1484
           const float rx = float(x_min) + ix * dx;
1462 1485
           for (int8_t iy = 0; iy < g29_grid_size; iy++) {
1463 1486
             const float ry = float(y_min) + dy * (zig_zag ? g29_grid_size - 1 - iy : iy);
1464 1487
 
1465 1488
             if (!abort_flag) {
1489
+              SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n");
1490
+              #if HAS_LCD_MENU
1491
+                ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points);
1492
+              #endif
1493
+
1466 1494
               measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling
1467 1495
 
1468 1496
               abort_flag = isnan(measured_z);
@@ -1491,6 +1519,8 @@
1491 1519
               }
1492 1520
               incremental_LSF(&lsf_results, rx, ry, measured_z);
1493 1521
             }
1522
+
1523
+            current++;
1494 1524
           }
1495 1525
 
1496 1526
           zig_zag ^= true;

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

@@ -247,6 +247,12 @@
247 247
 #ifndef MSG_UBL_LEVEL_BED
248 248
   #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
249 249
 #endif
250
+#ifndef MSG_LCD_PROBING_MESH
251
+  #define MSG_LCD_PROBING_MESH                _UxGT("Probing point")
252
+#endif
253
+#ifndef MSG_LCD_TILTING_MESH
254
+  #define MSG_LCD_TILTING_MESH                _UxGT("Tilting point")
255
+#endif
250 256
 #ifndef MSG_IDEX_MENU
251 257
   #define MSG_IDEX_MENU                       _UxGT("IDEX Mode")
252 258
 #endif

Loading…
Cancel
Save