|
44 | 44 | #include "LightManager.h" |
45 | 45 | #include "cardreader.h" |
46 | 46 |
|
| 47 | +#ifdef DOGLCD |
| 48 | + #include "StatsManager.h" |
| 49 | +#endif |
| 50 | + |
47 | 51 | bool raised = false; |
48 | 52 | extern bool home_all_axis; |
49 | 53 | extern bool bed_leveling; |
@@ -620,17 +624,7 @@ void action_start_print() |
620 | 624 | if(PrintManager::single::instance().state() == PRINTING) |
621 | 625 | { |
622 | 626 | serial_printing = false; |
623 | | - |
624 | | - strcpy(cmd, card.longFilename); |
625 | | - for (c = &cmd[0]; *c; c++) |
626 | | - { |
627 | | - if ((uint8_t)*c > 127) |
628 | | - { |
629 | | - SERIAL_ECHOLN(MSG_SD_BAD_FILENAME); |
630 | | - return; |
631 | | - } |
632 | | - } |
633 | | - |
| 627 | + |
634 | 628 | sprintf_P(cmd, PSTR("M23 %s"), card.filename); |
635 | 629 | } |
636 | 630 |
|
@@ -660,6 +654,7 @@ void action_start_print() |
660 | 654 |
|
661 | 655 | #ifdef DOGLCD |
662 | 656 | PrintManager::single::instance().state(READY); |
| 657 | + StatsManager::single::instance().increaseTotalPrints(); |
663 | 658 | #endif //DOGLCD |
664 | 659 |
|
665 | 660 | enquecommand_P(PSTR("G90")); |
@@ -763,12 +758,20 @@ void action_stop_print() |
763 | 758 | PrintManager::knownPosition(true); |
764 | 759 |
|
765 | 760 | stop_buffer = false; |
| 761 | + |
| 762 | + #ifdef DOGLCD |
| 763 | + Time_t printTime = PrintManager::single::instance().printingTime(); |
| 764 | + StatsManager::single::instance().updateTotalTime(printTime); |
| 765 | + #endif |
766 | 766 | } |
767 | 767 |
|
768 | 768 | void action_finish_print() |
769 | 769 | { |
770 | 770 | action_stop_print(); |
771 | 771 | action_cooldown(); |
| 772 | + #ifdef DOGLCD |
| 773 | + StatsManager::single::instance().increaseSuccededPrints(); |
| 774 | + #endif |
772 | 775 | } |
773 | 776 |
|
774 | 777 | extern float target[4]; |
@@ -998,3 +1001,12 @@ bool action_check_auto_gcode() |
998 | 1001 | } |
999 | 1002 | return false; |
1000 | 1003 | } |
| 1004 | + |
| 1005 | +bool action_check_pause_state() |
| 1006 | +{ |
| 1007 | + if(PrintManager::single::instance().state() == PrinterState_t::PAUSED) |
| 1008 | + { |
| 1009 | + return true; |
| 1010 | + } |
| 1011 | + return false; |
| 1012 | +} |
0 commit comments