extruder: Add support for extruders sharing the same heater

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-09-03 16:51:08 -04:00
parent 6fa95e12ea
commit 09eec3710d
2 changed files with 12 additions and 1 deletions

View File

@ -13,6 +13,13 @@
#step_pin: ar36
#dir_pin: ar34
#...
#shared_heater:
# If this extruder uses the same heater already defined for another
# extruder then place the name of that extruder here. For example,
# should extruder3 and extruder4 share a heater then the extruder3
# config section should define the heater and the extruder4 section
# should specify "shared_heater: extruder3". The default is to not
# reuse an existing heater.
#deactivate_gcode:
# A list of G-Code commands (one per line) to execute on a G-Code
# tool change command (eg, "T1") that deactivates this extruder and

View File

@ -10,7 +10,11 @@ EXTRUDE_DIFF_IGNORE = 1.02
class PrinterExtruder:
def __init__(self, printer, config):
self.heater = heater.PrinterHeater(printer, config)
shared_heater = config.get('shared_heater', None)
if shared_heater is None:
self.heater = heater.PrinterHeater(printer, config)
else:
self.heater = get_printer_heater(printer, shared_heater)
self.stepper = stepper.PrinterStepper(printer, config)
self.nozzle_diameter = config.getfloat('nozzle_diameter', above=0.)
filament_diameter = config.getfloat(