Merge branch '3.0'

This commit is contained in:
Ghostkeeper 2017-10-06 16:02:13 +02:00
commit bc419370d0
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
6 changed files with 53 additions and 37 deletions

View file

@ -1,8 +1,6 @@
# Copyright (c) 2017 Ultimaker B.V. # Copyright (c) 2017 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher. # Uranium is released under the terms of the LGPLv3 or higher.
from threading import Thread, Event
from PyQt5.QtCore import Qt, QCoreApplication, QTimer from PyQt5.QtCore import Qt, QCoreApplication, QTimer
from PyQt5.QtGui import QPixmap, QColor, QFont, QPen, QPainter from PyQt5.QtGui import QPixmap, QColor, QFont, QPen, QPainter
from PyQt5.QtWidgets import QSplashScreen from PyQt5.QtWidgets import QSplashScreen
@ -10,6 +8,7 @@ from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources from UM.Resources import Resources
from UM.Application import Application from UM.Application import Application
class CuraSplashScreen(QSplashScreen): class CuraSplashScreen(QSplashScreen):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@ -26,7 +25,6 @@ class CuraSplashScreen(QSplashScreen):
self._change_timer = QTimer() self._change_timer = QTimer()
self._change_timer.setInterval(50) self._change_timer.setInterval(50)
self._change_timer.setSingleShot(False) self._change_timer.setSingleShot(False)
#self.timeoutSignal.connect(self._onTimeout)
self._change_timer.timeout.connect(self.updateLoadingImage) self._change_timer.timeout.connect(self.updateLoadingImage)
def show(self): def show(self):
@ -62,12 +60,12 @@ class CuraSplashScreen(QSplashScreen):
font = QFont() # Using system-default font here font = QFont() # Using system-default font here
font.setPixelSize(37) font.setPixelSize(37)
painter.setFont(font) painter.setFont(font)
painter.drawText(220, 66, 330 * self._scale, 230 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[0]) painter.drawText(215, 66, 330 * self._scale, 230 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[0])
if len(version) > 1: if len(version) > 1:
font.setPointSize(12) font.setPointSize(12)
painter.setFont(font) painter.setFont(font)
painter.setPen(QColor(200, 200, 200, 255)) painter.setPen(QColor(200, 200, 200, 255))
painter.drawText(252, 105, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1]) painter.drawText(247, 105, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1])
painter.setPen(QColor(255, 255, 255, 255)) painter.setPen(QColor(255, 255, 255, 255))
# draw the loading image # draw the loading image

View file

