mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Fix case where Cura and the firmware could be waiting for eachother
This commit is contained in:
parent
777470db7f
commit
71d365c0c6
1 changed files with 11 additions and 3 deletions
|
@ -267,19 +267,27 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
if b"FIRMWARE_NAME:" in line:
|
if b"FIRMWARE_NAME:" in line:
|
||||||
self._setFirmwareName(line)
|
self._setFirmwareName(line)
|
||||||
|
|
||||||
if line.startswith(b"ok "):
|
if line == b"":
|
||||||
|
# An empty line means that the firmware is idle
|
||||||
|
# Multiple empty lines probably means that the firmware and Cura are waiting
|
||||||
|
# for eachother due to a missed "ok", so we keep track of empty lines
|
||||||
|
self._firmware_idle_count += 1
|
||||||
|
else:
|
||||||
|
self._firmware_idle_count = 0
|
||||||
|
|
||||||
|
if line.startswith(b"ok") or self._firmware_idle_count > 1:
|
||||||
self._printer_busy = False
|
self._printer_busy = False
|
||||||
|
|
||||||
self._command_received.set()
|
self._command_received.set()
|
||||||
if not self._command_queue.empty():
|
if not self._command_queue.empty():
|
||||||
self._sendCommand(self._command_queue.get())
|
self._sendCommand(self._command_queue.get())
|
||||||
if self._is_printing:
|
elif self._is_printing:
|
||||||
if self._paused:
|
if self._paused:
|
||||||
pass # Nothing to do!
|
pass # Nothing to do!
|
||||||
else:
|
else:
|
||||||
self._sendNextGcodeLine()
|
self._sendNextGcodeLine()
|
||||||
|
|
||||||
if line.startswith(b"echo:busy: "):
|
if line.startswith(b"echo:busy:"):
|
||||||
self._printer_busy = True
|
self._printer_busy = True
|
||||||
|
|
||||||
if self._is_printing:
|
if self._is_printing:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue