🎨 steps_to_mm => mm_per_step (#22847)

This commit is contained in:
espr14
2021-09-27 21:05:52 +02:00
committed by Scott Lahteine
parent 064f91e9b0
commit 604a01cd1a
15 changed files with 58 additions and 58 deletions

View File

@ -755,7 +755,7 @@ namespace ExtUI {
* what nozzle is printing.
*/
void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles) {
const float mm = steps * planner.steps_to_mm[axis];
const float mm = steps * planner.mm_per_step[axis];
UNUSED(mm);
if (!babystepAxis_steps(steps, axis)) return;
@ -791,12 +791,12 @@ namespace ExtUI {
* steps that is at least mm long.
*/
int16_t mmToWholeSteps(const_float_t mm, const axis_t axis) {
const float steps = mm / planner.steps_to_mm[axis];
const float steps = mm / planner.mm_per_step[axis];
return steps > 0 ? CEIL(steps) : FLOOR(steps);
}
float mmFromWholeSteps(int16_t steps, const axis_t axis) {
return steps * planner.steps_to_mm[axis];
return steps * planner.mm_per_step[axis];
}
#endif // BABYSTEPPING
@ -806,7 +806,7 @@ namespace ExtUI {
#if HAS_BED_PROBE
+ probe.offset.z
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
+ planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
+ planner.mm_per_step[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
#endif
);
}

View File

@ -315,7 +315,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_SIZE_Z);
ui.encoderPosition = 0;
const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
const float diff = planner.mm_per_step[Z_AXIS] * babystep_increment,
new_probe_offset = probe.offset.z + diff,
new_offs = TERN(BABYSTEP_HOTEND_Z_OFFSET
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff

View File

@ -532,7 +532,7 @@ void menu_advanced_steps_per_mm() {
if (e == active_extruder)
planner.refresh_positioning();
else
planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
});
#elif E_STEPPERS
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });

View File

@ -65,8 +65,8 @@
babystep.add_steps(axis, steps);
}
if (ui.should_draw()) {
const float spm = planner.steps_to_mm[axis];
MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(spm * babystep.accum));
const float mps = planner.mm_per_step[axis];
MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(mps * babystep.accum));
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1));
if (in_view) {
@ -81,7 +81,7 @@
lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL));
lcd_put_wchar(':');
#endif
lcd_put_u8str(BABYSTEP_TO_STR(spm * babystep.axis_total[BS_TOTAL_IND(axis)]));
lcd_put_u8str(BABYSTEP_TO_STR(mps * babystep.axis_total[BS_TOTAL_IND(axis)]));
}
#endif
}

View File

@ -667,7 +667,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z;
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
const float bsDiff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment,
new_probe_offset = probe.offset.z + bsDiff,
new_offs = TERN(BABYSTEP_HOTEND_Z_OFFSET
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff

View File

@ -652,7 +652,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z;
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
const float bsDiff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment,
new_probe_offset = probe.offset.z + bsDiff,
new_offs = TERN(BABYSTEP_HOTEND_Z_OFFSET
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff

View File

@ -654,7 +654,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z;
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
const float bsDiff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment,
new_probe_offset = probe.offset.z + bsDiff,
new_offs = TERN(BABYSTEP_HOTEND_Z_OFFSET
, do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff