Merge pull request #25570 from Connor9220/FixChipLoad

CAM: Ensure Chipload is restored and displayed with user-preferred units
This commit is contained in:
sliptonic
2025-11-23 12:42:24 -06:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -181,6 +181,8 @@ class ToolBit(Asset, ABC):
# Update parameters.
for param_name, param_value in params.items():
tool_bit_shape.set_parameter(param_name, param_value)
if hasattr(toolbit.obj, param_name):
PathUtil.setProperty(toolbit.obj, param_name, param_value)
# Update attributes; the separation between parameters and attributes
# is currently not well defined, so for now we add them to the

View File

@@ -55,6 +55,16 @@ class ToolBitPropertiesWidget(QtGui.QWidget):
self._show_shape = icon
self._tool_no = tool_no
# Set schema to user preference if no document is open
# TODO: Add a preference for toolbit unit schema.
# We probably want to look at making it possible to have a toolbit be metric
# or imperial regardless of document settings / or user preferences, but for now this is sufficient.
if FreeCAD.ActiveDocument is None:
pref_schema = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt(
"UserSchema", 0
)
FreeCAD.Units.setSchema(pref_schema)
# UI Elements
self._label_edit = QtGui.QLineEdit()
self._id_label = QtGui.QLabel() # Read-only ID