✨ Z Offset Wizard for TFT_LVGL_UI (English) (#23489)
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							d8c5e49281
						
					
				
				
					commit
					8695f462b7
				
			@@ -36,7 +36,8 @@ enum {
 | 
			
		||||
  ID_LEVEL_RETURN = 1,
 | 
			
		||||
  ID_LEVEL_POSITION,
 | 
			
		||||
  ID_LEVEL_COMMAND,
 | 
			
		||||
  ID_LEVEL_ZOFFSET
 | 
			
		||||
  ID_LEVEL_ZOFFSET,
 | 
			
		||||
  ID_Z_OFFSET_WIZARD
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
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) {
 | 
			
		||||
      case ID_LEVEL_ZOFFSET:
 | 
			
		||||
        lv_draw_auto_level_offset_settings();
 | 
			
		||||
        break;
 | 
			
		||||
      #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
        case ID_Z_OFFSET_WIZARD:
 | 
			
		||||
          lv_draw_z_offset_wizard();
 | 
			
		||||
          break;
 | 
			
		||||
      #endif
 | 
			
		||||
    #endif
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -67,6 +73,9 @@ void lv_draw_level_settings() {
 | 
			
		||||
  lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1);
 | 
			
		||||
  #if HAS_BED_PROBE
 | 
			
		||||
    lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2);
 | 
			
		||||
    #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
      lv_screen_menu_item(scr, machine_menu.LevelingZoffsetWizard, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3);
 | 
			
		||||
    #endif
 | 
			
		||||
  #endif
 | 
			
		||||
  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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -456,6 +456,10 @@ char *getDispText(int index) {
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
    case MOVE_MOTOR_UI:       strcpy(public_buf_l, move_menu.title); break;
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
      case Z_OFFSET_WIZARD_UI: break;
 | 
			
		||||
    #endif
 | 
			
		||||
    case OPERATE_UI:
 | 
			
		||||
      switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) {
 | 
			
		||||
        IF_DISABLED(TFT35, case OPERATE_UI: case PAUSE_UI:)
 | 
			
		||||
@@ -785,6 +789,10 @@ void GUI_RefreshPage() {
 | 
			
		||||
 | 
			
		||||
    case MOVE_MOTOR_UI: break;
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
      case Z_OFFSET_WIZARD_UI: break;
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(MKS_WIFI_MODULE)
 | 
			
		||||
      case WIFI_UI:
 | 
			
		||||
        if (temps_update_flag) {
 | 
			
		||||
@@ -885,6 +893,9 @@ void clear_cur_ui() {
 | 
			
		||||
    case PRINT_FILE_UI:               lv_clear_print_file(); break;
 | 
			
		||||
    case PRINTING_UI:                 lv_clear_printing(); break;
 | 
			
		||||
    case MOVE_MOTOR_UI:               lv_clear_move_motor(); break;
 | 
			
		||||
    #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
      case Z_OFFSET_WIZARD_UI:        lv_clear_z_offset_wizard(); break;
 | 
			
		||||
    #endif
 | 
			
		||||
    case OPERATE_UI:                  lv_clear_operation(); break;
 | 
			
		||||
    case PAUSE_UI:                    break;
 | 
			
		||||
    case EXTRUSION_UI:                lv_clear_extrusion(); break;
 | 
			
		||||
@@ -993,6 +1004,9 @@ void draw_return_ui() {
 | 
			
		||||
                                        break;
 | 
			
		||||
 | 
			
		||||
      case MOVE_MOTOR_UI:               lv_draw_move_motor(); break;
 | 
			
		||||
      #if ENABLED(PROBE_OFFSET_WIZARD)
 | 
			
		||||
        case Z_OFFSET_WIZARD_UI:        lv_draw_z_offset_wizard(); break;
 | 
			
		||||
      #endif
 | 
			
		||||
      case OPERATE_UI:                  lv_draw_operation(); break;
 | 
			
		||||
      case PAUSE_UI:                    break;
 | 
			
		||||
      case EXTRUSION_UI:                lv_draw_extrusion(); break;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,6 +69,7 @@
 | 
			
		||||
#include "draw_max_feedrate_settings.h"
 | 
			
		||||
#include "draw_tmc_step_mode_settings.h"
 | 
			
		||||
#include "draw_level_settings.h"
 | 
			
		||||
#include "draw_z_offset_wizard.h"
 | 
			
		||||
#include "draw_tramming_pos_settings.h"
 | 
			
		||||
#include "draw_auto_level_offset_settings.h"
 | 
			
		||||
#include "draw_filament_change.h"
 | 
			
		||||
@@ -266,6 +267,7 @@ typedef enum {
 | 
			
		||||
  PRINT_FILE_UI,
 | 
			
		||||
  PRINTING_UI,
 | 
			
		||||
  MOVE_MOTOR_UI,
 | 
			
		||||
  Z_OFFSET_WIZARD_UI,
 | 
			
		||||
  OPERATE_UI,
 | 
			
		||||
  PAUSE_UI,
 | 
			
		||||
  EXTRUSION_UI,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										228
									
								
								Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										228
									
								
								Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,228 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Marlin 3D Printer Firmware
 | 
			
		||||
 * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 | 
			
		||||
 *
 | 
			
		||||
 * Based on Sprinter and grbl.
 | 
			
		||||
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "../../../inc/MarlinConfigPre.h"
 | 
			
		||||
 | 
			
		||||
#if BOTH(HAS_TFT_LVGL_UI, PROBE_OFFSET_WIZARD)
 | 
			
		||||
 | 
			
		||||
#include "draw_ui.h"
 | 
			
		||||
#include <lv_conf.h>
 | 
			
		||||
 | 
			
		||||
#include "../../../gcode/queue.h"
 | 
			
		||||
#include "../../../module/motion.h"
 | 
			
		||||
 | 
			
		||||
#include "../../../module/planner.h"
 | 
			
		||||
#include "../../../inc/MarlinConfig.h"
 | 
			
		||||
#include "../../../module/probe.h"
 | 
			
		||||
 | 
			
		||||
#if HAS_LEVELING
 | 
			
		||||
  #include "../../../feature/bedlevel/bedlevel.h"
 | 
			
		||||
  bool leveling_was_active;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern lv_group_t *g;
 | 
			
		||||
static lv_obj_t *scr;
 | 
			
		||||
 | 
			
		||||
static lv_obj_t *labelV, *buttonV, *labelP;
 | 
			
		||||
static lv_obj_t *labelP_z_offset_ref;
 | 
			
		||||
static lv_task_t *updatePosTask;
 | 
			
		||||
static char cur_label = 'Z';
 | 
			
		||||
static float cur_pos = 0;
 | 
			
		||||
static float cur_OffsetPos = 0;
 | 
			
		||||
 | 
			
		||||
// Global storage
 | 
			
		||||
float z_offset_backup, calculated_z_offset, z_offset_ref;
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  ID_M_Z_P = 1,
 | 
			
		||||
  ID_M_Z_N,
 | 
			
		||||
  ID_M_STEP,
 | 
			
		||||
  ID_M_SAVE,
 | 
			
		||||
  ID_M_RETURN
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void disp_cur_wizard_pos() {
 | 
			
		||||
  char str_1[18];
 | 
			
		||||
  sprintf_P(public_buf_l, PSTR("%c:%s mm"), cur_label, dtostrf(cur_pos, 1, 3, str_1));
 | 
			
		||||
  if (labelP) lv_label_set_text(labelP, public_buf_l);
 | 
			
		||||
 | 
			
		||||
  sprintf_P(public_buf_l, PSTR("%c Offset:%s mm"), cur_label, dtostrf(cur_OffsetPos, 1, 3, str_1));
 | 
			
		||||
  if (labelP_z_offset_ref) lv_label_set_text(labelP_z_offset_ref, public_buf_l);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void event_handler(lv_obj_t *obj, lv_event_t event) {
 | 
			
		||||
  char str_1[16];
 | 
			
		||||
  if (event != LV_EVENT_RELEASED) return;
 | 
			
		||||
  //lv_clear_z_offset_wizard();
 | 
			
		||||
  if (!queue.ring_buffer.full(3)) {
 | 
			
		||||
    bool do_inject = true;
 | 
			
		||||
    float dist = uiCfg.move_dist;
 | 
			
		||||
    switch (obj->mks_obj_id) {
 | 
			
		||||
      case ID_M_Z_N: dist *= -1; case ID_M_Z_P: cur_label = 'Z'; break;
 | 
			
		||||
      default: do_inject = false;
 | 
			
		||||
    }
 | 
			
		||||
    if (do_inject) {
 | 
			
		||||
      sprintf_P(public_buf_l, PSTR("G91\nG1 %c%s F%d\nG90"), cur_label, dtostrf(dist, 1, 3, str_1), uiCfg.moveSpeed);
 | 
			
		||||
      queue.inject(public_buf_l);
 | 
			
		||||
      //calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
 | 
			
		||||
      disp_cur_wizard_pos();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  switch (obj->mks_obj_id) {
 | 
			
		||||
    case ID_M_STEP:
 | 
			
		||||
      if (ABS((int)(10 * uiCfg.move_dist)) == 10)
 | 
			
		||||
        uiCfg.move_dist = 0.025;
 | 
			
		||||
      else if (ABS((int)(1000 * uiCfg.move_dist)) == 25)
 | 
			
		||||
        uiCfg.move_dist = 0.1;
 | 
			
		||||
      else
 | 
			
		||||
        uiCfg.move_dist *= 10.0f;
 | 
			
		||||
      disp_move_wizard_dist();
 | 
			
		||||
      break;
 | 
			
		||||
    case ID_M_SAVE:
 | 
			
		||||
      current_position.z = z_offset_ref;  // Set Z to z_offset_ref, as we can expect it is at probe height
 | 
			
		||||
      probe.offset.z = calculated_z_offset;
 | 
			
		||||
      sync_plan_position();
 | 
			
		||||
      // Raise Z as if it was homed
 | 
			
		||||
      do_z_clearance(Z_POST_CLEARANCE);
 | 
			
		||||
      watchdog_refresh();
 | 
			
		||||
      draw_return_ui();
 | 
			
		||||
      return;
 | 
			
		||||
    case ID_M_RETURN:
 | 
			
		||||
      probe.offset.z = z_offset_backup;
 | 
			
		||||
      SET_SOFT_ENDSTOP_LOOSE(false);
 | 
			
		||||
      TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
 | 
			
		||||
      #if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
 | 
			
		||||
        set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
 | 
			
		||||
        queue.inject_P(PSTR("G28Z"));
 | 
			
		||||
      #else // Otherwise do a Z clearance move like after Homing
 | 
			
		||||
        do_z_clearance(Z_POST_CLEARANCE);
 | 
			
		||||
      #endif
 | 
			
		||||
      watchdog_refresh();
 | 
			
		||||
      draw_return_ui();
 | 
			
		||||
      return;
 | 
			
		||||
  }
 | 
			
		||||
  disp_cur_wizard_pos();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void refresh_wizard_pos(lv_task_t *) {
 | 
			
		||||
  switch (cur_label) {
 | 
			
		||||
    case 'Z':
 | 
			
		||||
      cur_pos = current_position.z;
 | 
			
		||||
      calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
 | 
			
		||||
      cur_OffsetPos = calculated_z_offset;
 | 
			
		||||
    break;
 | 
			
		||||
    default: return;
 | 
			
		||||
  }
 | 
			
		||||
  disp_cur_wizard_pos();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void lv_draw_z_offset_wizard() {
 | 
			
		||||
 | 
			
		||||
  set_all_unhomed();
 | 
			
		||||
 | 
			
		||||
  // Store probe.offset.z for Case: Cancel
 | 
			
		||||
  z_offset_backup = probe.offset.z;
 | 
			
		||||
 | 
			
		||||
  #ifdef PROBE_OFFSET_WIZARD_START_Z
 | 
			
		||||
    probe.offset.z = PROBE_OFFSET_WIZARD_START_Z;
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  // Store Bed-Leveling-State and disable
 | 
			
		||||
  #if HAS_LEVELING
 | 
			
		||||
    leveling_was_active = planner.leveling_active;
 | 
			
		||||
    set_bed_leveling_enabled(leveling_was_active);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  queue.inject_P(PSTR("G28"));
 | 
			
		||||
 | 
			
		||||
  z_offset_ref = 0;             // Set Z Value for Wizard Position to 0
 | 
			
		||||
  calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
 | 
			
		||||
  cur_OffsetPos = calculated_z_offset;
 | 
			
		||||
 | 
			
		||||
  scr = lv_screen_create(Z_OFFSET_WIZARD_UI, machine_menu.LevelingZoffsetTitle);
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
  lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW);
 | 
			
		||||
  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);
 | 
			
		||||
 | 
			
		||||
  // button with image and label changed dynamically by disp_move_dist
 | 
			
		||||
  buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP);
 | 
			
		||||
  labelV = lv_label_create_empty(buttonV);
 | 
			
		||||
  #if HAS_ROTARY_ENCODER
 | 
			
		||||
    if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonV);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  // save and back
 | 
			
		||||
  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);
 | 
			
		||||
  // cancel and back
 | 
			
		||||
  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);
 | 
			
		||||
 | 
			
		||||
  // We need to patch the title to leave some space on the right for displaying the status
 | 
			
		||||
  lv_obj_t * z_offset_ref_title = lv_obj_get_child_back(scr, nullptr);
 | 
			
		||||
  if (z_offset_ref_title != nullptr) lv_obj_set_width(z_offset_ref_title, (int)(TFT_WIDTH / 2) - 101);
 | 
			
		||||
    labelP_z_offset_ref = lv_label_create(scr, (int)(TFT_WIDTH / 2) - 80, (int)(TFT_HEIGHT/2)-20, "Z Offset:0.0mm");
 | 
			
		||||
 | 
			
		||||
  // We need to patch the Z Offset to leave some space in the middle for displaying the status
 | 
			
		||||
  lv_obj_t * title= lv_obj_get_child_back(scr, nullptr);
 | 
			
		||||
  if (title != nullptr) lv_obj_set_width(title, TFT_WIDTH - 101);
 | 
			
		||||
  labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm");
 | 
			
		||||
 | 
			
		||||
  if (labelP != nullptr)
 | 
			
		||||
    updatePosTask = lv_task_create(refresh_wizard_pos, 300, LV_TASK_PRIO_LOWEST, 0);
 | 
			
		||||
 | 
			
		||||
  disp_move_wizard_dist();
 | 
			
		||||
  disp_cur_wizard_pos();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void disp_move_wizard_dist() {
 | 
			
		||||
  if ((int)(1000 * uiCfg.move_dist) == 25)
 | 
			
		||||
    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move0_1.bin");
 | 
			
		||||
  else if ((int)(10 * uiCfg.move_dist) == 1)
 | 
			
		||||
    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move1.bin");
 | 
			
		||||
  else if ((int)(10 * uiCfg.move_dist) == 10)
 | 
			
		||||
    lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move10.bin");
 | 
			
		||||
 | 
			
		||||
  if (gCfgItems.multiple_language) {
 | 
			
		||||
    if ((int)(1000 * uiCfg.move_dist) == 25) {
 | 
			
		||||
      lv_label_set_text(labelV, move_menu.step_0025mm);
 | 
			
		||||
      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
 | 
			
		||||
    }
 | 
			
		||||
    else if ((int)(10 * uiCfg.move_dist) == 1) {
 | 
			
		||||
      lv_label_set_text(labelV, move_menu.step_01mm);
 | 
			
		||||
      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
 | 
			
		||||
    }
 | 
			
		||||
    else if ((int)(10 * uiCfg.move_dist) == 10) {
 | 
			
		||||
      lv_label_set_text(labelV, move_menu.step_1mm);
 | 
			
		||||
      lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void lv_clear_z_offset_wizard() {
 | 
			
		||||
  #if HAS_ROTARY_ENCODER
 | 
			
		||||
    if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
 | 
			
		||||
  #endif
 | 
			
		||||
  lv_obj_del(scr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif // HAS_TFT_LVGL_UI && PROBE_OFFSET_WIZARD
 | 
			
		||||
							
								
								
									
										36
									
								
								Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Marlin 3D Printer Firmware
 | 
			
		||||
 * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 | 
			
		||||
 *
 | 
			
		||||
 * Based on Sprinter and grbl.
 | 
			
		||||
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
  extern "C" { /* C-declarations for C++ */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void lv_draw_z_offset_wizard();
 | 
			
		||||
void refresh_wizard_pos();
 | 
			
		||||
void disp_cur_wizard_pos();
 | 
			
		||||
void disp_move_wizard_dist();
 | 
			
		||||
void lv_clear_z_offset_wizard();
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
  } /* C-declarations for C++ */
 | 
			
		||||
#endif
 | 
			
		||||
@@ -103,6 +103,8 @@
 | 
			
		||||
#define LEVELING_AUTO_COMMAND_EN        "AutoLeveling command settings"
 | 
			
		||||
#define LEVELING_AUTO_ZOFFSET_EN        "Nozzle-to-probe offsets settings"
 | 
			
		||||
 | 
			
		||||
#define LEVELING_ZOFFSET_TITLE_EN       "Machine Settings>Z Offset Wizard"
 | 
			
		||||
 | 
			
		||||
#define LEVELING_PARA_CONF_TITLE_EN     "leveling setting"
 | 
			
		||||
#define AUTO_LEVELING_ENABLE_EN         "Enable auto leveling"
 | 
			
		||||
#define BLTOUCH_LEVELING_ENABLE_EN      "Enable BLTouch"
 | 
			
		||||
@@ -293,6 +295,7 @@
 | 
			
		||||
#define CLOSE_TEXT_EN           "Close"
 | 
			
		||||
 | 
			
		||||
#define BACK_TEXT_EN            "Back"
 | 
			
		||||
#define SAVE_TEXT_EN            "Save"
 | 
			
		||||
 | 
			
		||||
#define TOOL_PREHEAT_EN         "Preheat"
 | 
			
		||||
#define TOOL_EXTRUDE_EN         "Extrusion"
 | 
			
		||||
 
 | 
			
		||||
@@ -578,6 +578,8 @@ void machine_setting_disp() {
 | 
			
		||||
    machine_menu.OutLength           = FILAMENT_OUT_LENGTH_EN;
 | 
			
		||||
    machine_menu.OutSpeed            = FILAMENT_OUT_SPEED_EN;
 | 
			
		||||
 | 
			
		||||
    machine_menu.LevelingZoffsetTitle = LEVELING_ZOFFSET_TITLE_EN;
 | 
			
		||||
 | 
			
		||||
    machine_menu.LevelingParaConfTitle   = LEVELING_CONF_TITLE_EN;
 | 
			
		||||
    machine_menu.LevelingParaConf        = LEVELING_PARA_CONF_EN;
 | 
			
		||||
    machine_menu.TrammingPosConf         = TRAMMING_POS_EN;
 | 
			
		||||
@@ -767,11 +769,12 @@ void disp_language_init() {
 | 
			
		||||
  move_menu.z_add = AXIS_Z_ADD_TEXT;
 | 
			
		||||
  move_menu.z_dec = AXIS_Z_DEC_TEXT;
 | 
			
		||||
 | 
			
		||||
  move_menu.step_001mm = TEXT_001MM;
 | 
			
		||||
  move_menu.step_005mm = TEXT_005MM;
 | 
			
		||||
  move_menu.step_01mm  = TEXT_01MM;
 | 
			
		||||
  move_menu.step_1mm   = TEXT_1MM;
 | 
			
		||||
  move_menu.step_10mm  = TEXT_10MM;
 | 
			
		||||
  move_menu.step_001mm  = TEXT_001MM;
 | 
			
		||||
  move_menu.step_0025mm = TEXT_0025MM;
 | 
			
		||||
  move_menu.step_005mm  = TEXT_005MM;
 | 
			
		||||
  move_menu.step_01mm   = TEXT_01MM;
 | 
			
		||||
  move_menu.step_1mm    = TEXT_1MM;
 | 
			
		||||
  move_menu.step_10mm   = TEXT_10MM;
 | 
			
		||||
 | 
			
		||||
  home_menu.home_x   = HOME_X_TEXT;
 | 
			
		||||
  home_menu.home_y   = HOME_Y_TEXT;
 | 
			
		||||
@@ -1346,6 +1349,7 @@ void disp_language_init() {
 | 
			
		||||
          case LANG_ENGLISH:
 | 
			
		||||
            common_menu.dialog_confirm_title  = TITLE_DIALOG_CONFIRM_EN;
 | 
			
		||||
            common_menu.text_back             = BACK_TEXT_EN;
 | 
			
		||||
            common_menu.text_save             = SAVE_TEXT_EN;
 | 
			
		||||
            common_menu.close_machine_tips    = DIALOG_CLOSE_MACHINE_EN;
 | 
			
		||||
            common_menu.unbind_printer_tips   = DIALOG_UNBIND_PRINTER_EN;
 | 
			
		||||
            common_menu.print_special_title   = PRINTING_OTHER_LANGUGE;
 | 
			
		||||
 
 | 
			
		||||
@@ -101,6 +101,8 @@ typedef struct machine_common_disp {
 | 
			
		||||
  const char *OutLength;
 | 
			
		||||
  const char *OutSpeed;
 | 
			
		||||
 | 
			
		||||
  const char *LevelingZoffsetTitle;
 | 
			
		||||
 | 
			
		||||
  const char *LevelingParaConfTitle;
 | 
			
		||||
  const char *LevelingParaConf;
 | 
			
		||||
  const char *TrammingPosConf;
 | 
			
		||||
@@ -294,6 +296,7 @@ extern machine_common_def machine_menu;
 | 
			
		||||
 | 
			
		||||
typedef struct common_menu_disp {
 | 
			
		||||
  const char *text_back;
 | 
			
		||||
  const char *text_save;
 | 
			
		||||
  const char *dialog_confirm_title;
 | 
			
		||||
  const char *close_machine_tips;
 | 
			
		||||
  const char *unbind_printer_tips;
 | 
			
		||||
@@ -355,6 +358,7 @@ typedef struct move_menu_disp {
 | 
			
		||||
  const char *z_add;
 | 
			
		||||
  const char *z_dec;
 | 
			
		||||
  const char *step_001mm;
 | 
			
		||||
  const char *step_0025mm;
 | 
			
		||||
  const char *step_005mm;
 | 
			
		||||
  const char *step_01mm;
 | 
			
		||||
  const char *step_1mm;
 | 
			
		||||
@@ -777,6 +781,7 @@ extern eeprom_def eeprom_menu;
 | 
			
		||||
#define AXIS_Z_ADD_TEXT     "Z+"
 | 
			
		||||
#define AXIS_Z_DEC_TEXT     "Z-"
 | 
			
		||||
#define TEXT_001MM          "0.01 mm"
 | 
			
		||||
#define TEXT_0025MM         "0.025 mm"
 | 
			
		||||
#define TEXT_005MM          "0.05 mm"
 | 
			
		||||
#define TEXT_01MM           "0.1 mm"
 | 
			
		||||
#define TEXT_1MM            "1 mm"
 | 
			
		||||
 
 | 
			
		||||
@@ -45,15 +45,7 @@ void _goto_manual_move_z(const_float_t);
 | 
			
		||||
float z_offset_backup, calculated_z_offset, z_offset_ref;
 | 
			
		||||
 | 
			
		||||
inline void z_clearance_move() {
 | 
			
		||||
  do_z_clearance(
 | 
			
		||||
    #ifdef Z_AFTER_HOMING
 | 
			
		||||
      Z_AFTER_HOMING
 | 
			
		||||
    #elif defined(Z_HOMING_HEIGHT)
 | 
			
		||||
      Z_HOMING_HEIGHT
 | 
			
		||||
    #else
 | 
			
		||||
      10
 | 
			
		||||
    #endif
 | 
			
		||||
  );
 | 
			
		||||
  do_z_clearance(Z_POST_CLEARANCE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void set_offset_and_go_back(const_float_t z) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user