Minor LCD cleanup, improvement

This commit is contained in:
Scott Lahteine
2020-06-25 16:39:22 -05:00
parent 520c0ab96b
commit f445bc26e5
9 changed files with 74 additions and 86 deletions

View File

@ -826,7 +826,7 @@
static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
float unified_bed_leveling::measure_business_card_thickness(float in_height) {
TERN_(HAS_LCD_MENU, ui.capture());
ui.capture();
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
@ -857,15 +857,13 @@
SERIAL_ECHOLNPGM("mm thick.");
}
ui.release();
restore_ubl_active_state_and_leave();
return thickness;
}
void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
TERN_(HAS_LCD_MENU, ui.capture());
ui.capture();
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
do_blocking_move_to_xy_z(current_position, z_clearance);
@ -893,7 +891,7 @@
do_blocking_move_to_z(z_clearance);
KEEPALIVE_STATE(PAUSED_FOR_USER);
TERN_(HAS_LCD_MENU, ui.capture());
ui.capture();
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
@ -907,7 +905,6 @@
if (click_and_hold()) {
SERIAL_ECHOLNPGM("\nMesh only partially populated.");
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
ui.release();
return restore_ubl_active_state_and_leave();
}
@ -958,9 +955,9 @@
save_ubl_active_state_and_disable();
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
TERN_(HAS_LCD_MENU, ui.capture()); // Take over control of the LCD encoder
ui.capture(); // Take over control of the LCD encoder
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset)); // Move Z to the given 'H' offset
@ -1016,8 +1013,6 @@
} while (lpos.x >= 0 && --g29_repetition_cnt > 0);
ui.release();
if (do_ubl_mesh_map) display_map(g29_map_type);
restore_ubl_active_state_and_leave();
@ -1168,6 +1163,7 @@
}
void unified_bed_leveling::restore_ubl_active_state_and_leave() {
TERN_(HAS_LCD_MENU, ui.release());
#if ENABLED(UBL_DEVEL_DEBUGGING)
if (--ubl_state_recursion_chk) {
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");