update lead in/out to use feed rate from tool controller

This commit is contained in:
David Kaufman
2025-09-03 12:42:45 -04:00
parent 093152b1dc
commit f7dc85ef29
3 changed files with 61 additions and 105 deletions

View File

@@ -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"):