From f7dc85ef29ce767f09685dc8a14336fb6b4c8bae Mon Sep 17 00:00:00 2001 From: David Kaufman Date: Wed, 3 Sep 2025 12:42:45 -0400 Subject: [PATCH] update lead in/out to use feed rate from tool controller --- .../Resources/panels/DressUpLeadInOutEdit.ui | 58 ------------------ src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py | 49 +-------------- src/Mod/CAM/Path/Tool/Controller.py | 59 +++++++++++++++++++ 3 files changed, 61 insertions(+), 105 deletions(-) diff --git a/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui b/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui index 39211d2045..26e44139c1 100644 --- a/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui +++ b/src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui @@ -175,64 +175,6 @@ - - - Entrance Feed Rate Percent - - - - - - - Feed rate to use when entering a cut, as a percentage of the normal feed rate. - - - 0 - - - 1.000000000000000 - - - 999999.000000000000000 - - - 5.000000000000000 - - - - - - - - - - Exit Feed Rate Percent - - - - - - - Feed rate to use when exiting a cut, as a percentage of the normal feed rate. - - - 0 - - - 1.000000000000000 - - - 999999.000000000000000 - - - 5.000000000000000 - - - - - - - diff --git a/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py b/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py index 0f8df380e3..3520545e8b 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py +++ b/src/Mod/CAM/Path/Dressup/Gui/LeadInOut.py @@ -162,24 +162,6 @@ class ObjectDressup: "Path Lead-out", QT_TRANSLATE_NOOP("App::Property", "Move end point"), ) - obj.addProperty( - "App::PropertyInteger", - "FeedRatePercentIn", - "Path", - QT_TRANSLATE_NOOP( - "App::Property", - "Percentage modifier to apply to feed rate while entering the cut", - ), - ) - obj.addProperty( - "App::PropertyInteger", - "FeedRatePercentOut", - "Path", - QT_TRANSLATE_NOOP( - "App::Property", - "Percentage modifier to apply to feed rate while exiting the cut", - ), - ) obj.Proxy = self def dumps(self): @@ -197,8 +179,6 @@ class ObjectDressup: obj.LeadOut = True obj.AngleIn = 90 obj.AngleOut = 90 - obj.FeedRatePercentIn = 100 - obj.FeedRatePercentOut = 100 obj.InvertIn = False obj.InvertOut = False obj.RapidPlunge = False @@ -273,8 +253,8 @@ class ObjectDressup: self.horizFeed = self.toolController.HorizFeed.Value self.vertFeed = self.toolController.VertFeed.Value - self.entranceFeed = self.horizFeed * obj.FeedRatePercentIn / 100 - self.exitFeed = self.horizFeed * obj.FeedRatePercentOut / 100 + self.entranceFeed = self.toolController.LeadInFeed.Value + self.exitFeed = self.toolController.LeadOutFeed.Value obj.Path = self.generateLeadInOutCurve(obj) @@ -441,29 +421,6 @@ 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, "FeedRatePercentIn"): - obj.addProperty( - "App::PropertyInteger", - "FeedRatePercentIn", - "Path", - QT_TRANSLATE_NOOP( - "App::Property", - "Percentage modifier to apply to feed rate while entering the cut", - ), - ) - obj.FeedRatePercentIn = 100 - if not hasattr(obj, "FeedRatePercentOut"): - obj.addProperty( - "App::PropertyInteger", - "FeedRatePercentOut", - "Path", - QT_TRANSLATE_NOOP( - "App::Property", - "Percentage modifier to apply to feed rate while exiting the cut", - ), - ) - obj.FeedRatePercentOut = 100 - # Get direction for lead-in/lead-out in XY plane def getLeadDir(self, obj, invert=False): output = math.pi / 2 @@ -1245,8 +1202,6 @@ class TaskDressupLeadInOut(SimpleEditPanel): def setupSpinBoxes(self): self.connectWidget("InvertIn", self.form.chkInvertDirectionIn) self.connectWidget("InvertOut", self.form.chkInvertDirectionOut) - self.connectWidget("FeedRatePercentIn", self.form.dspFeedRatePercentIn) - self.connectWidget("FeedRatePercentOut", self.form.dspFeedRatePercentOut) self.connectWidget("PercentageRadiusIn", self.form.dspPercentageRadiusIn) self.connectWidget("PercentageRadiusOut", self.form.dspPercentageRadiusOut) self.connectWidget("StyleIn", self.form.cboStyleIn) diff --git a/src/Mod/CAM/Path/Tool/Controller.py b/src/Mod/CAM/Path/Tool/Controller.py index d76b8f9c07..133a7582eb 100644 --- a/src/Mod/CAM/Path/Tool/Controller.py +++ b/src/Mod/CAM/Path/Tool/Controller.py @@ -106,6 +106,31 @@ class ToolController: "Rapid", QT_TRANSLATE_NOOP("App::Property", "Rapid rate for horizontal moves"), ) + + obj.addProperty( + "App::PropertySpeed", + "RampFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for ramp moves"), + ) + obj.setExpression("RampFeed", "HorizFeed") + + obj.addProperty( + "App::PropertySpeed", + "LeadInFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for lead-in moves"), + ) + obj.setExpression("LeadInFeed", "HorizFeed") + + obj.addProperty( + "App::PropertySpeed", + "LeadOutFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for lead-out moves"), + ) + obj.setExpression("LeadOutFeed", "HorizFeed") + obj.setEditorMode("Placement", 2) for n in self.propertyEnumerations(): @@ -166,6 +191,40 @@ class ToolController: obj.setEditorMode("Placement", 2) + needsRecompute = False + if not hasattr(obj, "RampFeed"): + obj.addProperty( + "App::PropertySpeed", + "RampFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for ramp moves"), + ) + obj.setExpression("RampFeed", "HorizFeed") + needsRecompute = True + + if not hasattr(obj, "LeadInFeed"): + obj.addProperty( + "App::PropertySpeed", + "LeadInFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for lead-in moves"), + ) + obj.setExpression("LeadInFeed", "HorizFeed") + needsRecompute = True + + if not hasattr(obj, "LeadOutFeed"): + obj.addProperty( + "App::PropertySpeed", + "LeadOutFeed", + "Feed", + QT_TRANSLATE_NOOP("App::Property", "Feed rate for lead-out moves"), + ) + obj.setExpression("LeadOutFeed", "HorizFeed") + needsRecompute = True + + if needsRecompute: + obj.recompute() + def onDelete(self, obj, arg2=None): if hasattr(obj.Tool, "InList") and len(obj.Tool.InList) == 1: if hasattr(obj.Tool.Proxy, "onDelete"):