Browse Source

Merge branch 'master' into PP-129_increase-filter-distance

Casper Lamboo 2 years ago
parent
commit
c4748ba332

+ 5 - 0
SECURITY.md

@@ -0,0 +1,5 @@
+# Reporting vulnerabilities
+
+If you discover a vulnerability, please let us know as soon as possible via `security@ultimaker.com`.
+Please do not take advantage of the vulnerability and do not reveal the problem to others.
+To allow us to resolve the issue, please do provide us with sufficient information to reproduce the problem.

+ 0 - 258
cura/Arranging/Arrange.py

@@ -1,258 +0,0 @@
-# Copyright (c) 2020 Ultimaker B.V.
-# Cura is released under the terms of the LGPLv3 or higher.
-from typing import Optional
-
-from UM.Decorators import deprecated
-from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
-from UM.Logger import Logger
-from UM.Math.Polygon import Polygon
-from UM.Math.Vector import Vector
-from UM.Scene.SceneNode import SceneNode
-from cura.Arranging.ShapeArray import ShapeArray
-from cura.BuildVolume import BuildVolume
-from cura.Scene import ZOffsetDecorator
-
-from collections import namedtuple
-
-import numpy
-import copy
-
-LocationSuggestion = namedtuple("LocationSuggestion", ["x", "y", "penalty_points", "priority"])
-"""Return object for  bestSpot"""
-
-
-class Arrange:
-    """
-    The Arrange classed is used together with :py:class:`cura.Arranging.ShapeArray.ShapeArray`. Use it to find good locations for objects that you try to put
-    on a build place. Different priority schemes can be defined so it alters the behavior while using the same logic.
-
-    .. note::
-
-       Make sure the scale is the same between :py:class:`cura.Arranging.ShapeArray.ShapeArray` objects and the :py:class:`cura.Arranging.Arrange.Arrange` instance.
-    """
-
-    build_volume = None  # type: Optional[BuildVolume]
-
-    @deprecated("Use the functions in Nest2dArrange instead", "4.8")
-    def __init__(self, x, y, offset_x, offset_y, scale = 0.5):
-        self._scale = scale  # convert input coordinates to arrange coordinates
-        world_x, world_y = int(x * self._scale), int(y * self._scale)
-        self._shape = (world_y, world_x)
-        self._priority = numpy.zeros((world_y, world_x), dtype=numpy.int32)  # beware: these are indexed (y, x)
-        self._priority_unique_values = []
-        self._occupied = numpy.zeros((world_y, world_x), dtype=numpy.int32)  # beware: these are indexed (y, x)
-        self._offset_x = int(offset_x * self._scale)
-        self._offset_y = int(offset_y * self._scale)
-        self._last_priority = 0
-        self._is_empty = True
-
-    @classmethod
-    @deprecated("Use the functions in Nest2dArrange instead", "4.8")
-    def create(cls, scene_root = None, fixed_nodes = None, scale = 0.5, x = 350, y = 250, min_offset = 8) -> "Arrange":
-        """Helper to create an :py:class:`cura.Arranging.Arrange.Arrange` instance
-
-        Either fill in scene_root and create will find all sliceable nodes by itself, or use fixed_nodes to provide the
-        nodes yourself.
-
-        :param scene_root: Root for finding all scene nodes default = None
-        :param fixed_nodes: Scene nodes to be placed default = None
-        :param scale: default = 0.5
-        :param x: default = 350
-        :param y: default = 250
-        :param min_offset: default = 8
-        """
-
-        arranger = Arrange(x, y, x // 2, y // 2, scale = scale)
-        arranger.centerFirst()
-
-        if fixed_nodes is None:
-            fixed_nodes = []
-            for node_ in DepthFirstIterator(scene_root):
-                # Only count sliceable objects
-                if node_.callDecoration("isSliceable"):
-                    fixed_nodes.append(node_)
-
-        # Place all objects fixed nodes
-        for fixed_node in fixed_nodes:
-            vertices = fixed_node.callDecoration("getConvexHullHead") or fixed_node.callDecoration("getConvexHull")
-            if not vertices:
-                continue
-            vertices = vertices.getMinkowskiHull(Polygon.approximatedCircle(min_offset))
-            points = copy.deepcopy(vertices._points)
-
-            # After scaling (like up to 0.1 mm) the node might not have points
-            if not points.size:
-                continue
-            try:
-                shape_arr = ShapeArray.fromPolygon(points, scale = scale)
-            except ValueError:
-                Logger.logException("w", "Unable to create polygon")
-                continue
-            arranger.place(0, 0, shape_arr)
-
-        # If a build volume was set, add the disallowed areas
-        if Arrange.build_volume:
-            disallowed_areas = Arrange.build_volume.getDisallowedAreasNoBrim()
-            for area in disallowed_areas:
-                points = copy.deepcopy(area._points)
-                shape_arr = ShapeArray.fromPolygon(points, scale = scale)
-                arranger.place(0, 0, shape_arr, update_empty = False)
-        return arranger
-
-    def resetLastPriority(self):
-        """This resets the optimization for finding location based on size"""
-
-        self._last_priority = 0
-
-    @deprecated("Use the functions in Nest2dArrange instead", "4.8")
-    def findNodePlacement(self, node: SceneNode, offset_shape_arr: ShapeArray, hull_shape_arr: ShapeArray, step = 1) -> bool:
-        """Find placement for a node (using offset shape) and place it (using hull shape)
-
-        :param node: The node to be placed
-        :param offset_shape_arr: shape array with offset, for placing the shape
-        :param hull_shape_arr: shape array without offset, used to find location
-        :param step: default = 1
-        :return: the nodes that should be placed
-        """
-
-        best_spot = self.bestSpot(
-            hull_shape_arr, start_prio = self._last_priority, step = step)
-        x, y = best_spot.x, best_spot.y
-
-        # Save the last priority.
-        self._last_priority = best_spot.priority
-
-        # Ensure that the object is above the build platform
-        node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
-        bbox = node.getBoundingBox()
-        if bbox:
-            center_y = node.getWorldPosition().y - bbox.bottom
-        else:
-            center_y = 0
-
-        if x is not None:  # We could find a place
-            node.setPosition(Vector(x, center_y, y))
-            found_spot = True
-            self.place(x, y, offset_shape_arr)  # place the object in arranger
-        else:
-            Logger.log("d", "Could not find spot!")
-            found_spot = False
-            node.setPosition(Vector(200, center_y, 100))
-        return found_spot
-
-    def centerFirst(self):
-        """Fill priority, center is best. Lower value is better. """
-
-        # Square distance: creates a more round shape
-        self._priority = numpy.fromfunction(
-            lambda j, i: (self._offset_x - i) ** 2 + (self._offset_y - j) ** 2, self._shape, dtype=numpy.int32)
-        self._priority_unique_values = numpy.unique(self._priority)
-        self._priority_unique_values.sort()
-
-    def backFirst(self):
-        """Fill priority, back is best. Lower value is better """
-
-        self._priority = numpy.fromfunction(
-            lambda j, i: 10 * j + abs(self._offset_x - i), self._shape, dtype=numpy.int32)
-        self._priority_unique_values = numpy.unique(self._priority)
-        self._priority_unique_values.sort()
-
-    def checkShape(self, x, y, shape_arr) -> Optional[numpy.ndarray]:
-        """Return the amount of "penalty points" for polygon, which is the sum of priority
-
-        :param x: x-coordinate to check shape
-        :param y: y-coordinate to check shape
-        :param shape_arr: the shape array object to place
-        :return: None if occupied
-        """
-
-        x = int(self._scale * x)
-        y = int(self._scale * y)
-        offset_x = x + self._offset_x + shape_arr.offset_x
-        offset_y = y + self._offset_y + shape_arr.offset_y
-        if offset_x < 0 or offset_y < 0:
-            return None  # out of bounds in self._occupied
-        occupied_x_max = offset_x + shape_arr.arr.shape[1]
-        occupied_y_max = offset_y + shape_arr.arr.shape[0]
-        if occupied_x_max > self._occupied.shape[1] + 1 or occupied_y_max > self._occupied.shape[0] + 1:
-            return None  # out of bounds in self._occupied
-        occupied_slice = self._occupied[
-            offset_y:occupied_y_max,
-            offset_x:occupied_x_max]
-        try:
-            if numpy.any(occupied_slice[numpy.where(shape_arr.arr == 1)]):
-                return None
-        except IndexError:  # out of bounds if you try to place an object outside
-            return None
-        prio_slice = self._priority[
-            offset_y:offset_y + shape_arr.arr.shape[0],
-            offset_x:offset_x + shape_arr.arr.shape[1]]
-        return numpy.sum(prio_slice[numpy.where(shape_arr.arr == 1)])
-
-    def bestSpot(self, shape_arr, start_prio = 0, step = 1) -> LocationSuggestion:
-        """Find "best" spot for ShapeArray
-
-        :param shape_arr: shape array
-        :param start_prio: Start with this priority value (and skip the ones before)
-        :param step: Slicing value, higher = more skips = faster but less accurate
-        :return: namedtuple with properties x, y, penalty_points, priority.
-        """
-
-        start_idx_list = numpy.where(self._priority_unique_values == start_prio)
-        if start_idx_list:
-            try:
-                start_idx = start_idx_list[0][0]
-            except IndexError:
-                start_idx = 0
-        else:
-            start_idx = 0
-        priority = 0
-        for priority in self._priority_unique_values[start_idx::step]:
-            tryout_idx = numpy.where(self._priority == priority)
-            for idx in range(len(tryout_idx[0])):
-                x = tryout_idx[1][idx]
-                y = tryout_idx[0][idx]
-                projected_x = int((x - self._offset_x) / self._scale)
-                projected_y = int((y - self._offset_y) / self._scale)
-
-                penalty_points = self.checkShape(projected_x, projected_y, shape_arr)
-                if penalty_points is not None:
-                    return LocationSuggestion(x = projected_x, y = projected_y, penalty_points = penalty_points, priority = priority)
-        return LocationSuggestion(x = None, y = None, penalty_points = None, priority = priority)  # No suitable location found :-(
-
-    def place(self, x, y, shape_arr, update_empty = True):
-        """Place the object.
-
-        Marks the locations in self._occupied and self._priority
-
-        :param x:
-        :param y:
-        :param shape_arr:
-        :param update_empty: updates the _is_empty, used when adding disallowed areas
-        """
-
-        x = int(self._scale * x)
-        y = int(self._scale * y)
-        offset_x = x + self._offset_x + shape_arr.offset_x
-        offset_y = y + self._offset_y + shape_arr.offset_y
-        shape_y, shape_x = self._occupied.shape
-
-        min_x = min(max(offset_x, 0), shape_x - 1)
-        min_y = min(max(offset_y, 0), shape_y - 1)
-        max_x = min(max(offset_x + shape_arr.arr.shape[1], 0), shape_x - 1)
-        max_y = min(max(offset_y + shape_arr.arr.shape[0], 0), shape_y - 1)
-        occupied_slice = self._occupied[min_y:max_y, min_x:max_x]
-        # we use a slice of shape because it can be out of bounds
-        new_occupied = numpy.where(shape_arr.arr[
-            min_y - offset_y:max_y - offset_y, min_x - offset_x:max_x - offset_x] == 1)
-        if update_empty and new_occupied:
-            self._is_empty = False
-        occupied_slice[new_occupied] = 1
-
-        # Set priority to low (= high number), so it won't get picked at trying out.
-        prio_slice = self._priority[min_y:max_y, min_x:max_x]
-        prio_slice[new_occupied] = 999
-
-    @property
-    def isEmpty(self):
-        return self._is_empty

+ 0 - 154
cura/Arranging/ArrangeObjectsAllBuildPlatesJob.py

@@ -1,154 +0,0 @@
-# Copyright (c) 2019 Ultimaker B.V.
-# Cura is released under the terms of the LGPLv3 or higher.
-
-from UM.Application import Application
-from UM.Job import Job
-from UM.Scene.SceneNode import SceneNode
-from UM.Math.Vector import Vector
-from UM.Operations.TranslateOperation import TranslateOperation
-from UM.Operations.GroupedOperation import GroupedOperation
-from UM.Message import Message
-from UM.i18n import i18nCatalog
-i18n_catalog = i18nCatalog("cura")
-
-from cura.Scene.ZOffsetDecorator import ZOffsetDecorator
-from cura.Arranging.Arrange import Arrange
-from cura.Arranging.ShapeArray import ShapeArray
-
-from typing import List
-
-
-class ArrangeArray:
-    """Do arrangements on multiple build plates (aka builtiplexer)"""
-
-    def __init__(self, x: int, y: int, fixed_nodes: List[SceneNode]) -> None:
-        self._x = x
-        self._y = y
-        self._fixed_nodes = fixed_nodes
-        self._count = 0
-        self._first_empty = None
-        self._has_empty = False
-        self._arrange = []  # type: List[Arrange]
-
-    def _updateFirstEmpty(self):
-        for i, a in enumerate(self._arrange):
-            if a.isEmpty:
-                self._first_empty = i
-                self._has_empty = True
-                return
-        self._first_empty = None
-        self._has_empty = False
-
-    def add(self):
-        new_arrange = Arrange.create(x = self._x, y = self._y, fixed_nodes = self._fixed_nodes)
-        self._arrange.append(new_arrange)
-        self._count += 1
-        self._updateFirstEmpty()
-
-    def count(self):
-        return self._count
-
-    def get(self, index):
-        return self._arrange[index]
-
-    def getFirstEmpty(self):
-        if not self._has_empty:
-            self.add()
-        return self._arrange[self._first_empty]
-
-
-class ArrangeObjectsAllBuildPlatesJob(Job):
-    def __init__(self, nodes: List[SceneNode], min_offset = 8) -> None:
-        super().__init__()
-        self._nodes = nodes
-        self._min_offset = min_offset
-
-    def run(self):
-        status_message = Message(i18n_catalog.i18nc("@info:status", "Finding new location for objects"),
-                                 lifetime = 0,
-                                 dismissable=False,
-                                 progress = 0,
-                                 title = i18n_catalog.i18nc("@info:title", "Finding Location"))
-        status_message.show()
-
-
-        # Collect nodes to be placed
-        nodes_arr = []  # fill with (size, node, offset_shape_arr, hull_shape_arr)
-        for node in self._nodes:
-            offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(node, min_offset = self._min_offset)
-            nodes_arr.append((offset_shape_arr.arr.shape[0] * offset_shape_arr.arr.shape[1], node, offset_shape_arr, hull_shape_arr))
-
-        # Sort the nodes with the biggest area first.
-        nodes_arr.sort(key=lambda item: item[0])
-        nodes_arr.reverse()
-
-        global_container_stack = Application.getInstance().getGlobalContainerStack()
-        machine_width = global_container_stack.getProperty("machine_width", "value")
-        machine_depth = global_container_stack.getProperty("machine_depth", "value")
-
-        x, y = machine_width, machine_depth
-
-        arrange_array = ArrangeArray(x = x, y = y, fixed_nodes = [])
-        arrange_array.add()
-
-        # Place nodes one at a time
-        start_priority = 0
-        grouped_operation = GroupedOperation()
-        found_solution_for_all = True
-        left_over_nodes = []  # nodes that do not fit on an empty build plate
-
-        for idx, (size, node, offset_shape_arr, hull_shape_arr) in enumerate(nodes_arr):
-            # For performance reasons, we assume that when a location does not fit,
-            # it will also not fit for the next object (while what can be untrue).
-
-            try_placement = True
-
-            current_build_plate_number = 0  # always start with the first one
-
-            while try_placement:
-                # make sure that current_build_plate_number is not going crazy or you'll have a lot of arrange objects
-                while current_build_plate_number >= arrange_array.count():
-                    arrange_array.add()
-                arranger = arrange_array.get(current_build_plate_number)
-
-                best_spot = arranger.bestSpot(hull_shape_arr, start_prio=start_priority)
-                x, y = best_spot.x, best_spot.y
-                node.removeDecorator(ZOffsetDecorator)
-                if node.getBoundingBox():
-                    center_y = node.getWorldPosition().y - node.getBoundingBox().bottom
-                else:
-                    center_y = 0
-                if x is not None:  # We could find a place
-                    arranger.place(x, y, offset_shape_arr)  # place the object in the arranger
-
-                    node.callDecoration("setBuildPlateNumber", current_build_plate_number)
-                    grouped_operation.addOperation(TranslateOperation(node, Vector(x, center_y, y), set_position = True))
-                    try_placement = False
-                else:
-                    # very naive, because we skip to the next build plate if one model doesn't fit.
-                    if arranger.isEmpty:
-                        # apparently we can never place this object
-                        left_over_nodes.append(node)
-                        try_placement = False
-                    else:
-                        # try next build plate
-                        current_build_plate_number += 1
-                        try_placement = True
-
-            status_message.setProgress((idx + 1) / len(nodes_arr) * 100)
-            Job.yieldThread()
-
-        for node in left_over_nodes:
-            node.callDecoration("setBuildPlateNumber", -1)  # these are not on any build plate
-            found_solution_for_all = False
-
-        grouped_operation.push()
-
-        status_message.hide()
-
-        if not found_solution_for_all:
-            no_full_solution_message = Message(i18n_catalog.i18nc("@info:status",
-                                                                  "Unable to find a location within the build volume for all objects"),
-                                               title = i18n_catalog.i18nc("@info:title", "Can't Find Location"),
-                                               message_type = Message.MessageType.WARNING)
-            no_full_solution_message.show()

+ 3 - 2
cura/BuildVolume.py

@@ -1113,7 +1113,8 @@ class BuildVolume(SceneNode):
         # Use brim width if brim is enabled OR the prime tower has a brim.
         if adhesion_type == "brim":
             brim_line_count = skirt_brim_stack.getProperty("brim_line_count", "value")
-            bed_adhesion_size = skirt_brim_line_width * brim_line_count * initial_layer_line_width_factor / 100.0
+            brim_gap = skirt_brim_stack.getProperty("brim_gap", "value")
+            bed_adhesion_size = brim_gap + skirt_brim_line_width * brim_line_count * initial_layer_line_width_factor / 100.0
 
             for extruder_stack in used_extruders:
                 bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0
@@ -1214,7 +1215,7 @@ class BuildVolume(SceneNode):
         return max(min(value, max_value), min_value)
 
     _machine_settings = ["machine_width", "machine_depth", "machine_height", "machine_shape", "machine_center_is_zero"]
-    _skirt_settings = ["adhesion_type", "skirt_gap", "skirt_line_count", "skirt_brim_line_width", "brim_width", "brim_line_count", "raft_margin", "draft_shield_enabled", "draft_shield_dist", "initial_layer_line_width_factor"]
+    _skirt_settings = ["adhesion_type", "skirt_gap", "skirt_line_count", "skirt_brim_line_width", "brim_gap", "brim_width", "brim_line_count", "raft_margin", "draft_shield_enabled", "draft_shield_dist", "initial_layer_line_width_factor"]
     _raft_settings = ["adhesion_type", "raft_base_thickness", "raft_interface_layers", "raft_interface_thickness", "raft_surface_layers", "raft_surface_thickness", "raft_airgap", "layer_0_z_overlap"]
     _extra_z_settings = ["retraction_hop_enabled", "retraction_hop"]
     _prime_settings = ["extruder_prime_pos_x", "extruder_prime_pos_y", "prime_blob_enable"]

+ 5 - 36
cura/CuraApplication.py

@@ -43,7 +43,7 @@ from UM.Scene.Selection import Selection
 from UM.Scene.ToolHandle import ToolHandle
 from UM.Settings.ContainerRegistry import ContainerRegistry
 from UM.Settings.InstanceContainer import InstanceContainer
-from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyType
+from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyType, toIntConversion
 from UM.Settings.SettingFunction import SettingFunction
 from UM.Settings.Validator import Validator
 from UM.View.SelectionPass import SelectionPass  # For typing.
@@ -52,8 +52,6 @@ from UM.i18n import i18nCatalog
 from cura import ApplicationMetadata
 from cura.API import CuraAPI
 from cura.API.Account import Account
-from cura.Arranging.Arrange import Arrange
-from cura.Arranging.ArrangeObjectsAllBuildPlatesJob import ArrangeObjectsAllBuildPlatesJob
 from cura.Arranging.ArrangeObjectsJob import ArrangeObjectsJob
 from cura.Arranging.Nest2DArrange import arrange
 from cura.Machines.MachineErrorChecker import MachineErrorChecker
@@ -129,7 +127,7 @@ class CuraApplication(QtApplication):
     # SettingVersion represents the set of settings available in the machine/extruder definitions.
     # You need to make sure that this version number needs to be increased if there is any non-backwards-compatible
     # changes of the settings.
-    SettingVersion = 19
+    SettingVersion = 20
 
     Created = False
 
@@ -382,11 +380,12 @@ class CuraApplication(QtApplication):
         SettingDefinition.addSupportedProperty("resolve", DefinitionPropertyType.Function, default=None,
                                                depends_on="value")
 
-        SettingDefinition.addSettingType("extruder", None, str, Validator)
-        SettingDefinition.addSettingType("optional_extruder", None, str, None)
+        SettingDefinition.addSettingType("extruder", None, toIntConversion, Validator)
+        SettingDefinition.addSettingType("optional_extruder", None, toIntConversion, None)
         SettingDefinition.addSettingType("[int]", None, str, None)
 
 
+
     def _initializeSettingFunctions(self):
         """Adds custom property types, settings types, and extra operators (functions).
 
@@ -818,9 +817,6 @@ class CuraApplication(QtApplication):
         root = self.getController().getScene().getRoot()
         self._volume = BuildVolume.BuildVolume(self, root)
 
-        # Ensure that the old style arranger still works.
-        Arrange.build_volume = self._volume
-
         # initialize info objects
         self._print_information = PrintInformation.PrintInformation(self)
         self._cura_actions = CuraActions.CuraActions(self)
@@ -1376,33 +1372,6 @@ class CuraApplication(QtApplication):
                 op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1)))
             op.push()
 
-    @pyqtSlot()
-    def arrangeObjectsToAllBuildPlates(self) -> None:
-        """Arrange all objects."""
-
-        nodes_to_arrange = []
-        for node in DepthFirstIterator(self.getController().getScene().getRoot()):
-            if not isinstance(node, SceneNode):
-                continue
-
-            if not node.getMeshData() and not node.callDecoration("isGroup"):
-                continue  # Node that doesn't have a mesh and is not a group.
-
-            parent_node = node.getParent()
-            if parent_node and parent_node.callDecoration("isGroup"):
-                continue  # Grouped nodes don't need resetting as their parent (the group) is reset)
-
-            if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"):
-                continue  # i.e. node with layer data
-
-            bounding_box = node.getBoundingBox()
-            # Skip nodes that are too big
-            if bounding_box is None or bounding_box.width < self._volume.getBoundingBox().width or bounding_box.depth < self._volume.getBoundingBox().depth:
-                nodes_to_arrange.append(node)
-        job = ArrangeObjectsAllBuildPlatesJob(nodes_to_arrange)
-        job.start()
-        self.getCuraSceneController().setActiveBuildPlate(0)  # Select first build plate
-
     # Single build plate
     @pyqtSlot()
     def arrangeAll(self) -> None:

+ 3 - 1
cura/PrinterOutput/PrinterOutputDevice.py

@@ -137,7 +137,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
         """
         if self.connectionState != connection_state:
             self._connection_state = connection_state
-            cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().setMetaDataEntry("is_online", self.isConnected())
+            global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
+            if global_stack:
+                global_stack.setMetaDataEntry("is_online", self.isConnected())
             self.connectionStateChanged.emit(self._id)
 
     @pyqtProperty(int, constant = True)

+ 0 - 4
cura/PrinterOutput/PrinterOutputModel.py

@@ -1,4 +0,0 @@
-import warnings
-warnings.warn("Importing cura.PrinterOutput.PrinterOutputModel has been deprecated since 4.1, use cura.PrinterOutput.Models.PrinterOutputModel instead", DeprecationWarning, stacklevel=2)
-# We moved the the models to one submodule deeper
-from cura.PrinterOutput.Models.PrinterOutputModel import PrinterOutputModel

+ 0 - 4
cura/PrinterOutputDevice.py

@@ -1,4 +0,0 @@
-import warnings
-warnings.warn("Importing cura.PrinterOutputDevice has been deprecated since 4.1, use cura.PrinterOutput.PrinterOutputDevice instead", DeprecationWarning, stacklevel=2)
-# We moved the PrinterOutput device to it's own submodule.
-from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState

+ 0 - 10
cura/Settings/GlobalStack.py

@@ -60,16 +60,6 @@ class GlobalStack(CuraContainerStack):
     extrudersChanged = pyqtSignal()
     configuredConnectionTypesChanged = pyqtSignal()
 
-    @pyqtProperty("QVariantMap", notify = extrudersChanged)
-    @deprecated("Please use extruderList instead.", "4.4")
-    def extruders(self) -> Dict[str, "ExtruderStack"]:
-        """Get the list of extruders of this stack.
-
-        :return: The extruders registered with this stack.
-        """
-
-        return self._extruders
-
     @pyqtProperty("QVariantList", notify = extrudersChanged)
     def extruderList(self) -> List["ExtruderStack"]:
         result_tuple_list = sorted(list(self._extruders.items()), key=lambda x: int(x[0]))

+ 12 - 14
cura/UI/CuraSplashScreen.py

@@ -14,7 +14,7 @@ import time
 class CuraSplashScreen(QSplashScreen):
     def __init__(self):
         super().__init__()
-        self._scale = 0.7
+        self._scale = 1
         self._version_y_offset = 0  # when extra visual elements are in the background image, move version text down
 
         if ApplicationMetadata.IsAlternateVersion:
@@ -69,23 +69,21 @@ class CuraSplashScreen(QSplashScreen):
         version = Application.getInstance().getVersion().split("-")
 
         # Draw version text
-        font = QFont()  # Using system-default font here
-        font.setPixelSize(18)
+        font = QFont()
+        font.setPixelSize(24)
         painter.setFont(font)
-        painter.drawText(60, 70 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0] if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType)
-        if len(version) > 1:
-            font.setPixelSize(16)
-            painter.setFont(font)
-            painter.setPen(QColor(200, 200, 200, 255))
-            painter.drawText(247, 105 + self._version_y_offset, round(330 * self._scale), round(255 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[1])
-        painter.setPen(QColor(255, 255, 255, 255))
+
+        if len(version) == 1:
+            painter.drawText(40, 104 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0] if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType)
+        elif len(version) > 1: 
+            painter.drawText(40, 104 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0] +" "+ version[1] if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType)
 
         # Draw the loading image
         pen = QPen()
-        pen.setWidthF(6 * self._scale)
-        pen.setColor(QColor(32, 166, 219, 255))
+        pen.setWidthF(2 * self._scale)
+        pen.setColor(QColor(255, 255, 255, 255))
         painter.setPen(pen)
-        painter.drawArc(60, 150, round(32 * self._scale), round(32 * self._scale), round(self._loading_image_rotation_angle * 16), 300 * 16)
+        painter.drawArc(38, 324, round(20 * self._scale), round(20 * self._scale), round(self._loading_image_rotation_angle * 16), 300 * 16)
 
         # Draw message text
         if self._current_message:
@@ -95,7 +93,7 @@ class CuraSplashScreen(QSplashScreen):
             pen.setColor(QColor(255, 255, 255, 255))
             painter.setPen(pen)
             painter.setFont(font)
-            painter.drawText(100, 128, 170, 64,
+            painter.drawText(70, 320, 170, 24,
                              Qt.AlignLeft | Qt.AlignVCenter | Qt.TextWordWrap,
                              self._current_message)
 

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