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>
This commit is contained in:
Kevin O'Connor 2016-11-17 17:24:03 -05:00
parent 7ef8c0442a
commit 9e1059afb4
8 changed files with 37 additions and 36 deletions

View file

@ -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)