mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
7850f5a18e
11 changed files with 179 additions and 90 deletions
|
@ -335,8 +335,15 @@ class PrintInformation(QObject):
|
||||||
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
|
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
|
||||||
is_empty = name == ""
|
is_empty = name == ""
|
||||||
if is_gcode or is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
|
if is_gcode or is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
|
||||||
# Only take the file name part
|
# Only take the file name part, Note : file name might have 'dot' in name as well
|
||||||
|
if is_project_file:
|
||||||
|
self._base_name = ".".join(filename_parts)
|
||||||
|
elif len(filename_parts) > 1:
|
||||||
|
self._base_name = ".".join(filename_parts[0:-1])
|
||||||
|
else:
|
||||||
self._base_name = filename_parts[0]
|
self._base_name = filename_parts[0]
|
||||||
|
|
||||||
|
|
||||||
self._updateJobName()
|
self._updateJobName()
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
||||||
|
|
108
plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml
Normal file
108
plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
// Toolbox is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import UM 1.1 as UM
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
height: visible ? childrenRect.height : 0
|
||||||
|
visible: packageData.type == "material" && packageData.has_configs
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: heading
|
||||||
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
width: parent.width
|
||||||
|
text: catalog.i18nc("@label", "Compatibility")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("medium")
|
||||||
|
}
|
||||||
|
TableView
|
||||||
|
{
|
||||||
|
id: table
|
||||||
|
anchors.top: heading.bottom
|
||||||
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
width: parent.width
|
||||||
|
frameVisible: false
|
||||||
|
selectionMode: 0
|
||||||
|
model: packageData.supported_configs
|
||||||
|
headerDelegate: Item
|
||||||
|
{
|
||||||
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
elide: styleData.elideMode
|
||||||
|
text: styleData.value
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
|
font: UM.Theme.getFont("default_bold")
|
||||||
|
}
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
height: UM.Theme.getSize("default_lining").height
|
||||||
|
width: parent.width
|
||||||
|
color: "black"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rowDelegate: Item
|
||||||
|
{
|
||||||
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
elide: styleData.elideMode
|
||||||
|
text: styleData.value
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemDelegate: Item
|
||||||
|
{
|
||||||
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
elide: styleData.elideMode
|
||||||
|
text: styleData.value
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "machine"
|
||||||
|
title: "Machine"
|
||||||
|
width: Math.floor(table.width * 0.25)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "print_core"
|
||||||
|
title: "Print Core"
|
||||||
|
width: Math.floor(table.width * 0.2)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "build_plate"
|
||||||
|
title: "Build Plate"
|
||||||
|
width: Math.floor(table.width * 0.225)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "support_material"
|
||||||
|
title: "Support"
|
||||||
|
width: Math.floor(table.width * 0.225)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "quality"
|
||||||
|
title: "Quality"
|
||||||
|
width: Math.floor(table.width * 0.1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -104,7 +104,7 @@ Item
|
||||||
spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
|
spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: details.version
|
text: details.version || catalog.i18nc("@label", "Unknown")
|
||||||
font: UM.Theme.getFont("very_small")
|
font: UM.Theme.getFont("very_small")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ Item
|
||||||
{
|
{
|
||||||
id: tile
|
id: tile
|
||||||
property bool installed: toolbox.isInstalled(model.id)
|
property bool installed: toolbox.isInstalled(model.id)
|
||||||
|
property var packageData: model
|
||||||
width: detailList.width - UM.Theme.getSize("wide_margin").width
|
width: detailList.width - UM.Theme.getSize("wide_margin").width
|
||||||
height: Math.max(UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height)
|
height: Math.max(UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height)
|
||||||
Item
|
Item
|
||||||
|
@ -158,76 +159,11 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
ToolboxCompatibilityChart
|
||||||
{
|
{
|
||||||
id: supportedConfigsChart
|
id: compatibilityChart
|
||||||
anchors.top: normalData.bottom
|
anchors.top: normalData.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
height: visible ? childrenRect.height : 0
|
|
||||||
width: normalData.width
|
width: normalData.width
|
||||||
visible: model.type == "material" && model.supported_configs.length > 0
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: compatibilityHeading
|
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
width: parent.width
|
|
||||||
text: catalog.i18nc("@label", "Compatibility")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: UM.Theme.getColor("text_medium")
|
|
||||||
font: UM.Theme.getFont("default")
|
|
||||||
}
|
|
||||||
Column
|
|
||||||
{
|
|
||||||
id: compatibilityLabels
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
top: compatibilityHeading.bottom
|
|
||||||
topMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
}
|
|
||||||
width: childrenRect.width
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Machines") + ":"
|
|
||||||
font: UM.Theme.getFont("small")
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Print Cores") + ":"
|
|
||||||
font: UM.Theme.getFont("small")
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Quality Profiles") + ":"
|
|
||||||
font: UM.Theme.getFont("small")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Column
|
|
||||||
{
|
|
||||||
id: compatibilityValues
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
left: compatibilityLabels.right
|
|
||||||
leftMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
top: compatibilityLabels.top
|
|
||||||
bottom: compatibilityLabels.bottom
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: "Thingy"
|
|
||||||
font: UM.Theme.getFont("very_small")
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: "Thingy"
|
|
||||||
font: UM.Theme.getFont("very_small")
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: "Thingy"
|
|
||||||
font: UM.Theme.getFont("very_small")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
|
@ -235,7 +171,7 @@ Item
|
||||||
color: UM.Theme.getColor("lining")
|
color: UM.Theme.getColor("lining")
|
||||||
width: tile.width
|
width: tile.width
|
||||||
height: UM.Theme.getSize("default_lining").height
|
height: UM.Theme.getSize("default_lining").height
|
||||||
anchors.top: supportedConfigsChart.bottom
|
anchors.top: compatibilityChart.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
|
anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
|
||||||
}
|
}
|
||||||
Connections
|
Connections
|
||||||
|
|
37
plugins/Toolbox/src/ConfigsModel.py
Normal file
37
plugins/Toolbox/src/ConfigsModel.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import re
|
||||||
|
from typing import Dict
|
||||||
|
from PyQt5.QtCore import Qt, pyqtProperty
|
||||||
|
from UM.Qt.ListModel import ListModel
|
||||||
|
|
||||||
|
## Model that holds supported configurations (for material/quality packages).
|
||||||
|
class ConfigsModel(ListModel):
|
||||||
|
def __init__(self, parent = None):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
self._configs = None
|
||||||
|
|
||||||
|
self.addRoleName(Qt.UserRole + 1, "machine")
|
||||||
|
self.addRoleName(Qt.UserRole + 2, "print_core")
|
||||||
|
self.addRoleName(Qt.UserRole + 3, "build_plate")
|
||||||
|
self.addRoleName(Qt.UserRole + 4, "support_material")
|
||||||
|
self.addRoleName(Qt.UserRole + 5, "quality")
|
||||||
|
|
||||||
|
def setConfigs(self, configs):
|
||||||
|
self._configs = configs
|
||||||
|
self._update()
|
||||||
|
|
||||||
|
def _update(self):
|
||||||
|
items = []
|
||||||
|
for item in self._configs:
|
||||||
|
items.append({
|
||||||
|
"machine": item["machine"],
|
||||||
|
"print_core": item["print_core"],
|
||||||
|
"build_plate": item["build_plate"],
|
||||||
|
"support_material": item["support_material"],
|
||||||
|
"quality": item["quality"]
|
||||||
|
})
|
||||||
|
|
||||||
|
self.setItems(items)
|
|
@ -5,9 +5,8 @@ import re
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, pyqtProperty
|
from PyQt5.QtCore import Qt, pyqtProperty
|
||||||
|
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
from .ConfigsModel import ConfigsModel
|
||||||
|
|
||||||
## Model that holds cura packages. By setting the filter property the instances held by this model can be changed.
|
## Model that holds cura packages. By setting the filter property the instances held by this model can be changed.
|
||||||
class PackagesModel(ListModel):
|
class PackagesModel(ListModel):
|
||||||
|
@ -29,7 +28,8 @@ class PackagesModel(ListModel):
|
||||||
self.addRoleName(Qt.UserRole + 11, "download_url")
|
self.addRoleName(Qt.UserRole + 11, "download_url")
|
||||||
self.addRoleName(Qt.UserRole + 12, "last_updated")
|
self.addRoleName(Qt.UserRole + 12, "last_updated")
|
||||||
self.addRoleName(Qt.UserRole + 13, "is_bundled")
|
self.addRoleName(Qt.UserRole + 13, "is_bundled")
|
||||||
self.addRoleName(Qt.UserRole + 14, "supported_configs")
|
self.addRoleName(Qt.UserRole + 14, "has_configs")
|
||||||
|
self.addRoleName(Qt.UserRole + 15, "supported_configs")
|
||||||
|
|
||||||
# List of filters for queries. The result is the union of the each list of results.
|
# List of filters for queries. The result is the union of the each list of results.
|
||||||
self._filter = {} # type: Dict[str, str]
|
self._filter = {} # type: Dict[str, str]
|
||||||
|
@ -42,6 +42,16 @@ class PackagesModel(ListModel):
|
||||||
items = []
|
items = []
|
||||||
|
|
||||||
for package in self._metadata:
|
for package in self._metadata:
|
||||||
|
|
||||||
|
has_configs = False
|
||||||
|
configs_model = None
|
||||||
|
if "data" in package:
|
||||||
|
if "supported_configs" in package["data"]:
|
||||||
|
if len(package["data"]["supported_configs"]) > 0:
|
||||||
|
has_configs = True
|
||||||
|
configs_model = ConfigsModel()
|
||||||
|
configs_model.setConfigs(package["data"]["supported_configs"])
|
||||||
|
|
||||||
items.append({
|
items.append({
|
||||||
"id": package["package_id"],
|
"id": package["package_id"],
|
||||||
"type": package["package_type"],
|
"type": package["package_type"],
|
||||||
|
@ -56,7 +66,8 @@ class PackagesModel(ListModel):
|
||||||
"download_url": package["download_url"] if "download_url" in package else None,
|
"download_url": package["download_url"] if "download_url" in package else None,
|
||||||
"last_updated": package["last_updated"] if "last_updated" in package else None,
|
"last_updated": package["last_updated"] if "last_updated" in package else None,
|
||||||
"is_bundled": package["is_bundled"] if "is_bundled" in package else False,
|
"is_bundled": package["is_bundled"] if "is_bundled" in package else False,
|
||||||
"supported_configs": package["supported_configs"] if "supported_configs" in package else []
|
"has_configs": has_configs,
|
||||||
|
"supported_configs": configs_model
|
||||||
})
|
})
|
||||||
|
|
||||||
# Filter on all the key-word arguments.
|
# Filter on all the key-word arguments.
|
||||||
|
|
|
@ -21,6 +21,7 @@ from UM.Version import Version
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from .AuthorsModel import AuthorsModel
|
from .AuthorsModel import AuthorsModel
|
||||||
from .PackagesModel import PackagesModel
|
from .PackagesModel import PackagesModel
|
||||||
|
from .ConfigsModel import ConfigsModel
|
||||||
|
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,6 @@
|
||||||
"wall_0_inset": { "value": "0" },
|
"wall_0_inset": { "value": "0" },
|
||||||
"wall_line_width_x": { "value": "round(wall_line_width * 0.3 / 0.35, 2)" },
|
"wall_line_width_x": { "value": "round(wall_line_width * 0.3 / 0.35, 2)" },
|
||||||
"wall_thickness": { "value": "1" },
|
"wall_thickness": { "value": "1" },
|
||||||
"zig_zaggify_infill": { "value": "True" }
|
"zig_zaggify_infill": { "value": "gradual_infill_steps == 0" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,6 @@
|
||||||
"optimize_wall_printing_order": { "value": "True" },
|
"optimize_wall_printing_order": { "value": "True" },
|
||||||
"retraction_combing": { "default_value": "all" },
|
"retraction_combing": { "default_value": "all" },
|
||||||
"initial_layer_line_width_factor": { "value": "120" },
|
"initial_layer_line_width_factor": { "value": "120" },
|
||||||
"zig_zaggify_infill": { "value": "True" }
|
"zig_zaggify_infill": { "value": "gradual_infill_steps == 0" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,18 +19,6 @@ Item {
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: backgroundItem
|
|
||||||
onHasMesh:
|
|
||||||
{
|
|
||||||
if (PrintInformation.baseName == "")
|
|
||||||
{
|
|
||||||
PrintInformation.baseName = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onActivityChanged: {
|
onActivityChanged: {
|
||||||
if (activity == false) {
|
if (activity == false) {
|
||||||
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
|
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
|
||||||
|
|
|
@ -459,6 +459,7 @@
|
||||||
"toolbox_heading_label": [1.0, 4.0],
|
"toolbox_heading_label": [1.0, 4.0],
|
||||||
"toolbox_header": [1.0, 4.0],
|
"toolbox_header": [1.0, 4.0],
|
||||||
"toolbox_action_button": [8.0, 2.5],
|
"toolbox_action_button": [8.0, 2.5],
|
||||||
"toolbox_progress_bar": [8.0, 0.5]
|
"toolbox_progress_bar": [8.0, 0.5],
|
||||||
|
"toolbox_chart_row": [1.0, 2.0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue