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

@ -5,7 +5,7 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import sys, optparse, ConfigParser, logging, time, threading
import gcode, toolhead, util, mcu, fan, heater, reactor
import gcode, toolhead, util, mcu, fan, heater, extruder, reactor
class ConfigWrapper:
def __init__(self, printer, section):
@ -52,9 +52,9 @@ class Printer:
if self.fileconfig.has_section('fan'):
self.objects['fan'] = fan.PrinterFan(
self, ConfigWrapper(self, 'fan'))
if self.fileconfig.has_section('heater_nozzle'):
self.objects['heater_nozzle'] = heater.PrinterHeater(
self, ConfigWrapper(self, 'heater_nozzle'))
if self.fileconfig.has_section('extruder'):
self.objects['extruder'] = extruder.PrinterExtruder(
self, ConfigWrapper(self, 'extruder'))
if self.fileconfig.has_section('heater_bed'):
self.objects['heater_bed'] = heater.PrinterHeater(
self, ConfigWrapper(self, 'heater_bed'))