🎨 Prefer axis element over index

This commit is contained in:
Scott Lahteine
2022-11-11 16:09:26 -06:00
parent 4d913fbf33
commit d123ea7346
6 changed files with 33 additions and 33 deletions

View File

@@ -113,7 +113,7 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) {
void BaseMoveAxisScreen::raiseZtoTop() {
constexpr xyze_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M;
setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate[Z_AXIS]);
setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z);
}
float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {

View File

@@ -74,16 +74,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_jerk_settings() {
scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle);
dtostrf(planner.max_jerk[X_AXIS], 1, 1, public_buf_l);
dtostrf(planner.max_jerk.x, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l);
dtostrf(planner.max_jerk[Y_AXIS], 1, 1, public_buf_l);
dtostrf(planner.max_jerk.y, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l);
dtostrf(planner.max_jerk[Z_AXIS], 1, 1, public_buf_l);
dtostrf(planner.max_jerk.z, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l);
dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_l);
dtostrf(planner.max_jerk.e, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_JERK_RETURN, true);

View File

@@ -119,22 +119,22 @@ static void disp_key_value() {
case XJerk:
#if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk[X_AXIS], 1, 1, public_buf_m);
dtostrf(planner.max_jerk.x, 1, 1, public_buf_m);
#endif
break;
case YJerk:
#if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk[Y_AXIS], 1, 1, public_buf_m);
dtostrf(planner.max_jerk.y, 1, 1, public_buf_m);
#endif
break;
case ZJerk:
#if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk[Z_AXIS], 1, 1, public_buf_m);
dtostrf(planner.max_jerk.z, 1, 1, public_buf_m);
#endif
break;
case EJerk:
#if HAS_CLASSIC_JERK
dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_m);
dtostrf(planner.max_jerk.e, 1, 1, public_buf_m);
#endif
break;
@@ -307,10 +307,10 @@ static void set_value_confirm() {
case ZMaxFeedRate: planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value); break;
case E0MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value); break;
case E1MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value); break;
case XJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[X_AXIS] = atof(key_value)); break;
case YJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Y_AXIS] = atof(key_value)); break;
case ZJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Z_AXIS] = atof(key_value)); break;
case EJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[E_AXIS] = atof(key_value)); break;
case XJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.x = atof(key_value)); break;
case YJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.y = atof(key_value)); break;
case ZJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.z = atof(key_value)); break;
case EJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk.e = atof(key_value)); break;
case Xstep: planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Ystep: planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Zstep: planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value); planner.refresh_positioning(); break;