Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ script:
### I2C PANELS ###
#
# LCD_I2C_SAINSMART_YWROBOT
# Failing at the moment needs different library
# Failing at the moment needs different library
#- restore_configs
#- opt_enable LCD_I2C_SAINSMART_YWROBOT
#- build_marlin
Expand Down Expand Up @@ -199,6 +199,12 @@ script:
- opt_set_adv Z2_MAX_PIN 2
- build_marlin
#
# Test PRINTCOUNTER
#
- restore_configs
- opt_enable PRINTCOUNTER
- build_marlin
#
#
######## Example Configurations ##############
#
Expand Down
13 changes: 13 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
12 changes: 10 additions & 2 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ typedef unsigned long millis_t;

#include "WString.h"

#include "stopwatch.h"
#if ENABLED(PRINTCOUNTER)
#include "printcounter.h"
#else
#include "stopwatch.h"
#endif

#ifdef USBCON
#if ENABLED(BLUETOOTH)
Expand Down Expand Up @@ -364,7 +368,11 @@ extern bool axis_homed[3]; // axis[n].is_homed
#endif

// Print job timer
extern Stopwatch print_job_timer;
#if ENABLED(PRINTCOUNTER)
extern PrintCounter print_job_timer;
#else
extern Stopwatch print_job_timer;
#endif

// Handling multiple extruders pins
extern uint8_t active_extruder;
Expand Down
28 changes: 27 additions & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -6636,6 +6653,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();
Expand Down Expand Up @@ -7750,6 +7773,9 @@ void idle(
);
host_keepalive();
lcd_update();
#if ENABLED(PRINTCOUNTER)
print_job_timer.tick();
#endif
}

/**
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/K8200/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 60 // K8200: set back to 110 if you have an upgraded heatbed power supply
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
15 changes: 14 additions & 1 deletion Marlin/example_configurations/RigidBot/Configuration.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
f/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
Expand Down Expand Up @@ -751,6 +751,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/SCARA/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/TAZ4/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/WITBOX/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/adafruit/ST7565/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 110
#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/delta/biv2.5/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/delta/generic/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
13 changes: 13 additions & 0 deletions Marlin/example_configurations/delta/kossel_mini/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,19 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255


//
// Print Counter
//
// When enabled Marlin will keep track of some print statistical data such as:
// - Total print jobs
// - Total successful print jobs
// - Total failed print jobs
// - Total time printing
//
// This information can be viewed by the M78 command.
//#define PRINTCOUNTER

//=============================================================================
//============================= LCD and SD support ============================
//=============================================================================
Expand Down
Loading