🚸 Fixes for ProUI popup, abort (#26308)

This commit is contained in:
Andrew 2023-11-22 03:19:29 -05:00 committed by GitHub
parent c5b267162c
commit f3473495d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 8 deletions

View file

@ -179,7 +179,7 @@ struct RuntimeSerial : public SerialBase< RuntimeSerial<SerialT> >, public Seria
// Append Hookable for this class
SerialFeature features(serial_index_t index) const { return SerialFeature::Hookable | CALL_IF_EXISTS(SerialFeature, static_cast<const SerialT*>(this), features, index); }
void setHook(WriteHook writeHook = 0, EndOfMessageHook eofHook = 0, void * userPointer = 0) {
void setHook(WriteHook writeHook=0, EndOfMessageHook eofHook=0, void * userPointer=0) {
// Order is important here as serial code can be called inside interrupts
// When setting a hook, the user pointer must be set first so if writeHook is called as soon as it's set, it'll be valid
if (userPointer) this->userPointer = userPointer;
@ -292,7 +292,7 @@ struct MultiSerial : public SerialBase< MultiSerial< REPEAT(NUM_SERIAL, _S_NAME)
#define _S_REFS(N) Serial##N##T & serial##N,
#define _S_INIT(N) ,serial##N (serial##N)
MultiSerial(REPEAT(NUM_SERIAL, _S_REFS) const SerialMask mask = ALL, const bool e = false)
MultiSerial(REPEAT(NUM_SERIAL, _S_REFS) const SerialMask mask=ALL, const bool e=false)
: BaseClassT(e), portMask(mask) REPEAT(NUM_SERIAL, _S_INIT) {}
};

View file

@ -1713,6 +1713,18 @@ void dwinPrintFinished() {
// Print was aborted
void dwinPrintAborted() {
#ifndef EVENT_GCODE_SD_ABORT
if (all_axes_homed()) {
queue.inject(
#if ENABLED(NOZZLE_PARK_FEATURE)
F("G27")
#else
TS(F("G0Z"), float(_MIN(current_position.z + (Z_POST_CLEARANCE), Z_MAX_POS)), F("\nG0F2000Y"), Y_MAX_POS);
#endif
);
}
#endif
hostui.notify("Print Aborted");
dwinPrintFinished();
}
@ -2226,7 +2238,8 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
#endif
#if LCD_BACKLIGHT_TIMEOUT_MINS
void setTimer() { setPIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max); }
void applyTimer() { ui.backlight_timeout_minutes = menuData.value; }
void setTimer() { setIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max, ui.backlight_timeout_minutes, applyTimer); }
#endif
#if HAS_FILAMENT_SENSOR

View file

@ -50,9 +50,15 @@ inline void drawPopupBkgd() {
template<typename T, typename U>
void dwinDrawPopup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) {
xy_uint8_t pos;
switch (icon) {
default: pos.set(81, 90); break; // Icon 1 - 8, 90 - 91; (110 x 100)
case 17 ... 24: pos.set(96, 90); break; // Icon 17 - 24; ( 80 x 100)
case 78 ... 81: pos.set(100, 107); break; // Icon 78 - 81; ( 73 x 66)
}
DWINUI::clearMainArea();
drawPopupBkgd();
if (icon) DWINUI::drawIcon(icon, 101, 105);
if (icon) DWINUI::drawIcon(icon, pos.x, pos.y);
if (amsg1) DWINUI::drawCenteredString(hmiData.colorPopupTxt, 210, amsg1);
if (amsg2) DWINUI::drawCenteredString(hmiData.colorPopupTxt, 240, amsg2);
if (button) DWINUI::drawButton(button, 86, 280);

View file

@ -93,7 +93,7 @@ public:
MenuItem(uint8_t cicon, const char * const text=nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
MenuItem(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
void setFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void setCaption(const char * const text = nullptr);
void setCaption(const char * const text=nullptr);
};
class MenuItemPtr: public MenuItem {

View file

@ -215,7 +215,7 @@ uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *
return InTransfer(pep, nak_limit, nbytesptr, data, bInterval);
}
uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval /*= 0*/) {
uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval/*=0*/) {
uint8_t rcode = 0;
uint8_t pktsize;

View file

@ -141,5 +141,5 @@ public:
theParser.Initialize(p);
}
bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = nullptr);
bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me=nullptr);
};

View file

@ -24,7 +24,7 @@ opt_enable DWIN_MARLINUI_LANDSCAPE LCD_ENDSTOP_TEST AUTO_BED_LEVELING_UBL BLTOUC
exec_test $1 $2 "Ender-3 v2 - MarlinUI (UBL+BLTOUCH, MPCTEMP, LCD_ENDSTOP_TEST)" "$3"
use_example_configs "Creality/Ender-3 S1/STM32F1"
opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CANCEL_OBJECTS FWRETRACT
opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CANCEL_OBJECTS FWRETRACT EVENT_GCODE_SD_ABORT
opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT STATUS_MESSAGE_SCROLLING \
SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \
BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU LCD_BED_TRAMMING \