From 0b5395e21d5f39ba06c25d3168313aaba00dc1f9 Mon Sep 17 00:00:00 2001 From: make-ing Date: Tue, 20 Oct 2015 17:22:03 +0200 Subject: [PATCH] changed send_event.set() handling into _readline() --- src/octoprint/util/comm_acc2.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/octoprint/util/comm_acc2.py b/src/octoprint/util/comm_acc2.py index f3f3e71f..6c8e623d 100644 --- a/src/octoprint/util/comm_acc2.py +++ b/src/octoprint/util/comm_acc2.py @@ -254,6 +254,7 @@ class MachineCom(object): if(len(self._acc_line_buffer) > 0): #print('buffer',sum(self.acc_line_lengths), 'deleting after ok', self.acc_line_lengths[0]) del self._acc_line_buffer[0] # Delete the commands character count corresponding to the last 'ok' + self._send_event.set() except serial.SerialException: self._log("Unexpected error while reading serial port: %s" % (get_exception_string())) self._errorValue = get_exception_string() @@ -307,14 +308,12 @@ class MachineCom(object): self._changeState(self.STATE_OPERATIONAL) def _state_operational_handle(self, line): - if line.startswith("ok"): - self._send_event.set() - elif line.startswith("<"): + if line.startswith("<"): self._update_grbl_pos(line) def _state_printing_handle(self, line): - if line.startswith("ok"): - self._send_event.set() + if line.startswith("<"): + self._update_grbl_pos(line) def _update_grbl_pos(self, line): # line example: