Browse Source

✨ Z Offset Wizard for TFT_LVGL_UI (English) (#23489)

A. Herlas 2 years ago
parent
commit
cc87695ae7
No account linked to committer's email address

+ 27
- 28
Marlin/Configuration_adv.h View File

@@ -1280,37 +1280,36 @@
1280 1280
   #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
1281 1281
 #endif
1282 1282
 
1283
+#if HAS_BED_PROBE && EITHER(HAS_LCD_MENU, HAS_TFT_LVGL_UI)
1284
+  //#define PROBE_OFFSET_WIZARD       // Add a Probe Z Offset calibration option to the LCD menu
1285
+  #if ENABLED(PROBE_OFFSET_WIZARD)
1286
+    /**
1287
+     * Enable to init the Probe Z-Offset when starting the Wizard.
1288
+     * Use a height slightly above the estimated nozzle-to-probe Z offset.
1289
+     * For example, with an offset of -5, consider a starting height of -4.
1290
+     */
1291
+    //#define PROBE_OFFSET_WIZARD_START_Z -4.0
1292
+
1293
+    // Set a convenient position to do the calibration (probing point and nozzle/bed-distance)
1294
+    //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER }
1295
+  #endif
1296
+#endif
1297
+
1283 1298
 #if HAS_LCD_MENU
1284 1299
 
1285 1300
   // Add Probe Z Offset calibration to the Z Probe Offsets menu
1286
-  #if HAS_BED_PROBE
1287
-    //#define PROBE_OFFSET_WIZARD
1288
-    #if ENABLED(PROBE_OFFSET_WIZARD)
1289
-      //
1290
-      // Enable to init the Probe Z-Offset when starting the Wizard.
1291
-      // Use a height slightly above the estimated nozzle-to-probe Z offset.
1292
-      // For example, with an offset of -5, consider a starting height of -4.
1293
-      //
1294
-      //#define PROBE_OFFSET_WIZARD_START_Z -4.0
1295
-
1296
-      // Set a convenient position to do the calibration (probing point and nozzle/bed-distance)
1297
-      //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER }
1298
-    #endif
1299
-
1300
-    #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
1301
-      // Add a calibration procedure in the Probe Offsets menu
1302
-      // to compensate for twist in the X-axis.
1303
-      //#define X_AXIS_TWIST_COMPENSATION
1304
-      #if ENABLED(X_AXIS_TWIST_COMPENSATION)
1305
-        /**
1306
-         * Enable to init the Probe Z-Offset when starting the Wizard.
1307
-         * Use a height slightly above the estimated nozzle-to-probe Z offset.
1308
-         * For example, with an offset of -5, consider a starting height of -4.
1309
-         */
1310
-        #define XATC_START_Z 0.0
1311
-        #define XATC_MAX_POINTS 3             // Number of points to probe in the wizard
1312
-        #define XATC_Y_POSITION Y_CENTER      // (mm) Y position to probe
1313
-      #endif
1301
+  #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR)
1302
+    // Add calibration in the Probe Offsets menu to compensate for X-axis twist.
1303
+    //#define X_AXIS_TWIST_COMPENSATION
1304
+    #if ENABLED(X_AXIS_TWIST_COMPENSATION)
1305
+      /**
1306
+       * Enable to init the Probe Z-Offset when starting the Wizard.
1307
+       * Use a height slightly above the estimated nozzle-to-probe Z offset.
1308
+       * For example, with an offset of -5, consider a starting height of -4.
1309
+       */
1310
+      #define XATC_START_Z 0.0
1311
+      #define XATC_MAX_POINTS 3             // Number of points to probe in the wizard
1312
+      #define XATC_Y_POSITION Y_CENTER      // (mm) Y position to probe
1314 1313
     #endif
1315 1314
   #endif
1316 1315
 

+ 10
- 1
Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp View File

@@ -36,7 +36,8 @@ enum {
36 36
   ID_LEVEL_RETURN = 1,
37 37
   ID_LEVEL_POSITION,
38 38
   ID_LEVEL_COMMAND,
39
-  ID_LEVEL_ZOFFSET
39
+  ID_LEVEL_ZOFFSET,
40
+  ID_Z_OFFSET_WIZARD
40 41
 };
41 42
 
42 43
 static void event_handler(lv_obj_t *obj, lv_event_t event) {
@@ -57,6 +58,11 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
57 58
       case ID_LEVEL_ZOFFSET:
58 59
         lv_draw_auto_level_offset_settings();
59 60
         break;
61
+      #if ENABLED(PROBE_OFFSET_WIZARD)
62
+        case ID_Z_OFFSET_WIZARD:
63
+          lv_draw_z_offset_wizard();
64
+          break;
65
+      #endif
60 66
     #endif
61 67
   }
62 68
 }
@@ -67,6 +73,9 @@ void lv_draw_level_settings() {
67 73
   lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1);
68 74
   #if HAS_BED_PROBE
69 75
     lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2);
76
+    #if ENABLED(PROBE_OFFSET_WIZARD)
77
+      lv_screen_menu_item(scr, machine_menu.LevelingZoffsetWizard, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3);
78
+    #endif
70 79
   #endif
71 80
   lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true);
72 81
 }

+ 14
- 0
Marlin/src/lcd/extui/mks_ui/draw_ui.cpp View File

@@ -456,6 +456,10 @@ char *getDispText(int index) {
456 456
       }
457 457
       break;
458 458
     case MOVE_MOTOR_UI:       strcpy(public_buf_l, move_menu.title); break;
459
+
460
+    #if ENABLED(PROBE_OFFSET_WIZARD)
461
+      case Z_OFFSET_WIZARD_UI: break;
462
+    #endif
459 463
     case OPERATE_UI:
460 464
       switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) {
461 465
         IF_DISABLED(TFT35, case OPERATE_UI: case PAUSE_UI:)
@@ -785,6 +789,10 @@ void GUI_RefreshPage() {
785 789
 
786 790
     case MOVE_MOTOR_UI: break;
787 791
 
792
+    #if ENABLED(PROBE_OFFSET_WIZARD)
793
+      case Z_OFFSET_WIZARD_UI: break;
794
+    #endif
795
+
788 796
     #if ENABLED(MKS_WIFI_MODULE)
789 797
       case WIFI_UI:
790 798
         if (temps_update_flag) {
@@ -885,6 +893,9 @@ void clear_cur_ui() {
885 893
     case PRINT_FILE_UI:               lv_clear_print_file(); break;
886 894
     case PRINTING_UI:                 lv_clear_printing(); break;
887 895
     case MOVE_MOTOR_UI:               lv_clear_move_motor(); break;
896
+    #if ENABLED(PROBE_OFFSET_WIZARD)
897
+      case Z_OFFSET_WIZARD_UI:        lv_clear_z_offset_wizard(); break;
898
+    #endif
888 899
     case OPERATE_UI:                  lv_clear_operation(); break;
889 900
     case PAUSE_UI:                    break;
890 901
     case EXTRUSION_UI:                lv_clear_extrusion(); break;
@@ -993,6 +1004,9 @@ void draw_return_ui() {
993 1004
                                         break;
994 1005
 
995 1006
       case MOVE_MOTOR_UI:               lv_draw_move_motor(); break;
1007
+      #if ENABLED(PROBE_OFFSET_WIZARD)
1008
+        case Z_OFFSET_WIZARD_UI:        lv_draw_z_offset_wizard(); break;
1009
+      #endif
996 1010
       case OPERATE_UI:                  lv_draw_operation(); break;
997 1011
       case PAUSE_UI:                    break;
998 1012
       case EXTRUSION_UI:                lv_draw_extrusion(); break;

+ 2
- 0
Marlin/src/lcd/extui/mks_ui/draw_ui.h View File

@@ -69,6 +69,7 @@
69 69
 #include "draw_max_feedrate_settings.h"
70 70
 #include "draw_tmc_step_mode_settings.h"
71 71
 #include "draw_level_settings.h"
72
+#include "draw_z_offset_wizard.h"
72 73
 #include "draw_tramming_pos_settings.h"
73 74
 #include "draw_auto_level_offset_settings.h"
74 75
 #include "draw_filament_change.h"
@@ -266,6 +267,7 @@ typedef enum {
266 267
   PRINT_FILE_UI,
267 268
   PRINTING_UI,
268 269
   MOVE_MOTOR_UI,
270
+  Z_OFFSET_WIZARD_UI,
269 271
   OPERATE_UI,
270 272
   PAUSE_UI,
271 273
   EXTRUSION_UI,

+ 228
- 0
Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp View File

@@ -0,0 +1,228 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../../inc/MarlinConfigPre.h"
24
+
25
+#if BOTH(HAS_TFT_LVGL_UI, PROBE_OFFSET_WIZARD)
26
+
27
+#include "draw_ui.h"
28
+#include <lv_conf.h>
29
+
30
+#include "../../../gcode/queue.h"
31
+#include "../../../module/motion.h"
32
+
33
+#include "../../../module/planner.h"
34
+#include "../../../inc/MarlinConfig.h"
35
+#include "../../../module/probe.h"
36
+
37
+#if HAS_LEVELING
38
+  #include "../../../feature/bedlevel/bedlevel.h"
39
+  bool leveling_was_active;
40
+#endif
41
+
42
+extern lv_group_t *g;
43
+static lv_obj_t *scr;
44
+
45
+static lv_obj_t *labelV, *buttonV, *labelP;
46
+static lv_obj_t *labelP_z_offset_ref;
47
+static lv_task_t *updatePosTask;
48
+static char cur_label = 'Z';
49
+static float cur_pos = 0;
50
+static float cur_OffsetPos = 0;
51
+
52
+// Global storage
53
+float z_offset_backup, calculated_z_offset, z_offset_ref;
54
+
55
+enum {
56
+  ID_M_Z_P = 1,
57
+  ID_M_Z_N,
58
+  ID_M_STEP,
59
+  ID_M_SAVE,
60
+  ID_M_RETURN
61
+};
62
+
63
+void disp_cur_wizard_pos() {
64
+  char str_1[18];
65
+  sprintf_P(public_buf_l, PSTR("%c:%s mm"), cur_label, dtostrf(cur_pos, 1, 3, str_1));
66
+  if (labelP) lv_label_set_text(labelP, public_buf_l);
67
+
68
+  sprintf_P(public_buf_l, PSTR("%c Offset:%s mm"), cur_label, dtostrf(cur_OffsetPos, 1, 3, str_1));
69
+  if (labelP_z_offset_ref) lv_label_set_text(labelP_z_offset_ref, public_buf_l);
70
+}
71
+
72
+static void event_handler(lv_obj_t *obj, lv_event_t event) {
73
+  char str_1[16];
74
+  if (event != LV_EVENT_RELEASED) return;
75
+  //lv_clear_z_offset_wizard();
76
+  if (!queue.ring_buffer.full(3)) {
77
+    bool do_inject = true;
78
+    float dist = uiCfg.move_dist;
79
+    switch (obj->mks_obj_id) {
80
+      case ID_M_Z_N: dist *= -1; case ID_M_Z_P: cur_label = 'Z'; break;
81
+      default: do_inject = false;
82
+    }
83
+    if (do_inject) {
84
+      sprintf_P(public_buf_l, PSTR("G91\nG1 %c%s F%d\nG90"), cur_label, dtostrf(dist, 1, 3, str_1), uiCfg.moveSpeed);
85
+      queue.inject(public_buf_l);
86
+      //calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
87
+      disp_cur_wizard_pos();
88
+    }
89
+  }
90
+
91
+  switch (obj->mks_obj_id) {
92
+    case ID_M_STEP:
93
+      if (ABS((int)(10 * uiCfg.move_dist)) == 10)
94
+        uiCfg.move_dist = 0.025;
95
+      else if (ABS((int)(1000 * uiCfg.move_dist)) == 25)
96
+        uiCfg.move_dist = 0.1;
97
+      else
98
+        uiCfg.move_dist *= 10.0f;
99
+      disp_move_wizard_dist();
100
+      break;
101
+    case ID_M_SAVE:
102
+      current_position.z = z_offset_ref;  // Set Z to z_offset_ref, as we can expect it is at probe height
103
+      probe.offset.z = calculated_z_offset;
104
+      sync_plan_position();
105
+      // Raise Z as if it was homed
106
+      do_z_clearance(Z_POST_CLEARANCE);
107
+      watchdog_refresh();
108
+      draw_return_ui();
109
+      return;
110
+    case ID_M_RETURN:
111
+      probe.offset.z = z_offset_backup;
112
+      SET_SOFT_ENDSTOP_LOOSE(false);
113
+      TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
114
+      #if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
115
+        set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
116
+        queue.inject_P(PSTR("G28Z"));
117
+      #else // Otherwise do a Z clearance move like after Homing
118
+        do_z_clearance(Z_POST_CLEARANCE);
119
+      #endif
120
+      watchdog_refresh();
121
+      draw_return_ui();
122
+      return;
123
+  }
124
+  disp_cur_wizard_pos();
125
+}
126
+
127
+void refresh_wizard_pos(lv_task_t *) {
128
+  switch (cur_label) {
129
+    case 'Z':
130
+      cur_pos = current_position.z;
131
+      calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
132
+      cur_OffsetPos = calculated_z_offset;
133
+    break;
134
+    default: return;
135
+  }
136
+  disp_cur_wizard_pos();
137
+}
138
+
139
+void lv_draw_z_offset_wizard() {
140
+
141
+  set_all_unhomed();
142
+
143
+  // Store probe.offset.z for Case: Cancel
144
+  z_offset_backup = probe.offset.z;
145
+
146
+  #ifdef PROBE_OFFSET_WIZARD_START_Z
147
+    probe.offset.z = PROBE_OFFSET_WIZARD_START_Z;
148
+  #endif
149
+
150
+  // Store Bed-Leveling-State and disable
151
+  #if HAS_LEVELING
152
+    leveling_was_active = planner.leveling_active;
153
+    set_bed_leveling_enabled(leveling_was_active);
154
+  #endif
155
+
156
+  queue.inject_P(PSTR("G28"));
157
+
158
+  z_offset_ref = 0;             // Set Z Value for Wizard Position to 0
159
+  calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
160
+  cur_OffsetPos = calculated_z_offset;
161
+
162
+  scr = lv_screen_create(Z_OFFSET_WIZARD_UI, machine_menu.LevelingZoffsetTitle);
163
+
164
+  lv_obj_t *buttonXI = lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, INTERVAL_V, titleHeight, event_handler, ID_M_Z_P);
165
+  lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW);
166
+  lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N);
167
+
168
+  // button with image and label changed dynamically by disp_move_dist
169
+  buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP);
170
+  labelV = lv_label_create_empty(buttonV);
171
+  #if HAS_ROTARY_ENCODER
172
+    if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonV);
173
+  #endif
174
+
175
+  // save and back
176
+  lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_save, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_SAVE);
177
+  // cancel and back
178
+  lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN);
179
+
180
+  // We need to patch the title to leave some space on the right for displaying the status
181
+  lv_obj_t * z_offset_ref_title = lv_obj_get_child_back(scr, nullptr);
182
+  if (z_offset_ref_title != nullptr) lv_obj_set_width(z_offset_ref_title, (int)(TFT_WIDTH / 2) - 101);
183
+    labelP_z_offset_ref = lv_label_create(scr, (int)(TFT_WIDTH / 2) - 80, (int)(TFT_HEIGHT/2)-20, "Z Offset:0.0mm");
184
+
185
+  // We need to patch the Z Offset to leave some space in the middle for displaying the status
186
+  lv_obj_t * title= lv_obj_get_child_back(scr, nullptr);
187
+  if (title != nullptr) lv_obj_set_width(title, TFT_WIDTH - 101);
188
+  labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm");
189
+
190
+  if (labelP != nullptr)
191
+    updatePosTask = lv_task_create(refresh_wizard_pos, 300, LV_TASK_PRIO_LOWEST, 0);
192
+
193
+  disp_move_wizard_dist();
194
+  disp_cur_wizard_pos();
195
+}
196
+
197
+void disp_move_wizard_dist() {
198
+  if ((int)(1000 * uiCfg.move_dist) == 25)
199
+    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move0_1.bin");
200
+  else if ((int)(10 * uiCfg.move_dist) == 1)
201
+    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move1.bin");
202
+  else if ((int)(10 * uiCfg.move_dist) == 10)
203
+    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move10.bin");
204
+
205
+  if (gCfgItems.multiple_language) {
206
+    if ((int)(1000 * uiCfg.move_dist) == 25) {
207
+      lv_label_set_text(labelV, move_menu.step_0025mm);
208
+      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
209
+    }
210
+    else if ((int)(10 * uiCfg.move_dist) == 1) {
211
+      lv_label_set_text(labelV, move_menu.step_01mm);
212
+      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
213
+    }
214
+    else if ((int)(10 * uiCfg.move_dist) == 10) {
215
+      lv_label_set_text(labelV, move_menu.step_1mm);
216
+      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
217
+    }
218
+  }
219
+}
220
+
221
+void lv_clear_z_offset_wizard() {
222
+  #if HAS_ROTARY_ENCODER
223
+    if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
224
+  #endif
225
+  lv_obj_del(scr);
226
+}
227
+
228
+#endif // HAS_TFT_LVGL_UI && PROBE_OFFSET_WIZARD

