summaryrefslogtreecommitdiff
path: root/gerber/excellon_statements.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-03-13 14:27:09 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-03-13 14:27:09 +0800
commit7053d320f0b3e9404edb4c05710001ea58d44995 (patch)
tree63f8a77ea4ee53c9c8bd42737ed46494431f3140 /gerber/excellon_statements.py
parent97924d188bf8fcc7d7537007464e65cbdc8c7bbb (diff)
downloadgerbonara-7053d320f0b3e9404edb4c05710001ea58d44995.tar.gz
gerbonara-7053d320f0b3e9404edb4c05710001ea58d44995.tar.bz2
gerbonara-7053d320f0b3e9404edb4c05710001ea58d44995.zip
Better detection of plated tools
Diffstat (limited to 'gerber/excellon_statements.py')
-rw-r--r--gerber/excellon_statements.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/gerber/excellon_statements.py b/gerber/excellon_statements.py
index 66641a1..18eaea1 100644
--- a/gerber/excellon_statements.py
+++ b/gerber/excellon_statements.py
@@ -111,9 +111,14 @@ class ExcellonTool(ExcellonStatement):
hit_count : integer
Number of tool hits in excellon file.
"""
+
+ PLATED_UNKNOWN = None
+ PLATED_YES = 'plated'
+ PLATED_NO = 'nonplated'
+ PLATED_OPTIONAL = 'optional'
@classmethod
- def from_excellon(cls, line, settings, id=None):
+ def from_excellon(cls, line, settings, id=None, plated=None):
""" Create a Tool from an excellon file tool definition line.
Parameters
@@ -150,6 +155,10 @@ class ExcellonTool(ExcellonStatement):
args['number'] = int(val)
elif cmd == 'Z':
args['depth_offset'] = parse_gerber_value(val, nformat, zero_suppression)
+
+ if plated != ExcellonTool.PLATED_UNKNOWN:
+ # Sometimees we can can parse the
+ args['plated'] = plated
return cls(settings, **args)
@classmethod
@@ -182,6 +191,8 @@ class ExcellonTool(ExcellonStatement):
self.diameter = kwargs.get('diameter')
self.max_hit_count = kwargs.get('max_hit_count')
self.depth_offset = kwargs.get('depth_offset')
+ self.plated = kwargs.get('plated')
+
self.hit_count = 0
def to_excellon(self, settings=None):
@@ -235,6 +246,7 @@ class ExcellonTool(ExcellonStatement):
and self.rpm == other.rpm
and self.depth_offset == other.depth_offset
and self.max_hit_count == other.max_hit_count
+ and self.plated == other.plated
and self.settings.units == other.settings.units)
def __repr__(self):