mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Prevent crash when starting the firmware update twice
CURA-6Q
This commit is contained in:
parent
09f40c8f77
commit
1a04744679
1 changed files with 6 additions and 2 deletions
|
@ -7,6 +7,8 @@ from enum import IntEnum
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
MYPY = False
|
MYPY = False
|
||||||
if MYPY:
|
if MYPY:
|
||||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||||
|
@ -38,8 +40,10 @@ class FirmwareUpdater(QObject):
|
||||||
return
|
return
|
||||||
|
|
||||||
self._setFirmwareUpdateState(FirmwareUpdateState.updating)
|
self._setFirmwareUpdateState(FirmwareUpdateState.updating)
|
||||||
|
try:
|
||||||
self._update_firmware_thread.start()
|
self._update_firmware_thread.start()
|
||||||
|
except RuntimeError:
|
||||||
|
Logger.warning("Could not start the update thread, since it's still running!")
|
||||||
|
|
||||||
def _updateFirmware(self) -> None:
|
def _updateFirmware(self) -> None:
|
||||||
raise NotImplementedError("_updateFirmware needs to be implemented")
|
raise NotImplementedError("_updateFirmware needs to be implemented")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue