- added a way to keep compatibility with old projects
This commit is contained in:
@@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- fixed an issue for importing DXF as Geometry when the DXF geometry is a single line
|
- fixed an issue for importing DXF as Geometry when the DXF geometry is a single line
|
||||||
- updated the convert_any2geo() method such that resulting geometry objects have the tools attribute required in the newer versions of the app
|
- updated the convert_any2geo() method such that resulting geometry objects have the tools attribute required in the newer versions of the app
|
||||||
|
- added a way to keep compatibility with old projects
|
||||||
|
|
||||||
21.11.2020
|
21.11.2020
|
||||||
|
|
||||||
|
|||||||
@@ -138,13 +138,15 @@ class AppObject(QtCore.QObject):
|
|||||||
# add some of the FlatCAM Tools related properties
|
# add some of the FlatCAM Tools related properties
|
||||||
if kind == 'excellon':
|
if kind == 'excellon':
|
||||||
for option in self.app.options:
|
for option in self.app.options:
|
||||||
if option.find('tools_drill_') == 0 or option.find('tools_mill_') == 0:
|
if option.find('tools_drill_') == 0:
|
||||||
obj.options[option] = self.app.options[option]
|
obj.options[option] = self.app.options[option]
|
||||||
if kind == 'gerber':
|
if kind == 'gerber':
|
||||||
for option in self.app.options:
|
for option in self.app.options:
|
||||||
if option.find('tools_iso_') == 0 or option.find('tools_mill_') == 0:
|
if option.find('tools_iso_') == 0:
|
||||||
obj.options[option] = self.app.options[option]
|
obj.options[option] = self.app.options[option]
|
||||||
if kind == 'geometry':
|
|
||||||
|
# the milling options should be inherited by all manufacturing objects
|
||||||
|
if kind in ['excellon', 'gerber', 'geometry']:
|
||||||
for option in self.app.options:
|
for option in self.app.options:
|
||||||
if option.find('tools_mill_') == 0:
|
if option.find('tools_mill_') == 0:
|
||||||
obj.options[option] = self.app.options[option]
|
obj.options[option] = self.app.options[option]
|
||||||
|
|||||||
@@ -2230,9 +2230,15 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
|||||||
# if this dict is not empty then the object is an Excellon object
|
# if this dict is not empty then the object is an Excellon object
|
||||||
if self.exc_cnc_tools:
|
if self.exc_cnc_tools:
|
||||||
first_key = next(iter(self.exc_cnc_tools))
|
first_key = next(iter(self.exc_cnc_tools))
|
||||||
include_header = self.app.preprocessors[
|
try:
|
||||||
self.exc_cnc_tools[first_key]['data']['tools_drill_ppname_e']
|
include_header = self.app.preprocessors[
|
||||||
].include_header
|
self.exc_cnc_tools[first_key]['data']['tools_drill_ppname_e']
|
||||||
|
].include_header
|
||||||
|
except KeyError:
|
||||||
|
# for older loaded projects
|
||||||
|
include_header = self.app.preprocessors[
|
||||||
|
self.exc_cnc_tools[first_key]['data']['ppname_e']
|
||||||
|
].include_header
|
||||||
|
|
||||||
gcode = ''
|
gcode = ''
|
||||||
if include_header is False:
|
if include_header is False:
|
||||||
|
|||||||
Reference in New Issue
Block a user