mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
CURA-2079: Adding error messages to the firmware update dialog
Adds messages for IO errors, communication errors, missing firmware and a general message for unknown problems.
This commit is contained in:
parent
9a34f6b067
commit
0435706736
2 changed files with 13 additions and 9 deletions
|
@ -32,7 +32,7 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
text: {
|
text: {
|
||||||
if (manager.firmwareUpdateCompleteStatus)
|
if (manager.firmwareUpdateCompleteStatus && !manager.progress > 0)
|
||||||
{
|
{
|
||||||
//: Firmware update status label
|
//: Firmware update status label
|
||||||
return catalog.i18nc("@label","Firmware update completed.")
|
return catalog.i18nc("@label","Firmware update completed.")
|
||||||
|
|
|
@ -198,7 +198,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
if not programmer.isConnected():
|
if not programmer.isConnected():
|
||||||
Logger.log("e", "Unable to connect with serial. Could not update firmware")
|
Logger.log("e", "Unable to connect with serial. Could not update firmware")
|
||||||
self._updateFirmware_completed()
|
self._updateFirmware_completed_communication_error()
|
||||||
return
|
return
|
||||||
|
|
||||||
self._updating_firmware = True
|
self._updating_firmware = True
|
||||||
|
@ -206,34 +206,38 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
try:
|
try:
|
||||||
programmer.programChip(hex_file)
|
programmer.programChip(hex_file)
|
||||||
self._updating_firmware = False
|
self._updating_firmware = False
|
||||||
|
except serial.SerialException as e:
|
||||||
|
Logger.log("e", "SerialException while trying to update firmware: <%s>" %(repr(e)))
|
||||||
|
self._updateFirmware_completed_io_error()
|
||||||
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Logger.log("e", "Exception while trying to update firmware %s" %e)
|
Logger.log("e", "Exception while trying to update firmware: <%s>" %(repr(e)))
|
||||||
self._updateFirmware_completed_unknown()
|
self._updateFirmware_completed_unknown()
|
||||||
return
|
return
|
||||||
programmer.close()
|
programmer.close()
|
||||||
|
|
||||||
self._updateFirmware_completed()
|
self._updateFirmware_completed_sucessfully()
|
||||||
return
|
return
|
||||||
|
|
||||||
## Private function which makes sure that firmware update process has failed by missing firmware
|
## Private function which makes sure that firmware update process has failed by missing firmware
|
||||||
def _updateFirmware_completed_missing_firmware(self):
|
def _updateFirmware_completed_missing_firmware(self):
|
||||||
return self._updateFirmware_common(progress = -4)
|
return self._updateFirmware_completed_common(progress = -4)
|
||||||
|
|
||||||
## Private function which makes sure that firmware update process has failed by an IO error
|
## Private function which makes sure that firmware update process has failed by an IO error
|
||||||
def _updateFirmware_completed_io_error(self):
|
def _updateFirmware_completed_io_error(self):
|
||||||
return self._updateFirmware_common(progress = -3)
|
return self._updateFirmware_completed_common(progress = -3)
|
||||||
|
|
||||||
## Private function which makes sure that firmware update process has failed by a communication problem
|
## Private function which makes sure that firmware update process has failed by a communication problem
|
||||||
def _updateFirmware_completed_communication_error(self):
|
def _updateFirmware_completed_communication_error(self):
|
||||||
return self._updateFirmware_common(progress = -2)
|
return self._updateFirmware_completed_common(progress = -2)
|
||||||
|
|
||||||
## Private function which makes sure that firmware update process has failed by an unknown error
|
## Private function which makes sure that firmware update process has failed by an unknown error
|
||||||
def _updateFirmware_completed_unknown(self):
|
def _updateFirmware_completed_unknown(self):
|
||||||
return self._updateFirmware_common(progress = -1)
|
return self._updateFirmware_completed_common(progress = -1)
|
||||||
|
|
||||||
## Private function which makes sure that firmware update process has sucessfully completed/ended
|
## Private function which makes sure that firmware update process has sucessfully completed/ended
|
||||||
def _updateFirmware_completed_sucessfully(self):
|
def _updateFirmware_completed_sucessfully(self):
|
||||||
return self._updateFirmware_common(progress = 100)
|
return self._updateFirmware_completed_common(progress = 100)
|
||||||
|
|
||||||
## Private common function which makes sure that firmware update process has completed/ended with a set progress state
|
## Private common function which makes sure that firmware update process has completed/ended with a set progress state
|
||||||
def _updateFirmware_completed_common(self, progress, max_progress = 100):
|
def _updateFirmware_completed_common(self, progress, max_progress = 100):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue