1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-28 06:21:31 +00:00

UBL: Log and display G29 progress (#14036)

This commit is contained in:
GUEST.it 2019-05-18 02:02:21 +02:00 committed by Scott Lahteine
parent 7907eec04c
commit 62ef54cb81
2 changed files with 39 additions and 3 deletions

View File

@ -411,7 +411,6 @@
restore_ubl_active_state_and_leave();
}
else { // grid_size == 0 : A 3-Point leveling has been requested
save_ubl_active_state_and_disable();
tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ );
restore_ubl_active_state_and_leave();
@ -738,12 +737,17 @@
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
DEPLOY_PROBE();
uint16_t count = GRID_MAX_POINTS;
uint16_t count = GRID_MAX_POINTS, current = 1;
do {
current = (GRID_MAX_POINTS) - count + 1;
if (do_ubl_mesh_map) display_map(g29_map_type);
SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", GRID_MAX_POINTS, ".\n");
#if HAS_LCD_MENU
ui.status_printf_P(0, PSTR(MSG_LCD_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS));
if (ui.button_pressed()) {
ui.quick_feedback(false); // Preserve button state for click-and-hold
SERIAL_ECHOLNPGM("\nMesh only partially populated.\n");
@ -771,6 +775,7 @@
#endif
}
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
} while (location.x_index >= 0 && --count);
STOW_PROBE();
@ -1401,6 +1406,11 @@
incremental_LSF_reset(&lsf_results);
if (do_3_pt_leveling) {
SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
#if HAS_LCD_MENU
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3"));
#endif
measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_Y, PROBE_PT_RAISE, g29_verbose_level);
if (isnan(measured_z))
abort_flag = true;
@ -1415,6 +1425,11 @@
}
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
#if HAS_LCD_MENU
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3"));
#endif
measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level);
//z2 = measured_z;
if (isnan(measured_z))
@ -1430,6 +1445,11 @@
}
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
#if HAS_LCD_MENU
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3"));
#endif
measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level);
//z3 = measured_z;
if (isnan(measured_z))
@ -1450,19 +1470,27 @@
#endif
if (abort_flag) {
SERIAL_ECHOLNPGM("?Error probing point. Aborting operation.");
SERIAL_ECHOLNPGM("?Error probing point. Aborting operation.");
return;
}
}
else { // !do_3_pt_leveling
bool zig_zag = false;
uint16_t total_points = g29_grid_size * g29_grid_size, current = 1;
for (uint8_t ix = 0; ix < g29_grid_size; ix++) {
const float rx = float(x_min) + ix * dx;
for (int8_t iy = 0; iy < g29_grid_size; iy++) {
const float ry = float(y_min) + dy * (zig_zag ? g29_grid_size - 1 - iy : iy);
if (!abort_flag) {
SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n");
#if HAS_LCD_MENU
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points);
#endif
measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling
abort_flag = isnan(measured_z);
@ -1491,6 +1519,8 @@
}
incremental_LSF(&lsf_results, rx, ry, measured_z);
}
current++;
}
zig_zag ^= true;

View File

@ -247,6 +247,12 @@
#ifndef MSG_UBL_LEVEL_BED
#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling")
#endif
#ifndef MSG_LCD_PROBING_MESH
#define MSG_LCD_PROBING_MESH _UxGT("Probing point")
#endif
#ifndef MSG_LCD_TILTING_MESH
#define MSG_LCD_TILTING_MESH _UxGT("Tilting point")
#endif
#ifndef MSG_IDEX_MENU
#define MSG_IDEX_MENU _UxGT("IDEX Mode")
#endif