LARGE_MOVE_ITEMS (#25026)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
mikemerryguy
2023-01-02 00:13:53 -05:00
committed by GitHub
parent 42cfa4f48f
commit 00fad1a79b
3 changed files with 13 additions and 8 deletions

View File

@@ -1417,6 +1417,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif
// Add 50/100mm moves to MarlinUI even with a smaller bed
//#define LARGE_MOVE_ITEMS
// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

View File

@@ -28,12 +28,13 @@
#if HAS_MARLINUI_MENU
#if ENABLED(TRULY_LARGE_AREA)
#define LARGE_AREA_TEST true
#define HAS_LARGE_AREA ((X_BED_SIZE) >= 1000 || TERN0(HAS_Y_AXIS, (Y_BED_SIZE) >= 1000) || TERN0(HAS_Z_AXIS, (Z_MAX_POS) >= 1000))
#if ENABLED(LARGE_MOVE_ITEMS)
#define HAS_LARGE_MOVES true
#elif ENABLED(SLIM_LCD_MENUS)
#define LARGE_AREA_TEST false
#define HAS_LARGE_MOVES false
#else
#define LARGE_AREA_TEST ((X_BED_SIZE) >= 1000 || TERN0(HAS_Y_AXIS, (Y_BED_SIZE) >= 1000) || TERN0(HAS_Z_AXIS, (Z_MAX_POS) >= 1000))
#define HAS_LARGE_MOVES HAS_LARGE_AREA
#endif
#include "menu_item.h"
@@ -87,7 +88,7 @@ void lcd_move_axis(const AxisEnum axis) {
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ftostr63(imp_pos));
}
else
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));
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ui.manual_move.menu_scale >= 0.1f ? (HAS_LARGE_AREA ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
}
}
@@ -156,7 +157,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
BACK_ITEM(MSG_MOVE_AXIS);
if (parser.using_inch_units()) {
if (LARGE_AREA_TEST) {
if (HAS_LARGE_MOVES) {
SUBMENU(MSG_MOVE_1IN, []{ _goto_manual_move(IN_TO_MM(1.000f)); });
SUBMENU(MSG_MOVE_05IN, []{ _goto_manual_move(IN_TO_MM(0.500f)); });
}
@@ -165,7 +166,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
SUBMENU(MSG_MOVE_0001IN, []{ _goto_manual_move(IN_TO_MM(0.001f)); });
}
else {
if (LARGE_AREA_TEST) {
if (HAS_LARGE_MOVES) {
SUBMENU(MSG_MOVE_100MM, []{ _goto_manual_move(100); });
SUBMENU(MSG_MOVE_50MM, []{ _goto_manual_move(50); });
}