From 9c5e8f834044d08e5365644bcf7051239469f025 Mon Sep 17 00:00:00 2001 From: David Kaufman Date: Thu, 21 Aug 2025 17:20:59 -0400 Subject: [PATCH] [CAM] Add feed rate percent to lead in/out dressup --- .../Resources/panels/DressUpLeadInOutEdit.ui | 29 +++++++++++++++++++ src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py | 27 ++++++++++++++++- src/Mod/CAM/Path/Dressup/Gui/RampEntry.py | 4 +-- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui b/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui index 26e44139c1..f6e956cfd3 100644 --- a/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui +++ b/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui @@ -175,6 +175,35 @@ + + + Feed Rate Percent + + + + + + + Horizontal feed rate during entrances and exits, as a percentage of the normal feed rate. + + + 0 + + + 1.000000000000000 + + + 999999.000000000000000 + + + 10.000000000000000 + + + + + + + diff --git a/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py b/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py index 3f301d8899..3cee50e06f 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py +++ b/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py @@ -162,6 +162,15 @@ class ObjectDressup: "Path Lead-out", QT_TRANSLATE_NOOP("App::Property", "Move end point"), ) + obj.addProperty( + "App::PropertyInteger", + "FeedRatePercent", + "Path", + QT_TRANSLATE_NOOP( + "App::Property", + "Percentage modifier to apply to feed rate while entering and exiting", + ), + ) obj.Proxy = self def dumps(self): @@ -179,6 +188,7 @@ class ObjectDressup: obj.LeadOut = True obj.AngleIn = 90 obj.AngleOut = 90 + obj.FeedRatePercent = 100 obj.InvertIn = False obj.InvertOut = False obj.RapidPlunge = False @@ -251,7 +261,7 @@ class ObjectDressup: ) return - self.horizFeed = self.toolController.HorizFeed.Value + self.horizFeed = self.toolController.HorizFeed.Value * obj.FeedRatePercent / 100 self.vertFeed = self.toolController.VertFeed.Value obj.Path = self.generateLeadInOutCurve(obj) @@ -419,6 +429,18 @@ class ObjectDressup: obj.setEditorMode(k + "In", 2 if obj.StyleIn in v else 0) obj.setEditorMode(k + "Out", 2 if obj.StyleOut in v else 0) + if not hasattr(obj, "FeedRatePercent"): + obj.addProperty( + "App::PropertyInteger", + "FeedRatePercent", + "Path", + QT_TRANSLATE_NOOP( + "App::Property", + "Percentage modifier to apply to feed rate while entering and exiting", + ), + ) + obj.FeedRatePercent = 100 + # Get direction for lead-in/lead-out in XY plane def getLeadDir(self, obj, invert=False): output = math.pi / 2 @@ -1188,6 +1210,9 @@ class TaskDressupLeadInOut(SimpleEditPanel): def setupSpinBoxes(self): self.connectWidget("InvertIn", self.form.chkInvertDirectionIn) self.connectWidget("InvertOut", self.form.chkInvertDirectionOut) + self.connectWidget("FeedRatePercent", self.form.dspFeedRatePercent) + self.connectWidget("PercentageRadiusIn", self.form.dspPercentageRadiusIn) + self.connectWidget("PercentageRadiusOut", self.form.dspPercentageRadiusOut) self.connectWidget("StyleIn", self.form.cboStyleIn) self.connectWidget("StyleOut", self.form.cboStyleOut) self.radiusIn = PathGuiUtil.QuantitySpinBox(self.form.dspRadiusIn, self.obj, "RadiusIn") diff --git a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py index 044fb53684..e13f76f56c 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py +++ b/src/Mod/CAM/Path/Dressup/Gui/RampEntry.py @@ -188,7 +188,7 @@ class ObjectDressup: QT_TRANSLATE_NOOP("App::Property", "Which feed rate to use for ramping"), ) obj.addProperty( - "App::PropertyPercent", + "App::PropertyInteger", "FeedRatePercent", "FeedRate", QT_TRANSLATE_NOOP( @@ -316,7 +316,7 @@ class ObjectDressup: def onDocumentRestored(self, obj): if not hasattr(obj, "FeedRatePercent"): obj.addProperty( - "App::PropertyPercent", + "App::PropertyInteger", "FeedRatePercent", "FeedRate", QT_TRANSLATE_NOOP(