From ad2d54546ebe21a813e0ba5a7b991bf9f61198dc Mon Sep 17 00:00:00 2001 From: Vlad Gribinchuk Date: Fri, 26 Oct 2018 12:05:23 +0300 Subject: [PATCH 1/8] JSON setting for "Z Hop After Extruder Switch Height" feature --- resources/definitions/fdmprinter.def.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index bc6e8a40f4..42e6b73477 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3529,6 +3529,19 @@ "enabled": "retraction_hop_enabled and extruders_enabled_count > 1", "settable_per_mesh": false, "settable_per_extruder": true + }, + "retraction_hop_after_extruder_switch_height": + { + "label": "Z Hop After Extruder Switch Height", + "description": "The height difference when performing a Z Hop after extruder switch.", + "unit": "mm", + "type": "float", + "default_value": 1, + "minimum_value_warning": "0", + "maximum_value_warning": "10", + "enabled": "retraction_enable and retraction_hop_after_extruder_switch", + "settable_per_mesh": false, + "settable_per_extruder": true } } }, From a52939730fac83363f5829619bb17922e4a50ae7 Mon Sep 17 00:00:00 2001 From: Vlad Gribinchuk Date: Thu, 18 Apr 2019 16:30:47 +0300 Subject: [PATCH 2/8] Put retraction_hop_after_extruder_switch_height into expert.cfg --- resources/setting_visibility/expert.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/setting_visibility/expert.cfg b/resources/setting_visibility/expert.cfg index 437790ef74..dc34f498e1 100644 --- a/resources/setting_visibility/expert.cfg +++ b/resources/setting_visibility/expert.cfg @@ -199,6 +199,7 @@ retraction_hop_enabled retraction_hop_only_when_collides retraction_hop retraction_hop_after_extruder_switch +retraction_hop_after_extruder_switch_height [cooling] cool_fan_enabled From 7d73921d63eda202ae365d79359587e1c135b151 Mon Sep 17 00:00:00 2001 From: Vlad Gribinchuk Date: Thu, 18 Apr 2019 16:32:23 +0300 Subject: [PATCH 3/8] Set "value" for retraction_hop_after_extruder_switch_height to ensure it copies the value of retraction_hop --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 42e6b73477..249a227d4f 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3537,6 +3537,7 @@ "unit": "mm", "type": "float", "default_value": 1, + "value": "retraction_hop", "minimum_value_warning": "0", "maximum_value_warning": "10", "enabled": "retraction_enable and retraction_hop_after_extruder_switch", From 86336591652d82ac53d1044080145c6ddc36f732 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 23 Apr 2019 18:02:39 +0200 Subject: [PATCH 4/8] Set maximum feedrate to light speed For many printers this maximum feedrate is unknown. The rationale for this commit is that if it's unknown we shouldn't limit the speed settings. This does cause the time estimations to be out of whack if the speed is limited on one axis but not on another axis, such as if you home the build plate while homing the head as well (when the head is much faster than the build plate). Because now Cura doesn't assume that there is a limit on any axis any more. It just holds the print speeds. Many printers override these settings so that they have a more realistic value. Previously the value of 500mm/s wasn't very realistic anyway, as most printers have somewhere in the area of 250mm/s in their firmware limits. Fixes #5640. --- resources/definitions/fdmprinter.def.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8384936d78..5311cc88e5 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -523,7 +523,7 @@ "description": "The maximum speed for the motor of the X-direction.", "unit": "mm/s", "type": "float", - "default_value": 500, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -534,7 +534,7 @@ "description": "The maximum speed for the motor of the Y-direction.", "unit": "mm/s", "type": "float", - "default_value": 500, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -545,7 +545,7 @@ "description": "The maximum speed for the motor of the Z-direction.", "unit": "mm/s", "type": "float", - "default_value": 5, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false From ce9f3c9bcc79fdd596bd3c5ac87ce9ba7120a031 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 23 Apr 2019 18:02:39 +0200 Subject: [PATCH 5/8] Set maximum feedrate to light speed For many printers this maximum feedrate is unknown. The rationale for this commit is that if it's unknown we shouldn't limit the speed settings. This does cause the time estimations to be out of whack if the speed is limited on one axis but not on another axis, such as if you home the build plate while homing the head as well (when the head is much faster than the build plate). Because now Cura doesn't assume that there is a limit on any axis any more. It just holds the print speeds. Many printers override these settings so that they have a more realistic value. Previously the value of 500mm/s wasn't very realistic anyway, as most printers have somewhere in the area of 250mm/s in their firmware limits. Fixes #5640. --- resources/definitions/fdmprinter.def.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8384936d78..5311cc88e5 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -523,7 +523,7 @@ "description": "The maximum speed for the motor of the X-direction.", "unit": "mm/s", "type": "float", - "default_value": 500, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -534,7 +534,7 @@ "description": "The maximum speed for the motor of the Y-direction.", "unit": "mm/s", "type": "float", - "default_value": 500, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -545,7 +545,7 @@ "description": "The maximum speed for the motor of the Z-direction.", "unit": "mm/s", "type": "float", - "default_value": 5, + "default_value": 299792458000, "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false From 4876d5af00d81555deac7b9e6f56916fd18e03d0 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 08:21:09 +0200 Subject: [PATCH 6/8] Fix data saving before making a backup CURA-6471 --- cura/AutoSave.py | 8 ++++++++ cura/Backups/BackupsManager.py | 4 ++-- cura/CuraApplication.py | 6 +----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cura/AutoSave.py b/cura/AutoSave.py index 1639868d6a..605a1e7beb 100644 --- a/cura/AutoSave.py +++ b/cura/AutoSave.py @@ -19,6 +19,7 @@ class AutoSave: self._change_timer.setInterval(self._application.getPreferences().getValue("cura/autosave_delay")) self._change_timer.setSingleShot(True) + self._enabled = True self._saving = False def initialize(self): @@ -32,6 +33,13 @@ class AutoSave: if not self._saving: self._change_timer.start() + def setEnabled(self, enabled: bool) -> None: + self._enabled = enabled + if self._enabled: + self._change_timer.start() + else: + self._change_timer.stop() + def _onGlobalStackChanged(self): if self._global_stack: self._global_stack.propertyChanged.disconnect(self._triggerTimer) diff --git a/cura/Backups/BackupsManager.py b/cura/Backups/BackupsManager.py index a0d3881209..91ee578941 100644 --- a/cura/Backups/BackupsManager.py +++ b/cura/Backups/BackupsManager.py @@ -51,8 +51,8 @@ class BackupsManager: ## Here we try to disable the auto-save plug-in as it might interfere with # restoring a back-up. def _disableAutoSave(self) -> None: - self._application.setSaveDataEnabled(False) + self._application.getAutoSave().setEnabled(False) ## Re-enable auto-save after we're done. def _enableAutoSave(self) -> None: - self._application.setSaveDataEnabled(True) + self._application.getAutoSave().setEnabled(True) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 67ff984e03..9dd1168135 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -258,7 +258,6 @@ class CuraApplication(QtApplication): # Backups self._auto_save = None - self._save_data_enabled = True from cura.Settings.CuraContainerRegistry import CuraContainerRegistry self._container_registry_class = CuraContainerRegistry @@ -668,13 +667,10 @@ class CuraApplication(QtApplication): self._message_box_callback(button, *self._message_box_callback_arguments) self._message_box_callback = None self._message_box_callback_arguments = [] - - def setSaveDataEnabled(self, enabled: bool) -> None: - self._save_data_enabled = enabled # Cura has multiple locations where instance containers need to be saved, so we need to handle this differently. def saveSettings(self): - if not self.started or not self._save_data_enabled: + if not self.started: # Do not do saving during application start or when data should not be saved on quit. return ContainerRegistry.getInstance().saveDirtyContainers() From 3bec7cdf8b7f0f1506fb48f4370562663ebd6e8d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 08:28:30 +0200 Subject: [PATCH 7/8] Add margins between label and content CURA-6435 --- resources/qml/WelcomePages/FirstStartMachineActionsContent.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 17fdb1e9fe..53504d7e92 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -53,6 +53,7 @@ Item anchors { top: titleLabel.bottom + topMargin: UM.Theme.getSize("default_margin").height bottom: nextButton.top bottomMargin: UM.Theme.getSize("default_margin").height left: parent.left From 1b9bf6f0b91ed8a1b624492b1793c01e853ae0a5 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 09:09:30 +0200 Subject: [PATCH 8/8] Add optional empty placeholder for CuraView CURA-6469 --- cura/CuraView.py | 14 ++++++++++++-- plugins/XRayView/XRayView.py | 6 +++--- resources/qml/EmptyViewMenuComponent.qml | 9 +++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 resources/qml/EmptyViewMenuComponent.qml diff --git a/cura/CuraView.py b/cura/CuraView.py index 978c651b43..45cd7ba61b 100644 --- a/cura/CuraView.py +++ b/cura/CuraView.py @@ -3,8 +3,11 @@ from PyQt5.QtCore import pyqtProperty, QUrl +from UM.Resources import Resources from UM.View.View import View +from cura.CuraApplication import CuraApplication + # Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure # to indicate this. @@ -12,13 +15,20 @@ from UM.View.View import View # the stageMenuComponent returns an item that should be used somehwere in the stage menu. It's up to the active stage # to actually do something with this. class CuraView(View): - def __init__(self, parent = None) -> None: + def __init__(self, parent = None, use_empty_menu_placeholder: bool = False) -> None: super().__init__(parent) + self._empty_menu_placeholder_url = QUrl(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, + "EmptyViewMenuComponent.qml")) + self._use_empty_menu_placeholder = use_empty_menu_placeholder + @pyqtProperty(QUrl, constant = True) def mainComponent(self) -> QUrl: return self.getDisplayComponent("main") @pyqtProperty(QUrl, constant = True) def stageMenuComponent(self) -> QUrl: - return self.getDisplayComponent("menu") \ No newline at end of file + url = self.getDisplayComponent("menu") + if not url.toString() and self._use_empty_menu_placeholder: + url = self._empty_menu_placeholder_url + return url diff --git a/plugins/XRayView/XRayView.py b/plugins/XRayView/XRayView.py index 86533fe51c..88a5a441b8 100644 --- a/plugins/XRayView/XRayView.py +++ b/plugins/XRayView/XRayView.py @@ -10,21 +10,21 @@ from UM.Math.Color import Color from UM.PluginRegistry import PluginRegistry from UM.Platform import Platform from UM.Event import Event -from UM.View.View import View from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.View.RenderBatch import RenderBatch from UM.View.GL.OpenGL import OpenGL from cura.CuraApplication import CuraApplication +from cura.CuraView import CuraView from cura.Scene.ConvexHullNode import ConvexHullNode from . import XRayPass ## View used to display a see-through version of objects with errors highlighted. -class XRayView(View): +class XRayView(CuraView): def __init__(self): - super().__init__() + super().__init__(parent = None, use_empty_menu_placeholder = True) self._xray_shader = None self._xray_pass = None diff --git a/resources/qml/EmptyViewMenuComponent.qml b/resources/qml/EmptyViewMenuComponent.qml new file mode 100644 index 0000000000..8551d21998 --- /dev/null +++ b/resources/qml/EmptyViewMenuComponent.qml @@ -0,0 +1,9 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + + +// Empty placeholder +Item { }