@ -279,7 +279,7 @@ Cura.MachineAction
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text:{ text:{
// The property cluster size does not exist for older UM3 devices. // The property cluster size does not exist for older UM3 devices.
if(base.selectedPrinter.clusterSize == null || base.selectedPrinter.clusterSize == 1) if(base.selectedPrinter != undefined && base.selectedPrinter.clusterSize == null || base.selectedPrinter.clusterSize == 1)
{ {
return ""; return "";
} }

View file

@ -1203,8 +1203,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# Remove cached post request items. # Remove cached post request items.
del self._material_post_objects[id(reply)] del self._material_post_objects[id(reply)]
elif "print_job" in reply_url: elif "print_job" in reply_url:
reply.uploadProgress.disconnect(self._onUploadProgress) try:
reply.finished.disconnect(self._onUploadFinished) reply.uploadProgress.disconnect(self._onUploadProgress)
except:
pass
try:
reply.finished.disconnect(self._onUploadFinished)
except:
pass
Logger.log("d", "Uploading of print succeeded after %s", time() - self._send_gcode_start) Logger.log("d", "Uploading of print succeeded after %s", time() - self._send_gcode_start)
# Only reset the _post_reply if it was the same one. # Only reset the _post_reply if it was the same one.
if reply == self._post_reply: if reply == self._post_reply:

View file

@ -4,7 +4,6 @@ import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM import UM 1.3 as UM
Rectangle Rectangle
{ {
function strPadLeft(string, pad, length) function strPadLeft(string, pad, length)
@ -94,25 +93,38 @@ Rectangle
id: jobNameLabel id: jobNameLabel
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: printJob != null ? printJob.name : "" text: printJob != null ? printJob.name : ""
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")
elide: Text.ElideRight
} }
Label Label
{ {
id: jobOwnerLabel id: jobOwnerLabel
anchors.top: jobNameLabel.bottom anchors.top: jobNameLabel.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: printJob != null ? printJob.owner : "" text: printJob != null ? printJob.owner : ""
opacity: 0.50 opacity: 0.50
elide: Text.ElideRight
} }
Label Label
{ {
id: totalTimeLabel id: totalTimeLabel
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: printJob != null ? getPrettyTime(printJob.time_total) : "" text: printJob != null ? getPrettyTime(printJob.time_total) : ""
opacity: 0.65 opacity: 0.65
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
elide: Text.ElideRight
} }
} }
@ -156,7 +168,7 @@ Rectangle
Image Image
{ {
width: 40 * screenScaleFactor width: parent.width
height: width height: width
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: parent.rightMargin anchors.rightMargin: parent.rightMargin
@ -164,26 +176,27 @@ Rectangle
} }
} }
Row // PrintCode config Row // PrintCore config
{ {
id: extruderInfo id: extruderInfo
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width / 2 - UM.Theme.getSize("default_margin").width width: parent.width / 2 - UM.Theme.getSize("default_margin").width
height: childrenRect.height height: childrenRect.height
spacing: 10 * screenScaleFactor
spacing: UM.Theme.getSize("default_margin").width
PrintCoreConfiguration PrintCoreConfiguration
{ {
id: leftExtruderInfo id: leftExtruderInfo
width: (parent.width-1) / 2 width: (parent.width - extruderSeperator.width) / 2
printCoreConfiguration: printer.configuration[0] printCoreConfiguration: printer.configuration[0]
} }
Rectangle Rectangle
{ {
id: extruderSeperator id: extruderSeperator
width: 1 * screenScaleFactor width: UM.Theme.getSize("default_lining").width
height: parent.height height: parent.height
color: lineColor color: lineColor
} }
@ -191,7 +204,7 @@ Rectangle
PrintCoreConfiguration PrintCoreConfiguration
{ {
id: rightExtruderInfo id: rightExtruderInfo
width: (parent.width-1) / 2 width: (parent.width - extruderSeperator.width) / 2
printCoreConfiguration: printer.configuration[1] printCoreConfiguration: printer.configuration[1]
} }
} }
@ -207,45 +220,42 @@ Rectangle
border.color: lineColor border.color: lineColor
radius: cornerRadius radius: cornerRadius
property var showExtended: { property var showExtended: {
if(printJob!= null) if(printJob != null)
{ {
var extendStates = ["sent_to_printer", "wait_for_configuration", "printing", "pre_print", "post_print", "wait_cleanup", "queued"]; var extendStates = ["sent_to_printer", "wait_for_configuration", "printing", "pre_print", "post_print", "wait_cleanup", "queued"];
return extendStates.indexOf(printJob.status) !== -1; return extendStates.indexOf(printJob.status) !== -1;
} }
return ! printer.enabled; return !printer.enabled;
}
visible:
{
return true
} }
Item // Status and Percent Item // Status and Percent
{ {
id: printProgressTitleBar id: printProgressTitleBar
width: parent.width
//border.width: UM.Theme.getSize("default_lining").width
//border.color: lineColor
height: 40 * screenScaleFactor
anchors.left: parent.left
property var showPercent: { property var showPercent: {
return printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.status) !== -1); return printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.status) !== -1);
} }
width: parent.width
//TODO: hardcoded value
height: 40 * screenScaleFactor
anchors.left: parent.left
Label Label
{ {
id: statusText id: statusText
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.right: progressText.left anchors.right: progressText.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
text: { text: {
if ( ! printer.enabled) if (!printer.enabled)
{ {
return catalog.i18nc("@label:status", "Disabled"); return catalog.i18nc("@label:status", "Disabled");
} }
if ((printJob != null) && ((printer.status === "pre_print") || (printer.status === "printing"))) if (printJob != null)
{ {
switch (printJob.status) switch (printJob.status)
{ {
@ -283,7 +293,6 @@ Rectangle
} }
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("small") font: UM.Theme.getFont("small")
} }
@ -292,11 +301,11 @@ Rectangle
id: progressText id: progressText
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.top: statusText.top anchors.top: statusText.top
text: formatPrintJobPercent(printJob) text: formatPrintJobPercent(printJob)
visible: printProgressTitleBar.showPercent visible: printProgressTitleBar.showPercent
//TODO: Hardcoded value
opacity: 0.65 opacity: 0.65
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("very_small")
} }
@ -309,10 +318,10 @@ Rectangle
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.top: statusText.top anchors.top: statusText.top
visible: ! printProgressTitleBar.showPercent visible: !printProgressTitleBar.showPercent
source: { source: {
if ( ! printer.enabled) if (!printer.enabled)
{ {
return "blocked-icon.svg"; return "blocked-icon.svg";
} }
@ -362,7 +371,7 @@ Rectangle
{ {
text: text:
{ {
if ( ! printer.enabled) if (!printer.enabled)
{ {
return catalog.i18nc("@label", "Not accepting print jobs"); return catalog.i18nc("@label", "Not accepting print jobs");
} }
@ -392,6 +401,8 @@ Rectangle
} }
return ""; return "";
} }
anchors.left: parent.left
anchors.right: parent.right
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
} }
@ -399,7 +410,8 @@ Rectangle
Label // Status 2nd row Label // Status 2nd row
{ {
text: { text: {
if(printJob != null) { if(printJob != null)
{
if(printJob.status == "printing" || printJob.status == "post_print") if(printJob.status == "printing" || printJob.status == "post_print")
{ {
return OutputDevice.getDateCompleted(printJob.time_total - printJob.time_elapsed) return OutputDevice.getDateCompleted(printJob.time_total - printJob.time_elapsed)

View file

@ -1537,7 +1537,7 @@
"default_value": 0, "default_value": 0,
"type": "int", "type": "int",
"minimum_value": "0", "minimum_value": "0",
"maximum_value_warning": "5", "maximum_value_warning": "1 if (infill_pattern == 'cross' or infill_pattern == 'cross_3d' or support_pattern == 'concentric' or support_pattern == 'concentric_3d') else 5",
"maximum_value": "0 if spaghetti_infill_enabled else (999999 if infill_line_distance == 0 else (20 - math.log(infill_line_distance) / math.log(2)))", "maximum_value": "0 if spaghetti_infill_enabled else (999999 if infill_line_distance == 0 else (20 - math.log(infill_line_distance) / math.log(2)))",
"enabled": "infill_sparse_density > 0 and infill_pattern != 'cubicsubdiv' and not spaghetti_infill_enabled", "enabled": "infill_sparse_density > 0 and infill_pattern != 'cubicsubdiv' and not spaghetti_infill_enabled",
"limit_to_extruder": "infill_extruder_nr", "limit_to_extruder": "infill_extruder_nr",
@ -3605,7 +3605,7 @@
"default_value": 0, "default_value": 0,
"type": "int", "type": "int",
"minimum_value": "0", "minimum_value": "0",
"maximum_value_warning": "5", "maximum_value_warning": "1 if (support_pattern == 'cross' or support_pattern == 'lines' or support_pattern == 'zigzag' or support_pattern == 'concentric' or support_pattern == 'concentric_3d') else 5",
"maximum_value": "999999 if support_line_distance == 0 else (20 - math.log(support_line_distance) / math.log(2))", "maximum_value": "999999 if support_line_distance == 0 else (20 - math.log(support_line_distance) / math.log(2))",
"enabled": "support_enable and support_infill_rate > 0", "enabled": "support_enable and support_infill_rate > 0",
"limit_to_extruder": "support_infill_extruder_nr", "limit_to_extruder": "support_infill_extruder_nr",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before After
Before After