aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-09 09:41:46 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-09 17:09:51 -0500
commitedd7dfe1c87cd4362c4ec2536bceef857389a692 (patch)
tree814f658b282ad9cb9212c7ab14bc937955779261 /klippy/gcode.py
parent89f5452ddbcaecfba7cee5a3ba73b2659746d63f (diff)
downloadkutter-edd7dfe1c87cd4362c4ec2536bceef857389a692.tar.gz
kutter-edd7dfe1c87cd4362c4ec2536bceef857389a692.tar.xz
kutter-edd7dfe1c87cd4362c4ec2536bceef857389a692.zip
gcode: Rework toolhead stalling to use greenlets
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index 5dee80cf..0c306147 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -22,7 +22,6 @@ class GCodeParser:
self.input_commands = [""]
self.bytes_read = 0
self.input_log = collections.deque([], 50)
- self.busy_state = None
# Command handling
self.gcode_handlers = {}
self.is_printer_ready = False
@@ -114,12 +113,6 @@ class GCodeParser:
logging.exception("Exception in command handler")
self.toolhead.force_shutdown()
self.respond_error('Internal error on command:"%s"' % (cmd,))
- # Check if machine can process next command or must stall input
- if self.busy_state is not None:
- self.busy_handler(eventtime)
- if self.is_printer_ready and self.toolhead.check_busy(eventtime):
- self.set_busy(self.toolhead)
- self.busy_handler(eventtime)
self.ack()
del self.input_commands[:i+1]
def process_data(self, eventtime):
@@ -160,26 +153,6 @@ class GCodeParser:
for line in lines[:-1]:
self.respond('// %s' % (line.strip(),))
self.respond('!! %s' % (lines[-1].strip(),))
- # Busy handling
- def set_busy(self, busy_handler):
- self.busy_state = busy_handler
- def busy_handler(self, eventtime):
- while 1:
- try:
- busy = self.busy_state.check_busy(eventtime)
- except homing.EndstopError, e:
- self.respond_error(str(e))
- busy = False
- except:
- logging.exception("Exception in busy handler")
- self.toolhead.force_shutdown()
- self.respond_error('Internal error in busy handler')
- busy = False
- if not busy:
- break
- self.toolhead.reset_motor_off_time(eventtime)
- eventtime = self.reactor.pause(eventtime + self.RETRY_TIME)
- self.busy_state = None
# Temperature wrappers
def get_temp(self):
if not self.is_printer_ready: