mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Adding check whether getGlobalContainerStack() returns None or not.
If we get None here, the firmware-updater will be closed and detailed error returned to the logs with an explanation why.
This commit is contained in:
parent
a7fc3258a7
commit
2e7db9b732
1 changed files with 9 additions and 2 deletions
|
@ -128,11 +128,18 @@ class USBPrinterOutputDeviceManager(QObject, SignalEmitter, OutputDevicePlugin,
|
|||
return USBPrinterOutputDeviceManager._instance
|
||||
|
||||
def _getDefaultFirmwareName(self):
|
||||
# Check whether getGlobalContainerStack() returns None or not...
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_container_stack:
|
||||
Logger.log("c", "getGlobalContainerStack() returned None")
|
||||
Logger.log("i", "Closing firmware-updater UI as a consequence")
|
||||
self._firmware_view.close()
|
||||
|
||||
# Detecting id of the current machine
|
||||
machine_id = Application.getInstance().getGlobalContainerStack().getBottom().id
|
||||
machine_id = global_container_stack.getBottom().id
|
||||
|
||||
# Detecting whether it has a heated bed
|
||||
machine_has_heated_bed = Application.getInstance().getGlobalContainerStack().getProperty("machine_heated_bed", "value")
|
||||
machine_has_heated_bed = global_container_stack.getProperty("machine_heated_bed", "value")
|
||||
|
||||
if platform.system() == "Linux":
|
||||
baudrate = 115200
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue