Browse Source

Allow setting build plate shape

fieldOfView 8 years ago
parent
commit
b9280fef12

+ 35 - 5
plugins/MachineSettingsAction/MachineSettingsAction.qml

@@ -120,12 +120,25 @@ Cura.MachineAction
 
                     Column
                     {
-                        CheckBox
+                        Row
                         {
-                            id: heatedBedCheckBox
-                            text: catalog.i18nc("@option:check", "Heated Bed")
-                            checked: String(machineHeatedBedProvider.properties.value).toLowerCase() != 'false'
-                            onClicked: machineHeatedBedProvider.setPropertyValue("value", checked)
+                            spacing: UM.Theme.getSize("default_margin").width
+
+                            Label
+                            {
+                                text: catalog.i18nc("@label", "Build Plate Shape")
+                            }
+
+                            ComboBox
+                            {
+                                model: ["Rectangular", "Elliptic"]
+                                currentIndex: machineShapeProvider.properties.value.toLowerCase() != model[1].toLowerCase() ? 0 : 1
+                                onActivated:
+                                {
+                                    machineShapeProvider.setPropertyValue("value", model[index]);
+                                    manager.forceUpdate();
+                                }
+                            }
                         }
                         CheckBox
                         {
@@ -134,6 +147,13 @@ Cura.MachineAction
                             checked: String(machineCenterIsZeroProvider.properties.value).toLowerCase() != 'false'
                             onClicked: machineCenterIsZeroProvider.setPropertyValue("value", checked)
                         }
+                        CheckBox
+                        {
+                            id: heatedBedCheckBox
+                            text: catalog.i18nc("@option:check", "Heated Bed")
+                            checked: String(machineHeatedBedProvider.properties.value).toLowerCase() != 'false'
+                            onClicked: machineHeatedBedProvider.setPropertyValue("value", checked)
+                        }
                     }
 
                     Row
@@ -428,6 +448,16 @@ Cura.MachineAction
         storeIndex: manager.containerIndex
     }
 
+    UM.SettingPropertyProvider
+    {
+        id: machineShapeProvider
+
+        containerStackId: Cura.MachineManager.activeMachineId
+        key: "machine_shape"
+        watchedProperties: [ "value" ]
+        storeIndex: manager.containerIndex
+    }
+
     UM.SettingPropertyProvider
     {
         id: machineHeatedBedProvider

+ 15 - 0
resources/definitions/fdmprinter.def.json

@@ -137,6 +137,21 @@
                     "settable_per_extruder": false,
                     "settable_per_meshgroup": false
                 },
+                "machine_shape":
+                {
+                    "label": "Build plate shape",
+                    "description": "The shape of the build plate without taking unprintable areas into account.",
+                    "default_value": "Rectangular",
+                    "type": "enum",
+                    "options":
+                    {
+                        "rectangular": "Rectangular",
+                        "elliptic": "Elliptic"
+                    },
+                    "settable_per_mesh": false,
+                    "settable_per_extruder": false,
+                    "settable_per_meshgroup": false
+                },
                 "machine_height":
                 {
                     "label": "Machine height",