Parcourir la source

DOGM Progress Display, option to disable display rotation

Robby Candra il y a 4 ans
Parent
révision
9b88c3e79b
2 fichiers modifiés avec 17 ajouts et 14 suppressions
  1. 4
    2
      Marlin/Configuration_adv.h
  2. 13
    12
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 4
- 2
Marlin/Configuration_adv.h Voir le fichier

@@ -890,8 +890,10 @@
890 890
 //#define LCD_SET_PROGRESS_MANUALLY
891 891
 
892 892
 #if HAS_PRINT_PROGRESS
893
-  //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits (Graphical LCD only)
894
-  //#define SHOW_REMAINING_TIME          // Display estimated time to completion (Graphical LCD only)
893
+  #define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits (Graphical LCD only)
894
+  #define SHOW_REMAINING_TIME          // Display estimated time to completion (Graphical LCD only)
895
+  #define ROTATE_PROGRESS_DISPLAY      // if DOGM_SD_PERCENT enabled and SHOW_REMAINING_TIME enabled,
896
+                                       // rotate diplay for (P)rogress, (E)laspsed and (R)emaining Time.
895 897
 #endif
896 898
 
897 899
 #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS

+ 13
- 12
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Voir le fichier

@@ -347,15 +347,17 @@ void MarlinUI::draw_status_screen() {
347 347
     static uint8_t lastElapsed = 0, elapsed_x_pos = 0;
348 348
     static char elapsed_string[16];
349 349
     #if ENABLED(SHOW_REMAINING_TIME)
350
-      #define SHOW_REMAINING_TIME_PREFIX 'R'
351 350
       static uint8_t estimation_x_pos = 0;
352 351
       static char estimation_string[10];
353
-      #if ENABLED(DOGM_SD_PERCENT)
354
-        #define PROGRESS_TIME_PREFIX 'P'
355
-        #define ELAPSED_TIME_PREFIX 'E'
352
+      #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
353
+        #define PROGRESS_TIME_PREFIX "PROG"
354
+        #define ELAPSED_TIME_PREFIX "ELAP"
355
+        #define SHOW_REMAINING_TIME_PREFIX "REM"
356 356
         static uint8_t progress_x_pos = 0;
357 357
         static uint8_t progress_state = 0;
358 358
         static bool prev_blink = 0;
359
+      #else
360
+        #define SHOW_REMAINING_TIME_PREFIX 'R'
359 361
       #endif
360 362
     #endif
361 363
   #endif
@@ -408,7 +410,7 @@ void MarlinUI::draw_status_screen() {
408 410
               ui8tostr3(progress / (PROGRESS_SCALE))
409 411
             #endif
410 412
           ));
411
-          #if ENABLED(SHOW_REMAINING_TIME) // Tristate progress display mode
413
+          #if ENABLED(SHOW_REMAINING_TIME)  && ENABLED(ROTATE_PROGRESS_DISPLAY) // Tristate progress display mode
412 414
             progress_x_pos = _SD_DURATION_X(strlen(progress_string)+1);
413 415
           #endif
414 416
         #endif
@@ -425,10 +427,10 @@ void MarlinUI::draw_status_screen() {
425 427
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
426 428
             const bool has_days = (estimation.value >= 60*60*24L);
427 429
             const uint8_t len = estimation.toDigital(estimation_string, has_days);
428
-            #if ENABLED(DOGM_SD_PERCENT)
430
+            #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
429 431
               estimation_x_pos = _SD_DURATION_X(len);
430 432
             #else
431
-              estimation_x_pos = _SD_DURATION_X(len + 2);
433
+              estimation_x_pos = _SD_DURATION_X(len + 1);
432 434
             #endif
433 435
           }
434 436
         #endif
@@ -579,7 +581,7 @@ void MarlinUI::draw_status_screen() {
579 581
 
580 582
     if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
581 583
 
582
-      #if ENABLED(DOGM_SD_PERCENT) && ENABLED(SHOW_REMAINING_TIME)
584
+      #if ENABLED(DOGM_SD_PERCENT) && ENABLED(SHOW_REMAINING_TIME) && ENABLED(ROTATE_PROGRESS_DISPLAY)
583 585
         if (prev_blink != blink) {
584 586
           prev_blink = blink;
585 587
           progress_state++;
@@ -588,17 +590,17 @@ void MarlinUI::draw_status_screen() {
588 590
 
589 591
         if (progress_state == 0) {
590 592
           if (progress_string[0] != '\0') {
591
-            lcd_put_wchar(PROGRESS_BAR_X, EXTRAS_BASELINE, PROGRESS_TIME_PREFIX);
593
+            lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, PROGRESS_TIME_PREFIX);
592 594
             lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
593 595
             lcd_put_wchar('%');
594 596
           }
595 597
         }
596 598
         else if (progress_state == 2  && estimation_string[0] != '\0') {
597
-          lcd_put_wchar(PROGRESS_BAR_X, EXTRAS_BASELINE, SHOW_REMAINING_TIME_PREFIX);
599
+          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, SHOW_REMAINING_TIME_PREFIX);
598 600
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
599 601
         }
600 602
         else if (elapsed_string[0] != '\0'){
601
-          lcd_put_wchar(PROGRESS_BAR_X, EXTRAS_BASELINE, ELAPSED_TIME_PREFIX);
603
+          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, ELAPSED_TIME_PREFIX);
602 604
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
603 605
         }
604 606
       #else
@@ -622,7 +624,6 @@ void MarlinUI::draw_status_screen() {
622 624
         #if ENABLED(SHOW_REMAINING_TIME)
623 625
           if (blink && (estimation_string[0] != '\0')) {
624 626
             lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, SHOW_REMAINING_TIME_PREFIX);
625
-            lcd_put_wchar(" ");
626 627
             lcd_put_u8str(estimation_string);
627 628
           }
628 629
           else

Chargement…
Annuler
Enregistrer