Reduced string storage using tokens (#15593)
This commit is contained in:
@ -65,7 +65,7 @@
|
||||
}
|
||||
if (ui.should_draw()) {
|
||||
const float spm = planner.steps_to_mm[axis];
|
||||
MenuEditItemBase::edit_screen(msg, ftostr54sign(spm * babystep.accum));
|
||||
MenuEditItemBase::draw_edit_screen(msg, ftostr54sign(spm * babystep.accum));
|
||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
const bool in_view = (true
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
@ -128,22 +128,9 @@ void menu_tune() {
|
||||
#if HOTENDS == 1
|
||||
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); });
|
||||
#elif HOTENDS > 1
|
||||
#define EDIT_NOZZLE(N) EDIT_ITEM_FAST(int3, MSG_NOZZLE_##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(N); })
|
||||
EDIT_NOZZLE(0);
|
||||
EDIT_NOZZLE(1);
|
||||
#if HOTENDS > 2
|
||||
EDIT_NOZZLE(2);
|
||||
#if HOTENDS > 3
|
||||
EDIT_NOZZLE(3);
|
||||
#if HOTENDS > 4
|
||||
EDIT_NOZZLE(4);
|
||||
#if HOTENDS > 5
|
||||
EDIT_NOZZLE(5);
|
||||
#endif // HOTENDS > 5
|
||||
#endif // HOTENDS > 4
|
||||
#endif // HOTENDS > 3
|
||||
#endif // HOTENDS > 2
|
||||
#endif // HOTENDS > 1
|
||||
#define EDIT_NOZZLE(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); })
|
||||
HOTEND_LOOP() EDIT_NOZZLE(e);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SINGLENOZZLE)
|
||||
EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15);
|
||||
@ -162,23 +149,23 @@ void menu_tune() {
|
||||
#if FAN_COUNT > 0
|
||||
#if HAS_FAN0
|
||||
editable.uint8 = thermalManager.fan_speed[0];
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
editable.uint8 = thermalManager.fan_speed[1];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_2, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_2, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
editable.uint8 = thermalManager.fan_speed[2];
|
||||
EDIT_ITEM_FAST(percent, MSG_FAN_SPEED_3, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST(percent, MSG_EXTRA_FAN_SPEED_3, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#endif // FAN_COUNT > 0
|
||||
@ -191,22 +178,9 @@ void menu_tune() {
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, []{ planner.refresh_e_factor(0); });
|
||||
#elif EXTRUDERS
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
|
||||
#define EDIT_FLOW(N) EDIT_ITEM(int3, MSG_FLOW_##N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(N); })
|
||||
EDIT_FLOW(0);
|
||||
EDIT_FLOW(1);
|
||||
#if EXTRUDERS > 2
|
||||
EDIT_FLOW(2);
|
||||
#if EXTRUDERS > 3
|
||||
EDIT_FLOW(3);
|
||||
#if EXTRUDERS > 4
|
||||
EDIT_FLOW(4);
|
||||
#if EXTRUDERS > 5
|
||||
EDIT_FLOW(5);
|
||||
#endif // EXTRUDERS > 5
|
||||
#endif // EXTRUDERS > 4
|
||||
#endif // EXTRUDERS > 3
|
||||
#endif // EXTRUDERS > 2
|
||||
#endif // EXTRUDERS
|
||||
#define EDIT_FLOW(N) EDIT_ITEM_N(int3, N, MSG_FLOW_N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); })
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FLOW(n);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Babystep X:
|
||||
|
Reference in New Issue
Block a user