heater: Move M105 command handling from gcode.py to heater.py

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-04-25 13:06:51 -04:00
parent 44f868a802
commit d858498a53
5 changed files with 59 additions and 49 deletions

View File

@@ -19,10 +19,10 @@ class PrinterHeaterBed:
# Set Bed Temperature
gcode = self.printer.lookup_object('gcode')
temp = gcode.get_float('S', params, 0.)
toolhead = self.printer.lookup_object('toolhead')
self.heater.set_temp(temp)
if wait and temp:
gcode.wait_for_temperature(self.heater)
pheater = self.printer.lookup_object('heater')
pheater.wait_for_temperature(self.heater)
def cmd_M190(self, params):
# Set Bed Temperature and Wait
self.cmd_M140(params, wait=True)

View File

@@ -31,7 +31,7 @@ class PIDCalibrate:
except self.printer.command_error as e:
heater.set_control(old_control)
raise
self.gcode.wait_for_temperature(heater)
pheater.wait_for_temperature(heater)
heater.set_control(old_control)
if write_file:
calibrate.write_file('/tmp/heattest.txt')