Merge branch 'master' into feature_local_container_server

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-11-29 13:06:08 +01:00
commit dad99f5292
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
542 changed files with 35309 additions and 16367 deletions

View file

@ -83,8 +83,7 @@ Component
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
//TODO; It's probably nicer to do this with a dynamic data model instead of hardcoding this.
//But you know the drill; time constraints don't result in elegant code.
Item
{
width: parent.width

View file

@ -114,7 +114,7 @@ Cura.MachineAction
Column
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
spacing: UM.Theme.getSize("default_margin").height
ScrollView
@ -191,8 +191,6 @@ Cura.MachineAction
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
//: Tips label
//TODO: get actual link from webteam
text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/troubleshooting");
onLinkActivated: Qt.openUrlExternally(link)
}
@ -200,7 +198,7 @@ Cura.MachineAction
}
Column
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
visible: base.selectedPrinter ? true : false
spacing: UM.Theme.getSize("default_margin").height
Label
@ -218,13 +216,13 @@ Cura.MachineAction
columns: 2
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Type")
}
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text:
{
@ -232,13 +230,13 @@ Cura.MachineAction
{
if(base.selectedPrinter.printerType == "ultimaker3")
{
return catalog.i18nc("@label", "Ultimaker 3")
return catalog.i18nc("@label Printer name", "Ultimaker 3")
} else if(base.selectedPrinter.printerType == "ultimaker3_extended")
{
return catalog.i18nc("@label", "Ultimaker 3 Extended")
return catalog.i18nc("@label Printer name", "Ultimaker 3 Extended")
} else
{
return catalog.i18nc("@label", "Unknown") // We have no idea what type it is. Should not happen 'in the field'
return catalog.i18nc("@label Printer name", "Unknown") // We have no idea what type it is. Should not happen 'in the field'
}
}
else
@ -249,25 +247,25 @@ Cura.MachineAction
}
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Firmware version")
}
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text: base.selectedPrinter ? base.selectedPrinter.firmwareVersion : ""
}
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Address")
}
Label
{
width: (parent.width * 0.5) | 0
width: Math.floor(parent.width * 0.5)
wrapMode: Text.WordWrap
text: base.selectedPrinter ? base.selectedPrinter.ipAddress : ""
}
@ -278,12 +276,8 @@ Cura.MachineAction
width: parent.width
wrapMode: Text.WordWrap
text:{
if (base.selectedPrinter == undefined)
{
return "";
}
// The property cluster size does not exist for older UM3 devices.
if(base.selectedPrinter != undefined && base.selectedPrinter.clusterSize == null || base.selectedPrinter.clusterSize == 1)
if(!base.selectedPrinter || base.selectedPrinter.clusterSize == null || base.selectedPrinter.clusterSize == 1)
{
return "";
}

View file

@ -17,10 +17,10 @@ Component
}
return (sourceSize.width / sourceSize.height) > (maximumWidth / maximumHeight);
}
property real _width: Math.min(maximumWidth, sourceSize.width)
property real _height: Math.min(maximumHeight, sourceSize.height)
width: proportionalHeight ? _width : sourceSize.width * _height / sourceSize.height
height: !proportionalHeight ? _height : sourceSize.height * _width / sourceSize.width
property real _width: Math.floor(Math.min(maximumWidth, sourceSize.width))
property real _height: Math.floor(Math.min(maximumHeight, sourceSize.height))
width: proportionalHeight ? _width : Math.floor(sourceSize.width * _height / sourceSize.height)
height: !proportionalHeight ? _height : Math.floor(sourceSize.height * _width / sourceSize.width)
anchors.horizontalCenter: parent.horizontalCenter
onVisibleChanged:

View file

@ -103,6 +103,7 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
self._can_pause = True
self._can_abort = True
self._can_pre_heat_bed = False
self._can_control_manually = False
self._cluster_size = int(properties.get(b"cluster_size", 0))
self._cleanupRequest()
@ -220,7 +221,9 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
self.setPrinters(json_data)
def materialHotendChangedMessage(self, callback):
pass # Do nothing.
# When there is just one printer, the activate configuration option is enabled
if (self._cluster_size == 1):
super().materialHotendChangedMessage(callback = callback)
def _startCameraStream(self):
## Request new image
@ -483,7 +486,7 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
printer_name = self.__getPrinterNameFromUuid(print_job["printer_uuid"])
if printer_name is None:
printer_name = i18n_catalog.i18nc("@label", "Unknown")
printer_name = i18n_catalog.i18nc("@label Printer name", "Unknown")
message_text = (i18n_catalog.i18nc("@info:status",
"Printer '{printer_name}' has finished printing '{job_name}'.")

View file

@ -102,6 +102,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._target_bed_temperature = 0
self._processing_preheat_requests = True
self._can_control_manually = False
self.setPriority(3) # Make sure the output device gets selected above local file output
self.setName(key)
self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network"))

View file

@ -10,7 +10,7 @@ Item
id: extruderInfo
property var printCoreConfiguration
width: parent.width / 2
width: Math.floor(parent.width / 2)
height: childrenRect.height
Label
{

View file

@ -44,7 +44,7 @@ Rectangle
case "maintenance": // TODO: new string
case "unknown":
default:
return catalog.i18nc("@label", "Unknown");
return catalog.i18nc("@label Printer status", "Unknown");
}
}
@ -86,7 +86,7 @@ Rectangle
Rectangle
{
width: parent.width / 3
width: Math.floor(parent.width / 3)
height: parent.height
Label // Print job name
@ -131,7 +131,7 @@ Rectangle
Rectangle
{
width: parent.width / 3 * 2
width: Math.floor(parent.width / 3 * 2)
height: parent.height
Label // Friendly machine name
@ -139,7 +139,7 @@ Rectangle
id: printerNameLabel
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width)
text: printer.friendly_name
font: UM.Theme.getFont("default_bold")
elide: Text.ElideRight
@ -149,7 +149,7 @@ Rectangle
{
id: printerTypeLabel
anchors.top: printerNameLabel.bottom
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
text: printer.machine_variant
anchors.left: parent.left
elide: Text.ElideRight
@ -183,7 +183,7 @@ Rectangle
id: extruderInfo
anchors.bottom: parent.bottom
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
@ -217,7 +217,7 @@ Rectangle
anchors.right: parent.right
anchors.top: parent.top
height: showExtended ? parent.height: printProgressTitleBar.height
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
border.width: UM.Theme.getSize("default_lining").width
border.color: lineColor
radius: cornerRadius

View file

@ -57,7 +57,7 @@ Item
{
id: cameraImage
width: Math.min(sourceSize.width === 0 ? 800 * screenScaleFactor : sourceSize.width, maximumWidth)
height: (sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width
height: Math.floor((sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width)
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
z: 1

View file

@ -115,8 +115,22 @@ Item
{
tooltip: catalog.i18nc("@info:tooltip", "Load the configuration of the printer into Cura")
text: catalog.i18nc("@action:button", "Activate Configuration")
visible: printerConnected
visible: printerConnected && !isClusterPrinter()
onClicked: manager.loadConfigurationFromPrinter()
function isClusterPrinter() {
if(Cura.MachineManager.printerOutputDevices.length == 0)
{
return false;
}
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
// This is not a cluster printer or the cluster it is just one printer
if(clusterSize == undefined || clusterSize == 1)
{
return false;
}
return true;
}
}
}