🚸 ProUI APRIL2022 updates (#24084)

This commit is contained in:
Scott Lahteine
2022-05-17 15:05:25 -05:00
parent 8351b1431f
commit 268a16b1ef
24 changed files with 1644 additions and 990 deletions

View File

@ -33,6 +33,10 @@
#include "../../feature/probe_temp_comp.h"
#endif
#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/marlinui.h"
#endif
/**
* G30: Do a single Z probe at the current XY
*
@ -48,20 +52,38 @@ void GcodeSuite::G30() {
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
parser.linearval('Y', current_position.y + probe.offset_xy.y) };
if (!probe.can_reach(pos)) return;
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
return;
}
// Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
remember_feedrate_scaling_off();
TERN_(DWIN_LCD_PROUI, process_subcommands_now(F("G28O")));
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
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);
#if ENABLED(DWIN_LCD_PROUI)
char msg[31], str_1[6], str_2[6], str_3[6];
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
dtostrf(pos.x, 1, 1, str_1),
dtostrf(pos.y, 1, 1, str_2),
dtostrf(measured_z, 1, 2, str_3)
);
ui.set_status(msg);
#endif
}
restore_feedrate_and_scaling();

View File

@ -33,7 +33,7 @@ void GcodeSuite::M31() {
char buffer[22];
duration_t(print_job_timer.duration()).toString(buffer);
ui.set_status(buffer);
ui.set_status(buffer, ENABLED(DWIN_LCD_PROUI));
SERIAL_ECHO_MSG("Print time: ", buffer);
}