Fix heatup flag not resetting on external SD print start

If the start of the SD print could only be verified after the blocking
heatup was through, the start time was reset to None and hence the
heatup flag was not cleared on receival of the first ok, causing no
commands to be sent out and things to run into a timeout.

Fixes #2536
This commit is contained in:
Gina Häußge committed 2018-04-03 15:41:13 +02:00
1 parent 25005b547c
commit fcecb5c0f0
1 file changed
+6 -5
+6 -5
View File
@@ -1003,7 +1003,7 @@ class MachineCom(object):
if self._currentFile is None:
raise ValueError("No file selected for printing")
self._heatupWaitStartTime = None
self._heatupWaitStartTime = None if not self._heating else time.time()
self._heatupWaitTimeLost = 0.0
self._pauseWaitStartTime = 0
self._pauseWaitTimeLost = 0.0
@@ -1631,7 +1631,7 @@ class MachineCom(object):
if not disable_external_heatup_detection and not self._temperature_autoreporting \
and not line.strip().startswith("ok") and not self._heating \
and self._firmware_info_received:
self._logger.debug("Externally triggered heatup detected")
self._logger.info("Externally triggered heatup detected")
self._heating = True
self._heatupWaitStartTime = time.time()
@@ -2043,9 +2043,10 @@ class MachineCom(object):
self._clear_to_send.set()
def _finish_heatup(self):
if self._heatupWaitStartTime:
self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime)
self._heatupWaitStartTime = None
if self._heating:
if self._heatupWaitStartTime:
self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime)
self._heatupWaitStartTime = None
self._heating = False
def _continue_sending(self):