Allow temporary override of heater off when using suspend or M600
authorJim Morris <morris@wolfman.com>
Fri, 11 Dec 2015 00:56:56 +0000 (16:56 -0800)
committerJim Morris <morris@wolfman.com>
Fri, 11 Dec 2015 00:56:56 +0000 (16:56 -0800)
  M600.1 or suspend h
will suspend and leave heaters on

src/modules/utils/player/Player.cpp
src/modules/utils/player/Player.h

index 9e4b051..cb7f319 100644 (file)
@@ -202,8 +202,8 @@ void Player::on_gcode_received(void *argument)
             this->played_cnt = 0;
             this->elapsed_secs = 0;
 
-        } else if (gcode->m == 600) { // suspend print, Not entirely Marlin compliant
-            this->suspend_command("", gcode->stream);
+        } else if (gcode->m == 600) { // suspend print, Not entirely Marlin compliant, M600.1 will leave the heaters on
+            this->suspend_command((gcode->subcode == 1)?"h":"", gcode->stream);
 
         } else if (gcode->m == 601) { // resume print
             this->resume_command("", gcode->stream);
@@ -488,6 +488,9 @@ void Player::suspend_command(string parameters, StreamOutput *stream )
 
     stream->printf("Suspending print, waiting for queue to empty...\n");
 
+    // override the leave_heaters_on setting
+    this->override_leave_heaters_on= (parameters == "h");
+
     suspended= true;
     if( this->playing_file ) {
         // pause an sd print
@@ -525,7 +528,7 @@ void Player::suspend_part2()
     // TODO retract by optional amount...
 
     this->saved_temperatures.clear();
-    if(!this->leave_heaters_on) {
+    if(!this->leave_heaters_on && !this->override_leave_heaters_on) {
         // save current temperatures, get a vector of all the controllers data
         std::vector<struct pad_temperature> controllers;
         bool ok = PublicData::get_value(temperature_control_checksum, poll_controls_checksum, &controllers);
index 0f5b4fc..cbcfb48 100644 (file)
@@ -60,6 +60,7 @@ class Player : public Module {
             bool suspended:1;
             bool was_playing_file:1;
             bool leave_heaters_on:1;
+            bool override_leave_heaters_on:1;
             uint8_t suspend_loops:4;
         };
 };