From 863569b7dece3c7f77eaebe0532722ec40056da5 Mon Sep 17 00:00:00 2001 From: Dmitry Gribenchuk Date: Thu, 17 Oct 2024 11:24:48 +0300 Subject: [PATCH 1/4] small code-style fixes --- tests/TestBuildVolume.py | 1 - tests/TestConvexHullDecorator.py | 2 +- tests/TestCuraSceneController.py | 3 +-- tests/TestCuraSceneNode.py | 2 -- tests/TestLayer.py | 2 +- tests/TestObjectsModel.py | 1 - tests/TestPrintInformation.py | 2 +- tests/TestProfileRequirements.py | 6 +++--- 8 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/TestBuildVolume.py b/tests/TestBuildVolume.py index 5012784bdf..ece4b22d6f 100644 --- a/tests/TestBuildVolume.py +++ b/tests/TestBuildVolume.py @@ -424,4 +424,3 @@ class TestGetEdgeDisallowedSize: with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance"): with patch.dict(self.setting_property_dict, {"print_sequence": {"value": "one_at_a_time"}}): assert build_volume.getEdgeDisallowedSize() == 0.1 - diff --git a/tests/TestConvexHullDecorator.py b/tests/TestConvexHullDecorator.py index eed5a3a6c3..94bcd58f37 100644 --- a/tests/TestConvexHullDecorator.py +++ b/tests/TestConvexHullDecorator.py @@ -188,4 +188,4 @@ def test_compute2DConvexHullMeshDataGrouped(convex_hull_decorator): copied_decorator._global_stack = mocked_stack copied_decorator._getSettingProperty = MagicMock(return_value=0) node.addDecorator(copied_decorator) - assert convex_hull_decorator._compute2DConvexHull() == Polygon([[-5.0, 5.0], [5.0, 5.0], [5.0, -5.0], [-5.0, -5.0]]) \ No newline at end of file + assert convex_hull_decorator._compute2DConvexHull() == Polygon([[-5.0, 5.0], [5.0, 5.0], [5.0, -5.0], [-5.0, -5.0]]) diff --git a/tests/TestCuraSceneController.py b/tests/TestCuraSceneController.py index 634ce89d86..fe6f964593 100644 --- a/tests/TestCuraSceneController.py +++ b/tests/TestCuraSceneController.py @@ -75,5 +75,4 @@ def test_updateMaxBuildPlate(objects_model, multi_build_plate_model): # And check what happens if we move down again! controller._calcMaxBuildPlate = MagicMock(return_value=2) controller.updateMaxBuildPlate(SceneNode()) - assert controller._active_build_plate == 0 # We don't have any items anywhere, so default to 0 - + assert controller._active_build_plate == 0 # We don't have any items anywhere, so default to 0 diff --git a/tests/TestCuraSceneNode.py b/tests/TestCuraSceneNode.py index 9e2fcb1188..77f4051a99 100644 --- a/tests/TestCuraSceneNode.py +++ b/tests/TestCuraSceneNode.py @@ -53,5 +53,3 @@ class TestCollidesWithAreas: def test_outsideBuildArea(cura_scene_node): cura_scene_node.setOutsideBuildArea(True) assert cura_scene_node.isOutsideBuildArea - - diff --git a/tests/TestLayer.py b/tests/TestLayer.py index f8183437d6..602a0a5061 100644 --- a/tests/TestLayer.py +++ b/tests/TestLayer.py @@ -36,4 +36,4 @@ def test_elementCount(): layer_polygon.elementCount = 12 layer.polygons.append(layer_polygon) assert layer.build(0, 0, [], [], [], [], [] ,[] , []) == (9001, 9002) - assert layer.elementCount == 12 \ No newline at end of file + assert layer.elementCount == 12 diff --git a/tests/TestObjectsModel.py b/tests/TestObjectsModel.py index b34c32a95e..1bc0bf6ace 100644 --- a/tests/TestObjectsModel.py +++ b/tests/TestObjectsModel.py @@ -226,4 +226,3 @@ class Test_Update: "per_object_settings_count": 0, "mesh_type": "" }] - diff --git a/tests/TestPrintInformation.py b/tests/TestPrintInformation.py index bfebe4a528..4135782f0c 100644 --- a/tests/TestPrintInformation.py +++ b/tests/TestPrintInformation.py @@ -148,4 +148,4 @@ def test_defineAbbreviatedMachineName(): # Test not ultimaker printer, name suffix should have first letter from the printer name project_name = ["HelloWorld", ".3mf"] print_information.setProjectName(project_name[0] + project_name[1]) - assert printer_name[0] + "_" + project_name[0] == print_information._job_name \ No newline at end of file + assert printer_name[0] + "_" + project_name[0] == print_information._job_name diff --git a/tests/TestProfileRequirements.py b/tests/TestProfileRequirements.py index a88513ce24..c2114cba79 100644 --- a/tests/TestProfileRequirements.py +++ b/tests/TestProfileRequirements.py @@ -1,8 +1,8 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -import configparser #To read the profiles. -import os #To join paths. +import configparser # To read the profiles. +import os # To join paths. import pytest ## Makes sure that the variants for the Ultimaker 3 Extended are exactly the @@ -13,7 +13,7 @@ import pytest # needed, but until then we should keep them the same. It's happened all too # often that we updated the variants for the UM3 but forgot about the UM3E. @pytest.mark.parametrize("um3_file, um3e_file", [ - #List the corresponding files below. + # List the corresponding files below. ("ultimaker3_aa0.25.inst.cfg", "ultimaker3_extended_aa0.25.inst.cfg"), ("ultimaker3_aa0.8.inst.cfg", "ultimaker3_extended_aa0.8.inst.cfg"), ("ultimaker3_aa04.inst.cfg", "ultimaker3_extended_aa04.inst.cfg"), From 0991c3c01d2f685dd69eb0fadf51e42a2ffe0b12 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 11 Nov 2024 16:13:10 +0100 Subject: [PATCH 2/4] Loop back to the beginning when ending simulation playback CURA-12192 --- plugins/SimulationView/SimulationView.py | 13 +++++-------- .../SimulationView/SimulationViewMainComponent.qml | 4 +--- plugins/SimulationView/SimulationViewProxy.py | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index b433321914..10861acfd0 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -222,12 +222,11 @@ class SimulationView(CuraView): self.setPath(i + fractional_value) - def advanceTime(self, time_increase: float) -> bool: + def advanceTime(self, time_increase: float) -> None: """ Advance the time by the given amount. :param time_increase: The amount of time to advance (in seconds). - :return: True if the time was advanced, False if the end of the simulation was reached. """ total_duration = 0.0 if len(self.cumulativeLineDuration()) > 0: @@ -237,15 +236,13 @@ class SimulationView(CuraView): # If we have reached the end of the simulation, go to the next layer. if self.getCurrentLayer() == self.getMaxLayers(): # If we are already at the last layer, go to the first layer. - self.setTime(total_duration) - return False - - # advance to the next layer, and reset the time - self.setLayer(self.getCurrentLayer() + 1) + self.setLayer(0) + else: + # advance to the next layer, and reset the time + self.setLayer(self.getCurrentLayer() + 1) self.setTime(0.0) else: self.setTime(self._current_time + time_increase) - return True def cumulativeLineDuration(self) -> List[float]: # Make sure _cumulative_line_duration is initialized properly diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index d9e7a95bc1..602d403a8a 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -144,9 +144,7 @@ Item { // divide by 1000 to account for ms to s conversion const advance_time = simulationTimer.interval / 1000.0; - if (!UM.SimulationView.advanceTime(advance_time)) { - playButton.pauseSimulation(); - } + UM.SimulationView.advanceTime(advance_time); // The status must be set here instead of in the resumeSimulation function otherwise it won't work // correctly, because part of the logic is in this trigger function. isSimulationPlaying = true; diff --git a/plugins/SimulationView/SimulationViewProxy.py b/plugins/SimulationView/SimulationViewProxy.py index bf449a99d1..30fed1422c 100644 --- a/plugins/SimulationView/SimulationViewProxy.py +++ b/plugins/SimulationView/SimulationViewProxy.py @@ -54,9 +54,9 @@ class SimulationViewProxy(QObject): def currentPath(self): return self._simulation_view.getCurrentPath() - @pyqtSlot(float, result=bool) - def advanceTime(self, duration: float) -> bool: - return self._simulation_view.advanceTime(duration) + @pyqtSlot(float) + def advanceTime(self, duration: float) -> None: + self._simulation_view.advanceTime(duration) @pyqtProperty(int, notify=currentPathChanged) def minimumPath(self): From f807af1b54cb49875a6bd954d30ba334f52ddac5 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 28 Nov 2024 10:46:04 +0100 Subject: [PATCH 3/4] Add warning for Conan2 migration --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 37978a30f9..d3fa8f55ce 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@
+# ⚠️ ⚠️ On 03-12-2024, we will start merging branches on all the Cura-related repositories, that contain a migration of our Conan recipes to use Conan 2, and also a huge rework on many GitHub workflows. Unfortunately, we cannot test everything until it is merged, so it is very likely that some existing workflows will stop working. If you are a developer, you may also encounter troubles when updating your branches or updating your Conan dependencies. This message will be removed when the situation is stable enough. After that, please open new issues if you are still in trouble with the new recipes/workflows. Sorry for the inconvenience. ⚠️ ⚠️ + [![Badge Issues]][Issues]    [![Badge PullRequests]][PullRequests]    [![Badge Closed]][Closed] From 1b9f1c55367bc0199cc36ef59e457c2cb3c6dbff Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 29 Nov 2024 11:40:47 +0100 Subject: [PATCH 4/4] Add preference to actually set the flip preference for Y handle --- resources/qml/Preferences/GeneralPage.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 4cc87e9644..a686fca8e5 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -109,6 +109,9 @@ UM.PreferencesPage UM.Preferences.resetPreference("general/restore_window_geometry") restoreWindowPositionCheckbox.checked = boolCheck(UM.Preferences.getValue("general/restore_window_geometry")) + UM.Preferences.resetPreference("tool/flip_y_axis_tool_handle") + flipToolhandleYCheckbox.checked = boolcheck(UM.Preferences.getValue("tool/flip_y_axis_tool_handle")) + UM.Preferences.resetPreference("general/camera_perspective_mode") //var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode") // /setDefaultCameraMode(defaultCameraMode) @@ -662,6 +665,21 @@ UM.PreferencesPage } } } + UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip", "Should the Y axis of the translate toolhandle be flipped?") + + UM.CheckBox + { + id: flipToolhandleYCheckbox + text: catalog.i18nc("@option:check", "Flip toolhandle Y axis") + checked: boolCheck(UM.Preferences.getValue("tool/flip_y_axis_tool_handle")) + onCheckedChanged: UM.Preferences.setValue("tool/flip_y_axis_tool_handle", checked) + } + } + Item {