mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Add canUpdateFirmware property to printer output devices
This commit is contained in:
parent
339987be9d
commit
688a5083d2
5 changed files with 11 additions and 1 deletions
|
@ -29,6 +29,8 @@ class GenericOutputController(PrinterOutputController):
|
|||
self._output_device.printersChanged.connect(self._onPrintersChanged)
|
||||
self._active_printer = None
|
||||
|
||||
self.can_update_firmware = True
|
||||
|
||||
def _onPrintersChanged(self):
|
||||
if self._active_printer:
|
||||
self._active_printer.stateChanged.disconnect(self._onPrinterStateChanged)
|
||||
|
|
|
@ -18,6 +18,7 @@ class PrinterOutputController:
|
|||
self.can_pre_heat_hotends = True
|
||||
self.can_send_raw_gcode = True
|
||||
self.can_control_manually = True
|
||||
self.can_update_firmware = False
|
||||
self._output_device = output_device
|
||||
|
||||
def setTargetHotendTemperature(self, printer: "PrinterOutputModel", extruder: "ExtruderOutputModel", temperature: int):
|
||||
|
|
|
@ -277,6 +277,13 @@ class PrinterOutputModel(QObject):
|
|||
return self._controller.can_control_manually
|
||||
return False
|
||||
|
||||
# Does the printer support upgrading firmware
|
||||
@pyqtProperty(bool, notify = canUpdateFirmwareChanged)
|
||||
def canUpdateFirmware(self):
|
||||
if self._controller:
|
||||
return self._controller.can_update_firmware
|
||||
return False
|
||||
|
||||
# Returns the configuration (material, variant and buildplate) of the current printer
|
||||
@pyqtProperty(QObject, notify = configurationChanged)
|
||||
def printerConfiguration(self):
|
||||
|
|
|
@ -9,7 +9,6 @@ from .avr_isp import stk500v2, intelHex
|
|||
|
||||
from enum import IntEnum
|
||||
|
||||
@signalemitter
|
||||
class AvrFirmwareUpdater(QObject):
|
||||
firmwareProgressChanged = pyqtSignal()
|
||||
firmwareUpdateStateChanged = pyqtSignal()
|
||||
|
|
|
@ -16,6 +16,7 @@ Cura.MachineAction
|
|||
anchors.fill: parent;
|
||||
property bool printerConnected: Cura.MachineManager.printerConnected
|
||||
property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property var canUpdateFirmware: activeOutputDevice ? activeOutputDevice.canUpdateFirmware : False
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue