Skip to content

Commit

Permalink
🚸 ProUI APRIL2022 updates (MarlinFirmware#24084)
Browse files Browse the repository at this point in the history
  • Loading branch information
mriscoc authored and LCh-77 committed Jul 19, 2022
1 parent b62bc9d commit 82887ed
Show file tree
Hide file tree
Showing 22 changed files with 1,603 additions and 970 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp
// Echo the LCD message to serial for extra context
if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); }

#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
#if HAS_DISPLAY
ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR));
#else
UNUSED(lcd_error); UNUSED(lcd_component);
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ void unified_bed_leveling::shift_mesh_height() {

TERN_(HAS_MARLINUI_MENU, ui.capture());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());

save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
uint8_t count = GRID_MAX_POINTS;
Expand Down Expand Up @@ -837,6 +838,7 @@ void unified_bed_leveling::shift_mesh_height() {
);

TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
TERN_(DWIN_LCD_PROUI, DWIN_LevelingDone());
}

#endif // HAS_BED_PROBE
Expand Down
31 changes: 17 additions & 14 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#include "../../feature/probe_temp_comp.h"
#endif

#include "../../lcd/marlinui.h"
#if ENABLED(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#include "../../lcd/marlinui.h"
#endif

/**
* G30: Do a single Z probe at the current XY
Expand All @@ -51,10 +53,9 @@ void GcodeSuite::G30() {
parser.linearval('Y', current_position.y + probe.offset_xy.y) };

if (!probe.can_reach(pos)) {
#if ENABLED(DWIN_CREALITY_LCD_JYERSUI)
PGM_P msg = {"Outside of Probing Area"};
SERIAL_ECHOLNPGM_P(msg);
ui.set_status(msg);
#if ENABLED(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
#endif
return;
}
Expand All @@ -64,7 +65,9 @@ void GcodeSuite::G30() {

remember_feedrate_scaling_off();

TERN_(DWIN_CREALITY_LCD_JYERSUI, gcode.process_subcommands_now(F("G28O"));)
#if ENABLED(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
process_subcommands_now(F("G28O"));
#endif

const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;

Expand All @@ -73,17 +76,17 @@ void GcodeSuite::G30() {
TERN_(HAS_PTC, ptc.set_enabled(true));
if (!isnan(measured_z)) {
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
#if ENABLED(DWIN_CREALITY_LCD_JYERSUI)
char buf[31] = "";
char strg_1[6], strg_2[6],strg_3[6] = "";
sprintf_P(buf, PSTR("X:%s, Y:%s, Z:%s"),
dtostrf(pos.x, 1, 1, strg_1),
dtostrf(pos.y, 1, 1, strg_2),
dtostrf(measured_z, 1, 2, strg_3)
#if ENABLED(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
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(buf);
ui.set_status(msg);
#endif
}

restore_feedrate_and_scaling();

if (raise_after == PROBE_PT_STOW)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/stats/M31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/common/dwin_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
// *string: The string
// rlimit: To limit the drawn string length
void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) {
#if DISABLED(DWIN_CREALITY_LCD_JYERSUI)
#if DISABLED(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size));
#endif
constexpr uint8_t widthAdjust = 0;
Expand Down
Loading

0 comments on commit 82887ed

Please sign in to comment.