mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 14:19:04 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
c7a120edd5
@ -270,11 +270,13 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
while timeout_time > time.time():
|
while timeout_time > time.time():
|
||||||
line = self._readline()
|
line = self._readline()
|
||||||
if line is None:
|
if line is None:
|
||||||
|
Logger.log("d", "No response from serial connection received.")
|
||||||
# Something went wrong with reading, could be that close was called.
|
# Something went wrong with reading, could be that close was called.
|
||||||
self.setConnectionState(ConnectionState.closed)
|
self.setConnectionState(ConnectionState.closed)
|
||||||
return
|
return
|
||||||
|
|
||||||
if b"T:" in line:
|
if b"T:" in line:
|
||||||
|
Logger.log("d", "Correct response for auto-baudrate detection received.")
|
||||||
self._serial.timeout = 0.5
|
self._serial.timeout = 0.5
|
||||||
sucesfull_responses += 1
|
sucesfull_responses += 1
|
||||||
if sucesfull_responses >= self._required_responses_auto_baud:
|
if sucesfull_responses >= self._required_responses_auto_baud:
|
||||||
|
@ -1565,6 +1565,19 @@
|
|||||||
"settable_per_mesh": false,
|
"settable_per_mesh": false,
|
||||||
"settable_per_extruder": true
|
"settable_per_extruder": true
|
||||||
},
|
},
|
||||||
|
"max_feedrate_z_override":
|
||||||
|
{
|
||||||
|
"label": "Maximum Z Speed",
|
||||||
|
"description": "The maximal speed with which the bed is moved. Setting this to zero causes the print to use the firmware defaults for the maximum z speed.",
|
||||||
|
"unit": "mm/s",
|
||||||
|
"type": "float",
|
||||||
|
"default_value": 0,
|
||||||
|
"minimum_value": "0",
|
||||||
|
"maximum_value": "299792458000",
|
||||||
|
"maximum_value_warning": "machine_max_feedrate_z",
|
||||||
|
"settable_per_mesh": false,
|
||||||
|
"settable_per_extruder": true
|
||||||
|
},
|
||||||
"speed_slowdown_layers":
|
"speed_slowdown_layers":
|
||||||
{
|
{
|
||||||
"label": "Number of Slower Layers",
|
"label": "Number of Slower Layers",
|
||||||
|
@ -19,6 +19,29 @@ Rectangle
|
|||||||
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
|
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
|
||||||
property int backendState: UM.Backend.state
|
property int backendState: UM.Backend.state
|
||||||
|
|
||||||
|
|
||||||
|
property bool showProgress: {
|
||||||
|
// determine if we need to show the progress bar + percentage
|
||||||
|
if(!printerConnected || !printerAcceptsCommands)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||||
|
{
|
||||||
|
case "printing":
|
||||||
|
case "pre_print": // heating, etc.
|
||||||
|
case "paused":
|
||||||
|
return true;
|
||||||
|
case "wait_cleanup":
|
||||||
|
case "ready": // nut sure if this occurs, "" seems to be the ready state.
|
||||||
|
case "offline":
|
||||||
|
case "abort": // note sure if this jobState actually occurs in the wild
|
||||||
|
case "error": // after clicking abort you apparently get "error"
|
||||||
|
case "": // ready to print
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property variant statusColor:
|
property variant statusColor:
|
||||||
{
|
{
|
||||||
if(!printerConnected || !printerAcceptsCommands)
|
if(!printerConnected || !printerAcceptsCommands)
|
||||||
@ -96,7 +119,7 @@ Rectangle
|
|||||||
color: base.statusColor
|
color: base.statusColor
|
||||||
font: UM.Theme.getFont("large")
|
font: UM.Theme.getFont("large")
|
||||||
text: Math.round(progress) + "%"
|
text: Math.round(progress) + "%"
|
||||||
visible: printerConnected
|
visible: showProgress
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
@ -110,6 +133,7 @@ Rectangle
|
|||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
radius: UM.Theme.getSize("progressbar_radius").width
|
radius: UM.Theme.getSize("progressbar_radius").width
|
||||||
color: UM.Theme.getColor("progressbar_background")
|
color: UM.Theme.getColor("progressbar_background")
|
||||||
|
visible: showProgress
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
@ -134,9 +158,8 @@ Rectangle
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
text: catalog.i18nc("@label:", "Abort Print")
|
text: catalog.i18nc("@label:", "Abort Print");
|
||||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
|
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort");
|
||||||
|
|
||||||
|
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
{
|
{
|
||||||
@ -206,8 +229,36 @@ Rectangle
|
|||||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||||
(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||||
|
|
||||||
text: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? catalog.i18nc("@label:", "Resume") : catalog.i18nc("@label:", "Pause") : ""
|
property bool userClicked: false
|
||||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause")
|
|
||||||
|
text: {
|
||||||
|
var result = "";
|
||||||
|
if (!printerConnected) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||||
|
{
|
||||||
|
if (userClicked) {
|
||||||
|
result = catalog.i18nc("@label:", "Resuming...");
|
||||||
|
} else {
|
||||||
|
result = catalog.i18nc("@label:", "Resume");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (userClicked) {
|
||||||
|
result = catalog.i18nc("@label:", "Pausing...");
|
||||||
|
} else {
|
||||||
|
result = catalog.i18nc("@label:", "Pause");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userClicked = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
var newJobState = Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause";
|
||||||
|
Cura.MachineManager.printerOutputDevices[0].setJobState(newJobState);
|
||||||
|
userClicked = true;
|
||||||
|
}
|
||||||
|
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user