aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-01-19 22:22:17 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-01-28 12:19:26 -0500
commit81013ba5c8638dd42932bd893e1b3115b1b98041 (patch)
tree3e0d60c2d084f808f2788a4645579093abdc8739 /klippy/toolhead.py
parentf0a754e496ca989bc355555e2c798c362299abc3 (diff)
downloadkutter-81013ba5c8638dd42932bd893e1b3115b1b98041.tar.gz
kutter-81013ba5c8638dd42932bd893e1b3115b1b98041.tar.xz
kutter-81013ba5c8638dd42932bd893e1b3115b1b98041.zip
klippy: Add access methods and avoid peeking into the printer classes
Add get_reactor(), lookup_object(), lookup_module_objects(), and set_rollover_info() to the main Printer class so that callers do not need to peek into the class' members. Similarly, add get_printer() and get_name() methods to the ConfigWrapper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index ce9db286..83357732 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -1,6 +1,6 @@
# Code for coordinating events on the printer toolhead
#
-# Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net>
+# Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import math, logging
@@ -183,8 +183,8 @@ STALL_TIME = 0.100
class ToolHead:
def __init__(self, printer, config):
self.printer = printer
- self.reactor = printer.reactor
- self.all_mcus = mcu.get_printer_mcus(printer)
+ self.reactor = printer.get_reactor()
+ self.all_mcus = printer.lookup_module_objects('mcu')
self.mcu = self.all_mcus[0]
self.max_velocity = config.getfloat('max_velocity', above=0.)
self.max_accel = config.getfloat('max_accel', above=0.)