diff --git a/FlatCAMObj.py b/FlatCAMObj.py index cbb4a83b..2e466d78 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -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 diff --git a/README.md b/README.md index 9e4ab4c3..d8c3dbb6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/flatcamParsers/ParseExcellon.py b/flatcamParsers/ParseExcellon.py index fb024bf4..a82cf401 100644 --- a/flatcamParsers/ParseExcellon.py +++ b/flatcamParsers/ParseExcellon.py @@ -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.