diff options
author | jaseg <git@jaseg.de> | 2022-01-17 23:14:52 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-01-17 23:14:52 +0100 |
commit | 73a44901c0ef0e94e9465c2f35750ca6f85a4473 (patch) | |
tree | a5c66526a38fe5a4e3d004dc7127680b6d0e25c6 /gerbonara/gerber/cam.py | |
parent | 336a18fb493c79824323a59865083a0037a4a2f4 (diff) | |
download | gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.gz gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.bz2 gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.zip |
Excellon, unit conversion WIP
Diffstat (limited to 'gerbonara/gerber/cam.py')
-rw-r--r-- | gerbonara/gerber/cam.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gerbonara/gerber/cam.py b/gerbonara/gerber/cam.py index f42c24d..42a5848 100644 --- a/gerbonara/gerber/cam.py +++ b/gerbonara/gerber/cam.py @@ -80,6 +80,8 @@ class FileSettings: # Format precision integer_digits, decimal_digits = self.number_format + if integer_digits is None or decimal_digits is None: + raise SyntaxError('No number format set and value does not contain a decimal point') # Remove extraneous information sign = '-' if value[0] == '-' else '' @@ -99,6 +101,10 @@ class FileSettings: value = self.unit.from(unit, value) integer_digits, decimal_digits = self.number_format + if integer_digits is None: + integer_digits = 3 + if decimal_digits is None: + decimal_digits = 3 # negative sign affects padding, so deal with it at the end... sign = '-' if value < 0 else '' |