From 5ecc0a1e90e8bb84f578241f87f97ca82d3c1087 Mon Sep 17 00:00:00 2001 From: make-ing Date: Thu, 1 Oct 2015 17:42:47 +0200 Subject: [PATCH] Revert "removed debugging output handling" This reverts commit 3f61ebc29e8978c18063933b996c55ac8720fb3d. --- src/octoprint/util/comm_acc.py | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/octoprint/util/comm_acc.py b/src/octoprint/util/comm_acc.py index 139e5fa7..f6b2f400 100644 --- a/src/octoprint/util/comm_acc.py +++ b/src/octoprint/util/comm_acc.py @@ -978,32 +978,32 @@ class MachineCom(object): # if line.strip() is not "": # self._timeout = get_new_timeout("communication") - # ##~~ debugging output handling - # if line.startswith("//"): - # debugging_output = line[2:].strip() - # if debugging_output.startswith("action:"): - # action_command = debugging_output[len("action:"):].strip() - # - # if action_command == "pause": - # self._log("Pausing on request of the printer...") - # self.setPause(True) - # elif action_command == "resume": - # self._log("Resuming on request of the printer...") - # self.setPause(False) - # elif action_command == "disconnect": - # self._log("Disconnecting on request of the printer...") - # self._callback.on_comm_force_disconnect() - # else: - # for hook in self._printer_action_hooks: - # self._printer_action_hooks[hook](self, line, action_command) - # else: - # continue + ##~~ debugging output handling + if line.startswith("//"): + debugging_output = line[2:].strip() + if debugging_output.startswith("action:"): + action_command = debugging_output[len("action:"):].strip() + + if action_command == "pause": + self._log("Pausing on request of the printer...") + self.setPause(True) + elif action_command == "resume": + self._log("Resuming on request of the printer...") + self.setPause(False) + elif action_command == "disconnect": + self._log("Disconnecting on request of the printer...") + self._callback.on_comm_force_disconnect() + else: + for hook in self._printer_action_hooks: + self._printer_action_hooks[hook](self, line, action_command) + else: + continue ##~~ Error handling #line = self._handleErrors(line) # GRBL Position update - if self._grbl: + if self._grbl : if(self._state == self.STATE_HOMING and 'ok' in line): self._changeState(self.STATE_OPERATIONAL) self._onHomingDone();