From 05b4689bd6e34a3c5eb792020eac94be1be260d4 Mon Sep 17 00:00:00 2001 From: orel Windows Date: Wed, 15 Nov 2017 11:39:54 +0100 Subject: [PATCH 1/5] Improve discoeasy200 profile, especially the machine gcode start as it uses 'print_temperature' which is an invalid Cura setting. --- .../definitions/dagoma_discoeasy200.def.json | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/resources/definitions/dagoma_discoeasy200.def.json b/resources/definitions/dagoma_discoeasy200.def.json index 8f1a792bc0..ef9a6084c8 100644 --- a/resources/definitions/dagoma_discoeasy200.def.json +++ b/resources/definitions/dagoma_discoeasy200.def.json @@ -8,7 +8,7 @@ "author": "Dagoma", "manufacturer": "Dagoma", "file_formats": "text/x-gcode", - "icon": "icon_ultimaker2.png", + "icon": "icon_discoeasy200.png", "platform": "discoeasy200.stl", "platform_offset": [ 105, -59, 280] }, @@ -30,24 +30,23 @@ }, "machine_head_with_fans_polygon": { "default_value": [ - [16, 37], - [16, -65], - [-16, -65], - [16, 37] + [17, 70], + [17, -40], + [-17, -40], + [17, 70] ] }, "gantry_height": { - "default_value": 55 - }, - "machine_gcode_flavor": { - "default_value": "RepRap" + "default_value": 10 }, "machine_start_gcode": { - "default_value": ";Gcode by Cura\nG90 ;absolute positioning\nM106 S250 ;fan on for the palpeur\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{print_temperature}\n;Activation palpeur\n;bloc palpeur\nG29 ;Auto level\nM107 ;start with the fan off\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{print_temperature}\nM140 S{material_bed_temperature}\nM82 ;set extruder to absolute mode\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Z3\nG1 F3000\n" + "default_value": ";Gcode by Cura\nG90 ;absolute positioning\nM106 S250 ;fan on for the palpeur\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{material_initial_print_temperature}\n;Activation palpeur\n;bloc palpeur\nG29 ;Auto level\nM107 ;start with the fan off\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{material_initial_print_temperature}\nM82 ;set extruder to absolute mode\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Z3\nG1 F6000" }, "machine_end_gcode": { - "default_value": "\nM104 S0\nM106 S255 ;start fan full power\nM140 S0 ;heated bed heater off (if you have it)\n;Home machine\nG91 ;relative positioning\nG1 E-1 F{retraction_speed} ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+3 F3000 ;move Z up a bit and retract filament even more\nG90\nG28 X Y\n;Ventilation forcee\nM107 ;stop fan\n;Shut down motor\nM84 ;shut down motors\n" + "default_value": "M104 S0\nM106 S255 ;start fan full power\nM140 S0 ;heated bed heater off (if you have it)\n;Home machine\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+3 F3000 ;move Z up a bit and retract filament even more\nG90\nG28 X Y\n;Ventilation forcee\nM107 ;stop fan\n;Shut down motor\nM84 ;shut down motors" + }, + "material_diameter": { + "default_value": 1.75 } } } - From 565574a18365089cd47ffa5e814a46dd2837cf7d Mon Sep 17 00:00:00 2001 From: orel Windows Date: Mon, 20 Nov 2017 10:59:57 +0100 Subject: [PATCH 2/5] Replace the print temperature setting used in gstart code as layer 0 print temperature seems more relevant. --- resources/definitions/dagoma_discoeasy200.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/dagoma_discoeasy200.def.json b/resources/definitions/dagoma_discoeasy200.def.json index ef9a6084c8..3b62ff042f 100644 --- a/resources/definitions/dagoma_discoeasy200.def.json +++ b/resources/definitions/dagoma_discoeasy200.def.json @@ -40,7 +40,7 @@ "default_value": 10 }, "machine_start_gcode": { - "default_value": ";Gcode by Cura\nG90 ;absolute positioning\nM106 S250 ;fan on for the palpeur\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{material_initial_print_temperature}\n;Activation palpeur\n;bloc palpeur\nG29 ;Auto level\nM107 ;start with the fan off\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{material_initial_print_temperature}\nM82 ;set extruder to absolute mode\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Z3\nG1 F6000" + "default_value": ";Gcode by Cura\nG90 ;absolute positioning\nM106 S250 ;fan on for the palpeur\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{material_print_temperature_layer_0}\n;Activation palpeur\n;bloc palpeur\nG29 ;Auto level\nM107 ;start with the fan off\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{material_print_temperature_layer_0}\nM82 ;set extruder to absolute mode\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Z3\nG1 F6000" }, "machine_end_gcode": { "default_value": "M104 S0\nM106 S255 ;start fan full power\nM140 S0 ;heated bed heater off (if you have it)\n;Home machine\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+3 F3000 ;move Z up a bit and retract filament even more\nG90\nG28 X Y\n;Ventilation forcee\nM107 ;stop fan\n;Shut down motor\nM84 ;shut down motors" From b776afaf3ddfb00c5b4a6521e20d2a4d34bfa755 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 22 Nov 2017 20:09:39 +0100 Subject: [PATCH 3/5] CURA-4509 Changing layout of the print time information tooltip, now in two lines per feature. This is for avoid trimming the labels because they depend on the language. --- resources/qml/Sidebar.qml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 383c599da8..31bda45b56 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -343,7 +343,6 @@ Rectangle onEntered: { - if(base.printDuration.valid && !base.printDuration.isTotalDurationZero) { // All the time information for the different features is achieved @@ -356,20 +355,10 @@ Rectangle { if(!print_time[feature].isTotalDurationZero) { - var feature_name = ""; - - if (feature.length <= 11) - { - feature_name = feature - } - else{ - feature_name = feature.substring(0, 8) + "..." - } - - - content += "" + feature_name + ":" + - "  " + print_time[feature].getDisplayString(UM.DurationFormat.Short) + - "  " + Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds) + "%" + + content += "" + feature + "" + + "" + + "" + print_time[feature].getDisplayString(UM.DurationFormat.Short) + "" + + "  " + Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds) + "%" + ""; } } From 5703f954d4649e48adf904d6d34ea30e82555aca Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 23 Nov 2017 14:13:18 +0100 Subject: [PATCH 4/5] CURA-4552 fix support for relative extrusion --- plugins/GCodeReader/GCodeReader.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/GCodeReader/GCodeReader.py b/plugins/GCodeReader/GCodeReader.py index 2a7e29e370..ba4c12abb2 100755 --- a/plugins/GCodeReader/GCodeReader.py +++ b/plugins/GCodeReader/GCodeReader.py @@ -58,6 +58,7 @@ class GCodeReader(MeshReader): self._layer_data_builder = LayerDataBuilder.LayerDataBuilder() self._center_is_zero = False self._is_absolute_positioning = True # It can be absolute (G90) or relative (G91) + self._is_absolute_extrusion = True # It can become absolute (M82, default) or relative (M83) @staticmethod def _getValue(line, code): @@ -180,11 +181,11 @@ class GCodeReader(MeshReader): f = params.f if params.f is not None else f if params.e is not None: - new_extrusion_value = params.e if self._is_absolute_positioning else e[self._extruder_number] + params.e + new_extrusion_value = params.e if self._is_absolute_extrusion else e[self._extruder_number] + params.e if new_extrusion_value > e[self._extruder_number]: - path.append([x, y, z, f, params.e + self._extrusion_length_offset[self._extruder_number], self._layer_type]) # extrusion + path.append([x, y, z, f, new_extrusion_value + self._extrusion_length_offset[self._extruder_number], self._layer_type]) # extrusion else: - path.append([x, y, z, f, params.e + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveRetractionType]) # retraction + path.append([x, y, z, f, new_extrusion_value + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveRetractionType]) # retraction e[self._extruder_number] = new_extrusion_value # Only when extruding we can determine the latest known "layer height" which is the difference in height between extrusions @@ -196,6 +197,7 @@ class GCodeReader(MeshReader): path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveCombingType]) return self._position(x, y, z, f, e) + # G0 and G1 should be handled exactly the same. _gCode1 = _gCode0 @@ -204,6 +206,7 @@ class GCodeReader(MeshReader): return self._position( params.x if params.x is not None else position.x, params.y if params.y is not None else position.y, + 0, position.f, position.e) @@ -266,6 +269,14 @@ class GCodeReader(MeshReader): position.e.extend([0] * (self._extruder_number - len(position.e) + 1)) return position + def _processMCode(self, m): + if m == 82: + # Set absolute extrusion mode + self._is_absolute_extrusion = True + elif m == 83: + # Set relative extrusion mode + self._is_absolute_extrusion = False + _type_keyword = ";TYPE:" _layer_keyword = ";LAYER:" @@ -383,6 +394,10 @@ class GCodeReader(MeshReader): current_position = self._processTCode(T, line, current_position, current_path) + if line.startswith("M"): + M = self._getInt(line, "M") + self._processMCode(M) + # "Flush" leftovers. Last layer paths are still stored if len(current_path) > 1: if self._createPolygon(self._current_layer_thickness, current_path, self._extruder_offsets.get(self._extruder_number, [0, 0])): From b6410ecf125021138af4a1126550d260f19327bb Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 23 Nov 2017 15:27:22 +0100 Subject: [PATCH 5/5] CURA-4561 prepare button upgrades --- resources/qml/SaveButton.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index e2890a6b49..3237dd9ade 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -45,6 +45,14 @@ Item { } } + function sliceOrStopSlicing() { + if ([1, 5].indexOf(UM.Backend.state) != -1) { + backend.forceSlice(); + } else { + backend.stopSlicing(); + } + } + Label { id: statusLabel width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width @@ -86,6 +94,10 @@ Item { if (saveToButton.enabled) { saveToButton.clicked(); } + // prepare button + if (prepareButton.enabled) { + sliceOrStopSlicing(); + } } } @@ -145,7 +157,7 @@ Item { Button { id: prepareButton - tooltip: UM.OutputDeviceManager.activeDeviceDescription; + tooltip: catalog.i18nc("@info:tooltip","Slice"); // 1 = not started, 2 = Processing enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true visible: { @@ -162,11 +174,7 @@ Item { text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel") onClicked: { - if ([1, 5].indexOf(UM.Backend.state) != -1) { - backend.forceSlice(); - } else { - backend.stopSlicing(); - } + sliceOrStopSlicing(); } style: ButtonStyle {