Added extensions as a working plugin type

This commit is contained in:
Jaime van Kessel 2015-04-14 14:31:52 +02:00
parent 6e9a07d73c
commit 0defece4bd
2 changed files with 12 additions and 6 deletions

View file

@ -1,20 +1,21 @@
from UM.Signal import Signal, SignalEmitter
from UM.PluginObject import PluginObject
from . import PrinterConnection
from UM.Application import Application
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Scene.SceneNode import SceneNode
from UM.Resources import Resources
import threading
import platform
import glob
import time
import os
import sys
from UM.Extension import Extension
from PyQt5.QtQuick import QQuickView
from PyQt5.QtCore import QUrl, QObject,pyqtSlot , pyqtProperty,pyqtSignal
class USBPrinterManager(QObject, SignalEmitter,PluginObject):
class USBPrinterManager(QObject, SignalEmitter, Extension):
def __init__(self, parent = None):
super().__init__(parent)
self._serial_port_list = []
@ -31,6 +32,8 @@ class USBPrinterManager(QObject, SignalEmitter,PluginObject):
self._bed_temp = 0
self._error_message = ""
self.addMenuItem("Update firmware", self.updateAllFirmware)
#time.sleep(1)
#self.connectAllConnections()
#time.sleep(5)
@ -105,6 +108,9 @@ class USBPrinterManager(QObject, SignalEmitter,PluginObject):
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):
printer_connection = self.getConnectionByPort(serial_port)

View file

@ -1,12 +1,12 @@
from . import USBPrinterManager
def getMetaData():
return {
'type': 'storage_device',
'type': 'extension',
'plugin': {
'name': 'Local File Storage',
'name': 'USB printing',
'author': 'Jaime van Kessel',
'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 '
}
}