Skip to content

Commit

Permalink
🚸 Manual Move coordinates >= 1000 (#22165)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored Jun 18, 2021
1 parent 55feb8a commit ad1ad93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ namespace Language_en {
PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm");
PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm");
PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm");
PROGMEM Language_Str MSG_MOVE_100MM = _UxGT("Move 100mm");
PROGMEM Language_Str MSG_MOVE_0001IN = _UxGT("Move 0.001in");
PROGMEM Language_Str MSG_MOVE_001IN = _UxGT("Move 0.01in");
PROGMEM Language_Str MSG_MOVE_01IN = _UxGT("Move 0.1in");
PROGMEM Language_Str MSG_MOVE_10IN = _UxGT("Move 1.0in");
PROGMEM Language_Str MSG_SPEED = _UxGT("Speed");
PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z");
PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle");
Expand Down
7 changes: 5 additions & 2 deletions Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#if HAS_LCD_MENU

#define LARGE_BED_TEST ((X_BED_SIZE) >= 1000 || (Y_BED_SIZE) >= 1000)

#include "menu_item.h"
#include "menu_addon.h"

Expand Down Expand Up @@ -85,7 +87,7 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) {
MenuEditItemBase::draw_edit_screen(name, ftostr63(imp_pos));
}
else
MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr63(pos));
MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_BED_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
}
}
void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); }
Expand Down Expand Up @@ -165,11 +167,13 @@ 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_BED_TEST) SUBMENU(MSG_MOVE_10IN, []{ _goto_manual_move(IN_TO_MM(1.000f)); });
SUBMENU(MSG_MOVE_01IN, []{ _goto_manual_move(IN_TO_MM(0.100f)); });
SUBMENU(MSG_MOVE_001IN, []{ _goto_manual_move(IN_TO_MM(0.010f)); });
SUBMENU(MSG_MOVE_0001IN, []{ _goto_manual_move(IN_TO_MM(0.001f)); });
}
else {
if (LARGE_BED_TEST) SUBMENU(MSG_MOVE_100MM, []{ _goto_manual_move(100); });
SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); });
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); });
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); });
Expand All @@ -180,7 +184,6 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
PGM_P const label = GET_TEXT(MSG_MOVE_N_MM);
char tmp[strlen_P(label) + 10 + 1], numstr[10];
sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));

#if DISABLED(HAS_GRAPHICAL_TFT)
SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
Expand Down

0 comments on commit ad1ad93

Please sign in to comment.