From ce9f3c9bcc79fdd596bd3c5ac87ce9ba7120a031 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 23 Apr 2019 18:02:39 +0200 Subject: [PATCH 1/2] 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 2/2] 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()