mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
🎨 Prefer axis element over index
This commit is contained in:
parent
7002e72f1c
commit
379d388b07
@ -3395,11 +3395,11 @@ void Draw_Max_Accel_Menu() {
|
||||
|
||||
Draw_Back_First();
|
||||
LOOP_L_N(i, 3 + ENABLED(HAS_HOTEND)) Draw_Menu_Line(i + 1, ICON_MaxSpeedJerkX + i);
|
||||
Draw_Edit_Float3(1, planner.max_jerk[X_AXIS] * MINUNITMULT);
|
||||
Draw_Edit_Float3(2, planner.max_jerk[Y_AXIS] * MINUNITMULT);
|
||||
Draw_Edit_Float3(3, planner.max_jerk[Z_AXIS] * MINUNITMULT);
|
||||
Draw_Edit_Float3(1, planner.max_jerk.x * MINUNITMULT);
|
||||
Draw_Edit_Float3(2, planner.max_jerk.y * MINUNITMULT);
|
||||
Draw_Edit_Float3(3, planner.max_jerk.z * MINUNITMULT);
|
||||
#if HAS_HOTEND
|
||||
Draw_Edit_Float3(4, planner.max_jerk[E_AXIS] * MINUNITMULT);
|
||||
Draw_Edit_Float3(4, planner.max_jerk.e * MINUNITMULT);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -2465,35 +2465,35 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
|
||||
case JERK_X:
|
||||
if (draw) {
|
||||
Draw_Menu_Item(row, ICON_MaxSpeedJerkX, F("X Axis"));
|
||||
Draw_Float(planner.max_jerk[X_AXIS], row, false, 10);
|
||||
Draw_Float(planner.max_jerk.x, row, false, 10);
|
||||
}
|
||||
else
|
||||
Modify_Value(planner.max_jerk[X_AXIS], 0, default_max_jerk[X_AXIS] * 2, 10);
|
||||
Modify_Value(planner.max_jerk.x, 0, default_max_jerk[X_AXIS] * 2, 10);
|
||||
break;
|
||||
case JERK_Y:
|
||||
if (draw) {
|
||||
Draw_Menu_Item(row, ICON_MaxSpeedJerkY, F("Y Axis"));
|
||||
Draw_Float(planner.max_jerk[Y_AXIS], row, false, 10);
|
||||
Draw_Float(planner.max_jerk.y, row, false, 10);
|
||||
}
|
||||
else
|
||||
Modify_Value(planner.max_jerk[Y_AXIS], 0, default_max_jerk[Y_AXIS] * 2, 10);
|
||||
Modify_Value(planner.max_jerk.y, 0, default_max_jerk[Y_AXIS] * 2, 10);
|
||||
break;
|
||||
case JERK_Z:
|
||||
if (draw) {
|
||||
Draw_Menu_Item(row, ICON_MaxSpeedJerkZ, F("Z Axis"));
|
||||
Draw_Float(planner.max_jerk[Z_AXIS], row, false, 10);
|
||||
Draw_Float(planner.max_jerk.z, row, false, 10);
|
||||
}
|
||||
else
|
||||
Modify_Value(planner.max_jerk[Z_AXIS], 0, default_max_jerk[Z_AXIS] * 2, 10);
|
||||
Modify_Value(planner.max_jerk.z, 0, default_max_jerk[Z_AXIS] * 2, 10);
|
||||
break;
|
||||
#if HAS_HOTEND
|
||||
case JERK_E:
|
||||
if (draw) {
|
||||
Draw_Menu_Item(row, ICON_MaxSpeedJerkE, F("Extruder"));
|
||||
Draw_Float(planner.max_jerk[E_AXIS], row, false, 10);
|
||||
Draw_Float(planner.max_jerk.e, row, false, 10);
|
||||
}
|
||||
else
|
||||
Modify_Value(planner.max_jerk[E_AXIS], 0, default_max_jerk[E_AXIS] * 2, 10);
|
||||
Modify_Value(planner.max_jerk.e, 0, default_max_jerk[E_AXIS] * 2, 10);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
@ -2654,11 +2654,11 @@ void SetMaxAccelZ() { HMI_value.axis = Z_AXIS, SetIntOnClick(MIN_MAXACCELERATION
|
||||
|
||||
#if HAS_CLASSIC_JERK
|
||||
void ApplyMaxJerk() { planner.set_max_jerk(HMI_value.axis, MenuData.Value / MINUNITMULT); }
|
||||
void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[X_AXIS], UNITFDIGITS, planner.max_jerk[X_AXIS], ApplyMaxJerk); }
|
||||
void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Y_AXIS], UNITFDIGITS, planner.max_jerk[Y_AXIS], ApplyMaxJerk); }
|
||||
void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Z_AXIS], UNITFDIGITS, planner.max_jerk[Z_AXIS], ApplyMaxJerk); }
|
||||
void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[X_AXIS], UNITFDIGITS, planner.max_jerk.x, ApplyMaxJerk); }
|
||||
void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Y_AXIS], UNITFDIGITS, planner.max_jerk.y, ApplyMaxJerk); }
|
||||
void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Z_AXIS], UNITFDIGITS, planner.max_jerk.z, ApplyMaxJerk); }
|
||||
#if HAS_HOTEND
|
||||
void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[E_AXIS], UNITFDIGITS, planner.max_jerk[E_AXIS], ApplyMaxJerk); }
|
||||
void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[E_AXIS], UNITFDIGITS, planner.max_jerk.e, ApplyMaxJerk); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -3641,11 +3641,11 @@ void Draw_MaxAccel_Menu() {
|
||||
SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK));
|
||||
MenuItemsPrepare(5);
|
||||
BACK_ITEM(Draw_Motion_Menu);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk.x);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk.y);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk.z);
|
||||
#if HAS_HOTEND
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]);
|
||||
EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk.e);
|
||||
#endif
|
||||
}
|
||||
CurrentMenu->draw();
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user