Browse Source

Fix merge conflicts with master

Lipu Fei 6 years ago
parent
commit
4e5d08f320

+ 0 - 5
cura/Arranging/Arrange.py

@@ -217,11 +217,6 @@ class Arrange:
         prio_slice = self._priority[min_y:max_y, min_x:max_x]
         prio_slice = self._priority[min_y:max_y, min_x:max_x]
         prio_slice[new_occupied] = 999
         prio_slice[new_occupied] = 999
 
 
-        # If you want to see how the rasterized arranger build plate looks like, uncomment this code
-        # numpy.set_printoptions(linewidth=500, edgeitems=200)
-        # print(self._occupied.shape)
-        # print(self._occupied)
-
     @property
     @property
     def isEmpty(self):
     def isEmpty(self):
         return self._is_empty
         return self._is_empty

+ 1 - 2
cura/Arranging/ArrangeObjectsAllBuildPlatesJob.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Ultimaker B.V.
+# Copyright (c) 2019 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 from UM.Application import Application
 from UM.Application import Application
@@ -48,7 +48,6 @@ class ArrangeArray:
         return self._count
         return self._count
 
 
     def get(self, index):
     def get(self, index):
-        print(self._arrange)
         return self._arrange[index]
         return self._arrange[index]
 
 
     def getFirstEmpty(self):
     def getFirstEmpty(self):

+ 18 - 5
cura/Machines/MaterialManager.py

@@ -219,7 +219,7 @@ class MaterialManager(QObject):
 
 
         root_material_id = material_metadata["base_file"]
         root_material_id = material_metadata["base_file"]
         definition = material_metadata["definition"]
         definition = material_metadata["definition"]
-        approximate_diameter = material_metadata["approximate_diameter"]
+        approximate_diameter = str(material_metadata["approximate_diameter"])
 
 
         if approximate_diameter not in self._diameter_machine_nozzle_buildplate_material_map:
         if approximate_diameter not in self._diameter_machine_nozzle_buildplate_material_map:
             self._diameter_machine_nozzle_buildplate_material_map[approximate_diameter] = {}
             self._diameter_machine_nozzle_buildplate_material_map[approximate_diameter] = {}
@@ -332,7 +332,6 @@ class MaterialManager(QObject):
                 buildplate_node = nozzle_node.getChildNode(buildplate_name)
                 buildplate_node = nozzle_node.getChildNode(buildplate_name)
 
 
         nodes_to_check = [buildplate_node, nozzle_node, machine_node, default_machine_node]
         nodes_to_check = [buildplate_node, nozzle_node, machine_node, default_machine_node]
-
         # Fallback mechanism of finding materials:
         # Fallback mechanism of finding materials:
         #  1. buildplate-specific material
         #  1. buildplate-specific material
         #  2. nozzle-specific material
         #  2. nozzle-specific material
@@ -553,10 +552,24 @@ class MaterialManager(QObject):
     #
     #
     # Methods for GUI
     # Methods for GUI
     #
     #
+    @pyqtSlot("QVariant", result=bool)
+    def canMaterialBeRemoved(self, material_node: "MaterialNode"):
+        # Check if the material is active in any extruder train. In that case, the material shouldn't be removed!
+        # In the future we might enable this again, but right now, it's causing a ton of issues if we do (since it
+        # corrupts the configuration)
+        root_material_id = material_node.getMetaDataEntry("base_file")
+        material_group = self.getMaterialGroup(root_material_id)
+        if not material_group:
+            return False
+
+        nodes_to_remove = [material_group.root_material_node] + material_group.derived_material_node_list
+        ids_to_remove = [node.getMetaDataEntry("id", "") for node in nodes_to_remove]
+
+        for extruder_stack in self._container_registry.findContainerStacks(type="extruder_train"):
+            if extruder_stack.material.getId() in ids_to_remove:
+                return False
+        return True
 
 
-    #
-    # Sets the new name for the given material.
-    #
     @pyqtSlot("QVariant", str)
     @pyqtSlot("QVariant", str)
     def setMaterialName(self, material_node: "MaterialNode", name: str) -> None:
     def setMaterialName(self, material_node: "MaterialNode", name: str) -> None:
         root_material_id = material_node.getMetaDataEntry("base_file")
         root_material_id = material_node.getMetaDataEntry("base_file")

+ 1 - 0
cura/Machines/QualityManager.py

@@ -209,6 +209,7 @@ class QualityManager(QObject):
         #   (1) the machine-specific node
         #   (1) the machine-specific node
         #   (2) the generic node
         #   (2) the generic node
         machine_node = self._machine_nozzle_buildplate_material_quality_type_to_quality_dict.get(machine_definition_id)
         machine_node = self._machine_nozzle_buildplate_material_quality_type_to_quality_dict.get(machine_definition_id)
+
         # Check if this machine has specific quality profiles for its extruders, if so, when looking up extruder
         # Check if this machine has specific quality profiles for its extruders, if so, when looking up extruder
         # qualities, we should not fall back to use the global qualities.
         # qualities, we should not fall back to use the global qualities.
         has_extruder_specific_qualities = False
         has_extruder_specific_qualities = False

+ 1 - 1
cura/OAuth2/AuthorizationService.py

@@ -124,7 +124,7 @@ class AuthorizationService:
             self._storeAuthData(response)
             self._storeAuthData(response)
             self.onAuthStateChanged.emit(logged_in = True)
             self.onAuthStateChanged.emit(logged_in = True)
         else:
         else:
-            self.onAuthStateChanged(logged_in = False)
+            self.onAuthStateChanged.emit(logged_in = False)
 
 
     ##  Delete the authentication data that we have stored locally (eg; logout)
     ##  Delete the authentication data that we have stored locally (eg; logout)
     def deleteAuthData(self) -> None:
     def deleteAuthData(self) -> None:

+ 4 - 2
cura/Settings/ContainerManager.py

@@ -47,8 +47,10 @@ class ContainerManager(QObject):
         if ContainerManager.__instance is not None:
         if ContainerManager.__instance is not None:
             raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
             raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
         ContainerManager.__instance = self
         ContainerManager.__instance = self
-
-        super().__init__(parent = application)
+        try:
+            super().__init__(parent = application)
+        except TypeError:
+            super().__init__()
 
 
         self._application = application # type: CuraApplication
         self._application = application # type: CuraApplication
         self._plugin_registry = self._application.getPluginRegistry()  # type: PluginRegistry
         self._plugin_registry = self._application.getPluginRegistry()  # type: PluginRegistry

+ 19 - 2
cura/Settings/CuraContainerRegistry.py

@@ -1,11 +1,11 @@
-# Copyright (c) 2018 Ultimaker B.V.
+# Copyright (c) 2019 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 import os
 import os
 import re
 import re
 import configparser
 import configparser
 
 
-from typing import cast, Dict, Optional
+from typing import Any, cast, Dict, Optional
 from PyQt5.QtWidgets import QMessageBox
 from PyQt5.QtWidgets import QMessageBox
 
 
 from UM.Decorators import override
 from UM.Decorators import override
@@ -327,6 +327,23 @@ class CuraContainerRegistry(ContainerRegistry):
         self._registerSingleExtrusionMachinesExtruderStacks()
         self._registerSingleExtrusionMachinesExtruderStacks()
         self._connectUpgradedExtruderStacksToMachines()
         self._connectUpgradedExtruderStacksToMachines()
 
 
+    ##  Check if the metadata for a container is okay before adding it.
+    #
+    #   This overrides the one from UM.Settings.ContainerRegistry because we
+    #   also require that the setting_version is correct.
+    @override(ContainerRegistry)
+    def _isMetadataValid(self, metadata: Optional[Dict[str, Any]]) -> bool:
+        if metadata is None:
+            return False
+        if "setting_version" not in metadata:
+            return False
+        try:
+            if int(metadata["setting_version"]) != cura.CuraApplication.CuraApplication.SettingVersion:
+                return False
+        except ValueError: #Not parsable as int.
+            return False
+        return True
+
     ##  Update an imported profile to match the current machine configuration.
     ##  Update an imported profile to match the current machine configuration.
     #
     #
     #   \param profile The profile to configure.
     #   \param profile The profile to configure.

+ 6 - 1
cura/Settings/CuraStackBuilder.py

@@ -125,7 +125,12 @@ class CuraStackBuilder:
 
 
         extruder_definition_dict = global_stack.getMetaDataEntry("machine_extruder_trains")
         extruder_definition_dict = global_stack.getMetaDataEntry("machine_extruder_trains")
         extruder_definition_id = extruder_definition_dict[str(extruder_position)]
         extruder_definition_id = extruder_definition_dict[str(extruder_position)]
