diff --git a/cura/LayerData.py b/cura/LayerData.py index fdcfca7631..eb8f5553ad 100644 --- a/cura/LayerData.py +++ b/cura/LayerData.py @@ -107,7 +107,7 @@ class Layer(): def build(self, offset, vertices, colors, indices): result = offset for polygon in self._polygons: - if polygon._type == Polygon.InfillType or polygon.type == Polygon.MoveCombingType or polygon.type == Polygon.MoveRetractionType: + if polygon.type == Polygon.InfillType or polygon.type == Polygon.MoveCombingType or polygon.type == Polygon.MoveRetractionType: continue polygon.build(result, vertices, colors, indices) @@ -238,7 +238,7 @@ class Polygon(): elif self._type == self.MoveCombingType: return Color(0.0, 0.0, 1.0, 1.0) elif self._type == self.MoveRetractionType: - return Color(0.0, 1.0, 1.0, 1.0) + return Color(0.5, 0.5, 1.0, 1.0) else: return Color(1.0, 1.0, 1.0, 1.0) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index aaaf650819..2e4d77b77f 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -127,8 +127,8 @@ class PlatformPhysics: if overlap is None: continue - move_vector.setX(overlap[0] * 1.01) - move_vector.setZ(overlap[1] * 1.01) + move_vector.setX(overlap[0] * 1.1) + move_vector.setZ(overlap[1] * 1.1) convex_hull = node.callDecoration("getConvexHull") if convex_hull: if not convex_hull.isValid(): diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 2f9cf5da5d..c2edab7793 100644 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -42,6 +42,10 @@ class ThreeMFReader(MeshReader): # There can be multiple objects, try to load all of them. objects = root.findall("./3mf:resources/3mf:object", self._namespaces) + if len(objects) == 0: + Logger.log("w", "No objects found in 3MF file %s, either the file is corrupt or you are using an outdated format", file_name) + return None + for object in objects: mesh = MeshData() node = SceneNode() @@ -53,18 +57,17 @@ class ThreeMFReader(MeshReader): triangles = object.findall(".//3mf:triangle", self._namespaces) mesh.reserveFaceCount(len(triangles)) - + #for triangle in object.mesh.triangles.triangle: for triangle in triangles: v1 = int(triangle.get("v1")) v2 = int(triangle.get("v2")) v3 = int(triangle.get("v3")) - mesh.addFace(vertex_list[v1][0],vertex_list[v1][2],vertex_list[v1][1],vertex_list[v2][0],vertex_list[v2][2],vertex_list[v2][1],vertex_list[v3][0],vertex_list[v3][2],vertex_list[v3][1]) - #TODO: We currently do not check for normals and simply recalculate them. + mesh.addFace(vertex_list[v1][0],vertex_list[v1][1],vertex_list[v1][2],vertex_list[v2][0],vertex_list[v2][1],vertex_list[v2][2],vertex_list[v3][0],vertex_list[v3][1],vertex_list[v3][2]) + #TODO: We currently do not check for normals and simply recalculate them. mesh.calculateNormals() node.setMeshData(mesh) node.setSelectable(True) - Logger.log("d", "Loaded a mesh with %s vertices", mesh.getVertexCount()) transformation = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(object.get("id")), self._namespaces) if transformation: @@ -89,18 +92,18 @@ class ThreeMFReader(MeshReader): temp_mat._data[0,2] = splitted_transformation[6] temp_mat._data[1,2] = splitted_transformation[7] temp_mat._data[2,2] = splitted_transformation[8] - + # Translation temp_mat._data[0,3] = splitted_transformation[9] temp_mat._data[1,3] = splitted_transformation[10] temp_mat._data[2,3] = splitted_transformation[11] - + node.setPosition(Vector(temp_mat.at(0,3), temp_mat.at(1,3), temp_mat.at(2,3))) - + temp_quaternion = Quaternion() temp_quaternion.setByMatrix(temp_mat) node.setOrientation(temp_quaternion) - + # Magical scale extraction S2 = temp_mat.getTransposed().multiply(temp_mat) scale_x = math.sqrt(S2.at(0,0)) diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index 4192749f76..2a731753fc 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -45,7 +45,8 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): self._connect_thread.daemon = True self._end_stop_thread = threading.Thread(target = self._pollEndStop) - self._end_stop_thread.daemon = True + self._end_stop_thread.deamon = True + self._poll_endstop = -1 # Printer is connected self._is_connected = False @@ -237,8 +238,9 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): @pyqtSlot() def startPollEndstop(self): - self._poll_endstop = True - self._end_stop_thread.start() + if self._poll_endstop == -1: + self._poll_endstop = True + self._end_stop_thread.start() @pyqtSlot() def stopPollEndstop(self): @@ -346,7 +348,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): self._serial = None def isConnected(self): - return self._is_connected + return self._is_connected @pyqtSlot(int) def heatupNozzle(self, temperature): diff --git a/plugins/USBPrinting/USBPrinterManager.py b/plugins/USBPrinting/USBPrinterManager.py index d2168b523b..1249c454ff 100644 --- a/plugins/USBPrinting/USBPrinterManager.py +++ b/plugins/USBPrinting/USBPrinterManager.py @@ -84,6 +84,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension): self._firmware_view.show() + @pyqtSlot() def updateAllFirmware(self): self.spawnFirmwareInterface("") for printer_connection in self._printer_connections: diff --git a/resources/machines/bq_hephestos_2.json b/resources/machines/bq_hephestos_2.json new file mode 100644 index 0000000000..7fb2a82f5a --- /dev/null +++ b/resources/machines/bq_hephestos_2.json @@ -0,0 +1,71 @@ +{ + "id": "bq_hephestos_2", + "version": 1, + "name": "BQ Hephestos 2", + "manufacturer": "Other", + "author": "BQ", + "platform": "bq_hephestos_2.stl", + "inherits": "fdmprinter.json", + + "machine_settings": { + "machine_start_gcode": { + "default": "; -- START GCODE --\nM800 ; Custom GCODE to fire start print procedure\n; -- end of START GCODE --" + }, + "machine_end_gcode": { + "default": "; -- END GCODE --\nM801 ; Custom GCODE to fire end print procedure\n; -- end of END GCODE --" + }, + "machine_width": { + "default": 210 + }, + "machine_depth": { + "default": 297 + }, + "machine_height": { + "default": 220 + }, + "machine_heated_bed": { + "default": false + }, + "machine_center_is_zero": { + "default": false + }, + "machine_gcode_flavor": { + "default": "RepRap" + }, + "machine_platform_offset": { + "default": [-6, 1320, 0] + } + }, + "overrides": { + "bottom_thickness": { "default": 1.2, "visible": true }, + "cool_fan_full_at_height": { "default": 0.8, "visible": false }, + "speed_wall_0": { "default": 35.0, "visible": false }, + "material_diameter": { "default": 1.75 }, + "layer_height_0": { "default": 0.2, "visible": true }, + "speed_layer_0": { "default": 35.0, "visible": true }, + "infill_overlap": { "default": 15.0, "visible": false }, + "layer_height": { "default": 0.2 }, + "cool_min_speed": { "default": 20.0, "visible": false }, + "speed_wall_x": { "default": 35.0, "visible": false }, + "wall_line_count": { "default": 3, "visible": false }, + "retraction_amount": { "default": 4.0, "visible": false }, + "retract_hop": { "default": 0.075, "visible": false }, + "retraction_speed": { "default": 45.0, "visible": false }, + "skirt_gap": { "default": 7.0 }, + "skirt_line_count": { "default": 4 }, + "speed_infill": { "default": 50.0, "visible": true }, + "material_print_temperature": { "default": 220.0, "visible": true }, + "speed_topbottom": { "default": 35.0, "visible": false }, + "top_thickness": { "default": 1.2, "visible": false }, + "top_layers": { "default": 6, "visible": false }, + "speed_travel": { "default": 150.0 }, + "shell_thickness": { "default": 1.2 }, + "wall_thickness": { "default": 1.2, "visible": false }, + "top_bottom_thickness": { "default": 1.2, "visible": false }, + "material_bed_temperature": { "default": 0 }, + "support_enable": { "default": false }, + "speed_print": { "default": 50.0 }, + "skirt_speed": { "default": 35.0, "visible": false }, + "skirt_minimal_length": { "default": 300.0, "visible": false } + } +} diff --git a/resources/machines/bq_witbox_2.json b/resources/machines/bq_witbox_2.json new file mode 100644 index 0000000000..a6a0ca07ae --- /dev/null +++ b/resources/machines/bq_witbox_2.json @@ -0,0 +1,71 @@ +{ + "id": "bq_witbox_2", + "version": 1, + "name": "BQ Witbox 2", + "manufacturer": "Other", + "author": "BQ", + "platform": "witbox_platform.stl", + "inherits": "fdmprinter.json", + + "machine_settings": { + "machine_start_gcode": { + "default": "; -- START GCODE --\nM800 ; Custom GCODE to fire start print procedure\n; -- end of START GCODE --" + }, + "machine_end_gcode": { + "default": "; -- END GCODE --\nM801 ; Custom GCODE to fire end print procedure\n; -- end of END GCODE --" + }, + "machine_width": { + "default": 297 + }, + "machine_depth": { + "default": 210 + }, + "machine_height": { + "default": 200 + }, + "machine_heated_bed": { + "default": false + }, + "machine_center_is_zero": { + "default": false + }, + "machine_gcode_flavor": { + "default": "RepRap" + }, + "machine_platform_offset": { + "default": [0, -145, -38] + } + }, + "overrides": { + "bottom_thickness": { "default": 1.2, "visible": true }, + "cool_fan_full_at_height": { "default": 0.8, "visible": false }, + "speed_wall_0": { "default": 35.0, "visible": false }, + "material_diameter": { "default": 1.75 }, + "layer_height_0": { "default": 0.2, "visible": true }, + "speed_layer_0": { "default": 35.0, "visible": true }, + "infill_overlap": { "default": 15.0, "visible": false }, + "layer_height": { "default": 0.2 }, + "cool_min_speed": { "default": 20.0, "visible": false }, + "speed_wall_x": { "default": 35.0, "visible": false }, + "wall_line_count": { "default": 3, "visible": false }, + "retraction_amount": { "default": 4.0, "visible": false }, + "retract_hop": { "default": 0.075, "visible": false }, + "retraction_speed": { "default": 45.0, "visible": false }, + "skirt_gap": { "default": 7.0 }, + "skirt_line_count": { "default": 4 }, + "speed_infill": { "default": 50.0, "visible": true }, + "material_print_temperature": { "default": 220.0, "visible": true }, + "speed_topbottom": { "default": 35.0, "visible": false }, + "top_thickness": { "default": 1.2, "visible": false }, + "top_layers": { "default": 6, "visible": false }, + "speed_travel": { "default": 150.0 }, + "shell_thickness": { "default": 1.2 }, + "wall_thickness": { "default": 1.2, "visible": false }, + "top_bottom_thickness": { "default": 1.2, "visible": false }, + "material_bed_temperature": { "default": 0 }, + "support_enable": { "default": false }, + "speed_print": { "default": 50.0 }, + "skirt_speed": { "default": 35.0, "visible": false }, + "skirt_minimal_length": { "default": 300.0, "visible": false } + } +} diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index 77643b500c..e5b0de849e 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -256,7 +256,6 @@ "min_value_warning": "0.2", "max_value_warning": "5", "type": "float", - "inherit_function": "parent_value", "visible": false, "children": { "wall_line_count": { @@ -275,7 +274,8 @@ "description": "Make an extra wall at every second layer, so that infill will be caught between an extra wall above and one below. This results in a better cohesion between infill and walls, but might have an impact on the surface quality.", "type": "boolean", "default": false, - "visible": false + "visible": false, + "inherit": false }, "top_bottom_thickness": { "label": "Bottom/Top Thickness", @@ -453,7 +453,7 @@ "type": "float", "default": 2, "visible": false, - "inherit_function": "0 if parent_value == 0 else (infill_line_width * 100) / parent_value" + "inherit_function": "0 if infill_sparse_density == 0 else (infill_line_width * 100) / infill_sparse_density" } } }, @@ -469,7 +469,7 @@ "zigzag": "Zig Zag" }, "default": "grid", - "inherit_function": "'lines' if parent_value > 25 else 'grid'" + "inherit_function": "'lines' if infill_sparse_density > 25 else 'grid'" }, "infill_overlap": { "label": "Infill Overlap", @@ -504,7 +504,7 @@ "type": "int", "default": 1, "visible": false, - "inherit_function": "math.floor((parent_value + 0.001) / layer_height)" + "inherit_function": "math.floor(( parent_value + 0.001) / layer_height)" } } }, diff --git a/resources/meshes/bq_hephestos_2.stl b/resources/meshes/bq_hephestos_2.stl new file mode 100644 index 0000000000..3a3a89eba4 Binary files /dev/null and b/resources/meshes/bq_hephestos_2.stl differ diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index e3ff6c9937..2c42275e0d 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -137,7 +137,6 @@ Item id: deleteObjectAction; text: catalog.i18nc("@action:inmenu","Delete Object"); iconName: "edit-delete"; - shortcut: StandardKey.Backspace; } Action @@ -216,5 +215,6 @@ Item id: showEngineLogAction; text: catalog.i18nc("@action:inmenu","Show Engine &Log..."); iconName: "view-list-text"; + shortcut: StandardKey.WhatsThis; } } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 93bc311da1..6af5c316cc 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -22,6 +22,19 @@ UM.MainWindow id: backgroundItem; anchors.fill: parent; UM.I18nCatalog{id: catalog; name:"cura"} + + //DeleteSelection on the keypress backspace event + Keys.onPressed: { + if (event.key == Qt.Key_Backspace) + { + if(objectContextMenu.objectId != 0) + { + Printer.deleteObject(objectContextMenu.objectId); + } + } + } + + UM.ApplicationMenu { id: menu @@ -636,6 +649,11 @@ UM.MainWindow onAccepted: { + //Because several implementations of the file dialog only update the folder + //when it is explicitly set. + var f = folder; + folder = f; + UM.MeshFileHandler.readLocalFile(fileUrl) openDialog.sendMeshName(fileUrl.toString()) } @@ -670,18 +688,22 @@ UM.MainWindow Component.onCompleted: { UM.Theme.load(UM.Resources.getPath(UM.Resources.Themes, "cura")) - visible = true; - addMachineTimer.start(); } Timer { - id: addMachineTimer; + id: startupTimer; interval: 100; repeat: false; + running: true; onTriggered: { - if(UM.MachineManager.activeMachineInstance == "") + if(!base.visible) + { + base.visible = true; + restart(); + } + else if(UM.MachineManager.activeMachineInstance == "") { addMachineWizard.firstRun = true; addMachineWizard.open(); diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index e104651ca4..70b43ffb72 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -54,7 +54,16 @@ Rectangle { Connections { target: openDialog onHasMesh: { - base.fileBaseName = name + if(base.fileBaseName == ''){ + base.fileBaseName = name + base.createFileName() + } + } + } + + onActivityChanged: { + if (activity == false){ + base.fileBaseName = '' base.createFileName() } } @@ -268,7 +277,6 @@ Rectangle { height: parent.height UM.RecolorImage { - id: lengthIcon anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter width: UM.Theme.sizes.standard_arrow.width diff --git a/resources/qml/ViewPage.qml b/resources/qml/ViewPage.qml index 6905c044f4..7b33345a9a 100644 --- a/resources/qml/ViewPage.qml +++ b/resources/qml/ViewPage.qml @@ -19,79 +19,51 @@ UM.PreferencesPage { UM.Preferences.resetPreference("view/show_overhang"); UM.Preferences.resetPreference("view/center_on_select"); - overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) - centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) } - GridLayout + Column { - columns: 2; UM.I18nCatalog { id: catalog; name:"cura"} - CheckBox + + UM.TooltipArea { - id: overhangCheckbox - checked: boolCheck(UM.Preferences.getValue("view/show_overhang")) - onCheckedChanged: UM.Preferences.setValue("view/show_overhang", checked ? "True" : "False") - } - Button - { - id: viewText //is a button so the user doesn't have to click inconveniently precise to enable or disable the checkbox + width: childrenRect.width; + height: childrenRect.height; - //: Display Overhang preference checkbox - text: catalog.i18nc("@option:check","Display Overhang"); - onClicked: overhangCheckbox.checked = !overhangCheckbox.checked + text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.") - //: Display Overhang preference tooltip - tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - - style: ButtonStyle + CheckBox { - background: Rectangle - { - border.width: 0 - color: "transparent" - } - label: Text - { - renderType: Text.NativeRendering - horizontalAlignment: Text.AlignLeft - text: control.text - } + id: overhangCheckbox + + checked: boolCheck(UM.Preferences.getValue("view/show_overhang")) + onClicked: UM.Preferences.setValue("view/show_overhang", checked) + + text: catalog.i18nc("@option:check","Display Overhang"); } } - CheckBox - { - id: centerCheckbox - checked: boolCheck(UM.Preferences.getValue("view/center_on_select")) - onCheckedChanged: UM.Preferences.setValue("view/center_on_select", checked ? "True" : "False") - } - Button - { - id: centerText //is a button so the user doesn't have to click inconveniently precise to enable or disable the checkbox + UM.TooltipArea { + width: childrenRect.width; + height: childrenRect.height; + text: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected") - //: Display Center camera preference checkbox - text: catalog.i18nc("@action:button","Center camera when item is selected"); - onClicked: centerCheckbox.checked = !centerCheckbox.checked - - //: Display Center camera preference tooltip - tooltip: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected") - - style: ButtonStyle + CheckBox { - background: Rectangle - { - border.width: 0 - color: "transparent" - } - label: Text - { - renderType: Text.NativeRendering - horizontalAlignment: Text.AlignLeft - text: control.text - } + id: centerCheckbox + text: catalog.i18nc("@action:button","Center camera when item is selected"); + checked: boolCheck(UM.Preferences.getValue("view/center_on_select")) + onClicked: UM.Preferences.setValue("view/center_on_select", checked) + } + } + + Connections { + target: UM.Preferences + onPreferenceChanged: + { + overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) + centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) } } - Item { Layout.fillHeight: true; Layout.columnSpan: 2 } } } diff --git a/resources/qml/WizardPages/AddMachine.qml b/resources/qml/WizardPages/AddMachine.qml index cd0713a34d..2ac479d276 100644 --- a/resources/qml/WizardPages/AddMachine.qml +++ b/resources/qml/WizardPages/AddMachine.qml @@ -128,14 +128,7 @@ Item text: model.name - onClicked: { - ListView.view.currentIndex = index; - if(model.pages.length > 0) { - base.wizard.nextAvailable = true; - } else { - base.wizard.nextAvailable = false; - } - } + onClicked: ListView.view.currentIndex = index; Label { diff --git a/resources/qml/WizardPages/Bedleveling.qml b/resources/qml/WizardPages/Bedleveling.qml index e8c3500eae..9bb9f4f652 100644 --- a/resources/qml/WizardPages/Bedleveling.qml +++ b/resources/qml/WizardPages/Bedleveling.qml @@ -15,6 +15,7 @@ Item property bool three_point_leveling: true property int platform_width: UM.MachineManager.getSettingValue("machine_width") property int platform_height: UM.MachineManager.getSettingValue("machine_depth") + property bool alreadyTested: base.addOriginalProgress.bedLeveling anchors.fill: parent; property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer Component.onCompleted: printer_connection.homeHead() @@ -40,7 +41,7 @@ Item } Label { - id: bedelevelingText + id: bedlevelingText anchors.top: pageDescription.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height width: parent.width @@ -49,47 +50,69 @@ Item } Item{ - anchors.top: bedelevelingText.bottom + id: bedlevelingWrapper + anchors.top: bedlevelingText.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.horizontalCenter: parent.horizontalCenter - width: bedelevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height < wizardPage.width ? bedelevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height : wizardPage.width + height: skipBedlevelingButton.height + width: bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height < wizardPage.width ? bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height : wizardPage.width Button { - id: bedelevelingButton + id: bedlevelingButton anchors.top: parent.top anchors.left: parent.left + enabled: !alreadyTested text: catalog.i18nc("@action:button","Move to Next Position"); onClicked: { if(wizardPage.leveling_state == 0) { - printer_connection.moveHead(platform_width /2 , platform_height,0) + printer_connection.moveHead(platform_width, 0 ,0) } if(wizardPage.leveling_state == 1) { - printer_connection.moveHead(platform_width , 0,0) + printer_connection.moveHead(platform_width/2, platform_height, 0) } if(wizardPage.leveling_state == 2) { - printer_connection.moveHead(0, 0 ,0) + printer_connection.moveHead(0, 0, 0) } wizardPage.leveling_state++ - + if (wizardPage.leveling_state >= 3){ + base.addOriginalProgress.bedLeveling = true + resultText.visible = true + skipBedlevelingButton.enabled = false + bedlevelingButton.enabled = false + wizardPage.leveling_state = 0 + } } } Button { id: skipBedlevelingButton - anchors.top: parent.width < wizardPage.width ? parent.top : bedelevelingButton.bottom + enabled: !alreadyTested + anchors.top: parent.width < wizardPage.width ? parent.top : bedlevelingButton.bottom anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2 - anchors.left: parent.width < wizardPage.width ? bedelevelingButton.right : parent.left + anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0 text: catalog.i18nc("@action:button","Skip Bedleveling"); onClicked: base.visible = false; } } + Label + { + id: resultText + visible: alreadyTested + anchors.top: bedlevelingWrapper.bottom + anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.left: parent.left + width: parent.width + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "Everythink is in order! You're done with bedeleveling.") + } + function threePointLeveling(width, height) { diff --git a/resources/qml/WizardPages/SelectUpgradedParts.qml b/resources/qml/WizardPages/SelectUpgradedParts.qml index 4275defdbf..4e84e61ec6 100644 --- a/resources/qml/WizardPages/SelectUpgradedParts.qml +++ b/resources/qml/WizardPages/SelectUpgradedParts.qml @@ -14,6 +14,19 @@ Item SystemPalette{id: palette} UM.I18nCatalog { id: catalog; name:"cura"} + + Component.onDestruction: + { + base.addOriginalProgress.upgrades[0] = extruderCheckBox.checked + base.addOriginalProgress.upgrades[1] = heatedBedCheckBox1.checked + base.addOriginalProgress.upgrades[2] = heatedBedCheckBox2.checked + if (extruderCheckBox.checked == true){ + UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true); + } + if (heatedBedCheckBox1.checked == true || heatedBedCheckBox2.checked == true){ + UM.MachineManager.setMachineSettingValue("machine_heated_bed", true) + } + } Label { id: pageTitle @@ -43,28 +56,31 @@ Item width: parent.width - UM.Theme.sizes.default_margin.width CheckBox { - id: checkBox + id: extruderCheckBox text: catalog.i18nc("@option:check","Extruder driver ugrades") - checked: true - onClicked: UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true); + checked: base.addOriginalProgress.upgrades[0] } CheckBox { + id: heatedBedCheckBox1 text: catalog.i18nc("@option:check","Heated printer bed (standard kit)") - y: checkBox.height * 1 - onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true) + y: extruderCheckBox.height * 1 + checked: base.addOriginalProgress.upgrades[1] + onClicked: { + if (heatedBedCheckBox2.checked == true) + heatedBedCheckBox2.checked = false + } } CheckBox { + id: heatedBedCheckBox2 text: catalog.i18nc("@option:check","Heated printer bed (self built)") - y: checkBox.height * 2 - onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true) - } - CheckBox - { - text: catalog.i18nc("@option:check","Dual extrusion (experimental)") - y: checkBox.height * 3 - enabled: false; + y: extruderCheckBox.height * 2 + checked: base.addOriginalProgress.upgrades[2] + onClicked: { + if (heatedBedCheckBox1.checked == true) + heatedBedCheckBox1.checked = false + } } } diff --git a/resources/qml/WizardPages/UltimakerCheckup.qml b/resources/qml/WizardPages/UltimakerCheckup.qml index 5f1ab3ee2e..6ef87ef069 100644 --- a/resources/qml/WizardPages/UltimakerCheckup.qml +++ b/resources/qml/WizardPages/UltimakerCheckup.qml @@ -14,24 +14,51 @@ Item property int leftRow: wizardPage.width*0.40 property int rightRow: wizardPage.width*0.60 anchors.fill: parent; + property bool alreadyTested: base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length-1] property bool x_min_pressed: false property bool y_min_pressed: false property bool z_min_pressed: false property bool heater_works: false property int extruder_target_temp: 0 property int bed_target_temp: 0 - property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.rowCount() != 0 ? UM.USBPrinterManager.connectedPrinterList.getItem(0).printer: null + property variant printer_connection: { + if (UM.USBPrinterManager.connectedPrinterList.rowCount() != 0){ + base.addOriginalProgress.checkUp[0] = true + checkTotalCheckUp() + return UM.USBPrinterManager.connectedPrinterList.getItem(0).printer + } + else { + return null + } + } + //property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer UM.I18nCatalog { id: catalog; name:"cura"} + function checkTotalCheckUp(){ + var allDone = true + for (var i = 0; i < (base.addOriginalProgress.checkUp.length - 1); i++){ + if (base.addOriginalProgress.checkUp[i] == false){ + allDone = false + } + } + if (allDone == true){ + base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length] = true + skipCheckButton.enabled = false + resultText.visible = true + } + } + Component.onCompleted: { - if (printer_connection != null) + if (printer_connection != null){ printer_connection.startPollEndstop() + } } Component.onDestruction: { - if (printer_connection != null) + if (printer_connection != null){ printer_connection.stopPollEndstop() + } } Label { @@ -64,11 +91,12 @@ Item id: startCheckButton anchors.top: parent.top anchors.left: parent.left + enabled: !alreadyTested text: catalog.i18nc("@action:button","Start Printer Check"); - enabled: manager.progress >= 100; onClicked: { checkupContent.visible = true startCheckButton.enabled = false + printer_connection.homeHead() } } @@ -79,8 +107,8 @@ Item anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2 anchors.left: parent.width < wizardPage.width ? startCheckButton.right : parent.left anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0 + enabled: !alreadyTested text: catalog.i18nc("@action:button","Skip Printer Check"); - enabled: manager.progress >= 100; onClicked: { base.currentPage += 1 } @@ -91,7 +119,7 @@ Item id: checkupContent anchors.top: startStopButtons.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height - visible: false + visible: alreadyTested ////////////////////////////////////////////////////////// Label { @@ -109,7 +137,7 @@ Item anchors.left: connectionLabel.right anchors.top: parent.top wrapMode: Text.WordWrap - text: UM.USBPrinterManager.connectedPrinterList.count ? catalog.i18nc("@info:status","Done"):catalog.i18nc("@info:status","Incomplete") + text: UM.USBPrinterManager.connectedPrinterList.rowCount() > 0 || base.addOriginalProgress.checkUp[0] ? catalog.i18nc("@info:status","Done"):catalog.i18nc("@info:status","Incomplete") } ////////////////////////////////////////////////////////// Label @@ -128,7 +156,7 @@ Item anchors.left: endstopXLabel.right anchors.top: connectionLabel.bottom wrapMode: Text.WordWrap - text: x_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + text: x_min_pressed || base.addOriginalProgress.checkUp[1] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") } ////////////////////////////////////////////////////////////// Label @@ -147,7 +175,7 @@ Item anchors.left: endstopYLabel.right anchors.top: endstopXLabel.bottom wrapMode: Text.WordWrap - text: y_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + text: y_min_pressed || base.addOriginalProgress.checkUp[2] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") } ///////////////////////////////////////////////////////////////////// Label @@ -166,7 +194,7 @@ Item anchors.left: endstopZLabel.right anchors.top: endstopYLabel.bottom wrapMode: Text.WordWrap - text: z_min_pressed ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + text: z_min_pressed || base.addOriginalProgress.checkUp[3] ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") } //////////////////////////////////////////////////////////// Label @@ -205,9 +233,14 @@ Item { if(printer_connection != null) { - heater_status_label.text = catalog.i18nc("@info:progress","Checking") - printer_connection.heatupNozzle(190) - wizardPage.extruder_target_temp = 190 + if (alreadyTested){ + nozzleTempStatus.text = catalog.i18nc("@info:status","Works") + } + else { + nozzleTempStatus.text = catalog.i18nc("@info:progress","Checking") + printer_connection.heatupNozzle(190) + wizardPage.extruder_target_temp = 190 + } } } } @@ -261,9 +294,14 @@ Item { if(printer_connection != null) { - bedTempStatus.text = catalog.i18nc("@info:progress","Checking") - printer_connection.heatupBed(60) - wizardPage.bed_target_temp = 60 + if (alreadyTested){ + bedTempStatus.text = catalog.i18nc("@info:status","Works") + } + else { + bedTempStatus.text = catalog.i18nc("@info:progress","Checking") + printer_connection.heatupBed(60) + wizardPage.bed_target_temp = 60 + } } } } @@ -279,6 +317,17 @@ Item text: printer_connection != null ? printer_connection.bedTemperature + "°C": "0°C" font.bold: true } + Label + { + id: resultText + visible: base.addOriginalProgress.checkUp[base.addOriginalProgress.checkUp.length-1] + anchors.top: bedTemp.bottom + anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.left: parent.left + width: parent.width + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "Everything is in order! You're done with your CheckUp.") + } } @@ -289,24 +338,33 @@ Item { if(key == "x_min") { + base.addOriginalProgress.checkUp[1] = true x_min_pressed = true + checkTotalCheckUp() } if(key == "y_min") { + base.addOriginalProgress.checkUp[2] = true y_min_pressed = true + checkTotalCheckUp() } if(key == "z_min") { + base.addOriginalProgress.checkUp[3] = true z_min_pressed = true + checkTotalCheckUp() } } + onExtruderTemperatureChanged: { if(printer_connection.extruderTemperature > wizardPage.extruder_target_temp - 10 && printer_connection.extruderTemperature < wizardPage.extruder_target_temp + 10) { if(printer_connection != null) { - heater_status_label.text = catalog.i18nc("@info:status","Works") + nozzleTempStatus.text = catalog.i18nc("@info:status","Works") + base.addOriginalProgress.checkUp[4] = true + checkTotalCheckUp() printer_connection.heatupNozzle(0) } } @@ -315,7 +373,9 @@ Item { if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5) { - bed_status_label.text = catalog.i18nc("@info:status","Works") + bedTempStatus.text = catalog.i18nc("@info:status","Works") + base.addOriginalProgress.checkUp[5] = true + checkTotalCheckUp() printer_connection.heatupBed(0) } } diff --git a/resources/qml/WizardPages/UpgradeFirmware.qml b/resources/qml/WizardPages/UpgradeFirmware.qml index edf075ee60..f7031febe3 100644 --- a/resources/qml/WizardPages/UpgradeFirmware.qml +++ b/resources/qml/WizardPages/UpgradeFirmware.qml @@ -14,6 +14,7 @@ Item SystemPalette{id: palette} UM.I18nCatalog { id: catalog; name:"cura"} + property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.rowCount() != 0 ? UM.USBPrinterManager.connectedPrinterList.getItem(0).printer : null Label { id: pageTitle @@ -61,6 +62,7 @@ Item anchors.top: parent.top anchors.left: parent.left text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware"); + onClicked: UM.USBPrinterManager.updateAllFirmware() } Button { id: skipUpgradeButton diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index f2b908e52e..63e04c6e6e 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -32,10 +32,11 @@ "capitalize": true, "family": "Roboto" }, - "timeslider_time": { + "default_header": { "size": 1.0, "bold": true, - "family": "Roboto" + "family": "Roboto", + "letterSpacing": 2.0 }, "button_tooltip": { "size": 0.75,