2019-10-13 13:59:43 +03:00
|
|
|
# Code for supporting multiple steppers in single filament extruder.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2019 Simo Apell <simo.apell@live.fi>
|
|
|
|
#
|
|
|
|
# This file may be distributed under the terms of the GNU GPLv3 license.
|
|
|
|
import logging
|
2022-01-11 23:00:36 +03:00
|
|
|
from kinematics import extruder
|
2019-10-13 13:59:43 +03:00
|
|
|
|
2022-01-11 23:00:36 +03:00
|
|
|
class PrinterExtruderStepper:
|
2019-10-13 13:59:43 +03:00
|
|
|
def __init__(self, config):
|
|
|
|
self.printer = config.get_printer()
|
2022-01-11 23:00:36 +03:00
|
|
|
self.extruder_stepper = extruder.ExtruderStepper(config)
|
2022-02-21 21:59:00 +03:00
|
|
|
self.extruder_name = config.get('extruder')
|
2019-10-13 13:59:43 +03:00
|
|
|
self.printer.register_event_handler("klippy:connect",
|
|
|
|
self.handle_connect)
|
|
|
|
def handle_connect(self):
|
2022-01-11 23:00:36 +03:00
|
|
|
self.extruder_stepper.sync_to_extruder(self.extruder_name)
|
2019-10-13 13:59:43 +03:00
|
|
|
|
|
|
|
def load_config_prefix(config):
|
2022-01-11 23:00:36 +03:00
|
|
|
return PrinterExtruderStepper(config)
|