- moved default_data data update from Excellon parser to the Excellon object constructor

This commit is contained in:
Marius Stanciu 2020-01-16 16:55:34 +02:00
parent b71d4e8c45
commit c417030896
3 changed files with 12 additions and 11 deletions

View File

@ -2269,6 +2269,17 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
# dict to hold the tool number as key and tool offset as value
self.tool_offset = dict()
# default set of data to be added to each tool in self.tools as self.tools[tool]['data'] = self.default_data
self.default_data = dict()
# fill in self.default_data values from self.options
for opt_key, opt_val in self.app.options.items():
if opt_key.find('excellon_') == 0:
self.default_data[opt_key] = deepcopy(opt_val)
for opt_key, opt_val in self.app.options.items():
if opt_key.find('geometry_') == 0:
self.default_data[opt_key] = deepcopy(opt_val)
# variable to store the total amount of drills per job
self.tot_drill_cnt = 0
self.tool_row = 0

View File

@ -19,6 +19,7 @@ CAD program, and create G-Code for Isolation routing.
- put bases for future changes to Excellon Object UI such that each tool will hold it's own parameters
- in ParseExcellon.Excellon the self.tools dict has now a key 'data' which holds a dict with all the default values for Excellon and Geometry
- Excellon and Geometry objects, when started with multiple tools selected, the parameters tool name reflect this situation
- moved default_data data update from Excellon parser to the Excellon object constructor
15.01.2020

View File

@ -121,9 +121,6 @@ class Excellon(Geometry):
self.zeros_found = deepcopy(self.zeros)
self.units_found = deepcopy(self.units)
# default set of data to be added to each tool in self.tools as self.tools[tool]['data'] = self.default_data
self.default_data = dict()
# this will serve as a default if the Excellon file has no info regarding of tool diameters (this info may be
# in another file like for PCB WIzard ECAD software
self.toolless_diam = 1.0
@ -264,14 +261,6 @@ class Excellon(Geometry):
except Exception:
return "fail"
# fill in self.default_data values from self.options
for opt_key, opt_val in self.app.options.items():
if opt_key.find('excellon_') == 0:
self.default_data[opt_key] = deepcopy(opt_val)
for opt_key, opt_val in self.app.options.items():
if opt_key.find('geometry_') == 0:
self.default_data[opt_key] = deepcopy(opt_val)
def parse_lines(self, elines):
"""
Main Excellon parser.