🔧 Configurable FR/Flow edit ranges (#26446)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Vovodroid 2023-11-24 21:03:06 +02:00 committed by GitHub
parent fd3de02a37
commit bd872a7a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 577 additions and 565 deletions

View file

@ -1254,7 +1254,7 @@
*/
//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>.
#ifdef XY_FREQUENCY_LIMIT
#define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G<min%>.
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 G<min%>.
#endif
//
@ -1625,6 +1625,15 @@
#endif // HAS_DISPLAY
#if HAS_FEEDRATE_EDIT
#define SPEED_EDIT_MIN 10 // (%) Feedrate percentage edit range minimum
#define SPEED_EDIT_MAX 999 // (%) Feedrate percentage edit range maximum
#endif
#if HAS_FLOW_EDIT
#define FLOW_EDIT_MIN 10 // (%) Flow percentage edit range minimum
#define FLOW_EDIT_MAX 999 // (%) Flow percentage edit range maximum
#endif
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
//#define SET_PROGRESS_MANUALLY
#if ENABLED(SET_PROGRESS_MANUALLY)

File diff suppressed because it is too large Load diff

View file

@ -97,10 +97,6 @@
#define MENU_CHAR_LIMIT 24
#define STATUS_Y 354
// Print speed limit
#define MIN_PRINT_SPEED 10
#define MAX_PRINT_SPEED 999
#define FEEDRATE_E (60)
// Minimum unit (0.1) : multiple (10)
@ -1559,7 +1555,7 @@ void hmiPrintSpeed() {
return;
}
// printSpeed limit
LIMIT(hmiValues.printSpeed, MIN_PRINT_SPEED, MAX_PRINT_SPEED);
LIMIT(hmiValues.printSpeed, SPEED_EDIT_MIN, SPEED_EDIT_MAX);
// printSpeed value
drawEditInteger3(select_tune.now + MROWS - index_tune, hmiValues.printSpeed, true);
}

View file

@ -135,16 +135,14 @@
#define PAUSE_HEAT
// Print speed limit
#define MIN_PRINT_SPEED 10
#define MAX_PRINT_SPEED 999
// Print flow limit
#define MIN_PRINT_FLOW 10
#define MAX_PRINT_FLOW 299
// Load and Unload limits
#define MAX_LOAD_UNLOAD 500
#ifndef EXTRUDE_MAXLENGTH
#ifdef FILAMENT_CHANGE_UNLOAD_LENGTH
#define EXTRUDE_MAXLENGTH (FILAMENT_CHANGE_UNLOAD_LENGTH + 10)
#else
#define EXTRUDE_MAXLENGTH 500
#endif
#endif
// Juntion deviation limits
#define MIN_JD_MM 0.001
@ -2254,8 +2252,8 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
void setFilLoad() { setPFloatOnClick(0, MAX_LOAD_UNLOAD, UNITFDIGITS); }
void setFilUnload() { setPFloatOnClick(0, MAX_LOAD_UNLOAD, UNITFDIGITS); }
void setFilLoad() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); }
void setFilUnload() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); }
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
@ -2263,7 +2261,7 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
void setExtMinT() { setPIntOnClick(MIN_ETEMP, MAX_ETEMP, applyExtMinT); }
#endif
void setSpeed() { setPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
void setSpeed() { setPIntOnClick(SPEED_EDIT_MIN, SPEED_EDIT_MAX); }
#if HAS_HOTEND
void applyHotendTemp() { thermalManager.setTargetHotend(menuData.value, 0); }
@ -2308,7 +2306,7 @@ void setSpeed() { setPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
#endif // ADVANCED_PAUSE_FEATURE
void setFlow() { setPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, []{ planner.refresh_e_factor(0); }); }
void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refresh_e_factor(0); }); }
// Bed Tramming

View file

@ -130,7 +130,7 @@ void process_lcd_c_command(const char *command) {
case 'C': // Cope with both V1 early rev and later LCDs.
case 'S':
feedrate_percentage = target_val * 10;
LIMIT(feedrate_percentage, 10, 999);
LIMIT(feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX);
break;
case 'T':

View file

@ -695,7 +695,7 @@ void MarlinUI::init() {
else if ((old_frm < 100 && new_frm > 100) || (old_frm > 100 && new_frm < 100))
new_frm = 100;
LIMIT(new_frm, 10, 999);
LIMIT(new_frm, SPEED_EDIT_MIN, SPEED_EDIT_MAX);
if (old_frm != new_frm) {
feedrate_percentage = new_frm;

View file

@ -264,9 +264,9 @@ class MenuItem_bool : public MenuEditItemBase {
* MenuItem_function::action(flabel, lcd_sdcard_pause)
* MenuItem_function::draw(sel, row, flabel, lcd_sdcard_pause)
*
* EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
* MenuItem_int3::action(flabel, &feedrate_percentage, 10, 999)
* MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, 10, 999)
* EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX)
* MenuItem_int3::action(flabel, &feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX)
* MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX)
*/
#if ENABLED(ENCODER_RATE_MULTIPLIER)

View file

@ -114,7 +114,7 @@ void menu_tune() {
//
// Speed:
//
EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999);
EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX);
//
// Manual bed leveling, Bed Z:
@ -198,11 +198,11 @@ void menu_tune() {
// Flow:
//
#if HAS_EXTRUDERS
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refresh_e_factor(active_extruder); });
// Flow En:
#if HAS_MULTI_EXTRUDER
EXTRUDER_LOOP()
EDIT_ITEM_N(int3, e, MSG_FLOW_N, &planner.flow_percentage[e], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
EDIT_ITEM_N(int3, e, MSG_FLOW_N, &planner.flow_percentage[e], FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
#endif
#endif

View file

@ -220,7 +220,7 @@ void Touch::touch(touch_control_t *control) {
break;
case FEEDRATE:
ui.clear_lcd();
MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999);
MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, SPEED_EDIT_MIN, SPEED_EDIT_MAX);
break;
#if HAS_EXTRUDERS
@ -228,9 +228,9 @@ void Touch::touch(touch_control_t *control) {
ui.clear_lcd();
MenuItemBase::itemIndex = control->data;
#if EXTRUDERS == 1
MenuItem_int3::action(GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
MenuItem_int3::action(GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
#else
MenuItem_int3::action(GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
MenuItem_int3::action(GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
#endif
break;
#endif