From b1129332c98baca25c7510b55e5f8d494e6e3a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 4 Mar 2015 20:33:44 +0100 Subject: [PATCH] Detect external heatup If a line "T: " comes in, the printer is heating up although we don't know why. Nevertheless count the time. --- src/octoprint/util/comm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 1356a4fa..ef39c8eb 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -153,6 +153,7 @@ class MachineCom(object): self._currentExtruder = 0 self._blocking_command = False + self._heating = False self._timeout = None @@ -842,9 +843,14 @@ class MachineCom(object): if line.strip().startswith("ok"): self._clear_to_send.set() self._blocking_command = False + self._heating = False ##~~ Temperature processing if ' T:' in line or line.startswith('T:') or ' T0:' in line or line.startswith('T0:'): + if not line.strip().startswith("ok") and not self._heating: + self._logger.debug("Externally triggered heatup detected") + self._heating = True + self._heatupWaitStartTime = time.time() self._processTemperatures(line) self._callback.on_comm_temperature_update(self._temp, self._bedTemp)