mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Added extensions as a working plugin type
This commit is contained in:
parent
6e9a07d73c
commit
0defece4bd
2 changed files with 12 additions and 6 deletions
|
@ -1,20 +1,21 @@
|
||||||
from UM.Signal import Signal, SignalEmitter
|
from UM.Signal import Signal, SignalEmitter
|
||||||
from UM.PluginObject import PluginObject
|
|
||||||
from . import PrinterConnection
|
from . import PrinterConnection
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
|
from UM.Resources import Resources
|
||||||
import threading
|
import threading
|
||||||
import platform
|
import platform
|
||||||
import glob
|
import glob
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
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
|
||||||
|
|
||||||
class USBPrinterManager(QObject, SignalEmitter,PluginObject):
|
class USBPrinterManager(QObject, SignalEmitter, Extension):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._serial_port_list = []
|
self._serial_port_list = []
|
||||||
|
@ -31,6 +32,8 @@ class USBPrinterManager(QObject, SignalEmitter,PluginObject):
|
||||||
self._bed_temp = 0
|
self._bed_temp = 0
|
||||||
self._error_message = ""
|
self._error_message = ""
|
||||||
|
|
||||||
|
self.addMenuItem("Update firmware", self.updateAllFirmware)
|
||||||
|
|
||||||
#time.sleep(1)
|
#time.sleep(1)
|
||||||
#self.connectAllConnections()
|
#self.connectAllConnections()
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
|
@ -105,7 +108,10 @@ class USBPrinterManager(QObject, SignalEmitter,PluginObject):
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def updateAllFirmware(self):
|
||||||
|
for printer_connection in self._printer_connections:
|
||||||
|
printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName()))
|
||||||
|
|
||||||
def updateFirmwareBySerial(self, serial_port):
|
def updateFirmwareBySerial(self, serial_port):
|
||||||
printer_connection = self.getConnectionByPort(serial_port)
|
printer_connection = self.getConnectionByPort(serial_port)
|
||||||
if printer_connection is not None:
|
if printer_connection is not None:
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
from . import USBPrinterManager
|
from . import USBPrinterManager
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
return {
|
return {
|
||||||
'type': 'storage_device',
|
'type': 'extension',
|
||||||
'plugin': {
|
'plugin': {
|
||||||
'name': 'Local File Storage',
|
'name': 'USB printing',
|
||||||
'author': 'Jaime van Kessel',
|
'author': 'Jaime van Kessel',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'description': 'Accepts G-Code and sends them to a printer. '
|
'description': 'Accepts G-Code and sends them to a printer. Plugin can also update firmware '
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue