2019-10-13 12:59:43 +02: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 21:00:36 +01:00
|
|
|
from kinematics import extruder
|
2019-10-13 12:59:43 +02:00
|
|
|
|
2022-01-11 21:00:36 +01:00
|
|
|
class PrinterExtruderStepper:
|
2019-10-13 12:59:43 +02:00
|
|
|
def __init__(self, config):
|
|
|
|
self.printer = config.get_printer()
|
2022-01-11 21:00:36 +01:00
|
|
|
self.extruder_stepper = extruder.ExtruderStepper(config)
|
2022-02-21 19:59:00 +01:00
|
|
|
self.extruder_name = config.get('extruder')
|
2019-10-13 12:59:43 +02:00
|
|
|
self.printer.register_event_handler("klippy:connect",
|
|
|
|
self.handle_connect)
|
|
|
|
def handle_connect(self):
|
2022-01-11 21:00:36 +01:00
|
|
|
self.extruder_stepper.sync_to_extruder(self.extruder_name)
|
2019-10-13 12:59:43 +02:00
|
|
|
|
|
|
|
def load_config_prefix(config):
|
2022-01-11 21:00:36 +01:00
|
|
|
return PrinterExtruderStepper(config)
|