fix bugs, clean up

This commit is contained in:
David Kaufman
2025-09-10 14:32:15 -04:00
parent e464cdb73d
commit 6f62d69b9f
4 changed files with 12 additions and 19 deletions

View File

@@ -124,7 +124,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::QuantitySpinBox" name="leadinFeed">
<widget class="Gui::QuantitySpinBox" name="leadInFeed">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -146,14 +146,14 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_leadoutFeed">
<widget class="QLabel" name="label_leadOutFeed">
<property name="text">
<string>Lead-out feed</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::QuantitySpinBox" name="leadoutFeed">
<widget class="Gui::QuantitySpinBox" name="leadOutFeed">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>

View File

@@ -278,7 +278,6 @@ class ObjectDressup:
if hasattr(obj, "RampFeedRate"):
obj.Proxy.RampFeedRate = obj.RampFeedRate
obj.removeProperty("RampFeedRate")
print("delete RampFeedRate", obj.Label)
if hasattr(obj, "CustomFeedRate"):
tmp = obj.CustomFeedRate.Value
@@ -287,7 +286,6 @@ class ObjectDressup:
tmp = exp
obj.Proxy.CustomFeedRate = tmp
obj.removeProperty("CustomFeedRate")
print("delete CustomFeedRate", obj.Label)
def setup(self, obj):
obj.Angle = 60

View File

@@ -66,10 +66,8 @@ def _migrateRampDressups(tc):
# Enumerate ramp dressups using this TC and their feed rates
ramps = set()
job_ramp_feeds = []
print("search tc", tc.Name)
for job in tc.Document.Objects:
if hasattr(job, "Operations") and hasattr(job.Operations, "Group"):
print("job", job.Name)
for op in job.Operations.Group:
for ramp in [op] + op.OutListRecursive:
try:
@@ -87,7 +85,7 @@ def _migrateRampDressups(tc):
if prop == "CustomFeedRate":
customFeedRate = exp
else:
ramp.Proxy.CustomFeedRate
customFeedRate = ramp.Proxy.CustomFeedRate
if op.Base.ToolController == tc:
ramps.add(ramp)
@@ -101,12 +99,10 @@ def _migrateRampDressups(tc):
else:
feed = customFeedRate
job_ramp_feeds.append((job, ramp, feed))
print("add", ramp.Label)
except:
pass
# Ensure there is a TC for each required feed, starting with this one
print("job_ramp_feeds", job_ramp_feeds)
feed_to_tc = {}
for i, (job, ramp, feed) in enumerate(job_ramp_feeds):
if feed in feed_to_tc:
@@ -116,9 +112,9 @@ def _migrateRampDressups(tc):
opTc = tc
else:
opTc = copyTC(tc, job)
# Note: C++ doesn't make an effort to deduplicate the Labels of
# objects created during document restore, so here we will reuse the
# (deduplicated) name as the label
# Note: C++ doesn't try to deduplicate the Labels of objects created
# during document restore, so here we will reuse the (deduplicated)
# name as the label
opTc.Label = opTc.Name
feed_to_tc[feed] = opTc
@@ -128,11 +124,11 @@ def _migrateRampDressups(tc):
else:
opTc.setExpression("RampFeed", None)
opTc.RampFeed = feed
opTc.recompute()
if opTc is not tc:
opTc.recompute()
# Loop over ramps and assign each one the appropriate TC
for _, ramp, feed in job_ramp_feeds:
print("assign", ramp.Name, feed_to_tc[feed].Name)
ramp.Base.ToolController = feed_to_tc[feed]
@@ -483,7 +479,6 @@ def copyTC(tc, job):
for prop in tc.PropertiesList:
try:
if prop not in ["Label", "Label2"]:
print("set prop", prop, getattr(tc, prop))
setattr(newtc, prop, getattr(tc, prop))
except:
pass

View File

@@ -218,11 +218,11 @@ class ToolControllerEditor(object):
PathGuiUtil.populateCombobox(self.controller, enumTups, comboToPropertyMap)
self.vertFeed = PathGuiUtil.QuantitySpinBox(self.controller.vertFeed, obj, "VertFeed")
self.horizFeed = PathGuiUtil.QuantitySpinBox(self.controller.horizFeed, obj, "HorizFeed")
self.leadInFeed = PathGuiUtil.QuantitySpinBox(self.controller.horizFeed, obj, "LeadInFeed")
self.leadInFeed = PathGuiUtil.QuantitySpinBox(self.controller.leadInFeed, obj, "LeadInFeed")
self.leadOutFeed = PathGuiUtil.QuantitySpinBox(
self.controller.horizFeed, obj, "LeadOutFeed"
self.controller.leadOutFeed, obj, "LeadOutFeed"
)
self.rampFeed = PathGuiUtil.QuantitySpinBox(self.controller.horizFeed, obj, "RampFeed")
self.rampFeed = PathGuiUtil.QuantitySpinBox(self.controller.rampFeed, obj, "RampFeed")
self.vertRapid = PathGuiUtil.QuantitySpinBox(self.controller.vertRapid, obj, "VertRapid")
self.horizRapid = PathGuiUtil.QuantitySpinBox(self.controller.horizRapid, obj, "HorizRapid")