Browse Source

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.

Simon Lundell 7 years ago
parent
commit
b1be25e8d8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/USBPrinting/USBPrinterOutputDevice.py

+ 1 - 1
plugins/USBPrinting/USBPrinterOutputDevice.py

@@ -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):