summaryrefslogtreecommitdiff
path: root/gerbonara/excellon.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-02-06 16:48:10 +0100
committerjaseg <git@jaseg.de>2022-02-06 16:48:10 +0100
commitc31aabc227333d79ad6e09e293a5da98a1ccf543 (patch)
tree9b89924926fe304c77983a7782079895379fa210 /gerbonara/excellon.py
parenta0a89a8182f5480cbde212998f581beb8c31ffc2 (diff)
downloadgerbonara-c31aabc227333d79ad6e09e293a5da98a1ccf543.tar.gz
gerbonara-c31aabc227333d79ad6e09e293a5da98a1ccf543.tar.bz2
gerbonara-c31aabc227333d79ad6e09e293a5da98a1ccf543.zip
Make parse_coord faster
Diffstat (limited to 'gerbonara/excellon.py')
-rwxr-xr-xgerbonara/excellon.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gerbonara/excellon.py b/gerbonara/excellon.py
index 721fcca..f3e2d64 100755
--- a/gerbonara/excellon.py
+++ b/gerbonara/excellon.py
@@ -725,6 +725,15 @@ class ExcellonParser(object):
self.generator_hints.append('zuken')
def do_move(self, match=None, x='X', y='Y'):
+ if self.settings.number_format == (None, None) and not '.' in match['X']:
+ # TARGET3001! exports zeros as "00" even when it uses an explicit decimal point everywhere else.
+ if match['X'] != '00':
+ raise SyntaxError('No number format set and value does not contain a decimal point. If this is an Allegro '
+ 'Excellon drill file make sure either nc_param.txt or ncdrill.log ends up in the same folder as '
+ 'it, because Allegro does not include this critical information in their Excellon output. If you '
+ 'call this through ExcellonFile.from_string, you must manually supply from_string with a '
+ 'FileSettings object from excellon.parse_allegro_ncparam.')
+
x = self.settings.parse_gerber_value(match['X'])
y = self.settings.parse_gerber_value(match['Y'])