From aed958eb5c32003c7ffcd10d8852082b6d896794 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 3 Apr 2018 17:01:10 -0400 Subject: heater: Add PrinterHeaters class that stores all sensors and heaters Add a PrinterHeaters class that can stores references to available temperature sensors and stores references to instantiated heaters. Add a extras/heater_bed.py file and delay instantiation of the heater_bed object. This allows the heater.py module to be imported earlier during the setup phase, and allows the PrinterHeaters class to be available for registering sensors and heaters. Signed-off-by: Kevin O'Connor --- klippy/extras/pid_calibrate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klippy/extras/pid_calibrate.py') diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index 477f3a93..1caffeb7 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -4,7 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import math, logging -import extruder, heater +import heater class PIDCalibrate: def __init__(self, config): @@ -18,8 +18,9 @@ class PIDCalibrate: heater_name = self.gcode.get_str('HEATER', params) target = self.gcode.get_float('TARGET', params) write_file = self.gcode.get_int('WRITE_FILE', params, 0) + pheater = self.printer.lookup_object('heater') try: - heater = extruder.get_printer_heater(self.printer, heater_name) + heater = pheater.lookup_heater(heater_name) except self.printer.config_error as e: raise self.gcode.error(str(e)) print_time = self.printer.lookup_object('toolhead').get_last_move_time() -- cgit v1.2.3-70-g09d2