+ 36
- 0
Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h View File

@@ -0,0 +1,36 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#ifdef __cplusplus
25
+  extern "C" { /* C-declarations for C++ */
26
+#endif
27
+
28
+void lv_draw_z_offset_wizard();
29
+void refresh_wizard_pos();
30
+void disp_cur_wizard_pos();
31
+void disp_move_wizard_dist();
32
+void lv_clear_z_offset_wizard();
33
+
34
+#ifdef __cplusplus
35
+  } /* C-declarations for C++ */
36
+#endif

+ 3
- 0
Marlin/src/lcd/extui/mks_ui/tft_Language_en.h View File

@@ -103,6 +103,8 @@
103 103
 #define LEVELING_AUTO_COMMAND_EN        "AutoLeveling command settings"
104 104
 #define LEVELING_AUTO_ZOFFSET_EN        "Nozzle-to-probe offsets settings"
105 105
 
106
+#define LEVELING_ZOFFSET_TITLE_EN       "Machine Settings>Z Offset Wizard"
107
+
106 108
 #define LEVELING_PARA_CONF_TITLE_EN     "leveling setting"
107 109
 #define AUTO_LEVELING_ENABLE_EN         "Enable auto leveling"
108 110
 #define BLTOUCH_LEVELING_ENABLE_EN      "Enable BLTouch"
