diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-11-17 17:24:03 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-18 14:04:09 -0500 |
commit | 9e1059afb46c9df439211d21590da987b32e2963 (patch) | |
tree | efaede08f7dd8ade191cd7c4c4ddf0e7b5576086 /klippy/gcode.py | |
parent | 7ef8c0442a719ef80b9ef4109ab7e8fa57157854 (diff) | |
download | kutter-9e1059afb46c9df439211d21590da987b32e2963.tar.gz kutter-9e1059afb46c9df439211d21590da987b32e2963.tar.xz kutter-9e1059afb46c9df439211d21590da987b32e2963.zip |
homing: Create QueryEndstops class from gcode
Create the QueryEndstops in the gcode handler instead of in the
kinematic classes. This simplifies the gcode handler as it can
directly register its response callback.
Also, store the stepper name in the stepper class. Also, propagate
the print_time of the query request to the mcu_endstop class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index 9902ec4c..97f88563 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -308,16 +308,10 @@ class GCodeParser: # Get Endstop Status if self.inputfile: return - # Wrapper class for check_busy() that responds with final status - class endstop_handler_wrapper: - gcode = self - state = self.toolhead.query_endstops() - def check_busy(self, eventtime): - busy = self.state.check_busy(eventtime) - if not busy: - self.gcode.respond(self.state.get_msg()) - return busy - self.set_busy(endstop_handler_wrapper()) + print_time = self.toolhead.get_last_move_time() + query_state = homing.QueryEndstops(print_time, self.respond) + self.toolhead.query_endstops(query_state) + self.set_busy(query_state) def cmd_M140(self, params): # Set Bed Temperature self.set_temp(self.heater_bed, params) |