|
@@ -22,6 +22,7 @@
|
22
|
22
|
|
23
|
23
|
#include "Marlin.h"
|
24
|
24
|
#include "printcounter.h"
|
|
25
|
+#include "timestamp_t.h"
|
25
|
26
|
|
26
|
27
|
PrintCounter::PrintCounter(): super() {
|
27
|
28
|
this->loadStats();
|
|
@@ -92,6 +93,9 @@ void PrintCounter::saveStats() {
|
92
|
93
|
}
|
93
|
94
|
|
94
|
95
|
void PrintCounter::showStats() {
|
|
96
|
+ char buffer[21];
|
|
97
|
+ timestamp_t time;
|
|
98
|
+
|
95
|
99
|
SERIAL_PROTOCOLPGM(MSG_STATS);
|
96
|
100
|
|
97
|
101
|
SERIAL_ECHOPGM("Prints: ");
|
|
@@ -107,17 +111,11 @@ void PrintCounter::showStats() {
|
107
|
111
|
SERIAL_EOL;
|
108
|
112
|
SERIAL_PROTOCOLPGM(MSG_STATS);
|
109
|
113
|
|
110
|
|
- uint32_t t = this->data.printTime / 60;
|
111
|
|
- SERIAL_ECHOPGM("Total time: ");
|
112
|
|
-
|
113
|
|
- SERIAL_ECHO(t / 60 / 24);
|
114
|
|
- SERIAL_ECHOPGM("d ");
|
|
114
|
+ time.timestamp = this->data.printTime;
|
|
115
|
+ time.toString(buffer);
|
115
|
116
|
|
116
|
|
- SERIAL_ECHO((t / 60) % 24);
|
117
|
|
- SERIAL_ECHOPGM("h ");
|
118
|
|
-
|
119
|
|
- SERIAL_ECHO(t % 60);
|
120
|
|
- SERIAL_ECHOPGM("min");
|
|
117
|
+ SERIAL_ECHOPGM("Total time: ");
|
|
118
|
+ SERIAL_ECHO(buffer);
|
121
|
119
|
|
122
|
120
|
#if ENABLED(DEBUG_PRINTCOUNTER)
|
123
|
121
|
SERIAL_ECHOPGM(" (");
|
|
@@ -125,17 +123,11 @@ void PrintCounter::showStats() {
|
125
|
123
|
SERIAL_ECHOPGM(")");
|
126
|
124
|
#endif
|
127
|
125
|
|
128
|
|
- uint32_t l = this->data.longestPrint / 60;
|
129
|
|
- SERIAL_ECHOPGM(", Longest job: ");
|
130
|
|
-
|
131
|
|
- SERIAL_ECHO(l / 60 / 24);
|
132
|
|
- SERIAL_ECHOPGM("d ");
|
|
126
|
+ time.timestamp = this->data.longestPrint;
|
|
127
|
+ time.toString(buffer);
|
133
|
128
|
|
134
|
|
- SERIAL_ECHO((l / 60) % 24);
|
135
|
|
- SERIAL_ECHOPGM("h ");
|
136
|
|
-
|
137
|
|
- SERIAL_ECHO(l % 60);
|
138
|
|
- SERIAL_ECHOPGM("min");
|
|
129
|
+ SERIAL_ECHOPGM(", Longest job: ");
|
|
130
|
+ SERIAL_ECHO(buffer);
|
139
|
131
|
|
140
|
132
|
#if ENABLED(DEBUG_PRINTCOUNTER)
|
141
|
133
|
SERIAL_ECHOPGM(" (");
|