🚸 G30 move to logical XY (#24953)
This commit is contained in:
parent
db3865520f
commit
96b8c28376
@ -309,9 +309,9 @@ typedef abce_float_t abce_pos_t;
|
|||||||
void toLogical(xy_pos_t &raw);
|
void toLogical(xy_pos_t &raw);
|
||||||
void toLogical(xyz_pos_t &raw);
|
void toLogical(xyz_pos_t &raw);
|
||||||
void toLogical(xyze_pos_t &raw);
|
void toLogical(xyze_pos_t &raw);
|
||||||
void toNative(xy_pos_t &raw);
|
void toNative(xy_pos_t &lpos);
|
||||||
void toNative(xyz_pos_t &raw);
|
void toNative(xyz_pos_t &lpos);
|
||||||
void toNative(xyze_pos_t &raw);
|
void toNative(xyze_pos_t &lpos);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Paired XY coordinates, counters, flags, etc.
|
// Paired XY coordinates, counters, flags, etc.
|
||||||
|
@ -58,16 +58,13 @@ void GcodeSuite::G30() {
|
|||||||
tool_change(0);
|
tool_change(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
|
// Convert the given logical position to native position
|
||||||
parser.linearval('Y', current_position.y + probe.offset_xy.y) };
|
const xy_pos_t pos = {
|
||||||
|
parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
|
||||||
|
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y
|
||||||
|
};
|
||||||
|
|
||||||
if (!probe.can_reach(pos)) {
|
if (probe.can_reach(pos)) {
|
||||||
#if ENABLED(DWIN_LCD_PROUI)
|
|
||||||
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
|
|
||||||
LCD_MESSAGE(MSG_ZPROBE_OUT);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Disable leveling so the planner won't mess with us
|
// Disable leveling so the planner won't mess with us
|
||||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||||
|
|
||||||
@ -83,7 +80,7 @@ void GcodeSuite::G30() {
|
|||||||
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
|
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
|
||||||
TERN_(HAS_PTC, ptc.set_enabled(true));
|
TERN_(HAS_PTC, ptc.set_enabled(true));
|
||||||
if (!isnan(measured_z)) {
|
if (!isnan(measured_z)) {
|
||||||
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
|
SERIAL_ECHOLNPGM("Bed X: ", pos.asLogical().x, " Y: ", pos.asLogical().y, " Z: ", measured_z);
|
||||||
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||||
char msg[31], str_1[6], str_2[6], str_3[6];
|
char msg[31], str_1[6], str_2[6], str_3[6];
|
||||||
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
|
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
|
||||||
@ -102,6 +99,12 @@ void GcodeSuite::G30() {
|
|||||||
|
|
||||||
report_current_position();
|
report_current_position();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
#if ENABLED(DWIN_LCD_PROUI)
|
||||||
|
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
|
||||||
|
LCD_MESSAGE(MSG_ZPROBE_OUT);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the active tool
|
// Restore the active tool
|
||||||
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
|
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
|
||||||
|
Loading…
Reference in New Issue
Block a user