50
50
// "Motion" > "Move Axis" submenu
51
51
//
52
52
53
- void lcd_move_axis (const AxisEnum axis) {
53
+ // TODO: Use substitution here with MSG_MOVE_N
54
+ static void _lcd_move_xyz (FSTR_P const name, const AxisEnum axis) {
54
55
if (ui.use_click ()) return ui.goto_previous_screen_no_defer ();
55
56
if (ui.encoderPosition && !ui.manual_move .processing ) {
56
57
// Get motion limit from software endstops, if any
@@ -77,15 +78,37 @@ void lcd_move_axis(const AxisEnum axis) {
77
78
const float pos = ui.manual_move .axis_value (axis);
78
79
if (parser.using_inch_units ()) {
79
80
const float imp_pos = LINEAR_UNIT (pos);
80
- MenuEditItemBase::draw_edit_screen (GET_TEXT_F (MSG_MOVE_N) , ftostr63 (imp_pos));
81
+ MenuEditItemBase::draw_edit_screen (name , ftostr63 (imp_pos));
81
82
}
82
83
else
83
- MenuEditItemBase::draw_edit_screen (GET_TEXT_F (MSG_MOVE_N) , ui.manual_move .menu_scale >= 0 .1f ? (LARGE_AREA_TEST ? ftostr51sign (pos) : ftostr41sign (pos)) : ftostr63 (pos));
84
+ MenuEditItemBase::draw_edit_screen (name , ui.manual_move .menu_scale >= 0 .1f ? (LARGE_AREA_TEST ? ftostr51sign (pos) : ftostr41sign (pos)) : ftostr63 (pos));
84
85
}
85
86
}
86
-
87
- // Move Z easy accessor
88
- void lcd_move_z () { lcd_move_axis (Z_AXIS); }
87
+ void lcd_move_x () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_X), X_AXIS); }
88
+ #if HAS_Y_AXIS
89
+ void lcd_move_y () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_Y), Y_AXIS); }
90
+ #endif
91
+ #if HAS_Z_AXIS
92
+ void lcd_move_z () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_Z), Z_AXIS); }
93
+ #endif
94
+ #if HAS_I_AXIS
95
+ void lcd_move_i () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_I), I_AXIS); }
96
+ #endif
97
+ #if HAS_J_AXIS
98
+ void lcd_move_j () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_J), J_AXIS); }
99
+ #endif
100
+ #if HAS_K_AXIS
101
+ void lcd_move_k () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_K), K_AXIS); }
102
+ #endif
103
+ #if HAS_U_AXIS
104
+ void lcd_move_u () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_U), U_AXIS); }
105
+ #endif
106
+ #if HAS_V_AXIS
107
+ void lcd_move_v () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_V), V_AXIS); }
108
+ #endif
109
+ #if HAS_W_AXIS
110
+ void lcd_move_w () { _lcd_move_xyz (GET_TEXT_F (MSG_MOVE_W), W_AXIS); }
111
+ #endif
89
112
90
113
#if E_MANUAL
91
114
0 commit comments