Patch blocking and manual moves

This commit is contained in:
Scott Lahteine 2019-10-06 23:58:19 -05:00
parent c6ffa7f38d
commit 211ff67440
5 changed files with 40 additions and 31 deletions

View File

@ -228,14 +228,14 @@ void reset_bed_level() {
#ifdef MANUAL_PROBE_START_Z #ifdef MANUAL_PROBE_START_Z
constexpr float startz = _MAX(0, MANUAL_PROBE_START_Z); constexpr float startz = _MAX(0, MANUAL_PROBE_START_Z);
#if MANUAL_PROBE_HEIGHT > 0 #if MANUAL_PROBE_HEIGHT > 0
do_blocking_move_to(pos, MANUAL_PROBE_HEIGHT); do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT);
do_blocking_move_to_z(startz); do_blocking_move_to_z(startz);
#else #else
do_blocking_move_to(pos, startz); do_blocking_move_to_xy_z(pos, startz);
#endif #endif
#elif MANUAL_PROBE_HEIGHT > 0 #elif MANUAL_PROBE_HEIGHT > 0
const float prev_z = current_position.z; const float prev_z = current_position.z;
do_blocking_move_to(pos, MANUAL_PROBE_HEIGHT); do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT);
do_blocking_move_to_z(prev_z); do_blocking_move_to_z(prev_z);
#else #else
do_blocking_move_to_xy(pos); do_blocking_move_to_xy(pos);

View File

@ -892,7 +892,7 @@
ui.capture(); ui.capture();
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
do_blocking_move_to(current_position.x, current_position.y, z_clearance); do_blocking_move_to_xy_z(current_position, z_clearance);
ui.return_to_status(); ui.return_to_status();
@ -948,7 +948,7 @@
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
restore_ubl_active_state_and_leave(); restore_ubl_active_state_and_leave();
do_blocking_move_to(pos, Z_CLEARANCE_DEPLOY_PROBE); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE);
} }
inline void set_message_with_feedback(PGM_P const msg_P) { inline void set_message_with_feedback(PGM_P const msg_P) {
@ -986,7 +986,7 @@
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
ui.capture(); // Take over control of the LCD encoder ui.capture(); // Take over control of the LCD encoder
do_blocking_move_to(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
#if ENABLED(UBL_MESH_EDIT_MOVES_Z) #if ENABLED(UBL_MESH_EDIT_MOVES_Z)
do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset
@ -1055,7 +1055,7 @@
if (do_ubl_mesh_map) display_map(g29_map_type); if (do_ubl_mesh_map) display_map(g29_map_type);
restore_ubl_active_state_and_leave(); restore_ubl_active_state_and_leave();
do_blocking_move_to(pos, Z_CLEARANCE_BETWEEN_PROBES); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES);
LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
SERIAL_ECHOLNPGM("Done Editing Mesh"); SERIAL_ECHOLNPGM("Done Editing Mesh");

View File

@ -41,7 +41,7 @@
#endif #endif
void _man_probe_pt(const xy_pos_t &xy) { void _man_probe_pt(const xy_pos_t &xy) {
do_blocking_move_to(xy, Z_CLEARANCE_BETWEEN_PROBES); do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES);
ui.synchronize(); ui.synchronize();
move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT));
ui.goto_screen(lcd_move_z); ui.goto_screen(lcd_move_z);

View File

@ -430,6 +430,17 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f
planner.synchronize(); planner.synchronize();
} }
void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s);
}
void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
}
void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
}
void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s/*=0.0*/) { void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s/*=0.0*/) {
do_blocking_move_to(rx, current_position.y, current_position.z, fr_mm_s); do_blocking_move_to(rx, current_position.y, current_position.z, fr_mm_s);
} }
@ -437,11 +448,19 @@ void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) {
do_blocking_move_to(current_position.x, ry, current_position.z, fr_mm_s); do_blocking_move_to(current_position.x, ry, current_position.z, fr_mm_s);
} }
void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) {
do_blocking_move_to(current_position.x, current_position.y, rz, fr_mm_s); do_blocking_move_to_xy_z(current_position, rz, fr_mm_s);
} }
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) { void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) {
do_blocking_move_to(rx, ry, current_position.z, fr_mm_s); do_blocking_move_to(rx, ry, current_position.z, fr_mm_s);
} }
void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
}
void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s/*=0.0f*/) {
do_blocking_move_to(raw.x, raw.y, z, fr_mm_s);
}
// //
// Prepare to do endstop or probe moves with custom feedrates. // Prepare to do endstop or probe moves with custom feedrates.

View File

@ -200,33 +200,23 @@ inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f)
* Blocking movement and shorthand functions * Blocking movement and shorthand functions
*/ */
void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f); void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f);
void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
FORCE_INLINE void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s); void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
}
FORCE_INLINE void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
}
FORCE_INLINE void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
}
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
FORCE_INLINE void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
}
FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
}
FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
}
void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f); void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f);
void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f); void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f);
void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f); void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f);
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f);
FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
void remember_feedrate_and_scaling(); void remember_feedrate_and_scaling();
void remember_feedrate_scaling_off(); void remember_feedrate_scaling_off();
void restore_feedrate_and_scaling(); void restore_feedrate_and_scaling();