From fcbd99d941bc680e6409998fdd4882eab5dba992 Mon Sep 17 00:00:00 2001 From: Desuuuu Date: Fri, 10 Sep 2021 12:15:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Use=20ExtUI=20API=20where=20appl?= =?UTF-8?q?icable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- .../lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 21 ++++++------------- .../extui/dgus_reloaded/DGUSSetupHandler.cpp | 4 ++-- .../lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 10 +++------ 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6a96411863..d8815b7ec5 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2566,7 +2566,7 @@ // - Copy the downloaded DWIN_SET folder to the SD card. // // 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. // //#define DGUS_LCD_UI_ORIGIN diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index 5f36dac7f6..20a4bee234 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -63,13 +63,13 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { } if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle - && (printingIsActive() || printingIsPaused())) { + && (ExtUI::isPrinting() || ExtUI::isPrintingPaused())) { dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing")); return; } if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing - && (!printingIsActive() && !printingIsPaused())) { + && (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused())) { dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle")); return; } @@ -166,7 +166,7 @@ void DGUSRxHandler::PrintAbort(DGUS_VP &vp, void *data_ptr) { return; } - if (!printingIsActive() && !printingIsPaused()) { + if (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused()) { dgus_screen_handler.TriggerFullUpdate(); return; } @@ -183,7 +183,7 @@ void DGUSRxHandler::PrintPause(DGUS_VP &vp, void *data_ptr) { return; } - if (!printingIsActive()) { + if (!ExtUI::isPrinting()) { dgus_screen_handler.TriggerFullUpdate(); return; } @@ -200,7 +200,7 @@ void DGUSRxHandler::PrintResume(DGUS_VP &vp, void *data_ptr) { return; } - if (!printingIsPaused()) { + if (!ExtUI::isPrintingPaused()) { dgus_screen_handler.TriggerFullUpdate(); return; } @@ -984,20 +984,11 @@ void DGUSRxHandler::WaitAbort(DGUS_VP &vp, void *data_ptr) { return; } - if (!printingIsPaused() - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || !did_pause_print - #endif - ) { + if (!ExtUI::isPrintingPaused()) { dgus_screen_handler.TriggerFullUpdate(); return; } - #if ENABLED(ADVANCED_PAUSE_FEATURE) - did_pause_print = 0; - #endif - - ExtUI::setUserConfirmed(); ExtUI::stopPrint(); dgus_screen_handler.TriggerFullUpdate(); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp index c12282c4ef..0d94751fc2 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp @@ -47,7 +47,7 @@ #endif bool DGUSSetupHandler::PrintStatus() { - if (printingIsActive() || printingIsPaused()) { + if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) { return true; } @@ -56,7 +56,7 @@ bool DGUSSetupHandler::PrintStatus() { } bool DGUSSetupHandler::PrintAdjust() { - if (printingIsActive() || printingIsPaused()) { + if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) { return true; } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 04362b07e8..b2fa8c18b3 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -214,7 +214,7 @@ void DGUSTxHandler::Percent(DGUS_VP &vp) { void DGUSTxHandler::StatusIcons(DGUS_VP &vp) { uint16_t icons = 0; - if (printingIsActive()) { + if (ExtUI::isPrinting()) { icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE; dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS, @@ -227,7 +227,7 @@ void DGUSTxHandler::StatusIcons(DGUS_VP &vp) { DGUS_Control::PAUSE); } - if (printingIsPaused()) { + if (ExtUI::isPrintingPaused()) { icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME; dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS, @@ -561,11 +561,7 @@ void DGUSTxHandler::FilamentUsed(DGUS_VP &vp) { void DGUSTxHandler::WaitIcons(DGUS_VP &vp) { uint16_t icons = 0; - if (printingIsPaused() - #if ENABLED(ADVANCED_PAUSE_FEATURE) - && did_pause_print - #endif - ) { + if (ExtUI::isPrintingPaused()) { icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT; dgus_display.EnableControl(DGUS_Screen::WAIT,