@@ -293,6 +295,7 @@
293 295
 #define CLOSE_TEXT_EN           "Close"
294 296
 
295 297
 #define BACK_TEXT_EN            "Back"
298
+#define SAVE_TEXT_EN            "Save"
296 299
 
297 300
 #define TOOL_PREHEAT_EN         "Preheat"
298 301
 #define TOOL_EXTRUDE_EN         "Extrusion"

+ 9
- 5
Marlin/src/lcd/extui/mks_ui/tft_multi_language.cpp View File

@@ -578,6 +578,8 @@ void machine_setting_disp() {
578 578
     machine_menu.OutLength           = FILAMENT_OUT_LENGTH_EN;
579 579
     machine_menu.OutSpeed            = FILAMENT_OUT_SPEED_EN;
580 580
 
581
+    machine_menu.LevelingZoffsetTitle = LEVELING_ZOFFSET_TITLE_EN;
582
+
581 583
     machine_menu.LevelingParaConfTitle   = LEVELING_CONF_TITLE_EN;
582 584
     machine_menu.LevelingParaConf        = LEVELING_PARA_CONF_EN;
583 585
     machine_menu.TrammingPosConf         = TRAMMING_POS_EN;
@@ -767,11 +769,12 @@ void disp_language_init() {
767 769
   move_menu.z_add = AXIS_Z_ADD_TEXT;
768 770
   move_menu.z_dec = AXIS_Z_DEC_TEXT;
769 771
 
770
-  move_menu.step_001mm = TEXT_001MM;
771
-  move_menu.step_005mm = TEXT_005MM;
772
-  move_menu.step_01mm  = TEXT_01MM;
773
-  move_menu.step_1mm   = TEXT_1MM;
774
-  move_menu.step_10mm  = TEXT_10MM;
772
+  move_menu.step_001mm  = TEXT_001MM;
773
+  move_menu.step_0025mm = TEXT_0025MM;
774
+  move_menu.step_005mm  = TEXT_005MM;
775
+  move_menu.step_01mm   = TEXT_01MM;
776
+  move_menu.step_1mm    = TEXT_1MM;
777
+  move_menu.step_10mm   = TEXT_10MM;
775 778
 
776 779
   home_menu.home_x   = HOME_X_TEXT;
777 780
   home_menu.home_y   = HOME_Y_TEXT;
@@ -1346,6 +1349,7 @@ void disp_language_init() {
1346 1349
           case LANG_ENGLISH:
1347 1350
             common_menu.dialog_confirm_title  = TITLE_DIALOG_CONFIRM_EN;
1348 1351
             common_menu.text_back             = BACK_TEXT_EN;
1352
+            common_menu.text_save             = SAVE_TEXT_EN;
1349 1353
             common_menu.close_machine_tips    = DIALOG_CLOSE_MACHINE_EN;
1350 1354
             common_menu.unbind_printer_tips   = DIALOG_UNBIND_PRINTER_EN;
1351 1355
             common_menu.print_special_title   = PRINTING_OTHER_LANGUGE;

+ 5
- 0
Marlin/src/lcd/extui/mks_ui/tft_multi_language.h View File

@@ -101,6 +101,8 @@ typedef struct machine_common_disp {
101 101
   const char *OutLength;
102 102
   const char *OutSpeed;
103 103
 
104
+  const char *LevelingZoffsetTitle;
105
+
104 106
   const char *LevelingParaConfTitle;
105 107
   const char *LevelingParaConf;
106 108
   const char *TrammingPosConf;
@@ -294,6 +296,7 @@ extern machine_common_def machine_menu;
294 296
 
295 297
 typedef struct common_menu_disp {
296 298
   const char *text_back;
299
+  const char *text_save;
297 300
   const char *dialog_confirm_title;
298 301
   const char *close_machine_tips;
299 302
   const char *unbind_printer_tips;
@@ -355,6 +358,7 @@ typedef struct move_menu_disp {
355 358
   const char *z_add;
356 359
   const char *z_dec;
357 360
   const char *step_001mm;
361
+  const char *step_0025mm;
358 362
   const char *step_005mm;
359 363
   const char *step_01mm;
360 364
   const char *step_1mm;
@@ -777,6 +781,7 @@ extern eeprom_def eeprom_menu;
777 781
 #define AXIS_Z_ADD_TEXT     "Z+"
778 782
 #define AXIS_Z_DEC_TEXT     "Z-"
779 783
 #define TEXT_001MM          "0.01 mm"
784
+#define TEXT_0025MM         "0.025 mm"
780 785
 #define TEXT_005MM          "0.05 mm"
781 786
 #define TEXT_01MM           "0.1 mm"
782 787
 #define TEXT_1MM            "1 mm"

+ 1
- 9
Marlin/src/lcd/menu/menu_probe_offset.cpp View File

@@ -45,15 +45,7 @@ void _goto_manual_move_z(const_float_t);
45 45
 float z_offset_backup, calculated_z_offset, z_offset_ref;
46 46
 
47 47
 inline void z_clearance_move() {
48
-  do_z_clearance(
49
-    #ifdef Z_AFTER_HOMING
50
-      Z_AFTER_HOMING
51
-    #elif defined(Z_HOMING_HEIGHT)
52
-      Z_HOMING_HEIGHT
53
-    #else
54
-      10
55
-    #endif
56
-  );
48
+  do_z_clearance(Z_POST_CLEARANCE);
57 49
 }
58 50
 
59 51
 void set_offset_and_go_back(const_float_t z) {

+ 8
- 0
Marlin/src/module/probe.h View File

@@ -45,6 +45,14 @@
45 45
   #define PROBE_TRIGGERED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)
46 46
 #endif
47 47
 
48
+#ifdef Z_AFTER_HOMING
49
+   #define Z_POST_CLEARANCE Z_AFTER_HOMING
50
+#elif defined(Z_HOMING_HEIGHT)
51
+   #define Z_POST_CLEARANCE Z_HOMING_HEIGHT
52
+#else
53
+   #define Z_POST_CLEARANCE 10
54
+#endif
55
+
48 56
 #if ENABLED(PREHEAT_BEFORE_LEVELING)
49 57
   #ifndef LEVELING_NOZZLE_TEMP
50 58
     #define LEVELING_NOZZLE_TEMP 0

Loading…
Cancel
Save