Browse Source

M73 remaining time for MKS UI (#18326)

Anton Skorochod 4 years ago
parent
commit
0b30de1b8e
No account linked to committer's email address
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp

+ 9
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp View File

@@ -39,6 +39,9 @@
39 39
 #if ENABLED(POWER_LOSS_RECOVERY)
40 40
   #include "../../../../feature/powerloss.h"
41 41
 #endif
42
+#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
43
+  #include "../../../ultralcd.h"
44
+#endif
42 45
 
43 46
 static lv_obj_t * scr;
44 47
 static lv_obj_t * labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime;
@@ -364,7 +367,12 @@ void disp_fan_speed() {
364 367
 
365 368
 void disp_print_time() {
366 369
   memset(public_buf_l, 0, sizeof(public_buf_l));
367
-  sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10);
370
+  #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
371
+    const uint32_t r = ui.get_remaining_time();
372
+    sprintf(public_buf_l, "%02d:%02d R", r / 3600, (r % 3600) / 60);
373
+  #else
374
+    sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10);
375
+  #endif
368 376
   lv_label_set_text(labelTime, public_buf_l);
369 377
 }
370 378
 

Loading…
Cancel
Save