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/klippy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'klippy/klippy.py') diff --git a/klippy/klippy.py b/klippy/klippy.py index 77ab3cc0..9532b911 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -7,7 +7,7 @@ import sys, os, optparse, logging, time, threading import collections, ConfigParser, importlib import util, reactor, queuelogger, msgproto -import gcode, pins, mcu, toolhead, extruder, heater +import gcode, pins, heater, mcu, toolhead, extruder message_ready = "Printer is ready" @@ -204,11 +204,11 @@ class Printer: ConfigLogger(fileconfig, self.bglogger) # Create printer components config = ConfigWrapper(self, fileconfig, 'printer') - for m in [pins, mcu]: + for m in [pins, heater, mcu]: m.add_printer_objects(self, config) for section in fileconfig.sections(): self.try_load_module(config, section) - for m in [toolhead, extruder, heater]: + for m in [toolhead, extruder]: m.add_printer_objects(self, config) # Validate that there are no undefined parameters in the config file valid_sections = { s: 1 for s, o in self.all_config_options } -- cgit v1.2.3-70-g09d2