Skip to content

Commit

Permalink
Move steps/mm out of slim menus (MarlinFirmware#16603)
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityAutomation authored and Vertabreak committed Jan 20, 2020
1 parent 760a857 commit 4a0050e
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,27 +480,6 @@ void menu_cancelobject();
END_MENU();
}

// M92 Steps-per-mm
void menu_advanced_steps_per_mm() {
START_MENU();
BACK_ITEM(MSG_ADVANCED_SETTINGS);

#define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); })
EDIT_QSTEPS(A);
EDIT_QSTEPS(B);
EDIT_QSTEPS(C);

#if ENABLED(DISTINCT_E_FACTORS)
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); });
for (uint8_t n = 0; n < E_STEPPERS; n++)
EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); });
#elif E_STEPPERS
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
#endif

END_MENU();
}

// M851 - Z Probe Offsets
#if HAS_BED_PROBE
void menu_probe_offsets() {
Expand All @@ -515,6 +494,27 @@ void menu_cancelobject();

#endif // !SLIM_LCD_MENUS

// M92 Steps-per-mm
void menu_advanced_steps_per_mm() {
START_MENU();
BACK_ITEM(MSG_ADVANCED_SETTINGS);

#define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); })
EDIT_QSTEPS(A);
EDIT_QSTEPS(B);
EDIT_QSTEPS(C);

#if ENABLED(DISTINCT_E_FACTORS)
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); });
for (uint8_t n = 0; n < E_STEPPERS; n++)
EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); });
#elif E_STEPPERS
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
#endif

END_MENU();
}

void menu_advanced_settings() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM
lcd_runout_distance_mm = runout.runout_distance();
Expand All @@ -540,17 +540,17 @@ void menu_advanced_settings() {
// M205 - Max Jerk
SUBMENU(MSG_JERK, menu_advanced_jerk);

if (!printer_busy()) {
// M92 - Steps Per mm
SUBMENU(MSG_STEPS_PER_MM, menu_advanced_steps_per_mm);

#if HAS_BED_PROBE
// M851 - Z Probe Offsets
// M851 - Z Probe Offsets
#if HAS_BED_PROBE
if (!printer_busy())
SUBMENU(MSG_ZPROBE_OFFSETS, menu_probe_offsets);
#endif
}
#endif
#endif // !SLIM_LCD_MENUS

// M92 - Steps Per mm
if (!printer_busy())
SUBMENU(MSG_STEPS_PER_MM, menu_advanced_steps_per_mm);

#if ENABLED(BACKLASH_GCODE)
SUBMENU(MSG_BACKLASH, menu_backlash);
#endif
Expand Down

0 comments on commit 4a0050e

Please sign in to comment.