Browse Source

Option to show SD percent on Graphical LCD

Kai 9 years ago
parent
commit
445d8215e4
1 changed files with 16 additions and 1 deletions
  1. 16
    1
      Marlin/ultralcd_impl_DOGM.h

+ 16
- 1
Marlin/ultralcd_impl_DOGM.h View File

349
   }
349
   }
350
 }
350
 }
351
 
351
 
352
+//#define DOGM_SD_PERCENT
353
+
352
 static void lcd_implementation_status_screen() {
354
 static void lcd_implementation_status_screen() {
353
   u8g.setColorIndex(1); // black on white
355
   u8g.setColorIndex(1); // black on white
354
 
356
 
380
     if (IS_SD_PRINTING) {
382
     if (IS_SD_PRINTING) {
381
       // Progress bar solid part
383
       // Progress bar solid part
382
       u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
384
       u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
385
+    
386
+      #if ENABLED(DOGM_SD_PERCENT)
387
+        // Percent complete
388
+        u8g.setPrintPos(55, 48);
389
+        u8g.print(itostr3(card.percentDone()));
390
+        u8g.print('%');
391
+      #endif
383
     }
392
     }
384
 
393
 
385
     char buffer[10];
394
     char buffer[10];
387
     bool has_days = (elapsed.value > 60*60*24L);
396
     bool has_days = (elapsed.value > 60*60*24L);
388
     elapsed.toDigital(buffer, has_days);
397
     elapsed.toDigital(buffer, has_days);
389
 
398
 
390
-    u8g.setPrintPos(has_days ? 71 : 80, 48);
399
+    #if DISABLED(DOGM_SD_PERCENT)
400
+      #define SD_DURATION_X 71
401
+    #else
402
+      #define SD_DURATION_X 89
403
+    #endif
404
+
405
+    u8g.setPrintPos(SD_DURATION_X + (has_days ? 0 : 9), 48);
391
     lcd_print(buffer);
406
     lcd_print(buffer);
392
 
407
 
393
   #endif
408
   #endif

Loading…
Cancel
Save