🚸 Improve Tramming Wizard usability (#22672)
This commit is contained in:
parent
19353fc98c
commit
2e9f819d5f
|
@ -120,6 +120,7 @@ namespace ExtUI {
|
||||||
void onPidTuning(const result_t rst) {
|
void onPidTuning(const result_t rst) {
|
||||||
// Called for temperature PID tuning result
|
// Called for temperature PID tuning result
|
||||||
switch (rst) {
|
switch (rst) {
|
||||||
|
case PID_STARTED: break;
|
||||||
case PID_BAD_EXTRUDER_NUM: break;
|
case PID_BAD_EXTRUDER_NUM: break;
|
||||||
case PID_TEMP_TOO_HIGH: break;
|
case PID_TEMP_TOO_HIGH: break;
|
||||||
case PID_TUNING_TIMEOUT: break;
|
case PID_TUNING_TIMEOUT: break;
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
//#define DEBUG_OUT 1
|
//#define DEBUG_OUT 1
|
||||||
#include "../../core/debug_out.h"
|
#include "../../core/debug_out.h"
|
||||||
|
|
||||||
float z_measured[G35_PROBE_COUNT] = { 0 };
|
static float z_measured[G35_PROBE_COUNT];
|
||||||
|
static bool z_isvalid[G35_PROBE_COUNT];
|
||||||
static uint8_t tram_index = 0;
|
static uint8_t tram_index = 0;
|
||||||
|
static int8_t reference_index; // = 0
|
||||||
|
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
#include "../../feature/bedlevel/bedlevel.h"
|
#include "../../feature/bedlevel/bedlevel.h"
|
||||||
|
@ -50,32 +52,31 @@ static bool probe_single_point() {
|
||||||
do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
|
do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
|
||||||
// Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
|
// Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
|
||||||
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
|
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
|
||||||
DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm");
|
|
||||||
z_measured[tram_index] = z_probed_height;
|
z_measured[tram_index] = z_probed_height;
|
||||||
|
if (reference_index < 0) reference_index = tram_index;
|
||||||
move_to_tramming_wait_pos();
|
move_to_tramming_wait_pos();
|
||||||
|
|
||||||
return !isnan(z_probed_height);
|
DEBUG_ECHOLNPAIR("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
|
||||||
|
return (z_isvalid[tram_index] = !isnan(z_probed_height));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _menu_single_probe(const uint8_t point) {
|
static void _menu_single_probe() {
|
||||||
tram_index = point;
|
DEBUG_ECHOLNPAIR("Screen: single probe screen Arg:", tram_index);
|
||||||
DEBUG_ECHOLNPAIR("Screen: single probe screen Arg:", point);
|
|
||||||
START_MENU();
|
START_MENU();
|
||||||
STATIC_ITEM(MSG_BED_TRAMMING, SS_LEFT);
|
STATIC_ITEM(MSG_BED_TRAMMING, SS_LEFT);
|
||||||
STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, ftostr42_52(z_measured[0] - z_measured[point])); // Print diff
|
STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, z_isvalid[tram_index] ? ftostr42_52(z_measured[reference_index] - z_measured[tram_index]) : "---");
|
||||||
ACTION_ITEM(MSG_UBL_BC_INSERT2, []{ if (probe_single_point()) ui.refresh(); });
|
ACTION_ITEM(MSG_UBL_BC_INSERT2, []{ if (probe_single_point()) ui.refresh(); });
|
||||||
ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen(); }); // Back
|
ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen(); });
|
||||||
END_MENU();
|
END_MENU();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tramming_wizard_menu() {
|
static void tramming_wizard_menu() {
|
||||||
DEBUG_ECHOLNPAIR("Screen: tramming_wizard_menu");
|
|
||||||
START_MENU();
|
START_MENU();
|
||||||
STATIC_ITEM(MSG_SELECT_ORIGIN);
|
STATIC_ITEM(MSG_SELECT_ORIGIN);
|
||||||
|
|
||||||
// Draw a menu item for each tramming point
|
// Draw a menu item for each tramming point
|
||||||
LOOP_L_N(i, G35_PROBE_COUNT)
|
for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++)
|
||||||
SUBMENU_N_P(i, (char*)pgm_read_ptr(&tramming_point_name[i]), []{ _menu_single_probe(MenuItemBase::itemIndex); });
|
SUBMENU_P((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe);
|
||||||
|
|
||||||
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
ACTION_ITEM(MSG_BUTTON_DONE, []{
|
||||||
probe.stow(); // Stow before exiting Tramming Wizard
|
probe.stow(); // Stow before exiting Tramming Wizard
|
||||||
|
@ -87,9 +88,12 @@ static void tramming_wizard_menu() {
|
||||||
// Init the wizard and enter the submenu
|
// Init the wizard and enter the submenu
|
||||||
void goto_tramming_wizard() {
|
void goto_tramming_wizard() {
|
||||||
DEBUG_ECHOLNPAIR("Screen: goto_tramming_wizard", 1);
|
DEBUG_ECHOLNPAIR("Screen: goto_tramming_wizard", 1);
|
||||||
tram_index = 0;
|
|
||||||
ui.defer_status_screen();
|
ui.defer_status_screen();
|
||||||
|
|
||||||
|
// Initialize measured point flags
|
||||||
|
ZERO(z_isvalid);
|
||||||
|
reference_index = -1;
|
||||||
|
|
||||||
// Inject G28, wait for homing to complete,
|
// Inject G28, wait for homing to complete,
|
||||||
set_all_unhomed();
|
set_all_unhomed();
|
||||||
queue.inject_P(TERN(CAN_SET_LEVELING_AFTER_G28, PSTR("G28L0"), G28_STR));
|
queue.inject_P(TERN(CAN_SET_LEVELING_AFTER_G28, PSTR("G28L0"), G28_STR));
|
||||||
|
|
|
@ -15,7 +15,7 @@ opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB \
|
||||||
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 6 HEATER_CHAMBER_PIN 45
|
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 6 HEATER_CHAMBER_PIN 45
|
||||||
opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \
|
opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \
|
||||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \
|
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \
|
||||||
ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
ASSISTED_TRAMMING REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
||||||
EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \
|
EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \
|
||||||
BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
|
BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
|
||||||
NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_USE_RGB_LED CASE_LIGHT_MENU \
|
NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_USE_RGB_LED CASE_LIGHT_MENU \
|
||||||
|
|
|
@ -42,6 +42,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB \
|
||||||
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \
|
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \
|
||||||
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
|
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
|
||||||
NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
||||||
|
ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
||||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
||||||
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
|
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
|
||||||
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
|
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
|
||||||
|
|
Loading…
Reference in a new issue