Start the device thread GCODE streaming after the main thread has sent those first few lines of codes. This fixes an issue where a race between the main thread and device thread, caused both to try to send the first lines of codes and the line numbering were then messed up. This caused the printer to

send a resend request for a line whose number Cura did not recognize, and the printing would wait forever to start.
This commit is contained in:
Simon Lundell 2018-02-23 18:13:42 +01:00
parent 946a09eb62
commit b1be25e8d8

View file

@ -198,7 +198,6 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
# Reset line number. If this is not done, first line is sometimes ignored
self._gcode.insert(0, "M110")
self._gcode_position = 0
self._is_printing = True
self._print_start_time = time()
self._print_estimated_time = int(Application.getInstance().getPrintInformation().currentPrintTime.getDisplayString(DurationFormat.Format.Seconds))
@ -206,6 +205,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
for i in range(0, 4): # Push first 4 entries before accepting other inputs
self._sendNextGcodeLine()
self._is_printing = True
self.writeFinished.emit(self)
def _autoDetectFinished(self, job: AutoDetectBaudJob):