FlatCAM 8.994 Beta, milling drills issue.
FlatCAM cannot create a drill milling geometry when data is loaded from an existing project- the application crashes. When you open a fresh Excellon file, a milling geometry object can be produced without any issues. I traced down the issue. The problem is that in some places (ParseExcellon.py, FlatCAMExcellon.py, FlatCAMGeometry.py) the tool container of objects self.tools[] is indexed using integers and string in different places. I’m not a Python developer, but I was able to change indexes to strings in all places and that fixed the issue.
Comments (6)
-
reporter -
I think that the issue is related to the fact that FlatCAM stores tool index as strings in a project file. When this value is deserialized back it is a string type. The index value was an integer type before it was serialized into the file.
True.
-
Hello,
The issue seems to be due to simplejson always stringifying integer key. Possibly one workaround is to convert tools keys back to integer when reading deserialized JSON objects. Please see the following pull request for the proposed fixes: https://bitbucket.org/jpcgt/flatcam/pull-requests/340/issue-495-milling-drills-issue
-
Helo Maksym,
you are right about this, just as Oleh mentioned it also. But I can’t pull in this PR because it is not complete. The solution should be implemented in the deserialization for all the objects and that require careful evaluation all over the app. The Gerber object self.apertures should be processed too.
But I think that at some point I am going to replace the self.apertures with a self.tools so there is a sort of uniformity for all the app objects. I will have to think and plan this because those attributes hold almost all the data structures. -
Hey i do have some error with panelized drilling too
[ERROR] An internal error has occurred. See shell. Object (excellon) failed because: 'App' object has no attribute 'export' Traceback (most recent call last): File "D:\1.DEV\FlatCAM_beta\appObjects\AppObject.py", line 162, in new_object File "D:\1.DEV\FlatCAM_beta\appTools\ToolPanelize.py", line 364, in job_init_excellon AttributeError: 'App' object has no attribute 'export'
-
@Wiktor this I think is called thread hijack? You should open your own bitbucket issue because the problem you have has nothing to do with the one the OP presented.
- Log in to comment
I think that the issue is related to the fact that FlatCAM stores tool index as strings in a project file. When this value is deserialized back it is a string type. The index value was an integer type before it was serialized into the file.