Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jack Ha 2016-09-12 13:55:14 +02:00
commit 78c119dbde
3 changed files with 30 additions and 1 deletions

View File

@ -44,6 +44,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._error_text = ""
self._accepts_commands = True
self._printer_state = ""
def requestWrite(self, node, file_name = None, filter_by_machine = False):
raise NotImplementedError("requestWrite needs to be implemented")
@ -91,10 +93,21 @@ class PrinterOutputDevice(QObject, OutputDevice):
acceptsCommandsChanged = pyqtSignal()
printerStateChanged = pyqtSignal()
@pyqtProperty(str, notify=printerStateChanged)
def printerState(self):
return self._printer_state
@pyqtProperty(str, notify = jobStateChanged)
def jobState(self):
return self._job_state
def _updatePrinterState(self, printer_state):
if self._printer_state != printer_state:
self._printer_state = printer_state
self.printerStateChanged.emit()
def _updateJobState(self, job_state):
if self._job_state != job_state:
self._job_state = job_state

View File

@ -48,7 +48,13 @@ Rectangle
{
if(!printerConnected || !printerAcceptsCommands)
return UM.Theme.getColor("text");
if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
{
return UM.Theme.getColor("status_busy");
} else if (Cura.MachineManager.printerOutputDevices[0].printerState == "error")
{
return UM.Theme.getColor("status_stopped");
}
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
{
case "printing":
@ -80,6 +86,11 @@ Rectangle
return catalog.i18nc("@label:MonitorStatus", "Printer does not accept commands");
var printerOutputDevice = Cura.MachineManager.printerOutputDevices[0]
if(printerOutputDevice.printerState == "maintenance")
{
return catalog.i18nc("@label:MonitorStatus", "Printer is in maintenance mode.");
}
switch(printerOutputDevice.jobState)
{
case "offline":

View File

@ -112,6 +112,11 @@ Rectangle
else if(!printerAcceptsCommands)
return UM.Theme.getIcon("tab_monitor_unknown");
if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
{
return UM.Theme.getIcon("tab_monitor_busy");
}
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
{
case "printing":