diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 1556ee8d22..9c4ea14e42 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -10,6 +10,7 @@ from UM.Mesh.MeshBuilder import MeshBuilder from UM.Math.Vector import Vector from UM.Math.Color import Color from UM.Math.AxisAlignedBox import AxisAlignedBox +from UM.Math.Polygon import Polygon import numpy @@ -33,6 +34,9 @@ class BuildVolume(SceneNode): self.setCalculateBoundingBox(False) + self._active_instance = None + Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveInstanceChanged) + self._onActiveInstanceChanged() def setWidth(self, width): self._width = width @@ -55,12 +59,12 @@ class BuildVolume(SceneNode): if not self._material: self._material = renderer.createMaterial( - Resources.getPath(Resources.ShadersLocation, "basic.vert"), - Resources.getPath(Resources.ShadersLocation, "vertexcolor.frag") + Resources.getPath(Resources.Shaders, "basic.vert"), + Resources.getPath(Resources.Shaders, "vertexcolor.frag") ) self._grid_material = renderer.createMaterial( - Resources.getPath(Resources.ShadersLocation, "basic.vert"), - Resources.getPath(Resources.ShadersLocation, "grid.frag") + Resources.getPath(Resources.Shaders, "basic.vert"), + Resources.getPath(Resources.Shaders, "grid.frag") ) self._grid_material.setUniformValue("u_gridColor0", Color(245, 245, 245, 255)) self._grid_material.setUniformValue("u_gridColor1", Color(205, 202, 201, 255)) @@ -135,17 +139,18 @@ class BuildVolume(SceneNode): self._aabb = AxisAlignedBox(minimum = Vector(minW, minH - 1.0, minD), maximum = Vector(maxW, maxH, maxD)) - settings = Application.getInstance().getActiveMachine() - skirt_size = 0.0 - if settings.getSettingValueByKey("adhesion_type") == "None": - skirt_size = settings.getSettingValueByKey("skirt_line_count") * settings.getSettingValueByKey("skirt_line_width") + settings.getSettingValueByKey("skirt_gap") - elif settings.getSettingValueByKey("adhesion_type") == "Brim": - skirt_size = settings.getSettingValueByKey("brim_line_count") * settings.getSettingValueByKey("skirt_line_width") - else: - skirt_size = settings.getSettingValueByKey("skirt_line_width") - skirt_size += settings.getSettingValueByKey("skirt_line_width") + #profile = Application.getInstance().getMachineManager().getActiveProfile() + #if profile: + #if profile.getSettingValue("adhesion_type") == "skirt": + #skirt_size = profile.getSettingValue("skirt_line_count") * profile.getSettingValue("skirt_line_width") + profile.getSettingValue("skirt_gap") + #elif profile.getSettingValue("adhesion_type") == "brim": + #skirt_size = profile.getSettingValue("brim_line_count") * profile.getSettingValue("skirt_line_width") + #else: + #skirt_size = profile.getSettingValue("skirt_line_width") + + #skirt_size += profile.getSettingValue("skirt_line_width") scale_to_max_bounds = AxisAlignedBox( minimum = Vector(minW + skirt_size, minH, minD + skirt_size + disallowed_area_size), @@ -153,3 +158,21 @@ class BuildVolume(SceneNode): ) Application.getInstance().getController().getScene()._maximum_bounds = scale_to_max_bounds + + def _onActiveInstanceChanged(self): + self._active_instance = Application.getInstance().getMachineManager().getActiveMachineInstance() + + if self._active_instance: + self._width = self._active_instance.getMachineSettingValue("machine_width") + self._height = self._active_instance.getMachineSettingValue("machine_height") + self._depth = self._active_instance.getMachineSettingValue("machine_depth") + + disallowed_areas = self._active_instance.getMachineSettingValue("machine_disallowed_areas") + areas = [] + if disallowed_areas: + for area in disallowed_areas: + areas.append(Polygon(numpy.array(area, numpy.float32))) + + self._disallowed_areas = areas + + self.rebuild() diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index c2a6913404..1f1bc5db34 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -14,18 +14,10 @@ class ConvexHullDecorator(SceneNodeDecorator): self._convex_hull_node = None self._convex_hull_job = None - settings = Application.getInstance().getActiveMachine() - print_sequence_setting = settings.getSettingByKey("print_sequence") - if print_sequence_setting: - print_sequence_setting.valueChanged.connect(self._onPrintSequenceSettingChanged) - - def _onPrintSequenceSettingChanged(self, setting): - if self._convex_hull_job: - self._convex_hull_job.cancel() - self.setConvexHull(None) - if self._convex_hull_node: - self._convex_hull_node.setParent(None) - self._convex_hull_node = None + + self._profile = None + Application.getInstance().getMachineManager().activeProfileChanged.connect(self._onActiveProfileChanged) + self._onActiveProfileChanged() def getConvexHull(self): return self._convex_hull @@ -61,4 +53,20 @@ class ConvexHullDecorator(SceneNodeDecorator): def setConvexHullNode(self, node): self._convex_hull_node = node - \ No newline at end of file + def _onActiveProfileChanged(self): + if self._profile: + self._profile.settingValueChanged.disconnect(self._onSettingValueChanged) + + self._profile = Application.getInstance().getMachineManager().getActiveProfile() + + if self._profile: + self._profile.settingValueChanged.connect(self._onSettingValueChanged) + + def _onSettingValueChanged(self, setting): + if setting == "print_sequence": + if self._convex_hull_job: + self._convex_hull_job.cancel() + self.setConvexHull(None) + if self._convex_hull_node: + self._convex_hull_node.setParent(None) + self._convex_hull_node = None diff --git a/cura/ConvexHullJob.py b/cura/ConvexHullJob.py index 8369d050c8..f858d142d4 100644 --- a/cura/ConvexHullJob.py +++ b/cura/ConvexHullJob.py @@ -46,14 +46,14 @@ class ConvexHullJob(Job): # Then, do a Minkowski hull with a simple 1x1 quad to outset and round the normal convex hull. # This is done because of rounding errors. hull = hull.getMinkowskiHull(Polygon(numpy.array([[-1, -1], [-1, 1], [1, 1], [1, -1]], numpy.float32))) - settings = Application.getInstance().getActiveMachine() - - if settings.getSettingValueByKey("print_sequence") == "One at a time" and not self._node.getParent().callDecoration("isGroup"): + + profile = Application.getInstance().getMachineManager().getActiveProfile() + if profile.getSettingValue("print_sequence") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"): # Printing one at a time and it's not an object in a group self._node.callDecoration("setConvexHullBoundary", copy.deepcopy(hull)) - head_hull = hull.getMinkowskiHull(Polygon(numpy.array(settings.getSettingValueByKey("machine_head_with_fans_polygon"),numpy.float32))) + head_hull = hull.getMinkowskiHull(Polygon(numpy.array(profile.getSettingValue("machine_head_with_fans_polygon"),numpy.float32))) self._node.callDecoration("setConvexHullHead", head_hull) - hull = hull.getMinkowskiHull(Polygon(numpy.array(settings.getSettingValueByKey("machine_head_polygon"),numpy.float32))) + hull = hull.getMinkowskiHull(Polygon(numpy.array(profile.getSettingValue("machine_head_polygon"),numpy.float32))) hull_node = ConvexHullNode.ConvexHullNode(self._node, hull, Application.getInstance().getController().getScene().getRoot()) self._node.callDecoration("setConvexHullNode", hull_node) self._node.callDecoration("setConvexHull", hull) @@ -67,4 +67,3 @@ class ConvexHullJob(Job): hull_node = self._node.getParent().callDecoration("getConvexHullNode") if hull_node: hull_node.setParent(None) - diff --git a/cura/ConvexHullNode.py b/cura/ConvexHullNode.py index d610149072..3ea148dce8 100644 --- a/cura/ConvexHullNode.py +++ b/cura/ConvexHullNode.py @@ -22,10 +22,13 @@ class ConvexHullNode(SceneNode): self._inherit_orientation = False self._inherit_scale = False + self._color = Color(35, 35, 35, 0.5) + self._node = node self._node.transformationChanged.connect(self._onNodePositionChanged) self._node.parentChanged.connect(self._onNodeParentChanged) - #self._onNodePositionChanged(self._node) + self._node.decoratorsChanged.connect(self._onNodeDecoratorsChanged) + self._onNodeDecoratorsChanged(self._node) self._hull = hull @@ -53,27 +56,34 @@ class ConvexHullNode(SceneNode): def render(self, renderer): if not self._material: - self._material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, "basic.vert"), Resources.getPath(Resources.ShadersLocation, "color.frag")) + self._material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "color.frag")) - self._material.setUniformValue("u_color", Color(35, 35, 35, 128)) if self.getParent(): + self._material.setUniformValue("u_color", self._color) renderer.queueNode(self, material = self._material, transparent = True) return True - def _onNodePositionChanged(self, node): - #self.setPosition(node.getWorldPosition()) if node.callDecoration("getConvexHull"): node.callDecoration("setConvexHull", None) node.callDecoration("setConvexHullNode", None) self.setParent(None) - #self._node.transformationChanged.disconnect(self._onNodePositionChanged) - #self._node.parentChanged.disconnect(self._onNodeParentChanged) - def _onNodeParentChanged(self, node): if node.getParent(): self.setParent(self._original_parent) else: self.setParent(None) + + def _onNodeDecoratorsChanged(self, node): + self._color = Color(35, 35, 35, 0.5) + + if not node: + return + + if node.hasDecoration("getProfile"): + self._color.setR(0.75) + + if node.hasDecoration("getSetting"): + self._color.setG(0.75) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 1771a5c548..57d25b9bfa 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -7,9 +7,11 @@ from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit def show(type, value, tb): + if not hasattr(sys, "frozen"): + traceback.print_exception(type, value, tb) + application = QCoreApplication.instance() if not application: - traceback.print_exception(type, value, tb) sys.exit(1) dialog = QDialog() diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 3e892e52a2..93e663697c 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -38,8 +38,9 @@ from . import PrintInformation from . import CuraActions from . import MultiMaterialDecorator -from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent +from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtGui import QColor, QIcon +from PyQt5.QtQml import qmlRegisterUncreatableType import platform import sys @@ -49,14 +50,19 @@ import numpy numpy.seterr(all="ignore") class CuraApplication(QtApplication): + class ResourceTypes: + QmlFiles = Resources.UserType + 1 + Firmware = Resources.UserType + 2 + Q_ENUMS(ResourceTypes) + def __init__(self): - Resources.addResourcePath(os.path.join(QtApplication.getInstallPrefix(), "share", "cura")) + Resources.addSearchPath(os.path.join(QtApplication.getInstallPrefix(), "share", "cura")) if not hasattr(sys, "frozen"): - Resources.addResourcePath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) + Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) super().__init__(name = "cura", version = "master") - self.setWindowIcon(QIcon(Resources.getPath(Resources.ImagesLocation, "cura-icon.png"))) + self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png"))) self.setRequiredPlugins([ "CuraEngineBackend", @@ -77,9 +83,13 @@ class CuraApplication(QtApplication): self._previous_active_tool = None self._platform_activity = False - self.activeMachineChanged.connect(self._onActiveMachineChanged) + self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged) + self.getMachineManager().addMachineRequested.connect(self._onAddMachineRequested) self.getController().getScene().sceneChanged.connect(self.updatePlatformActivity) + Resources.addType(self.ResourceTypes.QmlFiles, "qml") + Resources.addType(self.ResourceTypes.Firmware, "firmware") + Preferences.getInstance().addPreference("cura/active_machine", "") Preferences.getInstance().addPreference("cura/active_mode", "simple") Preferences.getInstance().addPreference("cura/recent_files", "") @@ -158,21 +168,14 @@ class CuraApplication(QtApplication): self.showSplashMessage(self._i18n_catalog.i18nc("Splash screen message", "Loading interface...")) - self.setMainQml(Resources.getPath(Resources.QmlFilesLocation, "Cura.qml")) + self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml")) self.initializeEngine() - if self.getMachines(): - active_machine_pref = Preferences.getInstance().getValue("cura/active_machine") - if active_machine_pref: - for machine in self.getMachines(): - if machine.getName() == active_machine_pref: - self.setActiveMachine(machine) - - if not self.getActiveMachine(): - self.setActiveMachine(self.getMachines()[0]) - else: + manager = self.getMachineManager() + if not self.getMachineManager().getMachineInstances(): self.requestAddPrinter.emit() + if self._engine.rootObjects: self.closeSplash() @@ -198,6 +201,8 @@ class CuraApplication(QtApplication): self._cura_actions = CuraActions.CuraActions(self) engine.rootContext().setContextProperty("CuraActions", self._cura_actions) + qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type") + def onSelectionChanged(self): if Selection.hasSelection(): if not self.getController().getActiveTool(): @@ -393,18 +398,18 @@ class CuraApplication(QtApplication): @pyqtSlot(str, result = "QVariant") def getSettingValue(self, key): - if not self.getActiveMachine(): + if not self.getMachineManager().getActiveProfile(): return None - - return self.getActiveMachine().getSettingValueByKey(key) + return self.getMachineManager().getActiveProfile().getSettingValue(key) + #return self.getActiveMachine().getSettingValueByKey(key) ## Change setting by key value pair @pyqtSlot(str, "QVariant") def setSettingValue(self, key, value): - if not self.getActiveMachine(): + if not self.getMachineManager().getActiveProfile(): return - self.getActiveMachine().setSettingValueByKey(key, value) + self.getMachineManager().getActiveProfile().setSettingValue(key, value) @pyqtSlot() def mergeSelected(self): @@ -460,29 +465,30 @@ class CuraApplication(QtApplication): Selection.remove(node) def _onActiveMachineChanged(self): - machine = self.getActiveMachine() + machine = self.getMachineManager().getActiveMachineInstance() if machine: - Preferences.getInstance().setValue("cura/active_machine", machine.getName()) + pass + #Preferences.getInstance().setValue("cura/active_machine", machine.getName()) - self._volume.setWidth(machine.getSettingValueByKey("machine_width")) - self._volume.setHeight(machine.getSettingValueByKey("machine_height")) - self._volume.setDepth(machine.getSettingValueByKey("machine_depth")) + #self._volume.setWidth(machine.getSettingValueByKey("machine_width")) + #self._volume.setHeight(machine.getSettingValueByKey("machine_height")) + #self._volume.setDepth(machine.getSettingValueByKey("machine_depth")) - disallowed_areas = machine.getSettingValueByKey("machine_disallowed_areas") - areas = [] - if disallowed_areas: - for area in disallowed_areas: - areas.append(Polygon(numpy.array(area, numpy.float32))) + #disallowed_areas = machine.getSettingValueByKey("machine_disallowed_areas") + #areas = [] + #if disallowed_areas: + #for area in disallowed_areas: + #areas.append(Polygon(numpy.array(area, numpy.float32))) - self._volume.setDisallowedAreas(areas) + #self._volume.setDisallowedAreas(areas) - self._volume.rebuild() + #self._volume.rebuild() - offset = machine.getSettingValueByKey("machine_platform_offset") - if offset: - self._platform.setPosition(Vector(offset[0], offset[1], offset[2])) - else: - self._platform.setPosition(Vector(0.0, 0.0, 0.0)) + #offset = machine.getSettingValueByKey("machine_platform_offset") + #if offset: + #self._platform.setPosition(Vector(offset[0], offset[1], offset[2])) + #else: + #self._platform.setPosition(Vector(0.0, 0.0, 0.0)) def _onFileLoaded(self, job): node = job.getResult() @@ -520,3 +526,5 @@ class CuraApplication(QtApplication): job.finished.connect(self._onFileLoaded) job.start() + def _onAddMachineRequested(self): + self.requestAddPrinter.emit() diff --git a/cura/OneAtATimeIterator.py b/cura/OneAtATimeIterator.py index 958d1e5b5f..cf767a65ff 100644 --- a/cura/OneAtATimeIterator.py +++ b/cura/OneAtATimeIterator.py @@ -17,7 +17,7 @@ class OneAtATimeIterator(Iterator.Iterator): def _fillStack(self): node_list = [] for node in self._scene_node.getChildren(): - if node.getBoundingBox().height > Application.getInstance().getActiveMachine().getSettingValueByKey("gantry_height"): + if node.getBoundingBox().height > Application.getInstance().getMachineManager().getActiveProfile().getSettingValue("gantry_height"): return if node.callDecoration("getConvexHull"): node_list.append(node) @@ -103,4 +103,4 @@ class _objectOrder(): """ self.order = order self.todo = todo - \ No newline at end of file + diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 6df4ae04f6..55507fd603 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -40,48 +40,13 @@ class PrintInformation(QObject): def __init__(self, parent = None): super().__init__(parent) - self._enabled = False - - self._minimum_print_time = Duration(None, self) self._current_print_time = Duration(None, self) - self._maximum_print_time = Duration(None, self) self._material_amount = -1 - self._time_quality_value = 50 - self._time_quality_changed_timer = QTimer() - self._time_quality_changed_timer.setInterval(500) - self._time_quality_changed_timer.setSingleShot(True) - self._time_quality_changed_timer.timeout.connect(self._updateTimeQualitySettings) - - self._interpolation_settings = { - "layer_height": { "minimum": "low", "maximum": "high", "curve": "linear", "precision": 2 }, - "fill_sparse_density": { "minimum": "low", "maximum": "high", "curve": "linear", "precision": 0 } - } - - self._low_quality_settings = None - self._current_settings = None - self._high_quality_settings = None - - self._slice_pass = None - self._slice_reason = None - - Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged) - self._onActiveMachineChanged() - - Application.getInstance().getController().getScene().sceneChanged.connect(self._onSceneChanged) - self._backend = Application.getInstance().getBackend() if self._backend: self._backend.printDurationMessage.connect(self._onPrintDurationMessage) - self._backend.slicingStarted.connect(self._onSlicingStarted) - self._backend.slicingCancelled.connect(self._onSlicingCancelled) - - minimumPrintTimeChanged = pyqtSignal() - - @pyqtProperty(Duration, notify = minimumPrintTimeChanged) - def minimumPrintTime(self): - return self._minimum_print_time currentPrintTimeChanged = pyqtSignal() @@ -89,145 +54,18 @@ class PrintInformation(QObject): def currentPrintTime(self): return self._current_print_time - maximumPrintTimeChanged = pyqtSignal() - - @pyqtProperty(Duration, notify = maximumPrintTimeChanged) - def maximumPrintTime(self): - return self._maximum_print_time - materialAmountChanged = pyqtSignal() @pyqtProperty(float, notify = materialAmountChanged) def materialAmount(self): return self._material_amount - timeQualityValueChanged = pyqtSignal() - - @pyqtProperty(int, notify = timeQualityValueChanged) - def timeQualityValue(self): - return self._time_quality_value - - def setEnabled(self, enabled): - if enabled != self._enabled: - self._enabled = enabled - - if self._enabled: - self._updateTimeQualitySettings() - self._onSlicingStarted() - - self.enabledChanged.emit() - - enabledChanged = pyqtSignal() - @pyqtProperty(bool, fset = setEnabled, notify = enabledChanged) - def enabled(self): - return self._enabled - - @pyqtSlot(int) - def setTimeQualityValue(self, value): - if value != self._time_quality_value: - self._time_quality_value = value - self.timeQualityValueChanged.emit() - - self._time_quality_changed_timer.start() - - def _onSlicingStarted(self): - if self._slice_pass is None: - self._slice_pass = self.SlicePass.CurrentSettings - - if self._slice_reason is None: - self._slice_reason = self.SliceReason.Other - - if self._slice_pass == self.SlicePass.CurrentSettings and self._slice_reason != self.SliceReason.SettingChanged: - self._minimum_print_time.setDuration(-1) - self.minimumPrintTimeChanged.emit() - self._maximum_print_time.setDuration(-1) - self.maximumPrintTimeChanged.emit() - def _onPrintDurationMessage(self, time, amount): - if self._slice_pass == self.SlicePass.CurrentSettings: - self._current_print_time.setDuration(time) - self.currentPrintTimeChanged.emit() + #if self._slice_pass == self.SlicePass.CurrentSettings: + self._current_print_time.setDuration(time) + self.currentPrintTimeChanged.emit() - # Material amount is sent as an amount of mm^3, so calculate length from that - r = self._current_settings.getSettingValueByKey("material_diameter") / 2 - self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2) - self.materialAmountChanged.emit() - - if not self._enabled: - return - - if self._slice_reason != self.SliceReason.SettingChanged or not self._minimum_print_time.valid or not self._maximum_print_time.valid: - self._slice_pass = self.SlicePass.LowQualitySettings - self._backend.slice(settings = self._low_quality_settings, save_gcode = False, save_polygons = False, force_restart = False, report_progress = False) - else: - self._slice_pass = None - self._slice_reason = None - elif self._slice_pass == self.SlicePass.LowQualitySettings: - self._minimum_print_time.setDuration(time) - self.minimumPrintTimeChanged.emit() - - self._slice_pass = self.SlicePass.HighQualitySettings - self._backend.slice(settings = self._high_quality_settings, save_gcode = False, save_polygons = False, force_restart = False, report_progress = False) - elif self._slice_pass == self.SlicePass.HighQualitySettings: - self._maximum_print_time.setDuration(time) - self.maximumPrintTimeChanged.emit() - - self._slice_pass = None - self._slice_reason = None - - def _onActiveMachineChanged(self): - if self._current_settings: - self._current_settings.settingChanged.disconnect(self._onSettingChanged) - - self._current_settings = Application.getInstance().getActiveMachine() - - if self._current_settings: - self._current_settings.settingChanged.connect(self._onSettingChanged) - self._low_quality_settings = None - self._high_quality_settings = None - self._updateTimeQualitySettings() - - self._slice_reason = self.SliceReason.ActiveMachineChanged - - def _updateTimeQualitySettings(self): - if not self._current_settings or not self._enabled: - return - - if not self._low_quality_settings: - self._low_quality_settings = MachineSettings() - self._low_quality_settings.loadSettingsFromFile(Resources.getPath(Resources.SettingsLocation, self._current_settings.getTypeID() + ".json")) - self._low_quality_settings.loadValuesFromFile(Resources.getPath(Resources.SettingsLocation, "profiles", "low_quality.conf")) - - if not self._high_quality_settings: - self._high_quality_settings = MachineSettings() - self._high_quality_settings.loadSettingsFromFile(Resources.getPath(Resources.SettingsLocation, self._current_settings.getTypeID() + ".json")) - self._high_quality_settings.loadValuesFromFile(Resources.getPath(Resources.SettingsLocation, "profiles", "high_quality.conf")) - - for key, options in self._interpolation_settings.items(): - minimum_value = None - if options["minimum"] == "low": - minimum_value = self._low_quality_settings.getSettingValueByKey(key) - elif options["minimum"] == "high": - minimum_value = self._high_quality_settings.getSettingValueByKey(key) - else: - continue - - maximum_value = None - if options["maximum"] == "low": - maximum_value = self._low_quality_settings.getSettingValueByKey(key) - elif options["maximum"] == "high": - maximum_value = self._high_quality_settings.getSettingValueByKey(key) - else: - continue - - setting_value = round(minimum_value + (maximum_value - minimum_value) * (self._time_quality_value / 100), options["precision"]) - self._current_settings.setSettingValueByKey(key, setting_value) - - def _onSceneChanged(self, source): - self._slice_reason = self.SliceReason.SceneChanged - - def _onSettingChanged(self, source): - self._slice_reason = self.SliceReason.SettingChanged - - def _onSlicingCancelled(self): - self._slice_pass = None + # Material amount is sent as an amount of mm^3, so calculate length from that + r = Application.getInstance().getMachineManager().getActiveProfile().getSettingValue("material_diameter") / 2 + self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2) + self.materialAmountChanged.emit() diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 26c4488857..84b2ca78ac 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -10,6 +10,7 @@ from UM.Math.Vector import Vector from UM.Signal import Signal from UM.Logger import Logger from UM.Resources import Resources +from UM.Settings.SettingOverrideDecorator import SettingOverrideDecorator from cura.OneAtATimeIterator import OneAtATimeIterator from . import Cura_pb2 @@ -44,9 +45,10 @@ class CuraEngineBackend(Backend): self._onActiveViewChanged() self._stored_layer_data = None - self._settings = None - Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged) - self._onActiveMachineChanged() + + self._profile = None + Application.getInstance().getMachineManager().activeProfileChanged.connect(self._onActiveProfileChanged) + self._onActiveProfileChanged() self._change_timer = QTimer() self._change_timer.setInterval(500) @@ -71,7 +73,7 @@ class CuraEngineBackend(Backend): self.backendConnected.connect(self._onBackendConnected) def getEngineCommand(self): - return [Preferences.getInstance().getValue("backend/location"),"connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.SettingsLocation, "fdmprinter.json"), "-vv"] + return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.MachineDefinitions, "fdmprinter.json"), "-vv"] ## Emitted when we get a message containing print duration and material amount. This also implies the slicing has finished. # \param time The amount of time the print will take. @@ -114,7 +116,7 @@ class CuraEngineBackend(Backend): return object_groups = [] - if self._settings.getSettingValueByKey("print_sequence") == "One at a time": + if self._profile.getSettingValue("print_sequence") == "one_at_a_time": for node in OneAtATimeIterator(self._scene.getRoot()): temp_list = [] children = node.getAllChildren() @@ -141,7 +143,8 @@ class CuraEngineBackend(Backend): if len(object_groups) == 0: return #No point in slicing an empty build plate - if kwargs.get("settings", self._settings).hasErrorValue(): + if kwargs.get("profile", self._profile).hasErrorValue(): + Logger.log('w', "Profile has error values. Aborting slicing") return #No slicing if we have error values since those are by definition illegal values. self._slicing = True @@ -151,7 +154,7 @@ class CuraEngineBackend(Backend): if self._report_progress: self.processingProgress.emit(0.0) - self._sendSettings(kwargs.get("settings", self._settings)) + self._sendSettings(kwargs.get("profile", self._profile)) self._scene.acquireLock() @@ -179,6 +182,12 @@ class CuraEngineBackend(Backend): verts[:,1] *= -1 obj.vertices = verts.tostring() + self._handlePerObjectSettings(object, obj) + + # Hack to add per-object settings also to the "MeshGroup" in CuraEngine + # We really should come up with a better solution for this. + self._handlePerObjectSettings(group[0], group_message) + self._scene.releaseLock() self._socket.sendMessage(slice_message) @@ -191,13 +200,14 @@ class CuraEngineBackend(Backend): self._onChanged() - def _onActiveMachineChanged(self): - if self._settings: - self._settings.settingChanged.disconnect(self._onSettingChanged) - self._settings = Application.getInstance().getActiveMachine() - if self._settings: - self._settings.settingChanged.connect(self._onSettingChanged) + def _onActiveProfileChanged(self): + if self._profile: + self._profile.settingValueChanged.disconnect(self._onSettingChanged) + + self._profile = Application.getInstance().getMachineManager().getActiveProfile() + if self._profile: + self._profile.settingValueChanged.connect(self._onSettingChanged) self._onChanged() def _onSettingChanged(self, setting): @@ -247,17 +257,17 @@ class CuraEngineBackend(Backend): self._change_timer.start() def _onChanged(self): - if not self._settings: + if not self._profile: return self._change_timer.start() - def _sendSettings(self, settings): + def _sendSettings(self, profile): msg = Cura_pb2.SettingList() - for setting in settings.getAllSettings(include_machine=True): + for key, value in profile.getAllSettingValues(include_machine = True).items(): s = msg.settings.add() - s.name = setting.getKey() - s.value = str(setting.getValue()).encode("utf-8") + s.name = key + s.value = str(value).encode("utf-8") self._socket.sendMessage(msg) @@ -283,3 +293,20 @@ class CuraEngineBackend(Backend): job.start() else: self._layer_view_active = False + + def _handlePerObjectSettings(self, node, message): + profile = node.callDecoration("getProfile") + if profile: + for key, value in profile.getChangedSettings().items(): + setting = message.settings.add() + setting.name = key + setting.value = str(value).encode() + + object_settings = node.callDecoration("getAllSettingValues") + if not object_settings: + return + + for key, value in object_settings.items(): + setting = message.settings.add() + setting.name = key + setting.value = str(value).encode() diff --git a/plugins/CuraEngineBackend/Cura_pb2.py b/plugins/CuraEngineBackend/Cura_pb2.py index beeaaf24cc..bb0b000541 100644 --- a/plugins/CuraEngineBackend/Cura_pb2.py +++ b/plugins/CuraEngineBackend/Cura_pb2.py @@ -18,7 +18,7 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='Cura.proto', package='cura.proto', - serialized_pb=_b('\n\nCura.proto\x12\ncura.proto\"1\n\nObjectList\x12#\n\x07objects\x18\x01 \x03(\x0b\x32\x12.cura.proto.Object\"5\n\x05Slice\x12,\n\x0cobject_lists\x18\x01 \x03(\x0b\x32\x16.cura.proto.ObjectList\"o\n\x06Object\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x10\n\x08vertices\x18\x02 \x01(\x0c\x12\x0f\n\x07normals\x18\x03 \x01(\x0c\x12\x0f\n\x07indices\x18\x04 \x01(\x0c\x12%\n\x08settings\x18\x05 \x03(\x0b\x32\x13.cura.proto.Setting\"\x1a\n\x08Progress\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x02\"=\n\x10SlicedObjectList\x12)\n\x07objects\x18\x01 \x03(\x0b\x32\x18.cura.proto.SlicedObject\"=\n\x0cSlicedObject\x12\n\n\x02id\x18\x01 \x01(\x03\x12!\n\x06layers\x18\x02 \x03(\x0b\x32\x11.cura.proto.Layer\"]\n\x05Layer\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x11\n\tthickness\x18\x03 \x01(\x02\x12%\n\x08polygons\x18\x04 \x03(\x0b\x32\x13.cura.proto.Polygon\"\xe1\x01\n\x07Polygon\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.cura.proto.Polygon.Type\x12\x0e\n\x06points\x18\x02 \x01(\x0c\x12\x12\n\nline_width\x18\x03 \x01(\x02\"\x89\x01\n\x04Type\x12\x0c\n\x08NoneType\x10\x00\x12\x0e\n\nInset0Type\x10\x01\x12\x0e\n\nInsetXType\x10\x02\x12\x0c\n\x08SkinType\x10\x03\x12\x0f\n\x0bSupportType\x10\x04\x12\r\n\tSkirtType\x10\x05\x12\x0e\n\nInfillType\x10\x06\x12\x15\n\x11SupportInfillType\x10\x07\"&\n\nGCodeLayer\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"D\n\x0fObjectPrintTime\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04time\x18\x02 \x01(\x02\x12\x17\n\x0fmaterial_amount\x18\x03 \x01(\x02\"4\n\x0bSettingList\x12%\n\x08settings\x18\x01 \x03(\x0b\x32\x13.cura.proto.Setting\"&\n\x07Setting\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"\x1b\n\x0bGCodePrefix\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x62\x06proto3') + serialized_pb=_b('\n\nCura.proto\x12\ncura.proto\"X\n\nObjectList\x12#\n\x07objects\x18\x01 \x03(\x0b\x32\x12.cura.proto.Object\x12%\n\x08settings\x18\x02 \x03(\x0b\x32\x13.cura.proto.Setting\"5\n\x05Slice\x12,\n\x0cobject_lists\x18\x01 \x03(\x0b\x32\x16.cura.proto.ObjectList\"o\n\x06Object\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x10\n\x08vertices\x18\x02 \x01(\x0c\x12\x0f\n\x07normals\x18\x03 \x01(\x0c\x12\x0f\n\x07indices\x18\x04 \x01(\x0c\x12%\n\x08settings\x18\x05 \x03(\x0b\x32\x13.cura.proto.Setting\"\x1a\n\x08Progress\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x02\"=\n\x10SlicedObjectList\x12)\n\x07objects\x18\x01 \x03(\x0b\x32\x18.cura.proto.SlicedObject\"=\n\x0cSlicedObject\x12\n\n\x02id\x18\x01 \x01(\x03\x12!\n\x06layers\x18\x02 \x03(\x0b\x32\x11.cura.proto.Layer\"]\n\x05Layer\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x11\n\tthickness\x18\x03 \x01(\x02\x12%\n\x08polygons\x18\x04 \x03(\x0b\x32\x13.cura.proto.Polygon\"\xe1\x01\n\x07Polygon\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.cura.proto.Polygon.Type\x12\x0e\n\x06points\x18\x02 \x01(\x0c\x12\x12\n\nline_width\x18\x03 \x01(\x02\"\x89\x01\n\x04Type\x12\x0c\n\x08NoneType\x10\x00\x12\x0e\n\nInset0Type\x10\x01\x12\x0e\n\nInsetXType\x10\x02\x12\x0c\n\x08SkinType\x10\x03\x12\x0f\n\x0bSupportType\x10\x04\x12\r\n\tSkirtType\x10\x05\x12\x0e\n\nInfillType\x10\x06\x12\x15\n\x11SupportInfillType\x10\x07\"&\n\nGCodeLayer\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"D\n\x0fObjectPrintTime\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04time\x18\x02 \x01(\x02\x12\x17\n\x0fmaterial_amount\x18\x03 \x01(\x02\"4\n\x0bSettingList\x12%\n\x08settings\x18\x01 \x03(\x0b\x32\x13.cura.proto.Setting\"&\n\x07Setting\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"\x1b\n\x0bGCodePrefix\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x62\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -65,8 +65,8 @@ _POLYGON_TYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=583, - serialized_end=720, + serialized_start=622, + serialized_end=759, ) _sym_db.RegisterEnumDescriptor(_POLYGON_TYPE) @@ -85,6 +85,13 @@ _OBJECTLIST = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='settings', full_name='cura.proto.ObjectList.settings', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -97,7 +104,7 @@ _OBJECTLIST = _descriptor.Descriptor( oneofs=[ ], serialized_start=26, - serialized_end=75, + serialized_end=114, ) @@ -126,8 +133,8 @@ _SLICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=77, - serialized_end=130, + serialized_start=116, + serialized_end=169, ) @@ -184,8 +191,8 @@ _OBJECT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=132, - serialized_end=243, + serialized_start=171, + serialized_end=282, ) @@ -214,8 +221,8 @@ _PROGRESS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=245, - serialized_end=271, + serialized_start=284, + serialized_end=310, ) @@ -244,8 +251,8 @@ _SLICEDOBJECTLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=273, - serialized_end=334, + serialized_start=312, + serialized_end=373, ) @@ -281,8 +288,8 @@ _SLICEDOBJECT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=336, - serialized_end=397, + serialized_start=375, + serialized_end=436, ) @@ -332,8 +339,8 @@ _LAYER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=399, - serialized_end=492, + serialized_start=438, + serialized_end=531, ) @@ -377,8 +384,8 @@ _POLYGON = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=495, - serialized_end=720, + serialized_start=534, + serialized_end=759, ) @@ -414,8 +421,8 @@ _GCODELAYER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=722, - serialized_end=760, + serialized_start=761, + serialized_end=799, ) @@ -458,8 +465,8 @@ _OBJECTPRINTTIME = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=762, - serialized_end=830, + serialized_start=801, + serialized_end=869, ) @@ -488,8 +495,8 @@ _SETTINGLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=832, - serialized_end=884, + serialized_start=871, + serialized_end=923, ) @@ -525,8 +532,8 @@ _SETTING = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=886, - serialized_end=924, + serialized_start=925, + serialized_end=963, ) @@ -555,11 +562,12 @@ _GCODEPREFIX = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=926, - serialized_end=953, + serialized_start=965, + serialized_end=992, ) _OBJECTLIST.fields_by_name['objects'].message_type = _OBJECT +_OBJECTLIST.fields_by_name['settings'].message_type = _SETTING _SLICE.fields_by_name['object_lists'].message_type = _OBJECTLIST _OBJECT.fields_by_name['settings'].message_type = _SETTING _SLICEDOBJECTLIST.fields_by_name['objects'].message_type = _SLICEDOBJECT diff --git a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py index e38e174238..6300499af7 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py @@ -43,12 +43,12 @@ class ProcessSlicedObjectListJob(Job): else: objectIdMap[id(node)] = node - settings = Application.getInstance().getActiveMachine() - layerHeight = settings.getSettingValueByKey("layer_height") + settings = Application.getInstance().getMachineManager().getActiveProfile() + layerHeight = settings.getSettingValue("layer_height") center = None - if not settings.getSettingValueByKey("machine_center_is_zero"): - center = numpy.array([settings.getSettingValueByKey("machine_width") / 2, 0.0, -settings.getSettingValueByKey("machine_depth") / 2]) + if not settings.getSettingValue("machine_center_is_zero"): + center = numpy.array([settings.getSettingValue("machine_width") / 2, 0.0, -settings.getSettingValue("machine_depth") / 2]) else: center = numpy.array([0.0, 0.0, 0.0]) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 1caf504ad1..b43ff0a5d3 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -52,10 +52,10 @@ class LayerView(View): renderer.setRenderSelection(False) if not self._material: - self._material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, "basic.vert"), Resources.getPath(Resources.ShadersLocation, "vertexcolor.frag")) + self._material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "vertexcolor.frag")) self._material.setUniformValue("u_color", [1.0, 0.0, 0.0, 1.0]) - self._selection_material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, "basic.vert"), Resources.getPath(Resources.ShadersLocation, "color.frag")) + self._selection_material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "color.frag")) self._selection_material.setUniformValue("u_color", Color(35, 35, 35, 128)) for node in DepthFirstIterator(scene.getRoot()): diff --git a/resources/settings/RigidBot.json b/resources/machines/RigidBot.json similarity index 100% rename from resources/settings/RigidBot.json rename to resources/machines/RigidBot.json diff --git a/resources/settings/RigidBotBig.json b/resources/machines/RigidBotBig.json similarity index 100% rename from resources/settings/RigidBotBig.json rename to resources/machines/RigidBotBig.json diff --git a/resources/settings/bq_hephestos.json b/resources/machines/bq_hephestos.json similarity index 100% rename from resources/settings/bq_hephestos.json rename to resources/machines/bq_hephestos.json diff --git a/resources/settings/bq_hephestos_xl.json b/resources/machines/bq_hephestos_xl.json similarity index 100% rename from resources/settings/bq_hephestos_xl.json rename to resources/machines/bq_hephestos_xl.json diff --git a/resources/settings/bq_witbox.json b/resources/machines/bq_witbox.json similarity index 100% rename from resources/settings/bq_witbox.json rename to resources/machines/bq_witbox.json diff --git a/resources/settings/dual_extrusion_printer.json b/resources/machines/dual_extrusion_printer.json similarity index 99% rename from resources/settings/dual_extrusion_printer.json rename to resources/machines/dual_extrusion_printer.json index 1b034ccd76..04b59757c7 100644 --- a/resources/settings/dual_extrusion_printer.json +++ b/resources/machines/dual_extrusion_printer.json @@ -1,8 +1,12 @@ { - "version": 1, + "version": 1, + "id": "dual_extrusion", + "name": "Dual Extrusion Base File", "inherits": "fdmprinter.json", + "visible": false, + "machine_settings": { "extruder_nr": { "label": "Extruder", @@ -285,4 +289,4 @@ } } } -} \ No newline at end of file +} diff --git a/resources/settings/fdmprinter.json b/resources/machines/fdmprinter.json similarity index 79% rename from resources/settings/fdmprinter.json rename to resources/machines/fdmprinter.json index 879a03736f..bf220f6e1d 100644 --- a/resources/settings/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -1,8 +1,10 @@ { + "id": "fdmprinter", "visible": false, "version": 1, - "author": "other", - "manufacturer": "other", + "name": "FDM Printer Base Description", + "author": "Ultimaker B.V.", + "manufacturer": "Ultimaker", "add_pages": [], @@ -110,9 +112,9 @@ "unit": "mm", "type": "float", "default": 0.1, - "min_value": 0.0001, - "min_value_warning": 0.04, - "max_value_warning": 0.32 + "min_value": "0.0001", + "min_value_warning": "0.04", + "max_value_warning": "0.32" }, "layer_height_0": { "label": "Initial Layer Height", @@ -120,18 +122,18 @@ "unit": "mm", "type": "float", "default": 0.3, - "min_value": 0.0001, - "min_value_warning": 0.04, - "max_value_warning": 0.32, + "min_value": "0.0001", + "min_value_warning": "0.04", + "max_value_warning": "0.32", "visible": false }, "line_width": { "label": "Line Width", "description": "Width of a single line. Each line will be printed with this width in mind. Generally the width of each line should correspond to the width of your nozzle, but for the outer wall and top/bottom surface smaller line widths may be chosen, for higher quality.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false, @@ -141,9 +143,9 @@ "label": "Wall Line Width", "description": "Width of a single shell line. Each line of the shell will be printed with this width in mind.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false, @@ -153,9 +155,9 @@ "label": "Outer Wall Line Width", "description": "Width of the outermost shell line. By printing a thinner outermost wall line you can print higher details with a larger nozzle.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false @@ -164,9 +166,9 @@ "label": "Other Walls Line Width", "description": "Width of a single shell line for all shell lines except the outermost one.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false @@ -177,9 +179,9 @@ "label": "Skirt line width", "description": "Width of a single skirt line.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false @@ -188,9 +190,9 @@ "label": "Top/bottom line width", "description": "Width of a single top/bottom printed line, used to fill up the top/bottom areas of a print.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false @@ -199,9 +201,9 @@ "label": "Infill line width", "description": "Width of the inner infill printed lines.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false @@ -210,16 +212,13 @@ "label": "Support line width", "description": "Width of the printed support structures lines.", "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0.0001", + "min_value_warning": "0.2", + "max_value_warning": "5", "default": 0.4, "type": "float", "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } + "enabled": "support_enable" }, "support_roof_line_width": { "label": "Support Hammock line width", @@ -228,10 +227,7 @@ "default": 0.4, "type": "float", "visible": false, - "active_if": { - "setting": "support_roof_enable", - "value": true - } + "enabled": "support_roof_enable" } } } @@ -248,25 +244,25 @@ "unit": "mm", "type": "float", "default": 0.8, - "min_value": 0, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0", + "min_value_warning": "0.2", + "max_value_warning": "5", "children": { "wall_thickness": { "label": "Wall Thickness", "description": "The thickness of the outside walls in the horizontal direction. This is used in combination with the nozzle size to define the number of perimeter lines and the thickness of those perimeter lines.", "unit": "mm", "default": 0.8, - "min_value": 0, - "min_value_warning": 0.2, - "max_value_warning": 5, + "min_value": "0", + "min_value_warning": "0.2", + "max_value_warning": "5", "type": "float", "visible": false, "children": { "wall_line_count": { "label": "Wall Line Count", "description": "Number of shell lines. This these lines are called perimeter lines in other tools and impact the strength and structural integrity of your print.", - "min_value": 0, + "min_value": "0", "default": 2, "type": "int", "visible": false, @@ -286,10 +282,10 @@ "description": "This controls the thickness of the bottom and top layers, the amount of solid layers put down is calculated by the layer thickness and this value. Having this value a multiple of the layer thickness makes sense. And keep it near your wall thickness to make an evenly strong part.", "unit": "mm", "default": 0.8, - "min_value": 0, - "max_value": 5, - "min_value_warning": 0.6, - "max_value_warning": 1, + "min_value": "0", + "max_value": "5", + "min_value_warning": "0.6", + "max_value_warning": "1", "type": "float", "visible": false, "children": { @@ -297,7 +293,7 @@ "label": "Top Thickness", "description": "This controls the thickness of the top layers. The number of solid layers printed is calculated from the layer thickness and this value. Having this value be a multiple of the layer thickness makes sense. And keep it nearto your wall thickness to make an evenly strong part.", "unit": "mm", - "min_value": 0, + "min_value": "0", "default": 0.8, "type": "float", "visible": false, @@ -305,7 +301,7 @@ "top_layers": { "label": "Top Layers", "description": "This controls the amount of top layers.", - "min_value": 0, + "min_value": "0", "default": 6, "type": "int", "visible": false, @@ -317,7 +313,7 @@ "label": "Bottom Thickness", "description": "This controls the thickness of the bottom layers. The number of solid layers printed is calculated from the layer thickness and this value. Having this value be a multiple of the layer thickness makes sense. And keep it near to your wall thickness to make an evenly strong part.", "unit": "mm", - "min_value": 0, + "min_value": "0", "default": 0.6, "type": "float", "visible": false, @@ -325,7 +321,7 @@ "bottom_layers": { "label": "Bottom Layers", "description": "This controls the amount of bottom layers.", - "min_value": 0, + "min_value": "0", "default": 6, "type": "int", "visible": false, @@ -373,28 +369,25 @@ "label": "Fill Gaps Between Walls", "description": "Fill the gaps created by walls where they would otherwise be overlapping. This will also fill thin walls. Optionally only the gaps occurring within the top and bottom skin can be filled.", "type": "enum", - "options": [ - "Nowhere", - "Everywhere", - "Skin" - ], - "default": "Everywhere", + "options": { + "nowhere": "Nowhere", + "everywhere": "Everywhere", + "skin": "Skin" + }, + "default": "everywhere", "visible": false, - "active_if": { - "setting": "remove_overlapping_walls_x_enabled", - "value": true - } + "enabled": "remove_overlapping_walls_x_enabled" }, "top_bottom_pattern": { "label": "Bottom/Top Pattern", "description": "Pattern of the top/bottom solid fill. This normally is done with lines to get the best possible finish, but in some cases a concentric fill gives a nicer end result.", "type": "enum", - "options": [ - "Lines", - "Concentric", - "ZigZag" - ], - "default": "Lines", + "options": { + "lines": "Lines", + "concentric": "Concentric", + "zigzag": "Zig Zag" + }, + "default": "lines", "visible": false }, "skin_alternate_rotation": { @@ -410,10 +403,7 @@ "default": 0, "type": "int", "visible": false, - "active_if": { - "setting": "top_bottom_pattern", - "value": "Lines" - } + "enabled": "top_bottom_pattern" }, "xy_offset": { "label": "Horizontal expansion", @@ -427,12 +417,12 @@ "label": "Z Seam Alignment", "description": "Starting point of each part in a layer. When parts in consecutive layers start at the same point a vertical seam may show on the print. When aligning these at the back, the seam is easiest to remove. When placed randomly the inaccuracies at the part start will be less noticable. When taking the shortest path the print will be more quick.", "type": "enum", - "options": [ - "Back", - "Shortest", - "Random" - ], - "default": "Shortest", + "options": { + "back": "Back", + "shortest": "Shortest", + "random": "Random" + }, + "default": "shortest", "visible": false } } @@ -448,6 +438,7 @@ "unit": "%", "type": "float", "default": 20, + "max_value_warning": "100.0", "children": { "infill_line_distance": { "label": "Line distance", @@ -465,15 +456,14 @@ "description": "Cura defaults to switching between grid and line infill. But with this setting visible you can control this yourself. The line infill swaps direction on alternate layers of infill, while the grid prints the full cross-hatching on each layer of infill.", "type": "enum", "visible": false, - "options": [ - "Lines", - "Grid", - "Triangles", - "Concentric", - "ZigZag" - ], - "default": "Grid", - "inherit_function": "'Lines' if parent_value > 25 else 'Grid'" + "options": { + "grid": "Grid", + "lines": "Lines", + "concentric": "Concentric", + "zigzag": "Zig Zag" + }, + "default": "grid", + "inherit_function": "'lines' if parent_value > 25 else 'grid'" }, "infill_overlap": { "label": "Infill Overlap", @@ -530,8 +520,8 @@ "unit": "°C", "type": "float", "default": 210, - "min_value": 0, - "max_value_warning": 260 + "min_value": "0", + "max_value_warning": "260" }, "material_bed_temperature": { "label": "Bed Temperature", @@ -539,8 +529,9 @@ "unit": "°C", "type": "float", "default": 60, - "min_value": 0, - "max_value_warning": 260 + "min_value": "0", + "max_value_warning": "260", + "enabled": "machine_heated_bed" }, "material_diameter": { "label": "Diameter", @@ -548,8 +539,8 @@ "unit": "mm", "type": "float", "default": 2.85, - "min_value_warning": 0.4, - "max_value_warning": 3.5 + "min_value_warning": "0.4", + "max_value_warning": "3.5" }, "material_flow": { "label": "Flow", @@ -557,9 +548,9 @@ "unit": "%", "default": 100, "type": "float", - "min_value": 5, - "min_value_warning": 50, - "max_value_warning": 150 + "min_value": "5", + "min_value_warning": "50", + "max_value_warning": "150" }, "retraction_enable": { "label": "Enable Retraction", @@ -576,10 +567,7 @@ "default": 4.5, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_speed": { "label": "Retraction Speed", @@ -589,10 +577,7 @@ "default": 25, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - }, + "enabled": "retraction_enable", "children": { "retraction_retract_speed": { "label": "Retraction Retract Speed", @@ -601,10 +586,7 @@ "type": "float", "default": 25, "visible": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_prime_speed": { "label": "Retraction Prime Speed", @@ -613,10 +595,7 @@ "type": "float", "default": 25, "visible": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" } } }, @@ -628,10 +607,7 @@ "default": 0, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_min_travel": { "label": "Retraction Minimum Travel", @@ -641,10 +617,7 @@ "default": 4.5, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_count_max": { "label": "Maximal Retraction Count", @@ -653,10 +626,7 @@ "type": "int", "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_extrusion_window": { "label": "Minimal Extrusion Distance Window", @@ -666,10 +636,7 @@ "default": 4.5, "visible": false, "inherit_function": "retraction_amount", - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" }, "retraction_hop": { "label": "Z Hop when Retracting", @@ -679,10 +646,7 @@ "default": 0, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } + "enabled": "retraction_enable" } } }, @@ -696,8 +660,8 @@ "description": "The speed at which printing happens. A well-adjusted Ultimaker can reach 150mm/s, but for good quality prints you will want to print slower. Printing speed depends on a lot of factors, so you will need to experiment with optimal settings for this.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "children": { "speed_infill": { @@ -705,8 +669,8 @@ "description": "The speed at which infill parts are printed. Printing the infill faster can greatly reduce printing time, but this can negatively affect print quality.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false }, @@ -715,8 +679,8 @@ "description": "The speed at which shell is printed. Printing the outer shell at a lower speed improves the final skin quality.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false, "children": { @@ -725,8 +689,8 @@ "description": "The speed at which outer shell is printed. Printing the outer shell at a lower speed improves the final skin quality. However, having a large difference between the inner shell speed and the outer shell speed will effect quality in a negative way.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false }, @@ -735,8 +699,8 @@ "description": "The speed at which all inner shells are printed. Printing the inner shell fasster than the outer shell will reduce printing time. It is good to set this in between the outer shell speed and the infill speed.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false } @@ -747,8 +711,8 @@ "description": "Speed at which top/bottom parts are printed. Printing the top/bottom faster can greatly reduce printing time, but this can negatively affect print quality.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false }, @@ -757,15 +721,12 @@ "description": "The speed at which exterior support is printed. Printing exterior supports at higher speeds can greatly improve printing time. And the surface quality of exterior support is usually not important, so higher speeds can be used.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 150, + "min_value": "0.1", + "max_value_warning": "150", "default": 50, "visible": false, "inherit_function": "speed_wall_0", - "active_if": { - "setting": "support_enable", - "value": true - }, + "enabled": "support_enable", "children": { "speed_support_lines": { "label": "Support Wall Speed", @@ -775,10 +736,7 @@ "default": 50, "visible": false, "inherit": true, - "active_if": { - "setting": "support_roof_enable", - "value": true - } + "enabled": "support_roof_enable" }, "speed_support_roof": { "label": "Support Hammock Speed", @@ -788,10 +746,7 @@ "default": 40, "visible": false, "inherit": false, - "active_if": { - "setting": "support_roof_enable", - "value": true - } + "enabled": "support_roof_enable" } } } @@ -802,8 +757,8 @@ "description": "The speed at which travel moves are done. A well-built Ultimaker can reach speeds of 250mm/s. But some machines might have misaligned layers then.", "unit": "mm/s", "type": "float", - "min_value": 0.1, - "max_value_warning": 300, + "min_value": "0.1", + "max_value_warning": "300", "default": 150 }, "speed_layer_0": { @@ -811,7 +766,7 @@ "description": "The print speed for the bottom layer: You want to print the first layer slower so it sticks to the printer bed better.", "unit": "mm/s", "type": "float", - "min_value": 0.1, + "min_value": "0.1", "default": 15, "visible": false, "children": { @@ -820,7 +775,7 @@ "description": "The speed at which the skirt and brim are printed. Normally this is done at the initial layer speed. But sometimes you want to print the skirt at a different speed.", "unit": "mm/s", "type": "float", - "min_value": 0.1, + "min_value": "0.1", "default": 15, "visible": false } @@ -830,7 +785,7 @@ "label": "Amount of Slower Layers", "description": "The first few layers are printed slower then the rest of the object, this to get better adhesion to the printer bed and improve the overall success rate of prints. The speed is gradually increased over these layers. 4 layers of speed-up is generally right for most materials and printers.", "type": "int", - "min_value": 0, + "min_value": "0", "default": 4, "visible": false } @@ -854,10 +809,7 @@ "type": "boolean", "default": true, "visible": false, - "active_if": { - "setting": "retraction_combing", - "value": true - }, + "enabled": "retraction_combing", "children": { "travel_avoid_distance": { "label": "Avoid Distance", @@ -867,10 +819,7 @@ "default": 1.5, "visible": false, "inherit": false, - "active_if": { - "setting": "retraction_combing", - "value": true - } + "enabled": "retraction_combing" } } }, @@ -889,10 +838,7 @@ "default": 0.064, "visible": false, "inherit": false, - "active_if": { - "setting": "coasting_enable", - "value": true - }, + "enabled": "coasting_enable", "children": { "coasting_volume_retract": { "label": "Retract-Coasting Volume", @@ -902,10 +848,7 @@ "default": 0.064, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" }, "coasting_volume_move": { "label": "Move-Coasting Volume", @@ -915,10 +858,7 @@ "default": 0.096, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" } } }, @@ -930,10 +870,7 @@ "default": 0.8, "visible": false, "inherit": false, - "active_if": { - "setting": "coasting_enable", - "value": true - }, + "enabled": "coasting_enable", "children": { "coasting_min_volume_retract": { "label": "Min Volume Retract-Coasting", @@ -943,10 +880,7 @@ "default": 0.6, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" }, "coasting_min_volume_move": { "label": "Min Volume Move-Coasting", @@ -956,10 +890,7 @@ "default": 0.8, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" } } }, @@ -971,10 +902,7 @@ "default": 90, "visible": false, "inherit": false, - "active_if": { - "setting": "coasting_enable", - "value": true - }, + "enabled": "coasting_enable", "children": { "coasting_speed_retract": { "label": "Retract-Coasting Speed", @@ -984,10 +912,7 @@ "default": 90, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" }, "coasting_speed_move": { "label": "Move-Coasting Speed", @@ -997,10 +922,7 @@ "default": 90, "visible": false, "inherit": true, - "active_if": { - "setting": "coasting_enable", - "value": true - } + "enabled": "coasting_enable" } } } @@ -1022,8 +944,8 @@ "description": "Fan speed used for the print cooling fan on the printer head.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false, "inherit_function": "100.0 if parent_value else 0.0", @@ -1033,8 +955,8 @@ "description": "Normally the fan runs at the minimum fan speed. If the layer is slowed down due to minimum layer time, the fan speed adjusts between minimum and maximum fan speed.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false }, @@ -1043,8 +965,8 @@ "description": "Normally the fan runs at the minimum fan speed. If the layer is slowed down due to minimum layer time, the fan speed adjusts between minimum and maximum fan speed.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false } @@ -1057,7 +979,7 @@ "description": "The height at which the fan is turned on completely. For the layers below this the fan speed is scaled linearly with the fan off for the first layer.", "unit": "mm", "type": "float", - "min_value": 0, + "min_value": "0", "default": 0.5, "visible": false, "children": { @@ -1065,7 +987,7 @@ "label": "Fan Full on at Layer", "description": "The layer number at which the fan is turned on completely. For the layers below this the fan speed is scaled linearly with the fan off for the first layer.", "type": "int", - "min_value": 0, + "min_value": "0", "default": 4, "visible": false, "inherit_function": "int((parent_value - layer_height_0 + 0.001) / layer_height)" @@ -1077,7 +999,7 @@ "description": "The minimum time spent in a layer: Gives the layer time to cool down before the next one is put on top. If a layer would print in less time, then the printer will slow down to make sure it has spent at least this many seconds printing the layer.", "unit": "sec", "type": "float", - "min_value": 0, + "min_value": "0", "default": 5, "visible": false }, @@ -1086,7 +1008,7 @@ "description": "The minimum time spent in a layer which will cause the fan to be at maximum speed. The fan speed increases linearly from minimal fan speed for layers taking minimal layer time to maximum fan speed for layers taking the time specified here.", "unit": "sec", "type": "float", - "min_value": 0, + "min_value": "0", "default": 10, "visible": false }, @@ -1122,79 +1044,68 @@ "label": "Placement", "description": "Where to place support structures. The placement can be restricted such that the support structures won't rest on the model, which could otherwise cause scarring.", "type": "enum", - "options": [ - "Touching Buildplate", - "Everywhere" - ], - "default": "Everywhere", - "visible": true, - "inherit_function": "'Everywhere' if support_enable else 'None'", - "active_if": { - "setting": "support_enable", - "value": true - } + "options": { + "buildplate": "Touching Buildplate", + "everywhere": "Everywhere" + }, + "default": "everywhere", + "enabled": "support_enable" }, "support_angle": { "label": "Overhang Angle", "description": "The maximum angle of overhangs for which support will be added. With 0 degrees being vertical, and 90 degrees being horizontal. A smaller overhang angle leads to more support.", "unit": "°", "type": "float", - "min_value": 0, - "max_value": 90, + "min_value": "0", + "max_value": "90", "default": 60, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } + "enabled": "support_enable" }, "support_xy_distance": { "label": "X/Y Distance", "description": "Distance of the support structure from the print, in the X/Y directions. 0.7mm typically gives a nice distance from the print so the support does not stick to the surface.", "unit": "mm", "type": "float", - "min_value": 0, - "max_value_warning": 10, + "min_value": "0", + "max_value_warning": "10", "default": 0.7, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } + "enabled": "support_enable" }, "support_z_distance": { "label": "Z Distance", "description": "Distance from the top/bottom of the support to the print. A small gap here makes it easier to remove the support but makes the print a bit uglier. 0.15mm allows for easier separation of the support structure.", "unit": "mm", "type": "float", - "min_value": 0, - "max_value_warning": 10, + "min_value": "0", + "max_value_warning": "10", "default": 0.15, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, + "enabled": "support_enable", + "children": { "support_top_distance": { "label": "Top Distance", "description": "Distance from the top of the support to the print.", "unit": "mm", - "min_value": 0, - "max_value_warning": 10, + "min_value": "0", + "max_value_warning": "10", "default": 0.15, "type": "float", - "visible": false + "visible": false, + "enabled": "support_enable" }, "support_bottom_distance": { "label": "Bottom Distance", "description": "Distance from the print to the bottom of the support.", "unit": "mm", - "min_value": 0, - "max_value_warning": 10, + "min_value": "0", + "max_value_warning": "10", "default": 0.15, "type": "float", - "visible": false + "visible": false, + "enabled": "support_enable" } } }, @@ -1204,37 +1115,28 @@ "type": "boolean", "default": false, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } + "enabled": "support_enable" }, "support_conical_angle": { "label": "Cone Angle", "description": "The angle of the tilt of conical support. With 0 degrees being vertical, and 90 degrees being horizontal. Smaller angles cause the support to be more sturdy, but consist of more material. Negative angles cause the base of the support to be wider than the top.", "unit": "°", "type": "float", - "min_value": -90, - "max_value": 90, + "min_value": "-90", + "max_value": "90", "default": 30, "visible": false, - "active_if": { - "setting": "support_conical_enabled", - "value": true - } + "enabled": "support_enable" }, "support_conical_min_width": { "label": "Minimal Width", "description": "Minimal width to which conical support reduces the support areas. Small widths can cause the base of the support to not act well as fundament for support above.", "unit": "mm", - "min_value": 0, + "min_value": "0", "default": 3.0, "type": "float", "visible": false, - "active_if": { - "setting": "support_conical_enabled", - "value": true - } + "enabled": "support_enable" }, "support_bottom_stair_step_height": { "label": "Stair Step Height", @@ -1243,10 +1145,7 @@ "type": "float", "default": 2, "visible": false, - "active_if": { - "setting": "support_type", - "value": "Everywhere" - } + "enabled": "support_enable" }, "support_join_distance": { "label": "Join Distance", @@ -1254,7 +1153,8 @@ "unit": "mm", "type": "float", "default": 2, - "visible": false + "visible": false, + "enabled": "support_enable" }, "support_offset": { "label": "Horizontal Expansion", @@ -1262,7 +1162,8 @@ "unit": "mm", "type": "float", "default": 0.2, - "visible": false + "visible": false, + "enabled": "support_enable" }, "support_area_smoothing": { "label": "Area Smoothing", @@ -1270,14 +1171,16 @@ "unit": "mm", "type": "float", "default": 0.6, - "visible": false + "visible": false, + "enabled": "support_enable" }, "support_roof_enable": { "label": "Enable Hammock", "description": "Generate a solid support roof on which the model sits.", "type": "boolean", "default": false, - "visible": true + "visible": true, + "enabled": "support_enable" }, "support_roof_height": { "label": "Hammock Thickness", @@ -1286,10 +1189,7 @@ "type": "float", "default": 1, "visible": false, - "active_if": { - "setting": "support_roof_enable", - "value": true - } + "enabled": "support_enable" }, "support_roof_density": { "label": "Hammock Density", @@ -1314,13 +1214,13 @@ "description": "The pattern with which the hammock is printed.", "type": "enum", "visible": false, - "options": [ - "Lines", - "Grid", - "Triangles", - "Concentric", - "ZigZag" - ], + "options": { + "lines": "Lines", + "grid": "Grid", + "triangles": "Triangles", + "concentric": "Concentric", + "zigzag": "Zig Zag" + }, "default": "Concentric" }, "support_use_towers": { @@ -1328,7 +1228,8 @@ "description": "Use specialized towers to support tiny overhang areas. These towers have a larger diameter than the region they support. Near the overhang the towers' diameter decreases, forming a roof.", "type": "boolean", "default": true, - "visible": true + "visible": false, + "enabled": "support_enable" }, "support_minimal_diameter": { "label": "Minimal Diameter", @@ -1337,10 +1238,7 @@ "type": "float", "default": 1, "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } + "enabled": "support_enable" }, "support_tower_diameter": { "label": "Tower Diameter", @@ -1349,42 +1247,33 @@ "type": "float", "default": 1, "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } + "enabled": "support_enable" }, "support_tower_roof_angle": { "label": "Tower Roof Angle", "description": "The angle of the rooftop of a tower. Larger angles mean more pointy towers. ", "unit": "°", "type": "int", - "min_value": 0, - "max_value": 90, + "min_value": "0", + "max_value": "90", "default": 65, "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } + "enabled": "support_enable" }, "support_pattern": { "label": "Pattern", "description": "Cura supports 3 distinct types of support structure. First is a grid based support structure which is quite solid and can be removed as 1 piece. The second is a line based support structure which has to be peeled off line by line. The third is a structure in between the other two; it consists of lines which are connected in an accordeon fashion.", "type": "enum", - "options": [ - "Lines", - "Grid", - "Triangles", - "Concentric", - "ZigZag" - ], - "default": "ZigZag", - "visible": true, - "active_if": { - "setting": "support_enable", - "value": true - } + "options": { + "lines": "Lines", + "grid": "Grid", + "triangles": "Triangles", + "concentric": "Concentric", + "zigzag": "Zig Zag" + }, + "default": "zigzag", + "visible": false, + "enabled": "support_enable" }, "support_connect_zigzags": { "label": "Connect ZigZags", @@ -1392,37 +1281,29 @@ "type": "boolean", "default": true, "visible": false, - "active_if": { - "setting": "support_pattern", - "value": "ZigZag" - } + "enabled": "support_enable" }, "support_infill_rate": { "label": "Fill Amount", "description": "The amount of infill structure in the support, less infill gives weaker support which is easier to remove.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 15, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, + "enabled": "support_enable", + "children": { "support_line_distance": { "label": "Line distance", "description": "Distance between the printed support lines.", "unit": "mm", "type": "float", - "min_value": 0, + "min_value": "0", "default": 2.66, "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, + "enabled": "support_enable", "inherit_function": "(support_line_width * 100) / parent_value" } } @@ -1438,22 +1319,19 @@ "label": "Type", "description": "Different options that help in preventing corners from lifting due to warping. Brim adds a single-layer-thick flat area around your object which is easy to cut off afterwards, and it is the recommended option. Raft adds a thick grid below the object and a thin interface between this and your object. (Note that enabling the brim or raft disables the skirt.)", "type": "enum", - "options": [ - "Skirt", - "Brim", - "Raft" - ], - "default": "Skirt" + "options": { + "skirt": "Skirt", + "brim": "Brim", + "raft": "Raft" + }, + "default": "skirt" }, "skirt_line_count": { "label": "Skirt Line Count", "description": "The skirt is a line drawn around the first layer of the. This helps to prime your extruder, and to see if the object fits on your platform. Setting this to 0 will disable the skirt. Multiple skirt lines can help to prime your extruder better for small objects.", "type": "int", "default": 1, - "active_if": { - "setting": "adhesion_type", - "value": "Skirt" - } + "enabled": "adhesion_type == \"skirt\"" }, "skirt_gap": { "label": "Skirt Distance", @@ -1461,10 +1339,7 @@ "unit": "mm", "type": "float", "default": 3, - "active_if": { - "setting": "adhesion_type", - "value": "Skirt" - } + "enabled": "adhesion_type == \"skirt\"" }, "skirt_minimal_length": { "label": "Skirt Minimum Length", @@ -1472,20 +1347,14 @@ "unit": "mm", "type": "float", "default": 250, - "active_if": { - "setting": "adhesion_type", - "value": "Skirt" - } + "enabled": "adhesion_type == \"skirt\"" }, "brim_line_count": { "label": "Brim Line Count", "description": "The amount of lines used for a brim: More lines means a larger brim which sticks better, but this also makes your effective print area smaller.", "type": "int", "default": 10, - "active_if": { - "setting": "adhesion_type", - "value": "Brim" - } + "enabled": "adhesion_type == \"brim\"" }, "raft_margin": { "label": "Raft Extra Margin", @@ -1493,10 +1362,7 @@ "unit": "mm", "type": "float", "default": 5, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_airgap": { "label": "Raft Air-gap", @@ -1504,20 +1370,14 @@ "unit": "mm", "type": "float", "default": 0.22, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_surface_layers": { "label": "Raft Surface Layers", "description": "The number of surface layers on top of the 2nd raft layer. These are fully filled layers that the object sits on. 2 layers usually works fine.", "type": "int", "default": 2, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_surface_thickness": { "label": "Raft Surface Thickness", @@ -1525,10 +1385,7 @@ "unit": "mm", "type": "float", "default": 0.1, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_surface_line_width": { "label": "Raft Surface Line Width", @@ -1536,10 +1393,7 @@ "unit": "mm", "type": "float", "default": 0.3, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_surface_line_spacing": { "label": "Raft Surface Spacing", @@ -1547,10 +1401,7 @@ "unit": "mm", "type": "float", "default": 0.3, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - }, + "enabled": "adhesion_type == \"raft\"", "inherit_function": "raft_surface_line_width" }, "raft_interface_thickness": { @@ -1559,10 +1410,7 @@ "unit": "mm", "type": "float", "default": 0.27, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_interface_line_width": { "label": "Raft Interface Line Width", @@ -1570,10 +1418,7 @@ "unit": "mm", "type": "float", "default": 1, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_interface_line_spacing": { "label": "Raft Interface Spacing", @@ -1581,10 +1426,7 @@ "unit": "mm", "type": "float", "default": 2, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_base_thickness": { "label": "Raft Base Thickness", @@ -1592,10 +1434,7 @@ "unit": "mm", "type": "float", "default": 0.3, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_base_line_width": { "label": "Raft Base Line Width", @@ -1603,10 +1442,7 @@ "unit": "mm", "type": "float", "default": 1, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_base_line_spacing": { "label": "Raft Line Spacing", @@ -1614,10 +1450,7 @@ "unit": "mm", "type": "float", "default": 5, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - } + "enabled": "adhesion_type == \"raft\"" }, "raft_speed": { "label": "Raft Print Speed", @@ -1625,10 +1458,7 @@ "unit": "mm/s", "type": "float", "default": 30, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - }, + "enabled": "adhesion_type == \"raft\"", "inherit_function": "0.6 * speed_print", "children": { "raft_surface_speed": { @@ -1637,10 +1467,7 @@ "unit": "mm/s", "type": "float", "default": 30, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - }, + "enabled": "adhesion_type == \"raft\"", "inherit_function": "parent_value" }, "raft_interface_speed": { @@ -1649,10 +1476,7 @@ "unit": "mm/s", "type": "float", "default": 15, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - }, + "enabled": "adhesion_type == \"raft\"", "inherit_function": "0.5 * parent_value" }, "raft_base_speed": { @@ -1661,10 +1485,7 @@ "unit": "mm/s", "type": "float", "default": 15, - "active_if": { - "setting": "adhesion_type", - "value": "Raft" - }, + "enabled": "adhesion_type == \"raft\"", "inherit_function": "0.5 * parent_value" } } @@ -1674,43 +1495,47 @@ "description": "The fan speed for the raft.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false, + "enabled": "adhesion_type == \"raft\"", "children": { "raft_surface_fan_speed": { "label": "Raft Surface Fan Speed", "description": "The fan speed for the surface raft layers.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false, - "inherit": true + "inherit": true, + "enabled": "adhesion_type == \"raft\"" }, "raft_interface_fan_speed": { "label": "Raft Interface Fan Speed", "description": "The fan speed for the interface raft layer.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false, - "inherit": true + "inherit": true, + "enabled": "adhesion_type == \"raft\"" }, "raft_base_fan_speed": { "label": "Raft Base Fan Speed", "description": "The fan speed for the base raft layer.", "unit": "%", "type": "float", - "min_value": 0, - "max_value": 100, + "min_value": "0", + "max_value": "100", "default": 100, "visible": false, - "inherit": true + "inherit": true, + "enabled": "adhesion_type == \"raft\"" } } }, @@ -1725,45 +1550,35 @@ "description": "Distance of the draft shield from the print, in the X/Y directions.", "unit": "mm", "type": "float", - "min_value": 0, - "max_value_warning": 100, + "min_value": "0", + "max_value_warning": "100", "default": 10, "visible": false, - "active_if": { - "setting": "draft_shield_enabled", - "value": true - } + "enabled": "draft_shield_enabled" }, "draft_shield_height_limitation": { "label": "Draft Shield Limitation", "description": "Whether to limit the height of the draft shield", "type": "enum", - "options": [ - "Full", - "Limited" - ], - "default": "Full", + "options": { + "full": "Full", + "limited": "Limited" + }, + "default": "full", "visible": false, - "inherit_function": "Full", - "active_if": { - "setting": "draft_shield_enabled", - "value": true - } + "enabled": "draft_shield_enabled" }, "draft_shield_height": { "label": "Draft Shield Height", "description": "Height limitation on the draft shield. Above this height no draft shield will be printed.", "unit": "mm", "type": "float", - "min_value": 0, - "max_value_warning": 30, + "min_value": "0", + "max_value_warning": "30", "default": 0, - "inherit_function": "9999 if draft_shield_height_limitation == 'Full' and draft_shield_enabled else 0.0", + "inherit_function": "9999 if draft_shield_height_limitation == 'full' and draft_shield_enabled else 0.0", "visible": false, - "active_if": { - "setting": "draft_shield_height_limitation", - "value": "Limited" - } + "enabled": "draft_shield_height_limitation == \"limited\"" } } }, @@ -1811,22 +1626,22 @@ "label": "Print sequence", "description": "Whether to print all objects one layer at a time or to wait for one object to finish, before moving on to the next. One at a time mode is only possible if all models are separated such that the whole print head can move between and all models are lower than the distance between the nozzle and the X/Y axles.", "type": "enum", - "options": [ - "All at once", - "One at a time" - ], - "default": "All at once", + "options": { + "all_at_once": "All at Once", + "one_at_a_time": "One at a Time" + }, + "default": "all_at_once", "visible": true }, "magic_mesh_surface_mode": { "label": "Surface Mode", "description": "Print the surface instead of the volume. No infill, no top/bottom skin, just a single wall of which the middle coincides with the surface of the mesh. It's also possible to do both: print the insides of a closed volume as normal, but print all polygons not part of a closed volume as surface.", "type": "enum", - "options": [ - "Normal", - "Surface", - "Both" - ], + "options": { + "normal": "Normal", + "surface": "Surface", + "both": "Both" + }, "default": "Normal", "visible": false }, @@ -1851,10 +1666,7 @@ "unit": "mm", "default": 3, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_roof_inset": { "label": "WP Roof Inset Distance", @@ -1863,10 +1675,7 @@ "unit": "mm", "default": 3, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - }, + "enabled": "wireframe_enabled", "inherit_function": "wireframe_height" }, "wireframe_printspeed": { @@ -1876,10 +1685,7 @@ "type": "float", "default": 5, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - }, + "enabled": "wireframe_enabled", "children": { "wireframe_printspeed_bottom": { "label": "WP Bottom Printing Speed", @@ -1889,10 +1695,7 @@ "default": 5, "visible": false, "inherit": true, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_printspeed_up": { "label": "WP Upward Printing Speed", @@ -1902,10 +1705,7 @@ "default": 5, "visible": false, "inherit": true, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_printspeed_down": { "label": "WP Downward Printing Speed", @@ -1915,10 +1715,7 @@ "default": 5, "visible": false, "inherit": true, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_printspeed_flat": { "label": "WP Horizontal Printing Speed", @@ -1928,10 +1725,7 @@ "default": 5, "visible": false, "inherit": true, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" } } }, @@ -1942,10 +1736,7 @@ "default": 100, "type": "float", "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - }, + "enabled": "wireframe_enabled", "children": { "wireframe_flow_connection": { "label": "WP Connection Flow", @@ -1954,10 +1745,7 @@ "default": 100, "type": "float", "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_flow_flat": { "label": "WP Flat Flow", @@ -1966,10 +1754,7 @@ "default": 100, "type": "float", "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" } } }, @@ -1980,10 +1765,7 @@ "type": "float", "default": 0, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_bottom_delay": { "label": "WP Bottom Delay", @@ -1992,10 +1774,7 @@ "type": "float", "default": 0, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_flat_delay": { "label": "WP Flat Delay", @@ -2004,10 +1783,7 @@ "type": "float", "default": 0.1, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_up_half_speed": { "label": "WP Ease Upward", @@ -2016,10 +1792,7 @@ "unit": "mm", "default": 0.3, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_top_jump": { "label": "WP Knot Size", @@ -2028,10 +1801,7 @@ "unit": "mm", "default": 0.6, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_fall_down": { "label": "WP Fall Down", @@ -2040,10 +1810,7 @@ "unit": "mm", "default": 0.5, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_drag_along": { "label": "WP Drag along", @@ -2052,26 +1819,20 @@ "unit": "mm", "default": 0.6, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_strategy": { "label": "WP Strategy", "description": "Strategy for making sure two consecutive layers connect at each connection point. Retraction lets the upward lines harden in the right position, but may cause filament grinding. A knot can be made at the end of an upward line to heighten the chance of connecting to it and to let the line cool; however it may require slow printing speeds. Another strategy is to compensate for the sagging of the top of an upward line; however, the lines won't always fall down as predicted.", "type": "enum", - "options": [ - "Compensate", - "Knot", - "Retract" - ], - "default": "Compensate", + "options": { + "compensate": "Compensate", + "knot": "Knot", + "retract": "Retract" + }, + "default": "compensate", "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_straight_before_down": { "label": "WP Straighten Downward Lines", @@ -2080,10 +1841,7 @@ "unit": "%", "default": 20, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_roof_fall_down": { "label": "WP Roof Fall Down", @@ -2092,10 +1850,7 @@ "unit": "mm", "default": 2, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_roof_drag_along": { "label": "WP Roof Drag Along", @@ -2104,10 +1859,7 @@ "unit": "mm", "default": 0.8, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_roof_outer_delay": { "label": "WP Roof Outer Delay", @@ -2116,10 +1868,7 @@ "unit": "sec", "default": 0.2, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" }, "wireframe_nozzle_clearance": { "label": "WP Nozzle Clearance", @@ -2128,10 +1877,7 @@ "unit": "mm", "default": 1, "visible": false, - "active_if": { - "setting": "wireframe_enabled", - "value": true - } + "enabled": "wireframe_enabled" } } } diff --git a/resources/settings/grr_neo.json b/resources/machines/grr_neo.json similarity index 100% rename from resources/settings/grr_neo.json rename to resources/machines/grr_neo.json diff --git a/resources/settings/maker_starter.json b/resources/machines/maker_starter.json similarity index 100% rename from resources/settings/maker_starter.json rename to resources/machines/maker_starter.json diff --git a/resources/settings/profiles/high_quality.conf b/resources/machines/profiles/high_quality.conf similarity index 100% rename from resources/settings/profiles/high_quality.conf rename to resources/machines/profiles/high_quality.conf diff --git a/resources/settings/profiles/low_quality.conf b/resources/machines/profiles/low_quality.conf similarity index 100% rename from resources/settings/profiles/low_quality.conf rename to resources/machines/profiles/low_quality.conf diff --git a/resources/settings/prusa_i3.json b/resources/machines/prusa_i3.json similarity index 100% rename from resources/settings/prusa_i3.json rename to resources/machines/prusa_i3.json diff --git a/resources/settings/ultimaker2.json b/resources/machines/ultimaker2.json similarity index 91% rename from resources/settings/ultimaker2.json rename to resources/machines/ultimaker2.json index 30814fe859..e3bfa9e9c7 100644 --- a/resources/settings/ultimaker2.json +++ b/resources/machines/ultimaker2.json @@ -78,9 +78,9 @@ }, "overrides": { - "material_print_temperature": { "visible": false }, - "material_bed_temperature": { "visible": false }, - "material_diameter": { "visible": false }, - "material_flow": { "visible": false } + "material_print_temperature": { "enabled": "False" }, + "material_bed_temperature": { "enabled": "False" }, + "material_diameter": { "enabled": "False" }, + "material_flow": { "enabled": "False" } } } diff --git a/resources/settings/ultimaker2_extended.json b/resources/machines/ultimaker2_extended.json similarity index 100% rename from resources/settings/ultimaker2_extended.json rename to resources/machines/ultimaker2_extended.json diff --git a/resources/settings/ultimaker2_go.json b/resources/machines/ultimaker2_go.json similarity index 100% rename from resources/settings/ultimaker2_go.json rename to resources/machines/ultimaker2_go.json diff --git a/resources/settings/ultimaker_original.json b/resources/machines/ultimaker_original.json similarity index 100% rename from resources/settings/ultimaker_original.json rename to resources/machines/ultimaker_original.json diff --git a/resources/settings/ultimaker_original_plus.json b/resources/machines/ultimaker_original_plus.json similarity index 75% rename from resources/settings/ultimaker_original_plus.json rename to resources/machines/ultimaker_original_plus.json index 73fdcc2370..baed0ca3aa 100644 --- a/resources/settings/ultimaker_original_plus.json +++ b/resources/machines/ultimaker_original_plus.json @@ -10,6 +10,13 @@ "inherits": "ultimaker_original.json", + "pages": [ + "SelectUpgradedParts", + "UpgradeFirmware", + "UltimakerCheckup", + "BedLeveling" + ], + "machine_settings": { "machine_heated_bed": { "default": true } } diff --git a/resources/profiles/High+Quality.cfg b/resources/profiles/High+Quality.cfg new file mode 100644 index 0000000000..a7621ed392 --- /dev/null +++ b/resources/profiles/High+Quality.cfg @@ -0,0 +1,6 @@ +[general] +version = 1 +name = High Quality + +[settings] +layer_height = 0.06 diff --git a/resources/profiles/Normal+Quality.cfg b/resources/profiles/Normal+Quality.cfg new file mode 100644 index 0000000000..c6a82b4910 --- /dev/null +++ b/resources/profiles/Normal+Quality.cfg @@ -0,0 +1,6 @@ +[general] +version = 1 +name = Normal Quality + +[settings] +layer_height = 0.1 diff --git a/resources/qml/AddMachineWizard.qml b/resources/qml/AddMachineWizard.qml index af200d07c7..22b5e67a74 100644 --- a/resources/qml/AddMachineWizard.qml +++ b/resources/qml/AddMachineWizard.qml @@ -7,24 +7,26 @@ import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import UM 1.1 as UM +import Cura 1.0 as Cura + +import "WizardPages" UM.Wizard { - //: Add Printer dialog title - wizardTitle: catalog.i18nc("@title:wizard","Add Printer") - wizardPages: [ - { - title: "Add Printer", - page: "AddMachine.qml" - } - ] - Item - { - UM.I18nCatalog{id: catalog; name:"cura"} - } + id: base; + + title: catalog.i18nc("@title:window", "Add Printer") // This part is optional // This part checks whether there is a printer -> if not: some of the functions (delete for example) are disabled - property bool printer: true - firstRun: printer ? false : true + firstRun: false + + Component.onCompleted: { + base.appendPage(UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/AddMachine.qml"), catalog.i18nc("@title", "Add Printer")); + base.currentPage = 0; + } + + Item { + UM.I18nCatalog { id: catalog; name: "cura"; } + } } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 6f0e6deac0..6b0cdf9a7c 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -80,7 +80,7 @@ UM.MainWindow id: saveAllMenu title: catalog.i18nc("@title:menu","Save All") iconName: "document-save"; - enabled: devicesModel.count > 0 && UM.Backend.progress > 0.99; + enabled: devicesModel.rowCount() > 0 && UM.Backend.progress > 0.99; Instantiator { @@ -131,6 +131,10 @@ UM.MainWindow onObjectRemoved: top_view_menu.removeItem(object) } ExclusiveGroup { id: view_menu_top_group; } + + MenuSeparator { } + + MenuItem { action: actions.toggleFullScreen; } } Menu { @@ -140,14 +144,14 @@ UM.MainWindow Instantiator { - model: UM.Models.machinesModel + model: UM.MachineInstancesModel { } MenuItem { text: model.name; checkable: true; checked: model.active; exclusiveGroup: machineMenuGroup; - onTriggered: UM.Models.machinesModel.setActive(index) + onTriggered: UM.MachineManager.setActiveMachineInstance(model.name) } onObjectAdded: machineMenu.insertItem(index, object) onObjectRemoved: machineMenu.removeItem(object) @@ -157,6 +161,24 @@ UM.MainWindow MenuSeparator { } + Instantiator + { + model: UM.MachineVariantsModel { } + MenuItem { + text: model.name; + checkable: true; + checked: model.active; + exclusiveGroup: machineVariantsGroup; + onTriggered: UM.MachineManager.setActiveMachineVariant(model.name) + } + onObjectAdded: machineMenu.insertItem(index, object) + onObjectRemoved: machineMenu.removeItem(object) + } + + ExclusiveGroup { id: machineVariantsGroup; } + + MenuSeparator { visible: UM.MachineManager.hasVariants; } + MenuItem { action: actions.addMachine; } MenuItem { action: actions.configureMachines; } } @@ -586,10 +608,10 @@ UM.MainWindow onRequestAddPrinter: { addMachineWizard.visible = true - addMachineWizard.printer = false + addMachineWizard.firstRun = true } } - Component.onCompleted: UM.Theme.load(UM.Resources.getPath(UM.Resources.ThemesLocation, "cura")) + Component.onCompleted: UM.Theme.load(UM.Resources.getPath(UM.Resources.Themes, "cura")) } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 4ca85ddfd9..77dcde94e7 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -63,10 +63,93 @@ Rectangle onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex); } - Loader{ + Item + { + id: variantItem; + + anchors.top: header.bottom; + height: UM.Theme.sizes.setting.height; + + visible: UM.MachineManager.hasVariants; + + Row + { + spacing: UM.Theme.sizes.default_margin.width; + Label + { + anchors.verticalCenter: parent.verticalCenter; + text: catalog.i18nc("@label","Variant"); + } + + ComboBox { + anchors.verticalCenter: parent.verticalCenter; + model: UM.MachineVariantsModel { } + textRole: "name" + onActivated: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name); + + currentIndex: + { + for(var i = 0; i < model.rowCount(); ++i) + { + if(model.getItem(i).name == UM.MachineManager.activeMachineVariant) + { + return i; + } + } + + return 0; + } + } + } + } + + Item + { + id: profileItem; + + anchors.top: variantItem.bottom; + height: UM.Theme.sizes.setting.height; + + Row + { + spacing: UM.Theme.sizes.default_margin.width; + Label + { + anchors.verticalCenter: parent.verticalCenter; + text: catalog.i18nc("@label","Global Profile"); + } + + ComboBox + { + anchors.verticalCenter: parent.verticalCenter; + model: UM.ProfilesModel { } + textRole: "name" + onActivated: UM.MachineManager.setActiveProfile(model.getItem(index).name) + + currentIndex: + { + for(var i = 0; i < model.rowCount(); ++i) + { + if(model.getItem(i).name == UM.MachineManager.activeProfile) + return i; + } + UM.MachineManager.setActiveProfile(model.getItem(0).name) + return 0; + } + } + + Button + { + text: catalog.i18nc("@action:button", "Save"); + } + } + } + + Loader + { id: sidebarContents; anchors.bottom: saveButton.top - anchors.top: header.bottom + anchors.top: profileItem.bottom anchors.left: base.left anchors.right: base.right @@ -91,7 +174,8 @@ Rectangle } } - SaveButton { + SaveButton + { id: saveButton; implicitWidth: base.width implicitHeight: totalHeight diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 71477fd5b9..612ff0aeb3 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -103,10 +103,11 @@ Item ToolButton { id: machineSelection - text: UM.Application.machineName; + text: UM.MachineManager.activeMachineInstance; width: parent.width/100*55 height: UM.Theme.sizes.setting_control.height - tooltip: UM.Application.machineName; + tooltip: UM.MachineManager.activeMachineInstance; + //style: UM.Theme.styles.sidebar_header_button; anchors.right: parent.right anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.verticalCenter: parent.verticalCenter @@ -117,17 +118,17 @@ Item id: machineSelectionMenu Instantiator { - model: UM.Models.machinesModel + model: UM.MachineInstancesModel { } MenuItem { text: model.name; checkable: true; checked: model.active; - exclusiveGroup: machineMenuGroup; - onTriggered: UM.Models.machinesModel.setActive(index) + exclusiveGroup: machineSelectionMenuGroup; + onTriggered: UM.MachineManager.setActiveMachineInstance(model.name); } - onObjectAdded: machineMenu.insertItem(index, object) - onObjectRemoved: machineMenu.removeItem(object) + onObjectAdded: machineSelectionMenu.insertItem(index, object) + onObjectRemoved: machineSelectionMenu.removeItem(object) } ExclusiveGroup { id: machineSelectionMenuGroup; } diff --git a/resources/qml/WizardPages/AddMachine.qml b/resources/qml/WizardPages/AddMachine.qml index 3904005f13..826a9bc0d7 100644 --- a/resources/qml/WizardPages/AddMachine.qml +++ b/resources/qml/WizardPages/AddMachine.qml @@ -8,43 +8,33 @@ import QtQuick.Window 2.1 import QtQuick.Controls.Styles 1.1 import UM 1.1 as UM +import Cura 1.0 as Cura import ".." -ColumnLayout +Item { - id: wizardPage - property string title - property int pageWidth - property int pageHeight - property var manufacturers: wizardPage.lineManufacturers() - property int manufacturerIndex: 0 + id: base - SystemPalette {id: palette} - signal reloadModel(var newModel) + property string activeManufacturer: "Ultimaker"; + + property variant wizard: null; - width: wizardPage.pageWidth - height: wizardPage.pageHeight - UM.I18nCatalog { id: catalog; name: "cura"} Connections { - target: elementRoot + target: base.wizard onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element { saveMachine() } - } - - function lineManufacturers(manufacturer) - { - var manufacturers = [] - for (var i = 0; i < UM.Models.availableMachinesModel.rowCount(); i++) + onBackClicked: { - if (UM.Models.availableMachinesModel.getItem(i).manufacturer != manufacturers[manufacturers.length - 1]) + var old_page_count = base.wizard.getPageCount() + // Delete old pages (if any) + for (var i = old_page_count - 1; i > 0; i--) { - manufacturers.push(UM.Models.availableMachinesModel.getItem(i).manufacturer) + base.wizard.removePage(i) } } - return manufacturers } Label @@ -52,7 +42,7 @@ ColumnLayout id: title anchors.left: parent.left anchors.top: parent.top - text: parent.title + text: catalog.i18nc("@title", "Add Printer") font.pointSize: 18; } @@ -61,164 +51,121 @@ ColumnLayout id: subTitle anchors.left: parent.left anchors.top: title.bottom - //: Add Printer wizard page description - text: catalog.i18nc("@label","Please select the type of printer:"); + text: catalog.i18nc("@label", "Please select the type of printer:"); } ScrollView { id: machinesHolder - anchors.left: parent.left - anchors.top: subTitle.bottom - implicitWidth: wizardPage.width- UM.Theme.sizes.default_margin.width - implicitHeight: wizardPage.height - subTitle.height - title.height - (machineNameHolder.height * 2) - Component - { - id: machineDelegate - ColumnLayout - { - id: machineLayout - spacing: 0 - anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width - function showManufacturer() - { - if (model.manufacturer == UM.Models.availableMachinesModel.getItem(index - 1).manufacturer){ - return false - } - else{ - return true - } - } - height: - { - if (machineLayout.showManufacturer() & wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer) - return UM.Theme.sizes.standard_list_lineheight.height * 2 - if (wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer | machineLayout.showManufacturer()) - return UM.Theme.sizes.standard_list_lineheight.height * 1 - else - return 0 - } - Behavior on height - { - NumberAnimation { target: machineLayout; property: "height"; duration: 200} - } - Button - { - id: manufacturer - property color backgroundColor: "transparent" - height: UM.Theme.sizes.standard_list_lineheight.height - visible: machineLayout.showManufacturer() - anchors.top: machineLayout.top - anchors.topMargin: 0 - text: - { - if (wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer) - return model.manufacturer + " ▼" - else - return model.manufacturer + " ►" - } - style: ButtonStyle - { - background: Rectangle - { - id: manufacturerBackground - opacity: 0.3 - border.width: 0 - color: manufacturer.backgroundColor - height: UM.Theme.sizes.standard_list_lineheight.height - } - label: Text - { - renderType: Text.NativeRendering - horizontalAlignment: Text.AlignLeft - text: control.text - color: palette.windowText - font.bold: true - } - } - MouseArea - { - id: mousearea - hoverEnabled: true - anchors.fill: parent - onEntered: manufacturer.backgroundColor = palette.light - onExited: manufacturer.backgroundColor = "transparent" - onClicked: - { - wizardPage.manufacturerIndex = wizardPage.manufacturers.indexOf(model.manufacturer) - machineList.currentIndex = index - } - } - } - - RadioButton - { - id: machineButton - opacity: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? 1 : 0 - height: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? UM.Theme.sizes.standard_list_lineheight.height : 0 - anchors.top: parent.top - anchors.topMargin: machineLayout.showManufacturer() ? manufacturer.height - 5 : 0 - anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width - checked: machineList.currentIndex == index ? true : false - exclusiveGroup: printerGroup; - text: model.name - onClicked: machineList.currentIndex = index; - function getAnimationTime(time) - { - if (machineButton.opacity == 0) - return time - else - return 0 - } - Label - { - id: author - visible: model.author != "Ultimaker" ? true : false - height: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? UM.Theme.sizes.standard_list_lineheight.height : 0 - //: Printer profile caption meaning: this profile is supported by the community - text: catalog.i18nc("@label","community supported profile"); - opacity: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? 1 : 0 - anchors.left: machineButton.right - anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.height/2 - anchors.verticalCenter: machineButton.verticalCenter - anchors.verticalCenterOffset: UM.Theme.sizes.standard_list_lineheight.height / 4 - font: UM.Theme.fonts.caption; - color: palette.mid - } - Behavior on opacity - { - SequentialAnimation - { - PauseAnimation { duration: machineButton.getAnimationTime(100) } - NumberAnimation { properties:"opacity"; duration: machineButton.getAnimationTime(200) } - } - } - } - - } + anchors{ + left: parent.left; + top: subTitle.bottom; + right: parent.right; + bottom: machineNameHolder.top; } ListView { id: machineList - property int currentIndex: 0 - property int otherMachinesIndex: - { - for (var i = 0; i < UM.Models.availableMachinesModel.rowCount(); i++) - { - if (UM.Models.availableMachinesModel.getItem(i).manufacturer != "Ultimaker") - { - return i + + model: UM.MachineDefinitionsModel { id: machineDefinitionsModel; showVariants: false; } + focus: true + + section.property: "manufacturer" + section.delegate: Button { + text: { + if (base,activeManufacturer == section) + return section + " ▼" + else + return section + " ►" + } + + style: ButtonStyle { + background: Rectangle { + id: manufacturerBackground + opacity: 0.3 + border.width: 0 + color: control.hovered ? palette.light : "transparent"; + height: UM.Theme.sizes.standard_list_lineheight.height + } + label: Text { + horizontalAlignment: Text.AlignLeft + text: control.text + color: palette.windowText + font.bold: true } } + + onClicked: { + base.activeManufacturer = section; + machineList.currentIndex = machineList.model.find("manufacturer", section) + } + } + + delegate: RadioButton { + id: machineButton + + anchors.left: parent.left + anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width + + opacity: 1; + height: UM.Theme.sizes.standard_list_lineheight.height; + + checked: ListView.isCurrentItem; + + exclusiveGroup: printerGroup; + + text: model.name + + onClicked: { + ListView.view.currentIndex = index; + if(model.pages.length > 0) { + base.wizard.nextAvailable = true; + } else { + base.wizard.nextAvailable = false; + } + } + + Label + { + id: author +// visible: model.author != "Ultimaker" ? true : false + //: Printer profile caption meaning: this profile is supported by the community +// text: qsTr("community supported profile"); + text: model.author; + anchors.left: machineButton.right + anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.height/2 + anchors.verticalCenter: machineButton.verticalCenter + anchors.verticalCenterOffset: UM.Theme.sizes.standard_list_lineheight.height / 4 + font: UM.Theme.fonts.caption; + color: palette.mid + } + + states: State { + name: "collapsed"; + when: base.activeManufacturer != model.manufacturer; + + PropertyChanges { target: machineButton; opacity: 0; height: 0; } + } + + transitions: [ + Transition { + to: "collapsed"; + SequentialAnimation { + NumberAnimation { property: "opacity"; duration: 75; } + NumberAnimation { property: "height"; duration: 75; } + } + }, + Transition { + from: "collapsed"; + SequentialAnimation { + NumberAnimation { property: "height"; duration: 75; } + NumberAnimation { property: "opacity"; duration: 75; } + } + } + ] } - anchors.fill: parent - model: UM.Models.availableMachinesModel - delegate: machineDelegate - focus: true } } @@ -226,12 +173,11 @@ ColumnLayout { id: machineNameHolder height: childrenRect.height - anchors.top: machinesHolder.bottom + anchors.bottom: parent.bottom; Label { id: insertNameLabel - //: Add Printer wizard field label - text: catalog.i18nc("@label","Printer Name:"); + text: catalog.i18nc("@label", "Printer Name:"); } TextField { @@ -242,44 +188,40 @@ ColumnLayout } } - ExclusiveGroup { id: printerGroup; } - - function saveMachine() { if(machineList.currentIndex != -1) { - UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text) - var pages = UM.Models.availableMachinesModel.getItem(machineList.currentIndex).pages - var old_page_count = elementRoot.getPageCount() - for(var i = 0; i < UM.Models.count; i++) - { - print(UM.Models.getItem(i)) - } - // Delete old pages (if any) - for (var i = old_page_count - 1; i > 0; i--) - { - elementRoot.removePage(i) - elementRoot.currentPage = 0 - } + var item = machineList.model.getItem(machineList.currentIndex); + machineList.model.createInstance(machineName.text, item.id) + + var pages = machineList.model.getItem(machineList.currentIndex).pages // Insert new pages (if any) - for(var i = 0; i < pages.count; i++) + for(var i = 0; i < pages.length; i++) { - elementRoot.insertPage(pages.getItem(i).page + ".qml",pages.getItem(i).title,i + 1) - } - - // Hack to ensure the current page is set correctly - if(old_page_count == 1) - { - elementRoot.currentPage += 1 - } - - if (elementRoot.getPageCount() == elementRoot.currentPage) - { - elementRoot.visible = false + console.log(pages[i]) + switch(pages[i]) { + case "SelectUpgradedParts": + base.wizard.appendPage(UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/SelectUpgradedParts.qml"), catalog.i18nc("@title", "Select Upgraded Parts")); + break; + case "UpgradeFirmware": + base.wizard.appendPage(UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/UpgradeFirmware.qml"), catalog.i18nc("@title", "Upgrade Firmware")); + break; + case "UltimakerCheckup": + base.wizard.appendPage(UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/UltimakerCheckup.qml"), catalog.i18nc("@title", "Check Printer")); + break; + case "BedLeveling": + base.wizard.appendPage(UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/Bedleveling.qml"), catalog.i18nc("@title", "Bed Levelling")); + break; + default: + break; + } } } } -} + ExclusiveGroup { id: printerGroup; } + UM.I18nCatalog { id: catalog; name: "cura"; } + SystemPalette { id: palette } +} diff --git a/resources/qml/WizardPages/Bedleveling.qml b/resources/qml/WizardPages/Bedleveling.qml index 3c1dcea552..edfde107d6 100644 --- a/resources/qml/WizardPages/Bedleveling.qml +++ b/resources/qml/WizardPages/Bedleveling.qml @@ -13,8 +13,8 @@ Column id: wizardPage property int leveling_state: 0 property bool three_point_leveling: true - property int platform_width: UM.Models.settingsModel.getMachineSetting("machine_width") - property int platform_height: UM.Models.settingsModel.getMachineSetting("machine_depth") + property int platform_width: UM.MachineManager.getSettingValue("machine_width") + property int platform_height: UM.MachineManager.getSettingValue("machine_depth") anchors.fill: parent; property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer Component.onCompleted: printer_connection.homeHead() @@ -51,4 +51,4 @@ Column } -} \ No newline at end of file +}