Bläddra i källkod

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 år sedan
förälder
incheckning
40e64b36de
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 10 tillägg och 3 borttagningar
  1. 1
    1
      Marlin/printcounter.cpp
  2. 9
    2
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/printcounter.cpp Visa fil

86
 
86
 
87
   SERIAL_ECHOPGM(", Failed: ");
87
   SERIAL_ECHOPGM(", Failed: ");
88
   SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints
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
   uint32_t t = this->data.printTime /60;
91
   uint32_t t = this->data.printTime /60;
92
   SERIAL_ECHOPGM(", Total print time: ");
92
   SERIAL_ECHOPGM(", Total print time: ");

+ 9
- 2
Marlin/ultralcd.cpp Visa fil

470
 
470
 
471
 #if ENABLED(SDSUPPORT)
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
   static void lcd_sdcard_stop() {
483
   static void lcd_sdcard_stop() {
478
     stepper.quick_stop();
484
     stepper.quick_stop();
479
     card.sdprinting = false;
485
     card.sdprinting = false;
480
     card.closefile();
486
     card.closefile();
487
+    print_job_timer.stop();
481
     thermalManager.autotempShutdown();
488
     thermalManager.autotempShutdown();
482
     cancel_heatup = true;
489
     cancel_heatup = true;
483
     lcd_setstatus(MSG_PRINT_ABORTED, true);
490
     lcd_setstatus(MSG_PRINT_ABORTED, true);

Laddar…
Avbryt
Spara