Browse Source

Update the stats menu to include longest job and extruded filament

pull/1/head
João Brázio 8 years ago
parent
commit
9e5dbf67e8
  1. 17
      Marlin/language_en.h
  2. 21
      Marlin/ultralcd.cpp

17
Marlin/language_en.h

@ -564,7 +564,13 @@
#define MSG_INFO_COMPLETED_PRINTS "Completed" #define MSG_INFO_COMPLETED_PRINTS "Completed"
#endif #endif
#ifndef MSG_INFO_PRINT_TIME #ifndef MSG_INFO_PRINT_TIME
#define MSG_INFO_PRINT_TIME "Total Time " #define MSG_INFO_PRINT_TIME "Total print time"
#endif
#ifndef MSG_INFO_PRINT_LONGEST
#define MSG_INFO_PRINT_LONGEST "Longest job time"
#endif
#ifndef MSG_INFO_PRINT_FILAMENT
#define MSG_INFO_PRINT_FILAMENT "Extruded total"
#endif #endif
#else #else
#ifndef MSG_INFO_PRINT_COUNT #ifndef MSG_INFO_PRINT_COUNT
@ -574,9 +580,16 @@
#define MSG_INFO_COMPLETED_PRINTS "Completed" #define MSG_INFO_COMPLETED_PRINTS "Completed"
#endif #endif
#ifndef MSG_INFO_PRINT_TIME #ifndef MSG_INFO_PRINT_TIME
#define MSG_INFO_PRINT_TIME "Duration " #define MSG_INFO_PRINT_TIME "Total"
#endif
#ifndef MSG_INFO_PRINT_LONGEST
#define MSG_INFO_PRINT_LONGEST "Longest"
#endif #endif
#ifndef MSG_INFO_PRINT_FILAMENT
#define MSG_INFO_PRINT_FILAMENT "Extruded"
#endif #endif
#endif
#ifndef MSG_INFO_MIN_TEMP #ifndef MSG_INFO_MIN_TEMP
#define MSG_INFO_MIN_TEMP "Min Temp" #define MSG_INFO_MIN_TEMP "Min Temp"
#endif #endif

21
Marlin/ultralcd.cpp

@ -1972,17 +1972,26 @@ void kill_screen(const char* lcd_msg) {
static void lcd_info_stats_menu() { static void lcd_info_stats_menu() {
if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
printStatistics stats = print_job_timer.getStats();
timestamp_t time(stats.printTime);
char buffer[21]; char buffer[21];
time.toString(buffer); printStatistics stats = print_job_timer.getStats();
START_SCREEN(); // 12345678901234567890 START_SCREEN(); // 12345678901234567890
STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999
STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS" : ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS" : ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666
STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total Time :
STATIC_ITEM(" ", false, false, buffer); // 12345d 12h 34m timestamp_t time(stats.printTime);
time.toString(buffer);
STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time:
STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
time.timestamp = stats.longestPrint;
time.toString(buffer);
STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time:
STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
sprintf_P(buffer, PSTR("%im"), stats.filamentUsed / 1000);
STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total:
STATIC_ITEM("", false, false, buffer); // 125m
END_SCREEN(); END_SCREEN();
} }
#endif // PRINTCOUNTER #endif // PRINTCOUNTER

Loading…
Cancel
Save