mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 11:43:11 +08:00
Prevent crash when starting the firmware update twice
CURA-6Q
This commit is contained in:
parent
09f40c8f77
commit
1a04744679
@ -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…
x
Reference in New Issue
Block a user