-        extruder_definition = registry.findDefinitionContainers(id = extruder_definition_id)[0]
+        try:
+            extruder_definition = registry.findDefinitionContainers(id = extruder_definition_id)[0]
+        except IndexError as e:
+            # It still needs to break, but we want to know what extruder ID made it break.
+            Logger.log("e", "Unable to find extruder with the id %s", extruder_definition_id)
+            raise e
 
 
         # get material container for extruders
         # get material container for extruders
         material_container = application.empty_material_container
         material_container = application.empty_material_container

+ 3 - 2
cura/Settings/MachineManager.py

@@ -1390,8 +1390,9 @@ class MachineManager(QObject):
             need_to_show_message = False
             need_to_show_message = False
 
 
             for extruder_configuration in configuration.extruderConfigurations:
             for extruder_configuration in configuration.extruderConfigurations:
-                extruder_has_hotend = extruder_configuration.hotendID != ""
-                extruder_has_material = extruder_configuration.material.guid != ""
+                # We support "" or None, since the cloud uses None instead of empty strings
+                extruder_has_hotend = extruder_configuration.hotendID and extruder_configuration.hotendID != ""
+                extruder_has_material = extruder_configuration.material.guid and extruder_configuration.material.guid != ""
 
 
                 # If the machine doesn't have a hotend or material, disable this extruder
                 # If the machine doesn't have a hotend or material, disable this extruder
                 if not extruder_has_hotend or not extruder_has_material:
                 if not extruder_has_hotend or not extruder_has_material:

+ 85 - 0
plugins/ChangeLogPlugin/ChangeLog.txt

@@ -1,3 +1,88 @@
+[4.0.0]
+*Updated user interface
+Ultimaker Cura is a very powerful tool with many features to support users’ needs. In the new UI, we present these features in a better, more intuitive way based on the workflow of our users. The Marketplace and user account control have been integrated into the main interface to easily access material profiles and plugins. Three stages are shown in the header to give a clear guidance of the flow. The stage menu is populated with collapsible panels that allow users to focus on the 3D view when needed, while still showing important information at the same time, such as slicing configuration and settings. Users can now easily go to the preview stage to examine the layer view after slicing the model, which previously was less obvious or hidden. The new UI also creates more distinction between recommended and custom mode. Novice users or users who are not interested in all the settings can easily prepare a file, relying on the strength of expert-configured print profiles. Experienced users who want greater control can configure over 300 settings to their needs.
+
+*Redesigned "Add Printer" dialog
+Updated one of the first dialogs a new user is presented with. The layout is loosely modeled on the layout of the Ultimaker 3/Ultimaker S5 "Connect to Network" dialog, and adds some instructions and intention to the dialog. Contributed by fieldOfView.
+
+*Updated custom mode panel
+Based on feedback from 4.0 beta, the custom mode panel is now resizable to make more settings visible. The set position will persist between sessions.
+
+*Monitor tab
+Updated the monitor tab interface for better alignment with Cura Connect interface.
+
+*Remote printing
+Use your Ultimaker S5 printer with an Ultimaker account to send and monitor print jobs from outside your local network. Requires firmware 5.2 (coming soon).
+
+*User ratings for plugins
+With an Ultimaker account, users can now give feedback on their experience by rating their favourite plugins.
+
+*Integrated backups
+‘Cura backups’ has been integrated into Ultimaker Cura and can be found in the ‘extensions’ menu. With this feature, users can use their Ultimaker account to backup their Ultimaker Cura configurations to the cloud for easy, convenient retrieval.
+
+*Plugin versioning
+Newer plug-ins can't load in older versions if they use newer features, while old plug-ins may still load in newer versions.
+
+*LAN and cloud printer icons
+Users can now quickly see if their printer is network or cloud enabled with new icons.
+
+*Improved UI speed
+This version switches faster between extruders and printers. Your mileage may vary depending on your system specifications.
+
+*Floats precision
+No settings in Ultimaker Cura require more than three digits of precision, so floats in setting input fields have been limited to three digits only. Contributed by fieldOfView.
+
+*Minimum support area
+This feature allows set minimum area size for support and support interface polygons. Polygons which area are smaller than set value will not be generated. Contributed by vgribinchuk/Desktop Metal.
+
+*Lazy Tree Support calculation
+In previous versions, 95% of Tree Support’s computation time was used to calculate the collision volumes to make sure that the branches avoid collisions with the meshes. Now it calculates these volumes only when necessary, reducing the computation time. Contributed by bjude.
+
+*CPE and CPE+ comb retractions
+Changed all CPE and CPE+ profiles to travel up to 50 mm without retraction, decreasing blobs caused by combing long distances.
+
+*Marketplace improvements
+Added optimizations to show a support site instead of an email address, increased the number of lines that are shown for the description, and show a 'website' link so people can order material directly.
+
+*Arduino drivers silent install
+Previous versions stopped silent installation because the Arduino drivers packaged with Cura are not signed. Arduino drivers are now skipped when performing a silent install.
+
+*New third-party definitions
+- Wanhao. Updated printer profiles to use new travel_speed macro (Contributed by forkineye).
+- JGAurora A1, A5 and Z-603S (Contributed by pinchies).
+- Alfawise U20 (Contributed by pinchies).
+- Cocoon Create ModelMaker (Contributed by pinchies).
+- Ender-3. Updates to the printer definition (Contributed by stelgenhof).
+
+*Bug fixes
+- Fixed an issue which prevented slicing when per extruder settings were changed with a disabled extruder.
+- Improved handling of non-Ultimaker network connected printers within Ultimaker Cura. Contributed by fieldOfView
+- Fixed an issue where printing with the second extruder only would retract material unnecessarily.
+- Fixed an issue where outdated plugins remained partially activated.
+- Fixed an issue where combing was not working when tweaking Retraction minimum travel.
+- Fixed an oversized print head collision zone when using print one-at-a-time mode.
+- Due to inaccuracy of floats in very large prints, the position is reset again several times using "G92 E0" commands.
+- Improved update checker text for better readability.
+- Updated the implementation of 3MF in Ultimaker Cura for better consistency with 3MF consortium specifications.
+- Removed all final and initial print temperature offsets, and increased first layer print temperature to fix under-extrusion problems.
+- Holding shift and rotating a model on its axis for fine-grained rotations would sometimes pan the camera. This has now been fixed.
+- Added file type associations for .gcode and .g extensions.
+- Marked some more profiles as experimental.
+- Fixed an issue where duplicated PLA with a different label would replace the original PLA entry.
+- Updated which profile new materials are based when you create a brand new material. Contributed by fieldOfView.
+- Fixed adhesion type errors on startup.
+- Fixed an issue where system tray icons would remain when Ultimaker Cura is closed until mouse-over.
+- Added extra tooltip to give extra information about start/end g-codes.
+- Fixed an issue where clicking 'Create Account' would go to login instead of sign-up.
+- Fixed an issue where the legacy profile importer would generate corrupt profiles.
+- Fixed an issue where Ultimaker Cura could crash on start-up during the upgrading of your configuration to the newest version for some people.
+- Fixed an issue where Ultimaker Cura would crash after downloading plugin from Marketplace.
+- Ignores plugins folder when checking files for version upgrade. Start-up is now much faster if you've installed a lot of plugins or have used many versions of Ultimaker Cura.
+- Fixed an issue where the firmware checker shows up when there is no internet connection.
+- Fixed an issue where settings could not be made visible again after hiding all settings.
+- Fixed false configuration error for CC Red 0.6 core after a version upgrade.
+- Fixed an issue where a warning is issued when selecting a printer with no material loaded. The extruder will now be disabled instead.
+
 [3.6.0]
 [3.6.0]
 *Gyroid infill
 *Gyroid infill
 New infill pattern with enhanced strength properties. Gyroid infill is one of the strongest infill types for a given weight, has isotropic properties, and prints relatively fast with reduced material use and a fully connected part interior. Note: Slicing time can increase up to 40 seconds or more, depending on the model. Contributed by smartavionics.
 New infill pattern with enhanced strength properties. Gyroid infill is one of the strongest infill types for a given weight, has isotropic properties, and prints relatively fast with reduced material use and a fully connected part interior. Note: Slicing time can increase up to 40 seconds or more, depending on the model. Contributed by smartavionics.

Some files were not shown because too many files changed in this diff