Browse Source

Closes #3826: SD printing will now pause and stop the print counter

The LCD menu items for SD printing pause/stop have been updated to control
also the print job timer. This commit also fixes a small output bug with
M78, the failed print counter was displaying the wrong value.
João Brázio 8 years ago
parent
commit
40e64b36de
No account linked to committer's email address
2 changed files with 10 additions and 3 deletions
  1. 1
    1
      Marlin/printcounter.cpp
  2. 9
    2
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/printcounter.cpp View File

@@ -86,7 +86,7 @@ void PrintCounter::showStats() {
86 86
 
87 87
   SERIAL_ECHOPGM(", Failed: ");
88 88
   SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints
89
-    - (this->isRunning() || this->isPaused()) ? 1 : 0); // Removes 1 from failures with an active counter
89
+    - ((this->isRunning() || this->isPaused()) ? 1 : 0)); // Removes 1 from failures with an active counter
90 90
 
91 91
   uint32_t t = this->data.printTime /60;
92 92
   SERIAL_ECHOPGM(", Total print time: ");

+ 9
- 2
Marlin/ultralcd.cpp View File

@@ -470,14 +470,21 @@ inline void line_to_current(AxisEnum axis) {
470 470
 
471 471
 #if ENABLED(SDSUPPORT)
472 472
 
473
-  static void lcd_sdcard_pause() { card.pauseSDPrint(); }
473
+  static void lcd_sdcard_pause() {
474
+    card.pauseSDPrint();
475
+    print_job_timer.pause();
476
+  }
474 477
 
475
-  static void lcd_sdcard_resume() { card.startFileprint(); }
478
+  static void lcd_sdcard_resume() {
479
+    card.startFileprint();
480
+    print_job_timer.start();
481
+  }
476 482
 
477 483
   static void lcd_sdcard_stop() {
478 484
     stepper.quick_stop();
479 485
     card.sdprinting = false;
480 486
     card.closefile();
487
+    print_job_timer.stop();
481 488
     thermalManager.autotempShutdown();
482 489
     cancel_heatup = true;
483 490
     lcd_setstatus(MSG_PRINT_ABORTED, true);

Loading…
Cancel
Save