Merge pull request #3625 from jbrazio/feature/print-counter

Print job statistics
This commit is contained in:
Scott Lahteine
2016-04-29 15:31:14 -07:00
24 changed files with 616 additions and 9 deletions

View File

@ -137,6 +137,10 @@
* M33 - Get the longname version of a path
* M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
* M48 - Measure Z_Probe repeatability. M48 [P # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
* M75 - Start the print job timer
* M76 - Pause the print job timer
* M77 - Stop the print job timer
* M78 - Show statistical information about the print jobs
* M80 - Turn on Power Supply
* M81 - Turn off Power Supply
* M82 - Set E codes absolute (default)
@ -327,7 +331,11 @@ static millis_t max_inactive_time = 0;
static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
// Print Job Timer
Stopwatch print_job_timer = Stopwatch();
#if ENABLED(PRINTCOUNTER)
PrintCounter print_job_timer = PrintCounter();
#else
Stopwatch print_job_timer = Stopwatch();
#endif
static uint8_t target_extruder;
@ -4252,6 +4260,15 @@ inline void gcode_M77() {
print_job_timer.stop();
}
#if ENABLED(PRINTCOUNTER)
/*+
* M78: Show print statistics
*/
inline void gcode_M78() {
print_job_timer.showStats();
}
#endif
/**
* M104: Set hot end temperature
*/
@ -6641,6 +6658,12 @@ void process_next_command() {
gcode_M77();
break;
#if ENABLED(PRINTCOUNTER)
case 78: // Show print statistics
gcode_M78();
break;
#endif
#if ENABLED(M100_FREE_MEMORY_WATCHER)
case 100:
gcode_M100();
@ -7755,6 +7778,9 @@ void idle(
);
host_keepalive();
lcd_update();
#if ENABLED(PRINTCOUNTER)
print_job_timer.tick();
#endif
}
/**