This commit is contained in:
fieldOfView 2016-08-09 09:56:40 +02:00
commit c7a120edd5
3 changed files with 74 additions and 8 deletions

View File

@ -270,11 +270,13 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
while timeout_time > time.time():
line = self._readline()
if line is None:
Logger.log("d", "No response from serial connection received.")
# Something went wrong with reading, could be that close was called.
self.setConnectionState(ConnectionState.closed)
return
if b"T:" in line:
Logger.log("d", "Correct response for auto-baudrate detection received.")
self._serial.timeout = 0.5
sucesfull_responses += 1
if sucesfull_responses >= self._required_responses_auto_baud:

View File

@ -1565,6 +1565,19 @@
"settable_per_mesh": false,
"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":
{
"label": "Number of Slower Layers",

View File

@ -19,6 +19,29 @@ Rectangle
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
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:
{
if(!printerConnected || !printerAcceptsCommands)
@ -96,7 +119,7 @@ Rectangle
color: base.statusColor
font: UM.Theme.getFont("large")
text: Math.round(progress) + "%"
visible: printerConnected
visible: showProgress
}
Rectangle
@ -110,6 +133,7 @@ Rectangle
anchors.leftMargin: UM.Theme.getSize("default_margin").width
radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.getColor("progressbar_background")
visible: showProgress
Rectangle
{
@ -134,9 +158,8 @@ Rectangle
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@label:", "Abort Print")
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
text: catalog.i18nc("@label:", "Abort Print");
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort");
style: ButtonStyle
{
@ -206,8 +229,36 @@ Rectangle
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
(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") : ""
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause")
property bool userClicked: false
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
{