From 51316e1dc1db3d58e3f7c2139f3b0b28b754c0b1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 12 Jan 2018 11:13:58 +0100 Subject: [PATCH 1/8] Fix Prepare/Cancel button visibility conditions for manual slicing CURA-4525 --- resources/qml/SaveButton.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index dc24cc4700..bf44a29cf5 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -170,8 +170,8 @@ Item { tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process") // 1 = not started, 2 = Processing - enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true - visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true + enabled: base.backendState != "undefined" && ([1, 2].indexOf(base.backendState) != -1) && base.activity + visible: base.backendState != "undefined" && !autoSlice && ([1, 2, 4].indexOf(base.backendState) != -1) && base.activity property bool autoSlice height: UM.Theme.getSize("save_button_save_to_button").height @@ -179,8 +179,8 @@ Item { anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width - // 1 = not started, 5 = disabled - text: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel") + // 1 = not started, 4 = error, 5 = disabled + text: [1, 4, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel") onClicked: { sliceOrStopSlicing(); From b54b075cc9b01d50c6850809ab6b400cfa4d03cf Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 12 Jan 2018 16:42:32 +0100 Subject: [PATCH 2/8] Use isinstance() instead or issubclass() CURA-4525 --- cura/CuraApplication.py | 16 ++++++++-------- cura/ObjectsModel.py | 2 +- cura/PlatformPhysics.py | 2 +- cura/Scene/BuildPlateDecorator.py | 2 +- cura/Scene/ConvexHullNode.py | 2 +- cura/Scene/CuraSceneController.py | 2 +- plugins/CuraEngineBackend/CuraEngineBackend.py | 2 +- plugins/SimulationView/SimulationPass.py | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 7cc8afae1e..af6f08c175 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -895,7 +895,7 @@ class CuraApplication(QtApplication): scene_bounding_box = None is_block_slicing_node = False for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode) or (not node.getMeshData() and not node.callDecoration("getLayerData")): + if not isinstance(node, SceneNode) or (not node.getMeshData() and not node.callDecoration("getLayerData")): continue if node.callDecoration("isBlockSlicing"): is_block_slicing_node = True @@ -1012,7 +1012,7 @@ class CuraApplication(QtApplication): Selection.clear() for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1058,7 +1058,7 @@ class CuraApplication(QtApplication): Logger.log("i", "Resetting all scene translations") nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1086,7 +1086,7 @@ class CuraApplication(QtApplication): Logger.log("i", "Resetting all scene transformations") nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1113,7 +1113,7 @@ class CuraApplication(QtApplication): def arrangeObjectsToAllBuildPlates(self): nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1134,7 +1134,7 @@ class CuraApplication(QtApplication): nodes = [] active_build_plate = self.getBuildPlateModel().activeBuildPlate for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1158,7 +1158,7 @@ class CuraApplication(QtApplication): # What nodes are on the build plate and are not being moved fixed_nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if not node.getMeshData() and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. @@ -1186,7 +1186,7 @@ class CuraApplication(QtApplication): Logger.log("i", "Reloading all loaded mesh data.") nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode) or not node.getMeshData(): + if not isinstance(node, SceneNode) or not node.getMeshData(): continue nodes.append(node) diff --git a/cura/ObjectsModel.py b/cura/ObjectsModel.py index 5218127fc5..1516b3ee33 100644 --- a/cura/ObjectsModel.py +++ b/cura/ObjectsModel.py @@ -28,7 +28,7 @@ class ObjectsModel(ListModel): active_build_plate_number = self._build_plate_number group_nr = 1 for node in DepthFirstIterator(Application.getInstance().getController().getScene().getRoot()): - if not issubclass(type(node), SceneNode): + if not isinstance(node, SceneNode): continue if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): continue diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 0ad3cf1328..69890178e4 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -61,7 +61,7 @@ class PlatformPhysics: random.shuffle(nodes) for node in nodes: - if node is root or not issubclass(type(node), SceneNode) or node.getBoundingBox() is None: + if node is root or not isinstance(node, SceneNode) or node.getBoundingBox() is None: continue bbox = node.getBoundingBox() diff --git a/cura/Scene/BuildPlateDecorator.py b/cura/Scene/BuildPlateDecorator.py index 44372976f0..c2fd3145dd 100644 --- a/cura/Scene/BuildPlateDecorator.py +++ b/cura/Scene/BuildPlateDecorator.py @@ -13,7 +13,7 @@ class BuildPlateDecorator(SceneNodeDecorator): # Make sure that groups are set correctly # setBuildPlateForSelection in CuraActions makes sure that no single childs are set. self._build_plate_number = nr - if issubclass(type(self._node), CuraSceneNode): + if isinstance(self._node, CuraSceneNode): self._node.transformChanged() # trigger refresh node without introducing a new signal if self._node and self._node.callDecoration("isGroup"): for child in self._node.getChildren(): diff --git a/cura/Scene/ConvexHullNode.py b/cura/Scene/ConvexHullNode.py index 02d8ed833c..c8106b5d15 100644 --- a/cura/Scene/ConvexHullNode.py +++ b/cura/Scene/ConvexHullNode.py @@ -65,7 +65,7 @@ class ConvexHullNode(SceneNode): ConvexHullNode.shader.setUniformValue("u_opacity", 0.6) if self.getParent(): - if self.getMeshData() and issubclass(type(self._node), SceneNode) and self._node.callDecoration("getBuildPlateNumber") == Application.getInstance().getBuildPlateModel().activeBuildPlate: + if self.getMeshData() and isinstance(self._node, SceneNode) and self._node.callDecoration("getBuildPlateNumber") == Application.getInstance().getBuildPlateModel().activeBuildPlate: renderer.queueNode(self, transparent = True, shader = ConvexHullNode.shader, backface_cull = True, sort = -8) if self._convex_hull_head_mesh: renderer.queueNode(self, shader = ConvexHullNode.shader, transparent = True, mesh = self._convex_hull_head_mesh, backface_cull = True, sort = -8) diff --git a/cura/Scene/CuraSceneController.py b/cura/Scene/CuraSceneController.py index c3e27ca3dd..652dc78841 100644 --- a/cura/Scene/CuraSceneController.py +++ b/cura/Scene/CuraSceneController.py @@ -30,7 +30,7 @@ class CuraSceneController(QObject): source = args[0] else: source = None - if not issubclass(type(source), SceneNode): + if not isinstance(source, SceneNode): return max_build_plate = self._calcMaxBuildPlate() changed = False diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 3272fb019d..97463e07da 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -422,7 +422,7 @@ class CuraEngineBackend(QObject, Backend): # # \param source The scene node that was changed. def _onSceneChanged(self, source): - if not issubclass(type(source), SceneNode): + if not isinstance(source, SceneNode): return build_plate_changed = set() diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index c9c1443bfe..76d7127534 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -106,7 +106,7 @@ class SimulationPass(RenderPass): nozzle_node = node nozzle_node.setVisible(False) - elif issubclass(type(node), SceneNode) and (node.getMeshData() or node.callDecoration("isBlockSlicing")) and node.isVisible(): + elif isinstance(node, SceneNode) and (node.getMeshData() or node.callDecoration("isBlockSlicing")) and node.isVisible(): layer_data = node.callDecoration("getLayerData") if not layer_data: continue From c5c357d1260e0fe2ec43084e815f19dd294871bc Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 11 Jan 2018 14:30:59 +0100 Subject: [PATCH 3/8] Fixed merge conflicts of cherry picking dimensions fix --- cura/CuraApplication.py | 11 +++++++++-- cura/Scene/CuraSceneController.py | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index af6f08c175..02c5c04203 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -266,6 +266,7 @@ class CuraApplication(QtApplication): self.getController().getScene().sceneChanged.connect(self.updatePlatformActivity) self.getController().toolOperationStopped.connect(self._onToolOperationStopped) self.getController().contextMenuRequested.connect(self._onContextMenuRequested) + self.getCuraSceneController().activeBuildPlateChanged.connect(self.updatePlatformActivity) Resources.addType(self.ResourceTypes.QmlFiles, "qml") Resources.addType(self.ResourceTypes.Firmware, "firmware") @@ -890,12 +891,18 @@ class CuraApplication(QtApplication): def getSceneBoundingBoxString(self): return self._i18n_catalog.i18nc("@info 'width', 'depth' and 'height' are variable names that must NOT be translated; just translate the format of ##x##x## mm.", "%(width).1f x %(depth).1f x %(height).1f mm") % {'width' : self._scene_bounding_box.width.item(), 'depth': self._scene_bounding_box.depth.item(), 'height' : self._scene_bounding_box.height.item()} + ## Update scene bounding box for current build plate def updatePlatformActivity(self, node = None): count = 0 scene_bounding_box = None is_block_slicing_node = False + active_build_plate = self.getBuildPlateModel().activeBuildPlate for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if not isinstance(node, SceneNode) or (not node.getMeshData() and not node.callDecoration("getLayerData")): + if ( + not issubclass(type(node), CuraSceneNode) or + (not node.getMeshData() and not node.callDecoration("getLayerData")) or + (node.callDecoration("getBuildPlateNumber") != active_build_plate)): + continue if node.callDecoration("isBlockSlicing"): is_block_slicing_node = True @@ -915,7 +922,7 @@ class CuraApplication(QtApplication): if not scene_bounding_box: scene_bounding_box = AxisAlignedBox.Null - if repr(self._scene_bounding_box) != repr(scene_bounding_box) and scene_bounding_box.isValid(): + if repr(self._scene_bounding_box) != repr(scene_bounding_box): self._scene_bounding_box = scene_bounding_box self.sceneBoundingBoxChanged.emit() diff --git a/cura/Scene/CuraSceneController.py b/cura/Scene/CuraSceneController.py index 652dc78841..a93a8769d0 100644 --- a/cura/Scene/CuraSceneController.py +++ b/cura/Scene/CuraSceneController.py @@ -10,9 +10,12 @@ from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.SceneNode import SceneNode from UM.Scene.Selection import Selection +from UM.Signal import Signal class CuraSceneController(QObject): + activeBuildPlateChanged = Signal() + def __init__(self, objects_model: ObjectsModel, build_plate_model: BuildPlateModel): super().__init__() @@ -101,6 +104,7 @@ class CuraSceneController(QObject): self._build_plate_model.setActiveBuildPlate(nr) self._objects_model.setActiveBuildPlate(nr) + self.activeBuildPlateChanged.emit() @staticmethod def createCuraSceneController(): From 87dc3535bbbd2ad3d66b9579fcda6b375920eaec Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 15 Jan 2018 09:59:02 +0100 Subject: [PATCH 4/8] Use isinstance() for SceneNode type check CURA-4525 --- cura/CuraApplication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 02c5c04203..ab7c093b1d 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1041,7 +1041,7 @@ class CuraApplication(QtApplication): nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if type(node) not in {SceneNode, CuraSceneNode}: + if not isinstance(node, SceneNode): continue if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. From 20e7fe911fdebb9fb74df4ae5490e1e423252504 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 15 Jan 2018 10:49:38 +0100 Subject: [PATCH 5/8] Only save models on the active build plate in 3MFWriter CURA-4792 --- plugins/3MFWriter/ThreeMFWriter.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 79b821fe31..c4b7035cf1 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -6,8 +6,9 @@ from UM.Math.Vector import Vector from UM.Logger import Logger from UM.Math.Matrix import Matrix from UM.Application import Application -import UM.Scene.SceneNode -from cura.Scene.CuraSceneNode import CuraSceneNode +from UM.Scene.SceneNode import SceneNode + +from cura.CuraApplication import CuraApplication import Savitar @@ -62,11 +63,15 @@ class ThreeMFWriter(MeshWriter): self._store_archive = store_archive ## Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode - # \returns Uranium Scenen node. + # \returns Uranium Scene node. def _convertUMNodeToSavitarNode(self, um_node, transformation = Matrix()): - if type(um_node) not in [UM.Scene.SceneNode.SceneNode, CuraSceneNode]: + if not isinstance(um_node, SceneNode): return None + active_build_plate_nr = CuraApplication.getInstance().getBuildPlateModel().activeBuildPlate + if um_node.callDecoration("getBuildPlateNumber") != active_build_plate_nr: + return + savitar_node = Savitar.SceneNode() node_matrix = um_node.getLocalTransformation() @@ -97,6 +102,9 @@ class ThreeMFWriter(MeshWriter): savitar_node.setSetting(key, str(stack.getProperty(key, "value"))) for child_node in um_node.getChildren(): + # only save the nodes on the active build plate + if child_node.callDecoration("getBuildPlateNumber") != active_build_plate_nr: + continue savitar_child_node = self._convertUMNodeToSavitarNode(child_node) if savitar_child_node is not None: savitar_node.addChild(savitar_child_node) From b60903afc2d4770b367ba79074b40bbc0c304249 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 15 Jan 2018 11:02:52 +0100 Subject: [PATCH 6/8] Fix setting new ID in project loading CURA-4795 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 40d64590f5..5c62c361c3 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -609,7 +609,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): instance_container.setName(self._container_registry.uniqueName(instance_container.getName())) new_changes_container_id = self.getNewId(instance_container.getId()) - instance_container._id = new_changes_container_id + instance_container.setMetaDataEntry("id", new_changes_container_id) # TODO: we don't know the following is correct or not, need to verify # AND REFACTOR!!! From dc596d0e1e041dfa024702463bcf04b3a55278c3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 15 Jan 2018 11:12:07 +0100 Subject: [PATCH 7/8] Only remove selectable nodes in deleteAll() CURA-4795 Otherwise, after loading a project file, all nodes including the machine will be removed and you don't see the machine any more. --- cura/CuraApplication.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index ab7c093b1d..756dae2704 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1045,6 +1045,8 @@ class CuraApplication(QtApplication): continue if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. + if not node.isSelectable(): + continue # Only remove nodes that are selectable. if node.getParent() and node.getParent().callDecoration("isGroup"): continue # Grouped nodes don't need resetting as their parent (the group) is resetted) nodes.append(node) From e6cd6c264590d0dac42980cec6dc61f3f2346c98 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 15 Jan 2018 13:55:35 +0100 Subject: [PATCH 8/8] Replace travel_speed with speed_travel That travel_speed is a very old setting name. I'm guessing that people were copy-pasting that from older versions of Cura. --- resources/definitions/3dator.def.json | 4 ++-- resources/definitions/alya3dp.def.json | 4 ++-- resources/definitions/anycubic_i3_mega.def.json | 4 ++-- resources/definitions/easyarts_ares.def.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/definitions/3dator.def.json b/resources/definitions/3dator.def.json index 2ec7119656..19307bfddd 100644 --- a/resources/definitions/3dator.def.json +++ b/resources/definitions/3dator.def.json @@ -47,9 +47,9 @@ "default_value": 30 }, "machine_start_gcode": { - "default_value": ";Sliced at: {day} {date} {time}\nM104 S{material_print_temperature} ;set temperatures\nM140 S{material_bed_temperature}\nM109 S{material_print_temperature} ;wait for temperatures\nM190 S{material_bed_temperature}\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 Z0 ;move Z to min endstops\nG28 X0 Y0 ;move X/Y to min endstops\nG29 ;Auto Level\nG1 Z0.6 F{travel_speed} ;move the Nozzle near the Bed\nG92 E0\nG1 Y0 ;zero the extruded length\nG1 X10 E30 F500 ;printing a Line from right to left\nG92 E0 ;zero the extruded length again\nG1 Z2\nG1 F{travel_speed}\nM117 Printing...;Put printing message on LCD screen\nM150 R255 U255 B255 P4 ;Change LED Color to white" }, + "default_value": ";Sliced at: {day} {date} {time}\nM104 S{material_print_temperature} ;set temperatures\nM140 S{material_bed_temperature}\nM109 S{material_print_temperature} ;wait for temperatures\nM190 S{material_bed_temperature}\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 Z0 ;move Z to min endstops\nG28 X0 Y0 ;move X/Y to min endstops\nG29 ;Auto Level\nG1 Z0.6 F{speed_travel} ;move the Nozzle near the Bed\nG92 E0\nG1 Y0 ;zero the extruded length\nG1 X10 E30 F500 ;printing a Line from right to left\nG92 E0 ;zero the extruded length again\nG1 Z2\nG1 F{speed_travel}\nM117 Printing...;Put printing message on LCD screen\nM150 R255 U255 B255 P4 ;Change LED Color to white" }, "machine_end_gcode": { - "default_value": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" + "default_value": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" } } } diff --git a/resources/definitions/alya3dp.def.json b/resources/definitions/alya3dp.def.json index 2fda102249..6bf5d89a95 100644 --- a/resources/definitions/alya3dp.def.json +++ b/resources/definitions/alya3dp.def.json @@ -40,10 +40,10 @@ "default_value": "RepRap" }, "machine_start_gcode": { - "default_value": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to max endstops\nG1 Z115.0 F{travel_speed} ;move th e platform up 20mm\nG28 Z0 ;move Z to max endstop\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\nM301 H1 P26.38 I2.57 D67.78\n;Put printing message on LCD screen\nM117 Printing..." + "default_value": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to max endstops\nG1 Z115.0 F{speed_travel} ;move th e platform up 20mm\nG28 Z0 ;move Z to max endstop\nG1 Z15.0 F{speed_travel} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\nM301 H1 P26.38 I2.57 D67.78\n;Put printing message on LCD screen\nM117 Printing..." }, "machine_end_gcode": { - "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" + "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" } } } \ No newline at end of file diff --git a/resources/definitions/anycubic_i3_mega.def.json b/resources/definitions/anycubic_i3_mega.def.json index a0bd0efb7c..a373872de8 100644 --- a/resources/definitions/anycubic_i3_mega.def.json +++ b/resources/definitions/anycubic_i3_mega.def.json @@ -46,10 +46,10 @@ "default_value":"RepRap (Marlin/Sprinter)" }, "machine_start_gcode":{ - "default_value":"G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\nM117 Printing...\nG5" + "default_value":"G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F{speed_travel} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\nM117 Printing...\nG5" }, "machine_end_gcode":{ - "default_value":"M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle\nto release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops\nso the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000" + "default_value":"M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle\nto release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops\nso the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000" } } } diff --git a/resources/definitions/easyarts_ares.def.json b/resources/definitions/easyarts_ares.def.json index 982496de4c..689ac63625 100644 --- a/resources/definitions/easyarts_ares.def.json +++ b/resources/definitions/easyarts_ares.def.json @@ -10,7 +10,7 @@ }, "overrides": { "machine_start_gcode": { - "default_value": "; -- START GCODE --\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 \nG29 Z0.12 ;Auto-bedleveling with Z offset \nG92 E0 ;zero the extruded length \nG1 F2000 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\nM117 Printing...\n; -- end of START GCODE --" + "default_value": "; -- START GCODE --\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 \nG29 Z0.12 ;Auto-bedleveling with Z offset \nG92 E0 ;zero the extruded length \nG1 F2000 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\nM117 Printing...\n; -- end of START GCODE --" }, "machine_end_gcode": { "default_value": "; -- START GCODE --\nG28 ; Home all axes\nM104 S0 ;extruder heater off\n;M140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n;M84 ;steppers off\nG90 ;absolute positioning\n; -- end of START GCODE --"