Crash when opening cutout tool (with fix)
Issue #602
new
Hi there, I’m new to FlatCam but I’ll try to give as much usable detail as possible.
My install details:
OS: Arch Linux (installed via the flatcam-git AUR package)
Python: 3.10
FlatCam: 8.994 Beta
I am getting the following traceback when clicking on the ‘Cutout Tool’ button, after selecting a Gerber file and going to Properties:
WARNING: Traceback (most recent call last):
File "/opt/flatcam/appTools/ToolCutOut.py", line 154, in run
self.set_tool_ui()
File "/opt/flatcam/appTools/ToolCutOut.py", line 246, in set_tool_ui
self.on_tool_add(custom_dia=tool_dia)
File "/opt/flatcam/appTools/ToolCutOut.py", line 358, in on_tool_add
self.on_tool_default_add()
File "/opt/flatcam/appTools/ToolCutOut.py", line 454, in on_tool_default_add
self.update_ui(self.default_data)
File "/opt/flatcam/appTools/ToolCutOut.py", line 263, in update_ui
self.ui.mpass_cb.set_value(float(tool_dict["tools_cutout_mdepth"]))
File "/opt/flatcam/appGUI/GUIElements.py", line 1520, in set_value
self.setChecked(val)
TypeError: setChecked(self, bool): argument 1 has unexpected type 'float'
/usr/bin/flatcam: line 3: 86852 Aborted
To fix this, on my machine I have simply changed the file appTools/ToolCutOut.py
on line 236 from
self.ui.mpass_cb.set_value(float(tool_dict["tools_cutout_mdepth"]))
to
self.ui.mpass_cb.set_value(bool(tool_dict["tools_cutout_mdepth"]))
The modification is to simply change the cast from float to bool.
I couldn’t actually find that file in the source code for this repo, otherwise I would have submitted a pull request to fix it.
Hi,
This is my fork of FlatCAM where I work on it: https://bitbucket.org/marius_stanciu/flatcam_beta/branches/
I only push changes here when I’m ready for a release. And I think this issue has been fixed a while back.
But thanks for the report!