Move Menu: Select axis first, resolution after

This commit is contained in:
Scott Lahteine 2016-12-12 21:58:16 -08:00
parent 641e0936d4
commit 93b2833347
2 changed files with 100 additions and 57 deletions

View File

@ -141,6 +141,9 @@
#ifndef MSG_MOVING #ifndef MSG_MOVING
#define MSG_MOVING "Moving..." #define MSG_MOVING "Moving..."
#endif #endif
#ifndef MSG_FREE_XY
#define MSG_FREE_XY "Free XY"
#endif
#ifndef MSG_MOVE_X #ifndef MSG_MOVE_X
#define MSG_MOVE_X "Move X" #define MSG_MOVE_X "Move X"
#endif #endif

View File

@ -1282,6 +1282,14 @@ KeepDrawing:
// //
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
//
// Move Axis
//
#if ENABLED(DELTA)
if (axis_homed[Z_AXIS])
#endif
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
// //
// Auto Home // Auto Home
// //
@ -1309,11 +1317,6 @@ KeepDrawing:
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
#endif #endif
//
// Move Axis
//
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
// //
// Disable Steppers // Disable Steppers
// //
@ -1557,58 +1560,48 @@ KeepDrawing:
* *
*/ */
#if IS_KINEMATIC screenFunc_t _manual_move_func_ptr;
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
#else
#define _MOVE_XYZ_ALLOWED true
#endif
void _lcd_move_menu_axis() { void lcd_move_menu_10mm() { move_menu_scale = 10.0; lcd_goto_screen(_manual_move_func_ptr); }
void lcd_move_menu_1mm() { move_menu_scale = 1.0; lcd_goto_screen(_manual_move_func_ptr); }
void lcd_move_menu_01mm() { move_menu_scale = 0.1; lcd_goto_screen(_manual_move_func_ptr); }
void _lcd_move_distance_menu(AxisEnum axis, screenFunc_t func) {
_manual_move_func_ptr = func;
START_MENU(); START_MENU();
if (LCD_HEIGHT >= 4) {
switch(axis) {
case X_AXIS:
STATIC_ITEM(MSG_MOVE_X, true, true); break;
case Y_AXIS:
STATIC_ITEM(MSG_MOVE_Y, true, true); break;
case Z_AXIS:
STATIC_ITEM(MSG_MOVE_Z, true, true); break;
default:
STATIC_ITEM(MSG_MOVE_E, true, true); break;
}
}
MENU_BACK(MSG_MOVE_AXIS); MENU_BACK(MSG_MOVE_AXIS);
if (axis == X_AXIS || axis == Y_AXIS)
if (_MOVE_XYZ_ALLOWED) { MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
}
if (move_menu_scale < 10.0) {
if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
#if ENABLED(SWITCHING_EXTRUDER)
if (active_extruder)
MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
else
MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
#endif
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
#if E_MANUAL > 1
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0);
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1);
#if E_MANUAL > 2
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2);
#if E_MANUAL > 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3);
#endif
#endif
#endif
}
END_MENU(); END_MENU();
} }
void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); }
void lcd_move_menu_10mm() { void lcd_move_get_y_amount() { _lcd_move_distance_menu(Y_AXIS, lcd_move_y); }
move_menu_scale = 10.0; void lcd_move_get_z_amount() { _lcd_move_distance_menu(Z_AXIS, lcd_move_z); }
_lcd_move_menu_axis(); void lcd_move_get_e_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e); }
} #if E_MANUAL > 1
void lcd_move_menu_1mm() { void lcd_move_get_e0_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e0); }
move_menu_scale = 1.0; void lcd_move_get_e1_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e1); }
_lcd_move_menu_axis(); #if E_MANUAL > 2
} void lcd_move_get_e2_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e2); }
void lcd_move_menu_01mm() { #if E_MANUAL > 3
move_menu_scale = 0.1; void lcd_move_get_e3_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e3); }
_lcd_move_menu_axis(); #endif
} #endif
#endif
/** /**
* *
@ -1616,16 +1609,63 @@ KeepDrawing:
* *
*/ */
#if IS_KINEMATIC
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
#if ENABLED(DELTA)
#define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
void lcd_lower_z_to_clip_height() {
if (!no_reentrance) {
current_position[Z_AXIS] = delta_clip_start_height;
line_to_current(Z_AXIS);
lcd_synchronize();
}
}
#else
#define _MOVE_XY_ALLOWED true
#endif
#else
#define _MOVE_XYZ_ALLOWED true
#define _MOVE_XY_ALLOWED true
#endif
void lcd_move_menu() { void lcd_move_menu() {
START_MENU(); START_MENU();
MENU_BACK(MSG_PREPARE); MENU_BACK(MSG_PREPARE);
if (_MOVE_XYZ_ALLOWED) if (_MOVE_XYZ_ALLOWED) {
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); if (_MOVE_XY_ALLOWED) {
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount);
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount);
}
#if ENABLED(DELTA)
else
MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height);
#endif
MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount);
}
else
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
#if ENABLED(SWITCHING_EXTRUDER)
if (active_extruder)
MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
else
MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
#endif
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
#if E_MANUAL > 1
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
#if E_MANUAL > 2
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
#if E_MANUAL > 3
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
#endif
#endif
#endif
MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
//TODO:X,Y,Z,E
END_MENU(); END_MENU();
} }