Browse Source

🎨 Use ExtUI API where applicable

Desuuuu 3 years ago
parent
commit
23d10ceccb

+ 1
- 1
Marlin/Configuration.h View File

2566
 //  - Copy the downloaded DWIN_SET folder to the SD card.
2566
 //  - Copy the downloaded DWIN_SET folder to the SD card.
2567
 //
2567
 //
2568
 // RELOADED (T5UID1)
2568
 // RELOADED (T5UID1)
2569
-//  - Download https://github.com/Desuuuu/DGUS-reloaded
2569
+//  - Download https://github.com/Desuuuu/DGUS-reloaded/releases
2570
 //  - Copy the downloaded DWIN_SET folder to the SD card.
2570
 //  - Copy the downloaded DWIN_SET folder to the SD card.
2571
 //
2571
 //
2572
 //#define DGUS_LCD_UI_ORIGIN
2572
 //#define DGUS_LCD_UI_ORIGIN

+ 6
- 15
Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp View File

63
   }
63
   }
64
 
64
 
65
   if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle
65
   if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle
66
-      && (printingIsActive() || printingIsPaused())) {
66
+      && (ExtUI::isPrinting() || ExtUI::isPrintingPaused())) {
67
     dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing"));
67
     dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing"));
68
     return;
68
     return;
69
   }
69
   }
70
 
70
 
71
   if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing
71
   if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing
72
-      && (!printingIsActive() && !printingIsPaused())) {
72
+      && (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused())) {
73
     dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle"));
73
     dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle"));
74
     return;
74
     return;
75
   }
75
   }
166
     return;
166
     return;
167
   }
167
   }
168
 
168
 
169
-  if (!printingIsActive() && !printingIsPaused()) {
169
+  if (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused()) {
170
     dgus_screen_handler.TriggerFullUpdate();
170
     dgus_screen_handler.TriggerFullUpdate();
171
     return;
171
     return;
172
   }
172
   }
183
     return;
183
     return;
184
   }
184
   }
185
 
185
 
186
-  if (!printingIsActive()) {
186
+  if (!ExtUI::isPrinting()) {
187
     dgus_screen_handler.TriggerFullUpdate();
187
     dgus_screen_handler.TriggerFullUpdate();
188
     return;
188
     return;
189
   }
189
   }
200
     return;
200
     return;
201
   }
201
   }
202
 
202
 
203
-  if (!printingIsPaused()) {
203
+  if (!ExtUI::isPrintingPaused()) {
204
     dgus_screen_handler.TriggerFullUpdate();
204
     dgus_screen_handler.TriggerFullUpdate();
205
     return;
205
     return;
206
   }
206
   }
984
     return;
984
     return;
985
   }
985
   }
986
 
986
 
987
-  if (!printingIsPaused()
988
-      #if ENABLED(ADVANCED_PAUSE_FEATURE)
989
-        || !did_pause_print
990
-      #endif
991
-  ) {
987
+  if (!ExtUI::isPrintingPaused()) {
992
     dgus_screen_handler.TriggerFullUpdate();
988
     dgus_screen_handler.TriggerFullUpdate();
993
     return;
989
     return;
994
   }
990
   }
995
 
991
 
996
-  #if ENABLED(ADVANCED_PAUSE_FEATURE)
997
-    did_pause_print = 0;
998
-  #endif
999
-
1000
-  ExtUI::setUserConfirmed();
1001
   ExtUI::stopPrint();
992
   ExtUI::stopPrint();
1002
 
993
 
1003
   dgus_screen_handler.TriggerFullUpdate();
994
   dgus_screen_handler.TriggerFullUpdate();

+ 2
- 2
Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp View File

47
 #endif
47
 #endif
48
 
48
 
49
 bool DGUSSetupHandler::PrintStatus() {
49
 bool DGUSSetupHandler::PrintStatus() {
50
-  if (printingIsActive() || printingIsPaused()) {
50
+  if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) {
51
     return true;
51
     return true;
52
   }
52
   }
53
 
53
 
56
 }
56
 }
57
 
57
 
58
 bool DGUSSetupHandler::PrintAdjust() {
58
 bool DGUSSetupHandler::PrintAdjust() {
59
-  if (printingIsActive() || printingIsPaused()) {
59
+  if (ExtUI::isPrinting() || ExtUI::isPrintingPaused()) {
60
     return true;
60
     return true;
61
   }
61
   }
62
 
62
 

+ 3
- 7
Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp View File

214
 void DGUSTxHandler::StatusIcons(DGUS_VP &vp) {
214
 void DGUSTxHandler::StatusIcons(DGUS_VP &vp) {
215
   uint16_t icons = 0;
215
   uint16_t icons = 0;
216
 
216
 
217
-  if (printingIsActive()) {
217
+  if (ExtUI::isPrinting()) {
218
     icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE;
218
     icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE;
219
 
219
 
220
     dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
220
     dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
227
                                 DGUS_Control::PAUSE);
227
                                 DGUS_Control::PAUSE);
228
   }
228
   }
229
 
229
 
230
-  if (printingIsPaused()) {
230
+  if (ExtUI::isPrintingPaused()) {
231
     icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME;
231
     icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME;
232
 
232
 
233
     dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
233
     dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
561
 void DGUSTxHandler::WaitIcons(DGUS_VP &vp) {
561
 void DGUSTxHandler::WaitIcons(DGUS_VP &vp) {
562
   uint16_t icons = 0;
562
   uint16_t icons = 0;
563
 
563
 
564
-  if (printingIsPaused()
565
-    #if ENABLED(ADVANCED_PAUSE_FEATURE)
566
-      && did_pause_print
567
-    #endif
568
-  ) {
564
+  if (ExtUI::isPrintingPaused()) {
569
     icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT;
565
     icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT;
570
 
566
 
571
     dgus_display.EnableControl(DGUS_Screen::WAIT,
567
     dgus_display.EnableControl(DGUS_Screen::WAIT,

Loading…
Cancel
Save