Browse Source

Update the stats menu to include longest job and extruded filament

João Brázio 8 years ago
parent
commit
9e5dbf67e8
2 changed files with 32 additions and 10 deletions
  1. 17
    4
      Marlin/language_en.h
  2. 15
    6
      Marlin/ultralcd.cpp

+ 17
- 4
Marlin/language_en.h View File

@@ -561,22 +561,35 @@
561 561
     #define MSG_INFO_PRINT_COUNT              "Print Count"
562 562
   #endif
563 563
   #ifndef MSG_INFO_COMPLETED_PRINTS
564
-    #define MSG_INFO_COMPLETED_PRINTS         "Completed  "
564
+    #define MSG_INFO_COMPLETED_PRINTS         "Completed"
565 565
   #endif
566 566
   #ifndef MSG_INFO_PRINT_TIME
567
-    #define MSG_INFO_PRINT_TIME               "Total Time "
567
+    #define MSG_INFO_PRINT_TIME               "Total print time"
568
+  #endif
569
+  #ifndef MSG_INFO_PRINT_LONGEST
570
+    #define MSG_INFO_PRINT_LONGEST            "Longest job time"
571
+  #endif
572
+  #ifndef MSG_INFO_PRINT_FILAMENT
573
+    #define MSG_INFO_PRINT_FILAMENT           "Extruded total"
568 574
   #endif
569 575
 #else
570 576
   #ifndef MSG_INFO_PRINT_COUNT
571
-    #define MSG_INFO_PRINT_COUNT              "Prints   "
577
+    #define MSG_INFO_PRINT_COUNT              "Prints"
572 578
   #endif
573 579
   #ifndef MSG_INFO_COMPLETED_PRINTS
574 580
     #define MSG_INFO_COMPLETED_PRINTS         "Completed"
575 581
   #endif
576 582
   #ifndef MSG_INFO_PRINT_TIME
577
-    #define MSG_INFO_PRINT_TIME               "Duration "
583
+    #define MSG_INFO_PRINT_TIME               "Total"
584
+  #endif
585
+  #ifndef MSG_INFO_PRINT_LONGEST
586
+    #define MSG_INFO_PRINT_LONGEST            "Longest"
587
+  #endif
588
+  #ifndef MSG_INFO_PRINT_FILAMENT
589
+    #define MSG_INFO_PRINT_FILAMENT           "Extruded"
578 590
   #endif
579 591
 #endif
592
+
580 593
 #ifndef MSG_INFO_MIN_TEMP
581 594
   #define MSG_INFO_MIN_TEMP                   "Min Temp"
582 595
 #endif

+ 15
- 6
Marlin/ultralcd.cpp View File

@@ -1972,17 +1972,26 @@ void kill_screen(const char* lcd_msg) {
1972 1972
       static void lcd_info_stats_menu() {
1973 1973
         if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1974 1974
 
1975
+        char buffer[21];
1975 1976
         printStatistics stats = print_job_timer.getStats();
1977
+
1978
+        START_SCREEN();                                                                                // 12345678901234567890
1979
+        STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints));          // Print Count: 999
1980
+        STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS"  : ", false, false, itostr3left(stats.finishedPrints)); // Completed  : 666
1981
+
1976 1982
         timestamp_t time(stats.printTime);
1983
+        time.toString(buffer);
1984
+        STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false);                                           // Total print Time:
1985
+        STATIC_ITEM("", false, false, buffer);                                                         // 99y 364d 23h 59m 59s
1977 1986
 
1978
-        char buffer[21];
1987
+        time.timestamp = stats.longestPrint;
1979 1988
         time.toString(buffer);
1989
+        STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false);                                        // Longest job time:
1990
+        STATIC_ITEM("", false, false, buffer);                                                         // 99y 364d 23h 59m 59s
1980 1991
 
1981
-        START_SCREEN();                                                                              // 12345678901234567890
1982
-        STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints));        // Print Count: 999
1983
-        STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed  : 666
1984
-        STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false);                                         // Total Time :
1985
-        STATIC_ITEM("  ", false, false, buffer);                                                     //   12345d 12h 34m
1992
+        sprintf_P(buffer, PSTR("%im"), stats.filamentUsed / 1000);
1993
+        STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false);                                       // Extruded total:
1994
+        STATIC_ITEM("", false, false, buffer);                                                         // 125m
1986 1995
         END_SCREEN();
1987 1996
       }
1988 1997
     #endif // PRINTCOUNTER

Loading…
Cancel
Save