diff --git a/src/Mod/CAM/CAMTests/TestPathToolBit.py b/src/Mod/CAM/CAMTests/TestPathToolBit.py index d5b9fbe758..126fe763c5 100644 --- a/src/Mod/CAM/CAMTests/TestPathToolBit.py +++ b/src/Mod/CAM/CAMTests/TestPathToolBit.py @@ -62,7 +62,7 @@ class TestPathToolBit(PathTestWithAssets): # Parameters should be loaded from the shape file and set on the tool bit's object self.assertEqual(bullnose_bit.obj.Diameter, FreeCAD.Units.Quantity("5.0 mm")) - self.assertEqual(bullnose_bit.obj.FlatRadius, FreeCAD.Units.Quantity("1.5 mm")) + self.assertEqual(bullnose_bit.obj.CornerRadius, FreeCAD.Units.Quantity("1.5 mm")) def testToolBitPickle(self): """Test if ToolBit is picklable""" diff --git a/src/Mod/CAM/CAMTests/TestPathToolShapeClasses.py b/src/Mod/CAM/CAMTests/TestPathToolShapeClasses.py index dc09140ef7..c473c99a4b 100644 --- a/src/Mod/CAM/CAMTests/TestPathToolShapeClasses.py +++ b/src/Mod/CAM/CAMTests/TestPathToolShapeClasses.py @@ -153,8 +153,8 @@ class TestPathToolShapeClasses(PathTestWithAssets): self.assertEqual(ToolBitShape.resolve_name("ballend").asset_id, "ballend") self.assertEqual(ToolBitShape.resolve_name("v-bit").asset_id, "v-bit") self.assertEqual(ToolBitShape.resolve_name("vbit").asset_id, "vbit") - self.assertEqual(ToolBitShape.resolve_name("torus").asset_id, "torus") - self.assertEqual(ToolBitShape.resolve_name("torus.fcstd").asset_id, "torus") + self.assertEqual(ToolBitShape.resolve_name("bullnose").asset_id, "bullnose") + self.assertEqual(ToolBitShape.resolve_name("bullnose.fcstd").asset_id, "bullnose") self.assertEqual(ToolBitShape.resolve_name("SlittingSaw").asset_id, "SlittingSaw") # Test unknown name - should return the input name self.assertEqual(ToolBitShape.resolve_name("nonexistent").asset_id, "nonexistent") @@ -336,12 +336,12 @@ class TestPathToolShapeClasses(PathTestWithAssets): shape = self._test_shape_common("bullnose") self.assertEqual(shape["Diameter"].Value, 5.0) self.assertEqual(unit(shape["Diameter"]), "mm") - self.assertEqual(shape["FlatRadius"].Value, 1.5) - self.assertEqual(unit(shape["FlatRadius"]), "mm") + self.assertEqual(shape["CornerRadius"].Value, 1.5) + self.assertEqual(unit(shape["CornerRadius"]), "mm") # Need an instance to get parameter labels, get it from the asset manager uri = ToolBitShape.resolve_name("bullnose") instance = self.assets.get(uri) - self.assertEqual(instance.get_parameter_label("FlatRadius"), "Torus radius") + self.assertEqual(instance.get_parameter_label("CornerRadius"), "Corner radius") def test_toolbitshapevbit_defaults(self): """Test ToolBitShapeVBit default parameters and labels.""" diff --git a/src/Mod/CAM/Gui/Resources/panels/PageOpAdaptiveEdit.ui b/src/Mod/CAM/Gui/Resources/panels/PageOpAdaptiveEdit.ui index 667bc2755a..b1f31d1dd5 100644 --- a/src/Mod/CAM/Gui/Resources/panels/PageOpAdaptiveEdit.ui +++ b/src/Mod/CAM/Gui/Resources/panels/PageOpAdaptiveEdit.ui @@ -50,19 +50,19 @@ - QFrame::Shape::StyledPanel + QFrame::StyledPanel - QFrame::Shadow::Raised + QFrame::Raised - QFrame::Shape::StyledPanel + QFrame::StyledPanel - QFrame::Shadow::Raised + QFrame::Raised @@ -92,7 +92,7 @@ Larger values (further to the right) will calculate faster; smaller values (furt 10 - Qt::Orientation::Horizontal + Qt::Horizontal 1 @@ -318,7 +318,7 @@ This option changes that behavior to cut each discrete area to its full depth be - Qt::Orientation::Vertical + Qt::Vertical diff --git a/src/Mod/CAM/Gui/Resources/preferences/PathJob.ui b/src/Mod/CAM/Gui/Resources/preferences/PathJob.ui index c53822ac8b..73482d95e4 100644 --- a/src/Mod/CAM/Gui/Resources/preferences/PathJob.ui +++ b/src/Mod/CAM/Gui/Resources/preferences/PathJob.ui @@ -106,7 +106,7 @@ If left empty no template will be preselected. - Qt::Orientation::Vertical + Qt::Vertical @@ -144,7 +144,7 @@ If left empty no template will be preselected. - QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow + QFormLayout::AllNonFixedFieldsGrow @@ -257,7 +257,7 @@ See the file save policy below on how to deal with name conflicts. - QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow + QFormLayout::AllNonFixedFieldsGrow @@ -322,7 +322,7 @@ See the file save policy below on how to deal with name conflicts. - Qt::Orientation::Vertical + Qt::Vertical @@ -387,7 +387,7 @@ See the file save policy below on how to deal with name conflicts. - Qt::Orientation::Horizontal + Qt::Horizontal @@ -514,7 +514,7 @@ See the file save policy below on how to deal with name conflicts. - Qt::Orientation::Horizontal + Qt::Horizontal @@ -556,21 +556,21 @@ See the file save policy below on how to deal with name conflicts. - QAbstractSpinBox::ButtonSymbols::NoButtons + QAbstractSpinBox::NoButtons - QAbstractSpinBox::ButtonSymbols::NoButtons + QAbstractSpinBox::NoButtons - QAbstractSpinBox::ButtonSymbols::NoButtons + QAbstractSpinBox::NoButtons @@ -599,7 +599,7 @@ See the file save policy below on how to deal with name conflicts. - Qt::Orientation::Vertical + Qt::Vertical @@ -616,7 +616,7 @@ See the file save policy below on how to deal with name conflicts. - Qt::Orientation::Vertical + Qt::Vertical diff --git a/src/Mod/CAM/Path/Base/PropertyBag.py b/src/Mod/CAM/Path/Base/PropertyBag.py index 2b0fd946ab..7cfa299120 100644 --- a/src/Mod/CAM/Path/Base/PropertyBag.py +++ b/src/Mod/CAM/Path/Base/PropertyBag.py @@ -105,6 +105,7 @@ class PropertyBag(object): try: obj.removeProperty(self.CustomPropertyGroups) except Exception: + # Removing the property may fail if it does not exist; safe to ignore in this context. pass obj.addProperty( "App::PropertyEnumeration", diff --git a/src/Mod/CAM/Path/Tool/assets/manager.py b/src/Mod/CAM/Path/Tool/assets/manager.py index 072ec3a100..e96cc8e0b0 100644 --- a/src/Mod/CAM/Path/Tool/assets/manager.py +++ b/src/Mod/CAM/Path/Tool/assets/manager.py @@ -46,7 +46,7 @@ from .cache import AssetCache, CacheKey logger = logging.getLogger(__name__) -logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.ERROR) @dataclass diff --git a/src/Mod/CAM/Path/Tool/library/serializers/fctl.py b/src/Mod/CAM/Path/Tool/library/serializers/fctl.py index 275bfea0fe..f8fe8555fc 100644 --- a/src/Mod/CAM/Path/Tool/library/serializers/fctl.py +++ b/src/Mod/CAM/Path/Tool/library/serializers/fctl.py @@ -35,9 +35,6 @@ class FCTLSerializer(AssetSerializer): extensions = (".fctl",) mime_type = "application/x-freecad-toolbit-library" - Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) - Path.Log.trackModule(Path.Log.thisModule()) - @classmethod def get_label(cls) -> str: return FreeCAD.Qt.translate("CAM", "FreeCAD Tool Library") diff --git a/src/Mod/CAM/Path/Tool/library/ui/properties.py b/src/Mod/CAM/Path/Tool/library/ui/properties.py index 20d1dc4f59..42202eea43 100644 --- a/src/Mod/CAM/Path/Tool/library/ui/properties.py +++ b/src/Mod/CAM/Path/Tool/library/ui/properties.py @@ -1,24 +1,28 @@ # -*- coding: utf-8 -*- +# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** +# * * # * Copyright (c) 2025 Samuel Abels * # * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU Lesser General Public License (LGPL) * -# * as published by the Free Software Foundation; either version 2 of * -# * the License, or (at your option) any later version. * -# * for detail see the LICENCE text file. * +# * This file is part of FreeCAD. * # * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU Library General Public License for more details. * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * # * * -# * You should have received a copy of the GNU Library General Public * -# * License along with this program; if not, write to the Free Software * -# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# * USA * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * # * * # *************************************************************************** + + from PySide import QtWidgets import FreeCADGui import FreeCAD diff --git a/src/Mod/CAM/Path/Tool/shape/models/bullnose.py b/src/Mod/CAM/Path/Tool/shape/models/bullnose.py index faeb13dc45..2e78f4eb4e 100644 --- a/src/Mod/CAM/Path/Tool/shape/models/bullnose.py +++ b/src/Mod/CAM/Path/Tool/shape/models/bullnose.py @@ -52,12 +52,12 @@ class ToolBitShapeBullnose(ToolBitShape): FreeCAD.Qt.translate("ToolBitShape", "Shank diameter"), "App::PropertyLength", ), - "FlatRadius": ( - FreeCAD.Qt.translate("ToolBitShape", "Torus radius"), + "CornerRadius": ( + FreeCAD.Qt.translate("ToolBitShape", "Corner radius"), "App::PropertyLength", ), } @property def label(self) -> str: - return FreeCAD.Qt.translate("ToolBitShape", "Torus") + return FreeCAD.Qt.translate("ToolBitShape", "Bullnose") diff --git a/src/Mod/CAM/Path/Tool/toolbit/models/bullnose.py b/src/Mod/CAM/Path/Tool/toolbit/models/bullnose.py index e86c180965..3033c02ebf 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/models/bullnose.py +++ b/src/Mod/CAM/Path/Tool/toolbit/models/bullnose.py @@ -39,9 +39,10 @@ class ToolBitBullnose(ToolBit, CuttingToolMixin, RotaryToolBitMixin): diameter = self.get_property_str("Diameter", "?", precision=3) flutes = self.get_property("Flutes") cutting_edge_height = self.get_property_str("CuttingEdgeHeight", "?", precision=3) - flat_radius = self.get_property_str("FlatRadius", "?", precision=3) + #flat_radius = self.get_property_str("FlatRadius", "?", precision=3) + corner_radius = self.get_property_str("CornerRadius", "?", precision=3) return FreeCAD.Qt.translate( "CAM", - f"{diameter} {flutes}-flute bullnose, {cutting_edge_height} cutting edge, {flat_radius} flat radius", + f"{diameter} {flutes}-flute bullnose, {cutting_edge_height} cutting edge, {corner_radius} corner radius", ) diff --git a/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py b/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py index ee1efa6959..498a0b31ce 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py +++ b/src/Mod/CAM/Path/Tool/toolbit/serializers/fctb.py @@ -28,7 +28,7 @@ from ...shape import ToolBitShape from ..models.base import ToolBit -if True: +if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) else: diff --git a/src/Mod/CAM/Path/Tool/toolbit/serializers/yaml.py b/src/Mod/CAM/Path/Tool/toolbit/serializers/yaml.py index 95d679dc4c..85f062b9ba 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/serializers/yaml.py +++ b/src/Mod/CAM/Path/Tool/toolbit/serializers/yaml.py @@ -1,26 +1,29 @@ # -*- coding: utf-8 -*- +# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** +# * * # * Copyright (c) 2025 Samuel Abels * # * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU Lesser General Public License (LGPL) * -# * as published by the Free Software Foundation; either version 2 of * -# * the License, or (at your option) any later version. * -# * for detail see the LICENCE text file. * +# * This file is part of FreeCAD. * # * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU Library General Public License for more details. * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * # * * -# * You should have received a copy of the GNU Library General Public * -# * License along with this program; if not, write to the Free Software * -# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# * USA * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * # * * # *************************************************************************** + import yaml -from typing import List, Optional, Mapping, Type, cast +from typing import List, Optional, Mapping, Type from ...assets.serializer import AssetSerializer from ...assets.uri import AssetUri from ...shape import ToolBitShape diff --git a/src/Mod/CAM/Tools/Bit/6mm_Bullnose.fctb b/src/Mod/CAM/Tools/Bit/6mm_Bullnose.fctb index b2830fd38c..fb6dbfab13 100644 --- a/src/Mod/CAM/Tools/Bit/6mm_Bullnose.fctb +++ b/src/Mod/CAM/Tools/Bit/6mm_Bullnose.fctb @@ -6,7 +6,7 @@ "parameter": { "CuttingEdgeHeight": "40.0000 mm", "Diameter": "6.0000 mm", - "FlatRadius": "1.5000 mm", + "CornerRadius": "1.5000 mm", "Length": "50.0000 mm", "ShankDiameter": "3.0000 mm" }, diff --git a/src/Mod/CAM/Tools/Shape/bullnose.fcstd b/src/Mod/CAM/Tools/Shape/bullnose.fcstd index 121fa63397..c2a7053993 100644 Binary files a/src/Mod/CAM/Tools/Shape/bullnose.fcstd and b/src/Mod/CAM/Tools/Shape/bullnose.fcstd differ