mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Fixed caused by cleanup
This commit is contained in:
parent
13d2d7e42a
commit
25cfce2803
@ -13,7 +13,7 @@ import sys
|
|||||||
from UM.Extension import Extension
|
from UM.Extension import Extension
|
||||||
|
|
||||||
from PyQt5.QtQuick import QQuickView
|
from PyQt5.QtQuick import QQuickView
|
||||||
from PyQt5.QtCore import QUrl, QObject,pyqtSlot , pyqtProperty,pyqtSignal
|
from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
|
||||||
@ -39,6 +39,11 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||||||
## Add menu item to top menu of the application.
|
## Add menu item to top menu of the application.
|
||||||
self.addMenuItem(i18n_catalog.i18n("Update firmware"), self.updateAllFirmware)
|
self.addMenuItem(i18n_catalog.i18n("Update firmware"), self.updateAllFirmware)
|
||||||
|
|
||||||
|
pyqtError = pyqtSignal(str, arguments = ['amount'])
|
||||||
|
processingProgress = pyqtSignal(float, arguments = ['amount'])
|
||||||
|
pyqtExtruderTemperature = pyqtSignal(float, arguments = ['amount'])
|
||||||
|
pyqtBedTemperature = pyqtSignal(float, arguments = ['amount'])
|
||||||
|
|
||||||
## Show firmware interface.
|
## Show firmware interface.
|
||||||
# This will create the view if its not already created.
|
# This will create the view if its not already created.
|
||||||
def spawnFirmwareInterface(self, serial_port):
|
def spawnFirmwareInterface(self, serial_port):
|
||||||
@ -60,27 +65,19 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||||||
@pyqtProperty(float,notify = processingProgress)
|
@pyqtProperty(float,notify = processingProgress)
|
||||||
def progress(self):
|
def progress(self):
|
||||||
return self._progress
|
return self._progress
|
||||||
|
|
||||||
processingProgress = pyqtSignal(float, arguments = ['amount'])
|
|
||||||
|
|
||||||
@pyqtProperty(float,notify = pyqtExtruderTemperature)
|
@pyqtProperty(float,notify = pyqtExtruderTemperature)
|
||||||
def extruderTemperature(self):
|
def extruderTemperature(self):
|
||||||
return self._extruder_temp
|
return self._extruder_temp
|
||||||
|
|
||||||
pyqtExtruderTemperature = pyqtSignal(float, arguments = ['amount'])
|
|
||||||
|
|
||||||
@pyqtProperty(float,notify = pyqtBedTemperature)
|
@pyqtProperty(float,notify = pyqtBedTemperature)
|
||||||
def bedTemperature(self):
|
def bedTemperature(self):
|
||||||
return self._bed_temp
|
return self._bed_temp
|
||||||
|
|
||||||
pyqtBedTemperature = pyqtSignal(float, arguments = ['amount'])
|
|
||||||
|
|
||||||
@pyqtProperty(str,notify = pyqtError)
|
@pyqtProperty(str,notify = pyqtError)
|
||||||
def error(self):
|
def error(self):
|
||||||
return self._error_message
|
return self._error_message
|
||||||
|
|
||||||
pyqtError = pyqtSignal(str, arguments = ['amount'])
|
|
||||||
|
|
||||||
## Check all serial ports and create a PrinterConnection object for them.
|
## Check all serial ports and create a PrinterConnection object for them.
|
||||||
# Note that this does not validate if the serial ports are actually usable!
|
# Note that this does not validate if the serial ports are actually usable!
|
||||||
# This (the validation) is only done when the connect function is called.
|
# This (the validation) is only done when the connect function is called.
|
||||||
@ -263,7 +260,7 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||||||
while True:
|
while True:
|
||||||
values = winreg.EnumValue(key, i)
|
values = winreg.EnumValue(key, i)
|
||||||
if not base_list or 'USBSER' in values[0]:
|
if not base_list or 'USBSER' in values[0]:
|
||||||
base_list + =[values[1]]
|
base_list += [values[1]]
|
||||||
i += 1
|
i += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user