🎨 Use ExtUI API where applicable

This commit is contained in:
Desuuuu 2021-09-10 12:15:08 +02:00 committed by Scott Lahteine
parent 209e5c27ca
commit fcbd99d941
4 changed files with 12 additions and 25 deletions

View file

@ -2566,7 +2566,7 @@
// - Copy the downloaded DWIN_SET folder to the SD card. // - Copy the downloaded DWIN_SET folder to the SD card.
// //
// RELOADED (T5UID1) // RELOADED (T5UID1)
// - Download https://github.com/Desuuuu/DGUS-reloaded // - Download https://github.com/Desuuuu/DGUS-reloaded/releases
// - Copy the downloaded DWIN_SET folder to the SD card. // - Copy the downloaded DWIN_SET folder to the SD card.
// //
//#define DGUS_LCD_UI_ORIGIN //#define DGUS_LCD_UI_ORIGIN

View file

@ -63,13 +63,13 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
} }
if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle
&& (printingIsActive() || printingIsPaused())) { && (ExtUI::isPrinting() || ExtUI::isPrintingPaused())) {
dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing")); dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing"));
return; return;
} }
if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing
&& (!printingIsActive() && !printingIsPaused())) { && (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused())) {
dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle")); dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle"));
return; return;
} }
@ -166,7 +166,7 @@ void DGUSRxHandler::PrintAbort(DGUS_VP &vp, void *data_ptr) {
return; return;
} }
if (!printingIsActive() && !printingIsPaused()) { if (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused()) {
dgus_screen_handler.TriggerFullUpdate(); dgus_screen_handler.TriggerFullUpdate();
return; return;
} }
@ -183,7 +183,7 @@ void DGUSRxHandler::PrintPause(DGUS_VP &vp, void *data_ptr) {
return; return;
} }
if (!printingIsActive()) { if (!ExtUI::isPrinting()) {
dgus_screen_handler.TriggerFullUpdate(); dgus_screen_handler.TriggerFullUpdate();
return; return;
} }
@ -200,7 +200,7 @@ void DGUSRxHandler::PrintResume(DGUS_VP &vp, void *data_ptr) {
return; return;
} }
if (!printingIsPaused()) { if (!ExtUI::isPrintingPaused()) {
dgus_screen_handler.TriggerFullUpdate(); dgus_screen_handler.TriggerFullUpdate();
return; return;
} }
@ -984,20 +984,11 @@ void DGUSRxHandler::WaitAbort(DGUS_VP &vp, void *data_ptr) {
return; return;
} }
if (!printingIsPaused() if (!ExtUI::isPrintingPaused()) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|| !did_pause_print
#endif
) {
dgus_screen_handler.TriggerFullUpdate(); dgus_screen_handler.TriggerFullUpdate();
return; return;
} }
#if ENABLED(ADVANCED_PAUSE_FEATURE)
did_pause_print = 0;
#endif
ExtUI::setUserConfirmed();
ExtUI::stopPrint(); ExtUI::stopPrint();
dgus_screen_handler.TriggerFullUpdate(); dgus_screen_handler.TriggerFullUpdate();

View file

@ -47,7 +47,7 @@
#endif #endif
bool DGUSSetupHandler::PrintStatus() { bool DGUSSetupHandler::PrintStatus() {
if (printingIsActive() || printingIsPaused()) { if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) {
return true; return true;
} }
@ -56,7 +56,7 @@ bool DGUSSetupHandler::PrintStatus() {
} }
bool DGUSSetupHandler::PrintAdjust() { bool DGUSSetupHandler::PrintAdjust() {
if (printingIsActive() || printingIsPaused()) { if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) {
return true; return true;
} }

View file

@ -214,7 +214,7 @@ void DGUSTxHandler::Percent(DGUS_VP &vp) {
void DGUSTxHandler::StatusIcons(DGUS_VP &vp) { void DGUSTxHandler::StatusIcons(DGUS_VP &vp) {
uint16_t icons = 0; uint16_t icons = 0;
if (printingIsActive()) { if (ExtUI::isPrinting()) {
icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE; icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE;
dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS, dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
@ -227,7 +227,7 @@ void DGUSTxHandler::StatusIcons(DGUS_VP &vp) {
DGUS_Control::PAUSE); DGUS_Control::PAUSE);
} }
if (printingIsPaused()) { if (ExtUI::isPrintingPaused()) {
icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME; icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME;
dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS, dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
@ -561,11 +561,7 @@ void DGUSTxHandler::FilamentUsed(DGUS_VP &vp) {
void DGUSTxHandler::WaitIcons(DGUS_VP &vp) { void DGUSTxHandler::WaitIcons(DGUS_VP &vp) {
uint16_t icons = 0; uint16_t icons = 0;
if (printingIsPaused() if (ExtUI::isPrintingPaused()) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
&& did_pause_print
#endif
) {
icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT; icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT;
dgus_display.EnableControl(DGUS_Screen::WAIT, dgus_display.EnableControl(DGUS_Screen::WAIT,