Merge branch 'master' into fieldOfView-feature_firmware_updater

Conflicts:
	cura/PrinterOutput/PrinterOutputModel.py - Bunch of code that was moved.
	plugins/USBPrinting/USBPrinterOutputDevice.py - Collisions with code style fixes.
	plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.qml - Bunch of code that was moved.
This commit is contained in:
Ghostkeeper 2018-10-15 16:52:22 +02:00
commit b5d8c1af6f
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
27 changed files with 253 additions and 94 deletions

View file

@ -51,7 +51,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._all_baud_rates = [115200, 250000, 230400, 57600, 38400, 19200, 9600]
# Instead of using a timer, we really need the update to be as a thread, as reading from serial can block.
self._update_thread = Thread(target=self._update, daemon=True)
self._update_thread = Thread(target = self._update, daemon = True)
self._last_temperature_request = None # type: Optional[int]
@ -172,15 +172,19 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
except SerialException:
Logger.log("w", "An exception occured while trying to create serial connection")
return
CuraApplication.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged)
self._onGlobalContainerStackChanged()
self.setConnectionState(ConnectionState.connected)
self._update_thread.start()
def _onGlobalContainerStackChanged(self):
container_stack = CuraApplication.getInstance().getGlobalContainerStack()
num_extruders = container_stack.getProperty("machine_extruder_count", "value")
# Ensure that a printer is created.
controller = GenericOutputController(self)
controller.setCanUpdateFirmware(True)
self._printers = [PrinterOutputModel(output_controller=controller, number_of_extruders=num_extruders)]
self._printers = [PrinterOutputModel(output_controller = controller, number_of_extruders = num_extruders)]
self._printers[0].updateName(container_stack.getName())
self.setConnectionState(ConnectionState.connected)
self._update_thread.start()
def close(self):
super().close()