diff --git a/src/octoprint/util/comm_acc.py b/src/octoprint/util/comm_acc.py index ace2e3c9..e88efcf5 100644 --- a/src/octoprint/util/comm_acc.py +++ b/src/octoprint/util/comm_acc.py @@ -4,6 +4,9 @@ __author__ = "Gina Häußge based on work by David Braam" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" +### DEBUGING START +import yappi +### DEBUG END import os import glob @@ -498,6 +501,8 @@ class MachineCom(object): self._temperature_timer = RepeatedTimer(frequency, self._poll_temperature, run_first=True) self._temperature_timer.start() + elif "disconnect" in specialcmd: + self.close() else: self._log("Command not Found! %s" % cmd) self._log("available commands are:") @@ -970,6 +975,8 @@ class MachineCom(object): self._sendCommand("?") self._clear_to_send.set() + yappi.start() + while self._monitoring_active: try: line = self._readline() @@ -1353,6 +1360,8 @@ class MachineCom(object): eventManager().fire(Events.ERROR, {"error": self.getErrorString()}) self._log("Connection closed, closing down monitor") + yappi.get_func_stats().print_all() + def _process_registered_message(self, line, feedback_matcher, feedback_controls, feedback_errors): feedback_match = feedback_matcher.search(line) if feedback_match is None: