Browse Source

DOGM Progress Display, option to disable display rotation

Robby Candra 5 years ago
parent
commit
9b88c3e79b
2 changed files with 17 additions and 14 deletions
  1. 4
    2
      Marlin/Configuration_adv.h
  2. 13
    12
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 4
- 2
Marlin/Configuration_adv.h View File

890
 //#define LCD_SET_PROGRESS_MANUALLY
890
 //#define LCD_SET_PROGRESS_MANUALLY
891
 
891
 
892
 #if HAS_PRINT_PROGRESS
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
 #endif
897
 #endif
896
 
898
 
897
 #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS
899
 #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS

+ 13
- 12
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

347
     static uint8_t lastElapsed = 0, elapsed_x_pos = 0;
347
     static uint8_t lastElapsed = 0, elapsed_x_pos = 0;
348
     static char elapsed_string[16];
348
     static char elapsed_string[16];
349
     #if ENABLED(SHOW_REMAINING_TIME)
349
     #if ENABLED(SHOW_REMAINING_TIME)
350
-      #define SHOW_REMAINING_TIME_PREFIX 'R'
351
       static uint8_t estimation_x_pos = 0;
350
       static uint8_t estimation_x_pos = 0;
352
       static char estimation_string[10];
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
         static uint8_t progress_x_pos = 0;
356
         static uint8_t progress_x_pos = 0;
357
         static uint8_t progress_state = 0;
357
         static uint8_t progress_state = 0;
358
         static bool prev_blink = 0;
358
         static bool prev_blink = 0;
359
+      #else
360
+        #define SHOW_REMAINING_TIME_PREFIX 'R'
359
       #endif
361
       #endif
360
     #endif
362
     #endif
361
   #endif
363
   #endif
408
               ui8tostr3(progress / (PROGRESS_SCALE))
410
               ui8tostr3(progress / (PROGRESS_SCALE))
409
             #endif
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
             progress_x_pos = _SD_DURATION_X(strlen(progress_string)+1);
414
             progress_x_pos = _SD_DURATION_X(strlen(progress_string)+1);
413
           #endif
415
           #endif
414
         #endif
416
         #endif
425
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
427
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
426
             const bool has_days = (estimation.value >= 60*60*24L);
428
             const bool has_days = (estimation.value >= 60*60*24L);
427
             const uint8_t len = estimation.toDigital(estimation_string, has_days);
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
               estimation_x_pos = _SD_DURATION_X(len);
431
               estimation_x_pos = _SD_DURATION_X(len);
430
             #else
432
             #else
431
-              estimation_x_pos = _SD_DURATION_X(len + 2);
433
+              estimation_x_pos = _SD_DURATION_X(len + 1);
432
             #endif
434
             #endif
433
           }
435
           }
434
         #endif
436
         #endif
579
 
581
 
580
     if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
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
         if (prev_blink != blink) {
585
         if (prev_blink != blink) {
584
           prev_blink = blink;
586
           prev_blink = blink;
585
           progress_state++;
587
           progress_state++;
588
 
590
 
589
         if (progress_state == 0) {
591
         if (progress_state == 0) {
590
           if (progress_string[0] != '\0') {
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
             lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
594
             lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
593
             lcd_put_wchar('%');
595
             lcd_put_wchar('%');
594
           }
596
           }
595
         }
597
         }
596
         else if (progress_state == 2  && estimation_string[0] != '\0') {
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
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
600
           lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
599
         }
601
         }
600
         else if (elapsed_string[0] != '\0'){
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
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
604
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
603
         }
605
         }
604
       #else
606
       #else
622
         #if ENABLED(SHOW_REMAINING_TIME)
624
         #if ENABLED(SHOW_REMAINING_TIME)
623
           if (blink && (estimation_string[0] != '\0')) {
625
           if (blink && (estimation_string[0] != '\0')) {
624
             lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, SHOW_REMAINING_TIME_PREFIX);
626
             lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, SHOW_REMAINING_TIME_PREFIX);
625
-            lcd_put_wchar(" ");
626
             lcd_put_u8str(estimation_string);
627
             lcd_put_u8str(estimation_string);
627
           }
628
           }
628
           else
629
           else

Loading…
Cancel
Save