Merge branch '3.0' of github.com:Ultimaker/Cura into 3.0

This commit is contained in:
Jaime van Kessel 2017-10-03 11:22:37 +02:00
commit a3eae31982
11 changed files with 48 additions and 20 deletions

View File

@ -242,8 +242,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
@pyqtSlot() @pyqtSlot()
def stopCamera(self): def stopCamera(self):
self._stopCamera()
self._camera_active = False self._camera_active = False
self._stopCamera()
def _stopCamera(self): def _stopCamera(self):
Logger.log("w", "_stopCamera is not implemented by this output device") Logger.log("w", "_stopCamera is not implemented by this output device")

View File

@ -389,4 +389,4 @@ Cura.MachineAction
} }
] ]
} }
} }

View File

@ -13,6 +13,7 @@ from PyQt5.QtGui import QDesktopServices
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkReply from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkReply
from PyQt5.QtQml import QQmlComponent, QQmlContext from PyQt5.QtQml import QQmlComponent, QQmlContext
from UM.Application import Application from UM.Application import Application
from UM.Decorators import override
from UM.Logger import Logger from UM.Logger import Logger
from UM.Message import Message from UM.Message import Message
from UM.OutputDevice import OutputDeviceError from UM.OutputDevice import OutputDeviceError
@ -45,6 +46,7 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
else: else:
name = key name = key
self._authentication_state = NetworkPrinterOutputDevice.AuthState.Authenticated # The printer is always authenticated
self._plugin_path = plugin_path self._plugin_path = plugin_path
self.setName(name) self.setName(name)
@ -111,6 +113,20 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
temporary_translation3 = i18n_catalog.i18n("{printer_name} has finished printing '{job_name}'. Please collect the print and confirm clearing the build plate.") #When finished. temporary_translation3 = i18n_catalog.i18n("{printer_name} has finished printing '{job_name}'. Please collect the print and confirm clearing the build plate.") #When finished.
temporary_translation4 = i18n_catalog.i18n("{printer_name} is reserved to print '{job_name}'. Please change the printer's configuration to match the job, for it to start printing.") #When configuration changed. temporary_translation4 = i18n_catalog.i18n("{printer_name} is reserved to print '{job_name}'. Please change the printer's configuration to match the job, for it to start printing.") #When configuration changed.
## No authentication, so requestAuthentication should do exactly nothing
@pyqtSlot()
def requestAuthentication(self, message_id = None, action_id = "Retry"):
pass # Cura Connect doesn't do any authorization
def setAuthenticationState(self, auth_state):
self._authentication_state = NetworkPrinterOutputDevice.AuthState.Authenticated # The printer is always authenticated
def _verifyAuthentication(self):
pass
def _checkAuthentication(self):
Logger.log("d", "_checkAuthentication Cura Connect - nothing to be done")
@pyqtProperty(QObject, notify=selectedPrinterChanged) @pyqtProperty(QObject, notify=selectedPrinterChanged)
def controlItem(self): def controlItem(self):
# TODO: Probably not the nicest way to do this. This needs to be done better at some point in time. # TODO: Probably not the nicest way to do this. This needs to be done better at some point in time.

View File

@ -331,13 +331,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
if self._camera_timer.isActive(): if self._camera_timer.isActive():
self._camera_timer.stop() self._camera_timer.stop()
else: #Camera wasn't even running. Don't try to stop it or you'll get a segfault.
return
if self._camera_active: if self._image_reply:
try: try:
try:
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
except TypeError:
pass #The signal was never connected.
self._image_reply.abort() self._image_reply.abort()
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
except RuntimeError: except RuntimeError:
pass # It can happen that the wrapped c++ object is already deleted. pass # It can happen that the wrapped c++ object is already deleted.
self._image_reply = None self._image_reply = None

View File

