Append units to feedrate variables
This commit is contained in:
@@ -104,7 +104,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
||||
#if HAS_POWER_SWITCH
|
||||
extern bool powersupply;
|
||||
#endif
|
||||
const float manual_feedrate[] = MANUAL_FEEDRATE;
|
||||
const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
|
||||
static void lcd_main_menu();
|
||||
static void lcd_tune_menu();
|
||||
static void lcd_prepare_menu();
|
||||
@@ -254,10 +254,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
||||
* lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
|
||||
* menu_action_function(lcd_sdcard_pause)
|
||||
*
|
||||
* MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
|
||||
* MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
|
||||
* lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
|
||||
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
|
||||
* MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
||||
* MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
* lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
*
|
||||
*/
|
||||
#define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
|
||||
@@ -523,29 +523,29 @@ static void lcd_status_screen() {
|
||||
}
|
||||
|
||||
#if ENABLED(ULTIPANEL_FEEDMULTIPLY)
|
||||
int new_frm = feedrate_multiplier + (int32_t)encoderPosition;
|
||||
int new_frm = feedrate_percentage + (int32_t)encoderPosition;
|
||||
// Dead zone at 100% feedrate
|
||||
if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) {
|
||||
feedrate_multiplier = 100;
|
||||
if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) {
|
||||
feedrate_percentage = 100;
|
||||
encoderPosition = 0;
|
||||
}
|
||||
else if (feedrate_multiplier == 100) {
|
||||
else if (feedrate_percentage == 100) {
|
||||
if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) {
|
||||
feedrate_multiplier += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
|
||||
feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
|
||||
encoderPosition = 0;
|
||||
}
|
||||
else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) {
|
||||
feedrate_multiplier += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
|
||||
feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
|
||||
encoderPosition = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
feedrate_multiplier = new_frm;
|
||||
feedrate_percentage = new_frm;
|
||||
encoderPosition = 0;
|
||||
}
|
||||
#endif // ULTIPANEL_FEEDMULTIPLY
|
||||
|
||||
feedrate_multiplier = constrain(feedrate_multiplier, 10, 999);
|
||||
feedrate_percentage = constrain(feedrate_percentage, 10, 999);
|
||||
|
||||
#endif //ULTIPANEL
|
||||
}
|
||||
@@ -573,9 +573,9 @@ void kill_screen(const char* lcd_msg) {
|
||||
inline void line_to_current(AxisEnum axis) {
|
||||
#if ENABLED(DELTA)
|
||||
calculate_delta(current_position);
|
||||
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
|
||||
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
|
||||
#else // !DELTA
|
||||
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
|
||||
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
|
||||
#endif // !DELTA
|
||||
}
|
||||
|
||||
@@ -757,7 +757,7 @@ void kill_screen(const char* lcd_msg) {
|
||||
//
|
||||
// Speed:
|
||||
//
|
||||
MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
|
||||
MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999);
|
||||
|
||||
// Manual bed leveling, Bed Z:
|
||||
#if ENABLED(MANUAL_BED_LEVELING)
|
||||
@@ -1020,7 +1020,7 @@ void kill_screen(const char* lcd_msg) {
|
||||
line_to_current(Z_AXIS);
|
||||
current_position[X_AXIS] = x + home_offset[X_AXIS];
|
||||
current_position[Y_AXIS] = y + home_offset[Y_AXIS];
|
||||
line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
|
||||
line_to_current(manual_feedrate_mm_m[X_AXIS] <= manual_feedrate_mm_m[Y_AXIS] ? X_AXIS : Y_AXIS);
|
||||
#if MIN_Z_HEIGHT_FOR_HOMING > 0
|
||||
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match?
|
||||
line_to_current(Z_AXIS);
|
||||
@@ -1310,9 +1310,9 @@ void kill_screen(const char* lcd_msg) {
|
||||
if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
|
||||
#if ENABLED(DELTA)
|
||||
calculate_delta(current_position);
|
||||
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index);
|
||||
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
|
||||
#else
|
||||
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index);
|
||||
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
|
||||
#endif
|
||||
manual_move_axis = (int8_t)NO_AXIS;
|
||||
}
|
||||
@@ -1800,12 +1800,12 @@ void kill_screen(const char* lcd_msg) {
|
||||
MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
|
||||
#endif
|
||||
MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999);
|
||||
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
|
||||
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
|
||||
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
|
||||
@@ -1905,7 +1905,7 @@ void kill_screen(const char* lcd_msg) {
|
||||
#if EXTRUDERS > 1
|
||||
MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
|
||||
#endif
|
||||
MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
|
||||
MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate_mm_s, 1, 999);
|
||||
END_MENU();
|
||||
}
|
||||
#endif // FWRETRACT
|
||||
@@ -2257,15 +2257,15 @@ void kill_screen(const char* lcd_msg) {
|
||||
* static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callback); // edit int with callback
|
||||
*
|
||||
* You can then use one of the menu macros to present the edit interface:
|
||||
* MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
|
||||
* MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
||||
*
|
||||
* This expands into a more primitive menu item:
|
||||
* MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
|
||||
* MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
*
|
||||
*
|
||||
* Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
|
||||
*
|
||||
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
|
||||
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
||||
*/
|
||||
#define menu_edit_type(_type, _name, _strFunc, scale) \
|
||||
bool _menu_edit_ ## _name () { \
|
||||
|
Reference in New Issue
Block a user