ソースを参照

Update the stats menu to include longest job and extruded filament

João Brázio 9年前
コミット
9e5dbf67e8
2個のファイルの変更32行の追加10行の削除
  1. 17
    4
      Marlin/language_en.h
  2. 15
    6
      Marlin/ultralcd.cpp

+ 17
- 4
Marlin/language_en.h ファイルの表示

561
     #define MSG_INFO_PRINT_COUNT              "Print Count"
561
     #define MSG_INFO_PRINT_COUNT              "Print Count"
562
   #endif
562
   #endif
563
   #ifndef MSG_INFO_COMPLETED_PRINTS
563
   #ifndef MSG_INFO_COMPLETED_PRINTS
564
-    #define MSG_INFO_COMPLETED_PRINTS         "Completed  "
564
+    #define MSG_INFO_COMPLETED_PRINTS         "Completed"
565
   #endif
565
   #endif
566
   #ifndef MSG_INFO_PRINT_TIME
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
   #endif
574
   #endif
569
 #else
575
 #else
570
   #ifndef MSG_INFO_PRINT_COUNT
576
   #ifndef MSG_INFO_PRINT_COUNT
571
-    #define MSG_INFO_PRINT_COUNT              "Prints   "
577
+    #define MSG_INFO_PRINT_COUNT              "Prints"
572
   #endif
578
   #endif
573
   #ifndef MSG_INFO_COMPLETED_PRINTS
579
   #ifndef MSG_INFO_COMPLETED_PRINTS
574
     #define MSG_INFO_COMPLETED_PRINTS         "Completed"
580
     #define MSG_INFO_COMPLETED_PRINTS         "Completed"
575
   #endif
581
   #endif
576
   #ifndef MSG_INFO_PRINT_TIME
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
   #endif
590
   #endif
579
 #endif
591
 #endif
592
+
580
 #ifndef MSG_INFO_MIN_TEMP
593
 #ifndef MSG_INFO_MIN_TEMP
581
   #define MSG_INFO_MIN_TEMP                   "Min Temp"
594
   #define MSG_INFO_MIN_TEMP                   "Min Temp"
582
 #endif
595
 #endif

+ 15
- 6
Marlin/ultralcd.cpp ファイルの表示

1972
       static void lcd_info_stats_menu() {
1972
       static void lcd_info_stats_menu() {
1973
         if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1973
         if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1974
 
1974
 
1975
+        char buffer[21];
1975
         printStatistics stats = print_job_timer.getStats();
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
         timestamp_t time(stats.printTime);
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
         time.toString(buffer);
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
         END_SCREEN();
1995
         END_SCREEN();
1987
       }
1996
       }
1988
     #endif // PRINTCOUNTER
1997
     #endif // PRINTCOUNTER

読み込み中…
キャンセル
保存