Added support for M71/72 in Excellon parser.

This commit is contained in:
jpcaram
2015-01-11 18:28:59 -05:00
parent 207842f98f
commit 1b154ab057

View File

@@ -1880,15 +1880,27 @@ class Excellon(Geometry):
### Cleanup lines
eline = eline.strip(' \r\n')
## Header Begin (M48) / End (M95) ##
## Header Begin (M48) ##
if self.hbegin_re.search(eline):
in_header = True
continue
## Header End ##
if self.hend_re.search(eline):
in_header = False
continue
## Alternative units format M71/M72
# Supposed to be just in the body (yes, the body)
# but some put it in the header (PADS for example).
# Will detect anywhere. Occurrence will change the
# object's units.
match = self.meas_re.match(eline)
if match:
self.units = {"1": "MM", "2": "IN"}[match.group(1)]
log.debug(" Units: %s" % self.units)
continue
#### Body ####
if not in_header: