extruder: Create a new class and python file to track the printer extruder

Create a new python file (extruder.py) to control the extruder heater
and stepper motors.  This separates the extruder control logic from
the cartesian robot code - making it easier to customize both the
kinematic control of the robot as well as the extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-07-10 12:23:35 -04:00
parent 4a527a46ce
commit af99ab1645
8 changed files with 88 additions and 27 deletions

View file

@ -35,7 +35,10 @@ class GCodeParser:
self.axis2pos = {'X': 0, 'Y': 1, 'Z': 2, 'E': 3}
def build_config(self):
self.toolhead = self.printer.objects['toolhead']
self.heater_nozzle = self.printer.objects.get('heater_nozzle')
self.heater_nozzle = None
extruder = self.printer.objects.get('extruder')
if extruder:
self.heater_nozzle = extruder.heater
self.heater_bed = self.printer.objects.get('heater_bed')
self.fan = self.printer.objects.get('fan')
self.build_handlers()