mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Completed configuration UI to export PCB file
CURA-11561
This commit is contained in:
parent
b5b0575baf
commit
2aef33f521
6 changed files with 80 additions and 38 deletions
|
@ -69,7 +69,7 @@ UM.Dialog
|
||||||
id: settingsExportList
|
id: settingsExportList
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("thick_margin").height
|
||||||
model: settingsExportModel.settingsGroups
|
model: settingsExportModel.settingsGroups
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
@ -77,21 +77,6 @@ UM.Dialog
|
||||||
|
|
||||||
delegate: SettingsSelectionGroup { Layout.margins: 0 }
|
delegate: SettingsSelectionGroup { Layout.margins: 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flickable
|
|
||||||
// {
|
|
||||||
// Column
|
|
||||||
// {
|
|
||||||
// width: parent.width - scrollbar.width - UM.Theme.getSize("default_margin").width
|
|
||||||
// height: childrenRect.height
|
|
||||||
//
|
|
||||||
// spacing: UM.Theme.getSize("default_margin").height
|
|
||||||
// leftPadding: UM.Theme.getSize("default_margin").width
|
|
||||||
// rightPadding: leftPadding
|
|
||||||
// topPadding: UM.Theme.getSize("default_margin").height
|
|
||||||
// bottomPadding: topPadding
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
footerComponent: Rectangle
|
footerComponent: Rectangle
|
||||||
|
|
|
@ -8,12 +8,12 @@ from UM.Qt.ListModel import ListModel
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
|
||||||
|
|
||||||
class SettingsExport():
|
class SettingsExport(QObject):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, name, value):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._name = "Generate Support"
|
self._name = name
|
||||||
self._value = "Enabled"
|
self._value = value
|
||||||
|
|
||||||
@pyqtProperty(str, constant=True)
|
@pyqtProperty(str, constant=True)
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
27
plugins/PCBWriter/SettingSelection.qml
Normal file
27
plugins/PCBWriter/SettingSelection.qml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright (c) 2024 Ultimaker B.V.
|
||||||
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.10
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
|
||||||
|
import UM 1.5 as UM
|
||||||
|
import Cura 1.1 as Cura
|
||||||
|
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
|
id: settingSelection
|
||||||
|
|
||||||
|
UM.CheckBox
|
||||||
|
{
|
||||||
|
text: modelData.name
|
||||||
|
Layout.preferredWidth: UM.Theme.getSize("setting").width
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
text: modelData.value
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,15 +20,14 @@ class SettingsExportGroup(QObject):
|
||||||
Extruder = 1
|
Extruder = 1
|
||||||
Model = 2
|
Model = 2
|
||||||
|
|
||||||
def __init__(self, name, category, category_details = '', extruder_index = 0, extruder_color = ''):
|
def __init__(self, name, category, settings, category_details = '', extruder_index = 0, extruder_color = ''):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._name = name
|
self._name = name
|
||||||
self._settings = []
|
self._settings = settings
|
||||||
self._category = category
|
self._category = category
|
||||||
self._category_details = category_details
|
self._category_details = category_details
|
||||||
self._extruder_index = extruder_index
|
self._extruder_index = extruder_index
|
||||||
self._extruder_color = extruder_color
|
self._extruder_color = extruder_color
|
||||||
self._updateSettings()
|
|
||||||
|
|
||||||
@pyqtProperty(str, constant=True)
|
@pyqtProperty(str, constant=True)
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -53,7 +52,3 @@ class SettingsExportGroup(QObject):
|
||||||
@pyqtProperty(str, constant=True)
|
@pyqtProperty(str, constant=True)
|
||||||
def extruder_color(self):
|
def extruder_color(self):
|
||||||
return self._extruder_color
|
return self._extruder_color
|
||||||
|
|
||||||
def _updateSettings(self):
|
|
||||||
self._settings.append(SettingsExport())
|
|
||||||
self._settings.append(SettingsExport())
|
|
|
@ -8,6 +8,7 @@ from UM.Qt.ListModel import ListModel
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
|
||||||
from .SettingsExportGroup import SettingsExportGroup
|
from .SettingsExportGroup import SettingsExportGroup
|
||||||
|
from .SettingExport import SettingsExport
|
||||||
|
|
||||||
|
|
||||||
class SettingsExportModel(QObject):
|
class SettingsExportModel(QObject):
|
||||||
|
@ -22,10 +23,27 @@ class SettingsExportModel(QObject):
|
||||||
return self._settingsGroups
|
return self._settingsGroups
|
||||||
|
|
||||||
def _updateSettingsExportGroups(self):
|
def _updateSettingsExportGroups(self):
|
||||||
self._settingsGroups.append(SettingsExportGroup("Global settings", SettingsExportGroup.Category.Global))
|
self._settingsGroups.append(SettingsExportGroup("Global settings",
|
||||||
self._settingsGroups.append(SettingsExportGroup("Extruder settings", SettingsExportGroup.Category.Extruder, extruder_index=1, extruder_color='#ff0000'))
|
SettingsExportGroup.Category.Global,
|
||||||
self._settingsGroups.append(SettingsExportGroup("Extruder settings", SettingsExportGroup.Category.Extruder, extruder_index=8, extruder_color='#008fff'))
|
[SettingsExport("Generate Support", "Enabled"),
|
||||||
|
SettingsExport("Support Type", "Tree")]))
|
||||||
|
self._settingsGroups.append(SettingsExportGroup("Extruder settings",
|
||||||
|
SettingsExportGroup.Category.Extruder,
|
||||||
|
[SettingsExport("Brim Width", "0.7mm")],
|
||||||
|
extruder_index=1,
|
||||||
|
extruder_color='#ff0000'))
|
||||||
|
self._settingsGroups.append(SettingsExportGroup("Extruder settings",
|
||||||
|
SettingsExportGroup.Category.Extruder,
|
||||||
|
[],
|
||||||
|
extruder_index=8,
|
||||||
|
extruder_color='#008fff'))
|
||||||
self._settingsGroups.append(SettingsExportGroup("Model settings",
|
self._settingsGroups.append(SettingsExportGroup("Model settings",
|
||||||
SettingsExportGroup.Category.Model, 'hypercube.stl'))
|
SettingsExportGroup.Category.Model,
|
||||||
|
[SettingsExport("Brim Width", "20.0 mm"),
|
||||||
|
SettingsExport("Z Hop when retracted", "Disabled")],
|
||||||
|
'hypercube.stl'))
|
||||||
self._settingsGroups.append(SettingsExportGroup("Model settings",
|
self._settingsGroups.append(SettingsExportGroup("Model settings",
|
||||||
SettingsExportGroup.Category.Model, 'homer-simpson.stl'))
|
SettingsExportGroup.Category.Model,
|
||||||
|
[SettingsExport("Walls Thickness", "3.0 mm"),
|
||||||
|
SettingsExport("Enable Ironing", "Enabled")],
|
||||||
|
'homer-simpson.stl'))
|
||||||
|
|
|
@ -10,13 +10,12 @@ import UM 1.5 as UM
|
||||||
import Cura 1.1 as Cura
|
import Cura 1.1 as Cura
|
||||||
import PCBWriter 1.0 as PCBWriter
|
import PCBWriter 1.0 as PCBWriter
|
||||||
|
|
||||||
Column
|
ColumnLayout
|
||||||
{
|
{
|
||||||
id: settingsGroup
|
id: settingsGroup
|
||||||
|
spacing: UM.Theme.getSize("narrow_margin").width
|
||||||
|
|
||||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
RowLayout
|
||||||
|
|
||||||
Row
|
|
||||||
{
|
{
|
||||||
id: settingsGroupTitleRow
|
id: settingsGroupTitleRow
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
@ -24,7 +23,6 @@ Column
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: icon
|
id: icon
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
height: UM.Theme.getSize("medium_button_icon").height
|
height: UM.Theme.getSize("medium_button_icon").height
|
||||||
width: height
|
width: height
|
||||||
|
|
||||||
|
@ -63,8 +61,27 @@ Column
|
||||||
{
|
{
|
||||||
id: settingsTitle
|
id: settingsTitle
|
||||||
text: modelData.name + (modelData.category_details ? ' (%1)'.arg(modelData.category_details) : '')
|
text: modelData.name + (modelData.category_details ? ' (%1)'.arg(modelData.category_details) : '')
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
font: UM.Theme.getFont("default_bold")
|
font: UM.Theme.getFont("default_bold")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListView
|
||||||
|
{
|
||||||
|
id: settingsExportList
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
spacing: 0
|
||||||
|
model: modelData.settings
|
||||||
|
visible: modelData.settings.length > 0
|
||||||
|
|
||||||
|
delegate: SettingSelection { }
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||||
|
|
||||||
|
text: catalog.i18nc("@label", "No specific value has been set")
|
||||||
|
visible: modelData.settings.length === 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue