Browse Source

UBL: Log and display G29 progress (#14036)

GUEST.it 6 years ago
parent
commit
62ef54cb81

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

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

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

247
 #ifndef MSG_UBL_LEVEL_BED
247
 #ifndef MSG_UBL_LEVEL_BED
248
   #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
248
   #define MSG_UBL_LEVEL_BED                   _UxGT("Unified Bed Leveling")
249
 #endif
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
 #ifndef MSG_IDEX_MENU
256
 #ifndef MSG_IDEX_MENU
251
   #define MSG_IDEX_MENU                       _UxGT("IDEX Mode")
257
   #define MSG_IDEX_MENU                       _UxGT("IDEX Mode")
252
 #endif
258
 #endif

Loading…
Cancel
Save