Add option to move Z on double-click when idle

This commit is contained in:
dot-bob 2018-07-02 23:23:44 -06:00 committed by Scott Lahteine
parent 389376c40e
commit b0fd8f2d74
3 changed files with 30 additions and 12 deletions

View File

@ -777,6 +777,11 @@
// Note: Extra time may be added to mitigate controller latency. // Note: Extra time may be added to mitigate controller latency.
#endif #endif
//#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle.
#if ENABLED(MOVE_Z_WHEN_IDLE)
#define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size.
#endif
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets

View File

@ -777,6 +777,11 @@
// Note: Extra time may be added to mitigate controller latency. // Note: Extra time may be added to mitigate controller latency.
#endif #endif
//#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle.
#if ENABLED(MOVE_Z_WHEN_IDLE)
#define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size.
#endif
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets

View File

@ -509,6 +509,9 @@ uint16_t max_display_update_time = 0;
inline bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING; } inline bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING; }
void lcd_move_z();
float move_menu_scale;
/** /**
* General function to go directly to a screen * General function to go directly to a screen
*/ */
@ -528,14 +531,23 @@ uint16_t max_display_update_time = 0;
if (currentScreen == lcd_status_screen) if (currentScreen == lcd_status_screen)
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
} }
else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms)/* && printer_busy()*/) else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms)) {
screen = if (printer_busy()) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) screen =
lcd_babystep_zoffset #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
#else lcd_babystep_zoffset
lcd_babystep_z #else
#endif lcd_babystep_z
; #endif
;
}
#if ENABLED(MOVE_Z_WHEN_IDLE)
else {
move_menu_scale = MOVE_Z_IDLE_MULTIPLICATOR;
screen = lcd_move_z;
}
#endif
}
#endif #endif
currentScreen = screen; currentScreen = screen;
@ -2850,12 +2862,8 @@ void lcd_quick_feedback(const bool clear_buttons) {
END_MENU(); END_MENU();
} }
float move_menu_scale;
#if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
void lcd_move_z();
void _man_probe_pt(const float &rx, const float &ry) { void _man_probe_pt(const float &rx, const float &ry) {
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
do_blocking_move_to_xy(rx, ry); do_blocking_move_to_xy(rx, ry);