Adds filamentUsed and longestPrint stats to PrintCounter

This commit is contained in:
João Brázio
2016-07-14 02:18:59 +01:00
parent 7202383695
commit 2f26bc2153
4 changed files with 87 additions and 20 deletions

View File

@@ -24,6 +24,7 @@
#define PRINTCOUNTER_H
#include "macros.h"
#include "language.h"
#include "stopwatch.h"
#include <avr/eeprom.h>
@@ -35,8 +36,9 @@ struct printStatistics { // 13 bytes
//const uint8_t magic; // Magic header, it will always be 0x16
uint16_t totalPrints; // Number of prints
uint16_t finishedPrints; // Number of complete prints
millis_t printTime; // Total printing time
millis_t longestPrint; // Longest print job - not in use
uint32_t printTime; // Accumulated printing time
uint32_t longestPrint; // Longest successfull print job
double filamentUsed; // Accumulated filament consumed in mm
};
class PrintCounter: public Stopwatch {
@@ -105,6 +107,14 @@ class PrintCounter: public Stopwatch {
*/
bool isLoaded();
/**
* @brief Increments the total filament used
* @details The total filament used counter will be incremented by "amount".
*
* @param amount The amount of filament used in mm
*/
void incFilamentUsed(double const &amount);
/**
* @brief Resets the Print Statistics
* @details Resets the statistics to zero and saves them to EEPROM creating