@ -30,6 +30,23 @@ Rectangle
return Math.min(100, Math.round(printJob.time_elapsed / printJob.time_total * 100)) + "%"; return Math.min(100, Math.round(printJob.time_elapsed / printJob.time_total * 100)) + "%";
} }
function printerStatusText(printer)
{
switch (printer.status)
{
case "pre_print":
return catalog.i18nc("@label", "Preparing to print")
case "printing":
return catalog.i18nc("@label:status", "Printing");
case "idle":
return catalog.i18nc("@label:status", "Available");
case "unreachable": // TODO: new string
case "maintenance": // TODO: new string
case "unknown":
default:
return catalog.i18nc("@label", "Unknown");
}
}
id: printerDelegate id: printerDelegate
property var printer property var printer
@ -228,7 +245,7 @@ Rectangle
return catalog.i18nc("@label:status", "Disabled"); return catalog.i18nc("@label:status", "Disabled");
} }
if(printJob != null) if ((printJob != null) && ((printer.status === "pre_print") || (printer.status === "printing")))
{ {
switch (printJob.status) switch (printJob.status)
{ {
@ -259,14 +276,10 @@ Rectangle
case "aborted": case "aborted":
return catalog.i18nc("@label:status", "Print aborted"); return catalog.i18nc("@label:status", "Print aborted");
default: default:
return ""; return printerStatusText(printer);
} }
} }
if (printer.status == "printing") return printerStatusText(printer);
{
return catalog.i18nc("@label:status", "Printing")
}
return catalog.i18nc("@label:status", "Available");
} }
elide: Text.ElideRight elide: Text.ElideRight

View File

@ -121,4 +121,4 @@ Item
} }
UM.I18nCatalog{id: catalog; name:"cura"} UM.I18nCatalog{id: catalog; name:"cura"}
} }

View File

@ -18,8 +18,6 @@ Rectangle
height: UM.Theme.getSize("sidebar_header").height height: UM.Theme.getSize("sidebar_header").height
color: base.monitoringPrint ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color") color: base.monitoringPrint ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color")
Behavior on color { ColorAnimation { duration: 100; } }
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property bool monitoringPrint: false property bool monitoringPrint: false

View File

@ -16,7 +16,7 @@
"secondary": [241, 242, 242, 255], "secondary": [241, 242, 242, 255],
"topbar_background_color": [0, 0, 0, 0], "topbar_background_color": [0, 0, 0, 0],
"topbar_background_color_monitoring": [0, 0, 0, 0], "topbar_background_color_monitoring": [31, 36, 39, 255],
"topbar_button_text_active": [255, 255, 255, 255], "topbar_button_text_active": [255, 255, 255, 255],
"topbar_button_text_inactive": [128, 128, 128, 255], "topbar_button_text_inactive": [128, 128, 128, 255],

View File

@ -68,7 +68,7 @@
"secondary": [245, 245, 245, 255], "secondary": [245, 245, 245, 255],
"topbar_background_color": [255, 255, 255, 0], "topbar_background_color": [255, 255, 255, 0],
"topbar_background_color_monitoring": [255, 255, 255, 0], "topbar_background_color_monitoring": [255, 255, 255, 255],
"topbar_button_text_active": [0, 0, 0, 255], "topbar_button_text_active": [0, 0, 0, 255],
"topbar_button_text_inactive": [128, 128, 128, 255], "topbar_button_text_inactive": [128, 128, 128, 255],

View File

@ -43,7 +43,7 @@ support_interface_height = 0.6
support_interface_skip_height = =layer_height support_interface_skip_height = =layer_height
support_join_distance = 3 support_join_distance = 3
support_line_width = =round(line_width * 0.4 / 0.35, 2) support_line_width = =round(line_width * 0.4 / 0.35, 2)
support_offset = 2 support_offset = 3
support_xy_distance = =round(wall_line_width_0 * 0.75, 2) support_xy_distance = =round(wall_line_width_0 * 0.75, 2)
support_xy_distance_overhang = =wall_line_width_0 / 2 support_xy_distance_overhang = =wall_line_width_0 / 2
switch_extruder_retraction_amount = 12 switch_extruder_retraction_amount = 12

View File

@ -43,7 +43,7 @@ support_interface_height = 0.6
support_interface_skip_height = =layer_height support_interface_skip_height = =layer_height
support_join_distance = 3 support_join_distance = 3
support_line_width = =round(line_width * 0.4 / 0.35, 2) support_line_width = =round(line_width * 0.4 / 0.35, 2)
support_offset = 2 support_offset = 3
support_xy_distance = =round(wall_line_width_0 * 0.75, 2) support_xy_distance = =round(wall_line_width_0 * 0.75, 2)
support_xy_distance_overhang = =wall_line_width_0 / 2 support_xy_distance_overhang = =wall_line_width_0 / 2
switch_extruder_retraction_amount = 12 switch_extruder_retraction_amount = 12