mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Merge branch 'master' into libArachne_rebased
Conflicts: resources/definitions/ultimaker2.def.json -> Additions in Arachne around a place where we fixed an enum setting. resources/definitions/ultimaker3.def.json resources/definitions/ultimaker_s3.def.json resources/definitions/ultimaker_s5.def.json
This commit is contained in:
commit
b8ccb32836
342 changed files with 19750 additions and 7653 deletions
|
@ -123,6 +123,9 @@ class StartSliceJob(Job):
|
|||
Job.yieldThread()
|
||||
|
||||
for changed_setting_key in changed_setting_keys:
|
||||
if not stack.getProperty(changed_setting_key, "enabled"):
|
||||
continue
|
||||
|
||||
validation_state = stack.getProperty(changed_setting_key, "validationState")
|
||||
|
||||
if validation_state is None:
|
||||
|
|
|
@ -198,7 +198,7 @@ class FlavorParser:
|
|||
|
||||
# Only when extruding we can determine the latest known "layer height" which is the difference in height between extrusions
|
||||
# Also, 1.5 is a heuristic for any priming or whatsoever, we skip those.
|
||||
if z > self._previous_z and (z - self._previous_z < 1.5):
|
||||
if z > self._previous_z and (z - self._previous_z < 1.5) and (params.x is not None or params.y is not None):
|
||||
self._current_layer_thickness = z - self._previous_z # allow a tiny overlap
|
||||
self._previous_z = z
|
||||
elif self._previous_extrusion_value > e[self._extruder_number]:
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
# Modified by Jaime van Kessel (Ultimaker), j.vankessel@ultimaker.com to make it work for 15.10 / 2.x
|
||||
# Modified by Ghostkeeper (Ultimaker), rubend@tutanota.com, to debug.
|
||||
# Modified by Wes Hanney, https://github.com/novamxd, Retract Length + Speed, Clean up
|
||||
# Modified by Alex Jaxon, https://github.com/legend069, Added option to modify Build Volume Temperature
|
||||
|
||||
|
||||
# history / changelog:
|
||||
# V3.0.1: TweakAtZ-state default 1 (i.e. the plugin works without any TweakAtZ comment)
|
||||
|
@ -33,13 +35,17 @@
|
|||
# V5.0: Bugfix for fall back after one layer and doubled G0 commands when using print speed tweak, Initial version for Cura 2.x
|
||||
# V5.0.1: Bugfix for calling unknown property 'bedTemp' of previous settings storage and unknown variable 'speed'
|
||||
# V5.1: API Changes included for use with Cura 2.2
|
||||
# V5.2.0: Wes Hanney. Added support for changing Retract Length and Speed. Removed layer spread option. Fixed issue of cumulative ChangeZ
|
||||
# V5.2.0: Wes Hanney. Added support for changing Retract Length and Speed. Removed layer spread option. Fixed issue of cumulative ChangeAtZ
|
||||
# mods so they can now properly be stacked on top of each other. Applied code refactoring to clean up various coding styles. Added comments.
|
||||
# Broke up functions for clarity. Split up class so it can be debugged outside of Cura.
|
||||
# V5.2.1: Wes Hanney. Added support for firmware based retractions. Fixed issue of properly restoring previous values in single layer option.
|
||||
# Added support for outputting changes to LCD (untested). Added type hints to most functions and variables. Added more comments. Created GCodeCommand
|
||||
# class for better detection of G1 vs G10 or G11 commands, and accessing arguments. Moved most GCode methods to GCodeCommand class. Improved wording
|
||||
# of Single Layer vs Keep Layer to better reflect what was happening.
|
||||
# V5.3.0 Alex Jaxon, Added option to modify Build Volume Temperature keeping current format
|
||||
#
|
||||
|
||||
|
||||
|
||||
# Uses -
|
||||
# M220 S<factor in percent> - set speed factor override percentage
|
||||
|
@ -56,9 +62,9 @@ from ..Script import Script
|
|||
import re
|
||||
|
||||
|
||||
# this was broken up into a separate class so the main ChangeZ script could be debugged outside of Cura
|
||||
# this was broken up into a separate class so the main ChangeAtZ script could be debugged outside of Cura
|
||||
class ChangeAtZ(Script):
|
||||
version = "5.2.1"
|
||||
version = "5.3.0"
|
||||
|
||||
def getSettingDataString(self):
|
||||
return """{
|
||||
|
@ -69,10 +75,10 @@ class ChangeAtZ(Script):
|
|||
"settings": {
|
||||
"caz_enabled": {
|
||||
"label": "Enabled",
|
||||
"description": "Allows adding multiple ChangeZ mods and disabling them as needed.",
|
||||
"description": "Allows adding multiple ChangeAtZ mods and disabling them as needed.",
|
||||
"type": "bool",
|
||||
"default_value": true
|
||||
},
|
||||
},
|
||||
"a_trigger": {
|
||||
"label": "Trigger",
|
||||
"description": "Trigger at height or at layer no.",
|
||||
|
@ -119,7 +125,7 @@ class ChangeAtZ(Script):
|
|||
"description": "Displays the current changes to the LCD",
|
||||
"type": "bool",
|
||||
"default_value": false
|
||||
},
|
||||
},
|
||||
"e1_Change_speed": {
|
||||
"label": "Change Speed",
|
||||
"description": "Select if total speed (print and travel) has to be changed",
|
||||
|
@ -222,6 +228,23 @@ class ChangeAtZ(Script):
|
|||
"maximum_value_warning": "120",
|
||||
"enabled": "h1_Change_bedTemp"
|
||||
},
|
||||
"h1_Change_buildVolumeTemperature": {
|
||||
"label": "Change Build Volume Temperature",
|
||||
"description": "Select if Build Volume Temperature has to be changed",
|
||||
"type": "bool",
|
||||
"default_value": false
|
||||
},
|
||||
"h2_buildVolumeTemperature": {
|
||||
"label": "Build Volume Temperature",
|
||||
"description": "New Build Volume Temperature",
|
||||
"unit": "C",
|
||||
"type": "float",
|
||||
"default_value": 20,
|
||||
"minimum_value": "0",
|
||||
"minimum_value_warning": "10",
|
||||
"maximum_value_warning": "50",
|
||||
"enabled": "h1_Change_buildVolumeTemperature"
|
||||
},
|
||||
"i1_Change_extruderOne": {
|
||||
"label": "Change Extruder 1 Temp",
|
||||
"description": "Select if First Extruder Temperature has to be changed",
|
||||
|
@ -278,25 +301,25 @@ class ChangeAtZ(Script):
|
|||
"description": "Indicates you would like to modify retraction properties.",
|
||||
"type": "bool",
|
||||
"default_value": false
|
||||
},
|
||||
},
|
||||
"caz_retractstyle": {
|
||||
"label": "Retract Style",
|
||||
"description": "Specify if you're using firmware retraction or linear move based retractions. Check your printer settings to see which you're using.",
|
||||
"type": "enum",
|
||||
"options": {
|
||||
"linear": "Linear Move",
|
||||
"linear": "Linear Move",
|
||||
"firmware": "Firmware"
|
||||
},
|
||||
"default_value": "linear",
|
||||
"enabled": "caz_change_retract"
|
||||
},
|
||||
},
|
||||
"caz_change_retractfeedrate": {
|
||||
"label": "Change Retract Feed Rate",
|
||||
"description": "Changes the retraction feed rate during print",
|
||||
"type": "bool",
|
||||
"default_value": false,
|
||||
"enabled": "caz_change_retract"
|
||||
},
|
||||
},
|
||||
"caz_retractfeedrate": {
|
||||
"label": "Retract Feed Rate",
|
||||
"description": "New Retract Feed Rate (mm/s)",
|
||||
|
@ -325,7 +348,7 @@ class ChangeAtZ(Script):
|
|||
"minimum_value_warning": "0",
|
||||
"maximum_value_warning": "20",
|
||||
"enabled": "caz_change_retractlength"
|
||||
}
|
||||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
|
@ -345,6 +368,7 @@ class ChangeAtZ(Script):
|
|||
self.setIntSettingIfEnabled(caz_instance, "g3_Change_flowrateOne", "flowrateOne", "g4_flowrateOne")
|
||||
self.setIntSettingIfEnabled(caz_instance, "g5_Change_flowrateTwo", "flowrateTwo", "g6_flowrateTwo")
|
||||
self.setFloatSettingIfEnabled(caz_instance, "h1_Change_bedTemp", "bedTemp", "h2_bedTemp")
|
||||
self.setFloatSettingIfEnabled(caz_instance, "h1_Change_buildVolumeTemperature", "buildVolumeTemperature", "h2_buildVolumeTemperature")
|
||||
self.setFloatSettingIfEnabled(caz_instance, "i1_Change_extruderOne", "extruderOne", "i2_extruderOne")
|
||||
self.setFloatSettingIfEnabled(caz_instance, "i3_Change_extruderTwo", "extruderTwo", "i4_extruderTwo")
|
||||
self.setIntSettingIfEnabled(caz_instance, "j1_Change_fanSpeed", "fanSpeed", "j2_fanSpeed")
|
||||
|
@ -776,6 +800,10 @@ class ChangeAtZProcessor:
|
|||
if "bedTemp" in values:
|
||||
codes.append("BedTemp: " + str(round(values["bedTemp"])))
|
||||
|
||||
# looking for wait for Build Volume Temperature
|
||||
if "buildVolumeTemperature" in values:
|
||||
codes.append("buildVolumeTemperature: " + str(round(values["buildVolumeTemperature"])))
|
||||
|
||||
# set our extruder one temp (if specified)
|
||||
if "extruderOne" in values:
|
||||
codes.append("Extruder 1 Temp: " + str(round(values["extruderOne"])))
|
||||
|
@ -858,6 +886,10 @@ class ChangeAtZProcessor:
|
|||
if "bedTemp" in values:
|
||||
codes.append("M140 S" + str(values["bedTemp"]))
|
||||
|
||||
# looking for wait for Build Volume Temperature
|
||||
if "buildVolumeTemperature" in values:
|
||||
codes.append("M141 S" + str(values["buildVolumeTemperature"]))
|
||||
|
||||
# set our extruder one temp (if specified)
|
||||
if "extruderOne" in values:
|
||||
codes.append("M104 S" + str(values["extruderOne"]) + " T0")
|
||||
|
@ -943,7 +975,7 @@ class ChangeAtZProcessor:
|
|||
# nothing to do
|
||||
return ""
|
||||
|
||||
# Returns the unmodified GCODE line from previous ChangeZ edits
|
||||
# Returns the unmodified GCODE line from previous ChangeAtZ edits
|
||||
@staticmethod
|
||||
def getOriginalLine(line: str) -> str:
|
||||
|
||||
|
@ -990,7 +1022,7 @@ class ChangeAtZProcessor:
|
|||
else:
|
||||
return self.currentZ >= self.targetZ
|
||||
|
||||
# Marks any current ChangeZ layer defaults in the layer for deletion
|
||||
# Marks any current ChangeAtZ layer defaults in the layer for deletion
|
||||
@staticmethod
|
||||
def markChangesForDeletion(layer: str):
|
||||
return re.sub(r";\[CAZD:", ";[CAZD:DELETE:", layer)
|
||||
|
@ -1288,7 +1320,7 @@ class ChangeAtZProcessor:
|
|||
# flag that we're inside our target layer
|
||||
self.insideTargetLayer = True
|
||||
|
||||
# Removes all the ChangeZ layer defaults from the given layer
|
||||
# Removes all the ChangeAtZ layer defaults from the given layer
|
||||
@staticmethod
|
||||
def removeMarkedChanges(layer: str) -> str:
|
||||
return re.sub(r";\[CAZD:DELETE:[\s\S]+?:CAZD\](\n|$)", "", layer)
|
||||
|
@ -1364,6 +1396,16 @@ class ChangeAtZProcessor:
|
|||
# move to the next command
|
||||
return
|
||||
|
||||
# handle Build Volume Temperature changes, really shouldn't want to wait for enclousure temp mid print though.
|
||||
if command.command == "M141" or command.command == "M191":
|
||||
|
||||
# get our bed temp if provided
|
||||
if "S" in command.arguments:
|
||||
self.lastValues["buildVolumeTemperature"] = command.getArgumentAsFloat("S")
|
||||
|
||||
# move to the next command
|
||||
return
|
||||
|
||||
# handle extruder temp changes
|
||||
if command.command == "M104" or command.command == "M109":
|
||||
|
||||
|
|
|
@ -458,7 +458,7 @@ class PauseAtHeight(Script):
|
|||
|
||||
# Optionally extrude material
|
||||
if extrude_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = extrude_amount, F = 200) + "\n"
|
||||
prepend_gcode += self.putValue(G = 1, E = extrude_amount, F = 200) + "; Extra extrude after the unpause\n"
|
||||
prepend_gcode += self.putValue("@info wait for cleaning nozzle from previous filament") + "\n"
|
||||
prepend_gcode += self.putValue("@pause remove the waste filament from parking area and press continue printing") + "\n"
|
||||
|
||||
|
@ -489,18 +489,17 @@ class PauseAtHeight(Script):
|
|||
# Set extruder resume temperature
|
||||
prepend_gcode += self.putValue(M = 109, S = int(target_temperature.get(current_t, 0))) + " ; resume temperature\n"
|
||||
|
||||
# Push the filament back,
|
||||
if retraction_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
|
||||
if extrude_amount != 0: # Need to prime after the pause.
|
||||
# Push the filament back.
|
||||
if retraction_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
|
||||
|
||||
# Optionally extrude material
|
||||
if extrude_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = extrude_amount, F = extrude_speed * 60) + "\n"
|
||||
# Prime the material.
|
||||
prepend_gcode += self.putValue(G = 1, E = extrude_amount, F = extrude_speed * 60) + "; Extra extrude after the unpause\n"
|
||||
|
||||
# and retract again, the properly primes the nozzle
|
||||
# when changing filament.
|
||||
if retraction_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = -retraction_amount, F = retraction_speed * 60) + "\n"
|
||||
# And retract again to make the movements back to the starting position.
|
||||
if retraction_amount != 0:
|
||||
prepend_gcode += self.putValue(G = 1, E = -retraction_amount, F = retraction_speed * 60) + "\n"
|
||||
|
||||
# Move the head back
|
||||
if park_enabled:
|
||||
|
|
|
@ -6,6 +6,7 @@ from PyQt5.QtWidgets import QApplication
|
|||
|
||||
from UM.Application import Application
|
||||
from UM.Math.Vector import Vector
|
||||
from UM.Operations.TranslateOperation import TranslateOperation
|
||||
from UM.Tool import Tool
|
||||
from UM.Event import Event, MouseEvent
|
||||
from UM.Mesh.MeshBuilder import MeshBuilder
|
||||
|
@ -120,8 +121,8 @@ class SupportEraser(Tool):
|
|||
# First add node to the scene at the correct position/scale, before parenting, so the eraser mesh does not get scaled with the parent
|
||||
op.addOperation(AddSceneNodeOperation(node, self._controller.getScene().getRoot()))
|
||||
op.addOperation(SetParentOperation(node, parent))
|
||||
op.addOperation(TranslateOperation(node, position, set_position = True))
|
||||
op.push()
|
||||
node.setPosition(position, CuraSceneNode.TransformSpace.World)
|
||||
|
||||
CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node)
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ Item
|
|||
case "queued":
|
||||
return catalog.i18nc("@label:status", "Action required");
|
||||
default:
|
||||
return catalog.i18nc("@label:status", "Finishes %1 at %2".arg(OutputDevice.getDateCompleted(printJob.timeRemaining)).arg(OutputDevice.getTimeCompleted(printJob.timeRemaining)));
|
||||
return catalog.i18nc("@label:status", "Finishes %1 at %2").arg(OutputDevice.getDateCompleted(printJob.timeRemaining)).arg(OutputDevice.getTimeCompleted(printJob.timeRemaining));
|
||||
}
|
||||
}
|
||||
width: contentWidth
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2020 Ultimaker B.V.
|
||||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import os
|
||||
|
@ -16,6 +16,7 @@ from UM.Util import parseBool
|
|||
from cura.API import Account
|
||||
from cura.API.Account import SyncState
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry # To update printer metadata with information received about cloud printers.
|
||||
from cura.Settings.CuraStackBuilder import CuraStackBuilder
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
from cura.UltimakerCloud.UltimakerCloudConstants import META_UM_LINKED_TO_ACCOUNT
|
||||
|
@ -129,6 +130,8 @@ class CloudOutputDeviceManager:
|
|||
self._um_cloud_printers[device_id].setMetaDataEntry(META_UM_LINKED_TO_ACCOUNT, True)
|
||||
self._onDevicesDiscovered(new_clusters)
|
||||
|
||||
self._updateOnlinePrinters(all_clusters)
|
||||
|
||||
# Hide the current removed_printers_message, if there is any
|
||||
if self._removed_printers_message:
|
||||
self._removed_printers_message.actionTriggered.disconnect(self._onRemovedPrintersMessageActionTriggered)
|
||||
|
@ -154,6 +157,8 @@ class CloudOutputDeviceManager:
|
|||
self._syncing = False
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, SyncState.SUCCESS)
|
||||
|
||||
Logger.debug("Synced cloud printers with account.")
|
||||
|
||||
def _onGetRemoteClusterFailed(self, reply: QNetworkReply, error: QNetworkReply.NetworkError) -> None:
|
||||
self._syncing = False
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, SyncState.ERROR)
|
||||
|
@ -255,6 +260,16 @@ class CloudOutputDeviceManager:
|
|||
message_text = self.i18n_catalog.i18nc("info:status", "Printers added from Digital Factory:") + "<ul>" + device_names + "</ul>"
|
||||
message.setText(message_text)
|
||||
|
||||
def _updateOnlinePrinters(self, printer_responses: Dict[str, CloudClusterResponse]) -> None:
|
||||
"""
|
||||
Update the metadata of the printers to store whether they are online or not.
|
||||
:param printer_responses: The responses received from the API about the printer statuses.
|
||||
"""
|
||||
for container_stack in CuraContainerRegistry.getInstance().findContainerStacks(type = "machine"):
|
||||
cluster_id = container_stack.getMetaDataEntry("um_cloud_cluster_id", "")
|
||||
if cluster_id in printer_responses:
|
||||
container_stack.setMetaDataEntry("is_online", printer_responses[cluster_id].is_online)
|
||||
|
||||
def _updateOutdatedMachine(self, outdated_machine: GlobalStack, new_cloud_output_device: CloudOutputDevice) -> None:
|
||||
"""
|
||||
Update the cloud metadata of a pre-existing machine that is rediscovered (e.g. if the printer was removed and
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import configparser
|
||||
import io
|
||||
import json
|
||||
import os.path
|
||||
from typing import List, Tuple
|
||||
|
||||
|
@ -49,6 +50,28 @@ class VersionUpgrade411to412(VersionUpgrade):
|
|||
# Update version number.
|
||||
parser["metadata"]["setting_version"] = "19"
|
||||
|
||||
# If the account scope in 4.11 is outdated, delete it so that the user is enforced to log in again and get the
|
||||
# correct permissions.
|
||||
new_scopes = {"account.user.read",
|
||||
"drive.backup.read",
|
||||
"drive.backup.write",
|
||||
"packages.download",
|
||||
"packages.rating.read",
|
||||
"packages.rating.write",
|
||||
"connect.cluster.read",
|
||||
"connect.cluster.write",
|
||||
"library.project.read",
|
||||
"library.project.write",
|
||||
"cura.printjob.read",
|
||||
"cura.printjob.write",
|
||||
"cura.mesh.read",
|
||||
"cura.mesh.write",
|
||||
"cura.material.write"}
|
||||
if "ultimaker_auth_data" in parser["general"]:
|
||||
ultimaker_auth_data = json.loads(parser["general"]["ultimaker_auth_data"])
|
||||
if new_scopes - set(ultimaker_auth_data["scope"].split(" ")):
|
||||
parser["general"]["ultimaker_auth_data"] = "{}"
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue