- fixed issue with not being able to mill holes in a Excellon object part of a loaded project (JSON serialization makes all keys in dictionary strings so I had to make sure that the obj.tools dict keys are made integers on project reconstruction)
This commit is contained in:
@@ -16,6 +16,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- fixed parseDXF() class imports to work with newer versions of ezdxf module (starting with 0.15) - contribution of Maurizio D'Addona and Hans Boot
|
- fixed parseDXF() class imports to work with newer versions of ezdxf module (starting with 0.15) - contribution of Maurizio D'Addona and Hans Boot
|
||||||
- fixed a string ("Penelization Reference") by Hans Boot contribution.
|
- fixed a string ("Penelization Reference") by Hans Boot contribution.
|
||||||
- fixed a string ("Penelization Reference") translations by Hans Boot contribution.
|
- fixed a string ("Penelization Reference") translations by Hans Boot contribution.
|
||||||
|
- fixed issue with not being able to mill holes in a Excellon object part of a loaded project (JSON serialization makes all keys in dictionary strings so I had to make sure that the obj.tools dict keys are made integers on project reconstruction)
|
||||||
|
|
||||||
30.12.2020
|
30.12.2020
|
||||||
|
|
||||||
|
|||||||
29
app_Main.py
29
app_Main.py
@@ -11024,16 +11024,31 @@ class MenuFileHandlers(QtCore.QObject):
|
|||||||
self.log.debug(" **************** Started PROEJCT loading... **************** ")
|
self.log.debug(" **************** Started PROEJCT loading... **************** ")
|
||||||
|
|
||||||
for obj in d['objs']:
|
for obj in d['objs']:
|
||||||
def obj_init(obj_inst, app_inst):
|
|
||||||
try:
|
|
||||||
obj_inst.from_dict(obj)
|
|
||||||
except Exception as erro:
|
|
||||||
app_inst.log.error('MenuFileHandlers.open_project() --> ' + str(erro))
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
"Recreating from opened project an %s object: %s" % (obj['kind'].capitalize(), obj['options']['name']))
|
"Recreating from opened project an %s object: %s" % (obj['kind'].capitalize(), obj['options']['name']))
|
||||||
|
|
||||||
|
def obj_init(new_obj, app_inst):
|
||||||
|
|
||||||
|
def worker_task():
|
||||||
|
with app_inst.proc_container.new('%s...' % _("Opening")):
|
||||||
|
try:
|
||||||
|
new_obj.from_dict(obj)
|
||||||
|
|
||||||
|
# try to make the keys in the tools dictionary to be integers
|
||||||
|
# JSON serialization makes them strings
|
||||||
|
# not all FlatCAM objects have the 'tools' dictionary attribute
|
||||||
|
try:
|
||||||
|
new_obj.tools = {
|
||||||
|
int(tool): tool_dict for tool, tool_dict in list(new_obj.tools.items())
|
||||||
|
}
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
except Exception as erro:
|
||||||
|
app_inst.log.error('MenuFileHandlers.open_project() --> ' + str(erro))
|
||||||
|
return 'fail'
|
||||||
|
|
||||||
|
app_inst.worker_task.emit({'fcn': worker_task, 'params': []})
|
||||||
|
|
||||||
# for some reason, setting ui_title does not work when this method is called from Tcl Shell
|
# for some reason, setting ui_title does not work when this method is called from Tcl Shell
|
||||||
# it's because the TclCommand is run in another thread (it inherit TclCommandSignaled)
|
# it's because the TclCommand is run in another thread (it inherit TclCommandSignaled)
|
||||||
if cli is None:
|
if cli is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user