|
@@ -80,30 +80,36 @@ millis_t PrintCounter::deltaDuration() {
|
80
|
80
|
return lastDuration - tmp;
|
81
|
81
|
}
|
82
|
82
|
|
83
|
|
-void PrintCounter::incFilamentUsed(float const &amount) {
|
84
|
|
- TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("incFilamentUsed")));
|
|
83
|
+#if HAS_EXTRUDERS
|
|
84
|
+ void PrintCounter::incFilamentUsed(float const &amount) {
|
|
85
|
+ TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("incFilamentUsed")));
|
85
|
86
|
|
86
|
|
- // Refuses to update data if object is not loaded
|
87
|
|
- if (!isLoaded()) return;
|
|
87
|
+ // Refuses to update data if object is not loaded
|
|
88
|
+ if (!isLoaded()) return;
|
88
|
89
|
|
89
|
|
- data.filamentUsed += amount; // mm
|
90
|
|
-}
|
|
90
|
+ data.filamentUsed += amount; // mm
|
|
91
|
+ }
|
|
92
|
+#endif
|
91
|
93
|
|
92
|
94
|
void PrintCounter::initStats() {
|
93
|
95
|
TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("initStats")));
|
94
|
96
|
|
95
|
97
|
loaded = true;
|
96
|
|
- data = { 0, 0, 0, 0, 0.0
|
97
|
|
- #if HAS_SERVICE_INTERVALS
|
98
|
|
- #if SERVICE_INTERVAL_1 > 0
|
99
|
|
- , SERVICE_INTERVAL_SEC_1
|
100
|
|
- #endif
|
101
|
|
- #if SERVICE_INTERVAL_2 > 0
|
102
|
|
- , SERVICE_INTERVAL_SEC_2
|
103
|
|
- #endif
|
104
|
|
- #if SERVICE_INTERVAL_3 > 0
|
105
|
|
- , SERVICE_INTERVAL_SEC_3
|
106
|
|
- #endif
|
|
98
|
+
|
|
99
|
+ data = {
|
|
100
|
+ .totalPrints = 0
|
|
101
|
+ , .finishedPrints = 0
|
|
102
|
+ , .printTime = 0
|
|
103
|
+ , .longestPrint = 0
|
|
104
|
+ OPTARG(HAS_EXTRUDERS, .filamentUsed = 0.0)
|
|
105
|
+ #if SERVICE_INTERVAL_1 > 0
|
|
106
|
+ , .nextService1 = SERVICE_INTERVAL_SEC_1
|
|
107
|
+ #endif
|
|
108
|
+ #if SERVICE_INTERVAL_2 > 0
|
|
109
|
+ , .nextService2 = SERVICE_INTERVAL_SEC_2
|
|
110
|
+ #endif
|
|
111
|
+ #if SERVICE_INTERVAL_3 > 0
|
|
112
|
+ , .nextService3 = SERVICE_INTERVAL_SEC_3
|
107
|
113
|
#endif
|
108
|
114
|
};
|
109
|
115
|
|
|
@@ -210,8 +216,11 @@ void PrintCounter::showStats() {
|
210
|
216
|
SERIAL_CHAR(')');
|
211
|
217
|
#endif
|
212
|
218
|
|
213
|
|
- SERIAL_ECHOPGM("\n" STR_STATS "Filament used: ", data.filamentUsed / 1000);
|
214
|
|
- SERIAL_CHAR('m');
|
|
219
|
+ #if HAS_EXTRUDERS
|
|
220
|
+ SERIAL_ECHOPGM("\n" STR_STATS "Filament used: ", data.filamentUsed / 1000);
|
|
221
|
+ SERIAL_CHAR('m');
|
|
222
|
+ #endif
|
|
223
|
+
|
215
|
224
|
SERIAL_EOL();
|
216
|
225
|
|
217
|
226
|
#if SERVICE_INTERVAL_1 > 0
|