From 1f19fd1e1db5edc1bfacd8e9ef57926721f0be95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 29 Jul 2016 07:41:19 +0200 Subject: [PATCH] Partially revert 937487037 This commit might be at the root of the problems reported in #1423 --- src/octoprint/settings.py | 1 - src/octoprint/util/comm.py | 20 +++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index edea1e25..830112f1 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -81,7 +81,6 @@ default_settings = { "detection": 0.5, "connection": 10, "communication": 30, - "heatup": 2, "temperature": 5, "sdStatus": 1 }, diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 8fb0bf23..d0d5ddcf 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -975,10 +975,7 @@ class MachineCom(object): break if line.strip() is not "": self._consecutive_timeouts = 0 - if self._heating: - self._timeout = get_new_timeout("heatup", self._timeout_intervals) - else: - self._timeout = get_new_timeout("communication", self._timeout_intervals) + self._timeout = get_new_timeout("communication", self._timeout_intervals) ##~~ debugging output handling if line.startswith("//"): @@ -1081,7 +1078,8 @@ class MachineCom(object): elif ' T:' in line or line.startswith('T:') or ' T0:' in line or line.startswith('T0:') or ((' B:' in line or line.startswith('B:')) and not 'A:' in line): if not disable_external_heatup_detection and not line.strip().startswith("ok") and not self._heating: self._logger.debug("Externally triggered heatup detected") - self._track_heatup() + self._heating = True + self._heatupWaitStartTime = time.time() self._processTemperatures(line) self._callback.on_comm_temperature_update(self._temp, self._bedTemp) @@ -1352,17 +1350,11 @@ class MachineCom(object): self._log(message + " " + general_message) self._clear_to_send.set() - def _track_heatup(self): - self._heating = True - self._heatupWaitStartTime = time.time() - self._serial.timeout = settings().getFloat(["serial", "timeout", "heatup"]) - def _finish_heatup(self): if self._heatupWaitStartTime: self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime) self._heatupWaitStartTime = None self._heating = False - self._serial.timeout = settings().getFloat(["serial", "timeout", "communication"]) def _continue_sending(self): while self._active: @@ -2152,13 +2144,15 @@ class MachineCom(object): pass def _gcode_M109_sent(self, cmd, cmd_type=None): + self._heatupWaitStartTime = time.time() self._long_running_command = True - self._track_heatup() + self._heating = True self._gcode_M104_sent(cmd, cmd_type, wait=True) def _gcode_M190_sent(self, cmd, cmd_type=None): + self._heatupWaitStartTime = time.time() self._long_running_command = True - self._track_heatup() + self._heating = True self._gcode_M140_sent(cmd, cmd_type, wait=True) def _gcode_M110_sending(self, cmd, cmd_type=None):