Add custom types for position (#15204)
This commit is contained in:
@@ -40,8 +40,8 @@
|
||||
#include "../../lcd/extensible_ui/ui_api.h"
|
||||
#endif
|
||||
|
||||
void _man_probe_pt(const float &rx, const float &ry) {
|
||||
do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
|
||||
void _man_probe_pt(const xy_pos_t &xy) {
|
||||
do_blocking_move_to(xy, Z_CLEARANCE_BETWEEN_PROBES);
|
||||
ui.synchronize();
|
||||
move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT));
|
||||
ui.goto_screen(lcd_move_z);
|
||||
@@ -51,8 +51,8 @@ void _man_probe_pt(const float &rx, const float &ry) {
|
||||
|
||||
#include "../../gcode/gcode.h"
|
||||
|
||||
float lcd_probe_pt(const float &rx, const float &ry) {
|
||||
_man_probe_pt(rx, ry);
|
||||
float lcd_probe_pt(const xy_pos_t &xy) {
|
||||
_man_probe_pt(xy);
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
ui.defer_status_screen();
|
||||
wait_for_user = true;
|
||||
@@ -64,7 +64,7 @@ void _man_probe_pt(const float &rx, const float &ry) {
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
ui.goto_previous_screen_no_defer();
|
||||
return current_position[Z_AXIS];
|
||||
return current_position.z;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -83,10 +83,14 @@ void _man_probe_pt(const float &rx, const float &ry) {
|
||||
ui.goto_screen(_lcd_calibrate_homing);
|
||||
}
|
||||
|
||||
void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); }
|
||||
void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); }
|
||||
void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
|
||||
void _goto_center() { _man_probe_pt(0,0); }
|
||||
void _goto_tower_a(const float &a) {
|
||||
xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) };
|
||||
_man_probe_pt(tower_vec * delta_calibration_radius);
|
||||
}
|
||||
void _goto_tower_x() { _goto_tower_a(210); }
|
||||
void _goto_tower_y() { _goto_tower_a(330); }
|
||||
void _goto_tower_z() { _goto_tower_a( 90); }
|
||||
void _goto_center() { xy_pos_t ctr{0}; _man_probe_pt(ctr); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -101,15 +105,15 @@ void lcd_delta_settings() {
|
||||
START_MENU();
|
||||
MENU_BACK(MSG_DELTA_CALIBRATE);
|
||||
MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings);
|
||||
#define EDIT_ENDSTOP_ADJ(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_endstop_adj[_AXIS(N)], -5, 5, _recalc_delta_settings)
|
||||
EDIT_ENDSTOP_ADJ("Ex",A);
|
||||
EDIT_ENDSTOP_ADJ("Ey",B);
|
||||
EDIT_ENDSTOP_ADJ("Ez",C);
|
||||
#define EDIT_ENDSTOP_ADJ(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_endstop_adj.N, -5, 5, _recalc_delta_settings)
|
||||
EDIT_ENDSTOP_ADJ("Ex",a);
|
||||
EDIT_ENDSTOP_ADJ("Ey",b);
|
||||
EDIT_ENDSTOP_ADJ("Ez",c);
|
||||
MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings);
|
||||
#define EDIT_ANGLE_TRIM(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_tower_angle_trim[_AXIS(N)], -5, 5, _recalc_delta_settings)
|
||||
EDIT_ANGLE_TRIM("Tx",A);
|
||||
EDIT_ANGLE_TRIM("Ty",B);
|
||||
EDIT_ANGLE_TRIM("Tz",C);
|
||||
#define EDIT_ANGLE_TRIM(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings)
|
||||
EDIT_ANGLE_TRIM("Tx",a);
|
||||
EDIT_ANGLE_TRIM("Ty",b);
|
||||
EDIT_ANGLE_TRIM("Tz",c);
|
||||
MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings);
|
||||
END_MENU();
|
||||
}
|
||||
|
Reference in New Issue
Block a user