@@ -170,11 +170,6 @@ void _goto_manual_move(const float scale) {
170
170
171
171
void _menu_move_distance (const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1 ) {
172
172
_manual_move_func_ptr = func;
173
- #if ENABLED(PREVENT_COLD_EXTRUSION)
174
- const bool too_cold = axis == E_AXIS && thermalManager.tooColdToExtrude (eindex >= 0 ? eindex : active_extruder);
175
- #else
176
- constexpr bool too_cold = false ;
177
- #endif
178
173
START_MENU ();
179
174
if (LCD_HEIGHT >= 4 ) {
180
175
switch (axis) {
@@ -187,35 +182,57 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
187
182
break ;
188
183
}
189
184
}
190
- if (too_cold)
191
- BACK_ITEM (MSG_HOTEND_TOO_COLD);
192
- else {
193
- BACK_ITEM (MSG_MOVE_AXIS);
194
- SUBMENU (MSG_MOVE_10MM, []{ _goto_manual_move (10 ); });
195
- SUBMENU (MSG_MOVE_1MM, []{ _goto_manual_move ( 1 ); });
196
- SUBMENU (MSG_MOVE_01MM, []{ _goto_manual_move ( 0 .1f ); });
197
- if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0 .0f && (SHORT_MANUAL_Z_MOVE) < 0 .1f ) {
198
- // Determine digits needed right of decimal
199
- constexpr uint8_t digs = !UNEAR_ZERO ((SHORT_MANUAL_Z_MOVE) * 1000 - int ((SHORT_MANUAL_Z_MOVE) * 1000 )) ? 4 :
200
- !UNEAR_ZERO ((SHORT_MANUAL_Z_MOVE) * 100 - int ((SHORT_MANUAL_Z_MOVE) * 100 )) ? 3 : 2 ;
201
- PGM_P const label = GET_TEXT (MSG_MOVE_Z_DIST);
202
- char tmp[strlen_P (label) + 10 + 1 ], numstr[10 ];
203
- sprintf_P (tmp, label, dtostrf (SHORT_MANUAL_Z_MOVE, 1 , digs, numstr));
204
-
205
- #if DISABLED(HAS_GRAPHICAL_TFT)
206
- extern const char NUL_STR[];
207
- SUBMENU_P (NUL_STR, []{ _goto_manual_move (float (SHORT_MANUAL_Z_MOVE)); });
208
- MENU_ITEM_ADDON_START (0 + ENABLED (HAS_MARLINUI_HD44780));
209
- lcd_put_u8str (tmp);
210
- MENU_ITEM_ADDON_END ();
211
- #else
212
- SUBMENU_P (tmp, []{ _goto_manual_move (float (SHORT_MANUAL_Z_MOVE)); });
213
- #endif
214
- }
185
+
186
+ BACK_ITEM (MSG_MOVE_AXIS);
187
+ SUBMENU (MSG_MOVE_10MM, []{ _goto_manual_move (10 ); });
188
+ SUBMENU (MSG_MOVE_1MM, []{ _goto_manual_move ( 1 ); });
189
+ SUBMENU (MSG_MOVE_01MM, []{ _goto_manual_move ( 0 .1f ); });
190
+ if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0 .0f && (SHORT_MANUAL_Z_MOVE) < 0 .1f ) {
191
+ // Determine digits needed right of decimal
192
+ constexpr uint8_t digs = !UNEAR_ZERO ((SHORT_MANUAL_Z_MOVE) * 1000 - int ((SHORT_MANUAL_Z_MOVE) * 1000 )) ? 4 :
193
+ !UNEAR_ZERO ((SHORT_MANUAL_Z_MOVE) * 100 - int ((SHORT_MANUAL_Z_MOVE) * 100 )) ? 3 : 2 ;
194
+ PGM_P const label = GET_TEXT (MSG_MOVE_Z_DIST);
195
+ char tmp[strlen_P (label) + 10 + 1 ], numstr[10 ];
196
+ sprintf_P (tmp, label, dtostrf (SHORT_MANUAL_Z_MOVE, 1 , digs, numstr));
197
+
198
+ #if DISABLED(HAS_GRAPHICAL_TFT)
199
+ extern const char NUL_STR[];
200
+ SUBMENU_P (NUL_STR, []{ _goto_manual_move (float (SHORT_MANUAL_Z_MOVE)); });
201
+ MENU_ITEM_ADDON_START (0 + ENABLED (HAS_MARLINUI_HD44780));
202
+ lcd_put_u8str (tmp);
203
+ MENU_ITEM_ADDON_END ();
204
+ #else
205
+ SUBMENU_P (tmp, []{ _goto_manual_move (float (SHORT_MANUAL_Z_MOVE)); });
206
+ #endif
215
207
}
216
208
END_MENU ();
217
209
}
218
210
211
+ #if E_MANUAL
212
+
213
+ inline void _goto_menu_move_distance_e () {
214
+ ui.goto_screen ([]{ _menu_move_distance (E_AXIS, []{ lcd_move_e (); }, -1 ); });
215
+ }
216
+
217
+ inline void _menu_move_distance_e_maybe () {
218
+ #if ENABLED(PREVENT_COLD_EXTRUSION)
219
+ const bool too_cold = thermalManager.tooColdToExtrude (active_extruder);
220
+ if (too_cold) {
221
+ ui.goto_screen ([]{
222
+ MenuItem_confirm::select_screen (
223
+ GET_TEXT (MSG_BUTTON_PROCEED), GET_TEXT (MSG_BACK),
224
+ _goto_menu_move_distance_e, ui.goto_previous_screen ,
225
+ GET_TEXT (MSG_HOTEND_TOO_COLD), (const char *)nullptr , PSTR (" !" )
226
+ );
227
+ });
228
+ return ;
229
+ }
230
+ #endif
231
+ _goto_menu_move_distance_e ();
232
+ }
233
+
234
+ #endif // E_MANUAL
235
+
219
236
void menu_move () {
220
237
START_MENU ();
221
238
BACK_ITEM (MSG_MOTION);
@@ -278,7 +295,7 @@ void menu_move() {
278
295
#if E_MANUAL
279
296
280
297
// The current extruder
281
- SUBMENU (MSG_MOVE_E, []{ _menu_move_distance (E_AXIS, []{ lcd_move_e (); }, - 1 ); });
298
+ SUBMENU (MSG_MOVE_E, []{ _menu_move_distance_e_maybe ( ); });
282
299
283
300
#define SUBMENU_MOVE_E (N ) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance (E_AXIS, []{ lcd_move_e (MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); });
284
301
0 commit comments