|
@@ -120,7 +120,7 @@
|
120
|
120
|
// Encoder knob or keypad buttons adjust the Z position
|
121
|
121
|
//
|
122
|
122
|
if (encoderPosition) {
|
123
|
|
- const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP);
|
|
123
|
+ const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MESH_EDIT_Z_STEP);
|
124
|
124
|
line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f));
|
125
|
125
|
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
126
|
126
|
encoderPosition = 0;
|
|
@@ -199,6 +199,25 @@
|
199
|
199
|
|
200
|
200
|
#endif // PROBE_MANUALLY || MESH_BED_LEVELING
|
201
|
201
|
|
|
202
|
+#if ENABLED(MESH_EDIT_MENU)
|
|
203
|
+
|
|
204
|
+ inline void refresh_planner() {
|
|
205
|
+ set_current_from_steppers_for_axis(ALL_AXES);
|
|
206
|
+ sync_plan_position();
|
|
207
|
+ }
|
|
208
|
+
|
|
209
|
+ void menu_mbl_edit_mesh() {
|
|
210
|
+ static uint8_t xind, yind; // =0
|
|
211
|
+ START_MENU();
|
|
212
|
+ MENU_BACK(MSG_BED_LEVELING);
|
|
213
|
+ MENU_ITEM_EDIT(int8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1);
|
|
214
|
+ MENU_ITEM_EDIT(int8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1);
|
|
215
|
+ MENU_ITEM_EDIT_CALLBACK(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner);
|
|
216
|
+ END_MENU();
|
|
217
|
+ }
|
|
218
|
+
|
|
219
|
+#endif // MESH_EDIT_MENU
|
|
220
|
+
|
202
|
221
|
/**
|
203
|
222
|
* Step 1: Bed Level entry-point
|
204
|
223
|
*
|
|
@@ -233,6 +252,10 @@ void menu_bed_leveling() {
|
233
|
252
|
MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29"));
|
234
|
253
|
#endif
|
235
|
254
|
|
|
255
|
+ #if ENABLED(MESH_EDIT_MENU)
|
|
256
|
+ MENU_ITEM(submenu, MSG_EDIT_MESH, menu_mbl_edit_mesh);
|
|
257
|
+ #endif
|
|
258
|
+
|
236
|
259
|
// Homed and leveling is valid? Then leveling can be toggled.
|
237
|
260
|
if (is_homed && leveling_is_valid()) {
|
238
|
261
|
bool new_level_state = planner.leveling_active;
|
|
@@ -245,7 +268,7 @@ void menu_bed_leveling() {
|
245
|
268
|
#endif
|
246
|
269
|
|
247
|
270
|
//
|
248
|
|
- // MBL Z Offset
|
|
271
|
+ // Mesh Bed Leveling Z-Offset
|
249
|
272
|
//
|
250
|
273
|
#if ENABLED(MESH_BED_LEVELING)
|
251
|
274
|
MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
|