diff options
author | jaseg <git@jaseg.de> | 2022-01-24 14:23:45 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-01-24 14:23:45 +0100 |
commit | b95c2baaf201b6a02ad680e535bd557321b3087b (patch) | |
tree | aa323bf30479ac2f2b94cad8cd21ee9ef9fba2cc /gerbonara/gerber/rs274x.py | |
parent | a1c1d6d971257f03f1926db9dc44e659d2773d2d (diff) | |
download | gerbonara-b95c2baaf201b6a02ad680e535bd557321b3087b.tar.gz gerbonara-b95c2baaf201b6a02ad680e535bd557321b3087b.tar.bz2 gerbonara-b95c2baaf201b6a02ad680e535bd557321b3087b.zip |
Add new test files
Diffstat (limited to 'gerbonara/gerber/rs274x.py')
-rw-r--r-- | gerbonara/gerber/rs274x.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gerbonara/gerber/rs274x.py b/gerbonara/gerber/rs274x.py index 859a29e..fe85c09 100644 --- a/gerbonara/gerber/rs274x.py +++ b/gerbonara/gerber/rs274x.py @@ -295,6 +295,7 @@ class GraphicsState: self.file_settings = file_settings self.aperture_map = aperture_map or {} self.warn = warn + self.unit_warning = False def __setattr__(self, name, value): # input validation @@ -362,6 +363,9 @@ class GraphicsState: return rx, ry def flash(self, x, y, attrs=None): + if self.file_settings.unit is None and not self.unit_warning: + self.warn('Gerber file does not contain a unit definition.') + self.unit_warning = True attrs = attrs or {} self.update_point(x, y) return go.Flash(*self.map_coord(*self.point), self.aperture, @@ -375,6 +379,10 @@ class GraphicsState: self.point = (0, 0) old_point = self.map_coord(*self.update_point(x, y)) + if self.file_settings.unit is None and not self.unit_warning: + self.warn('Gerber file does not contain a unit definition.') + self.unit_warning = True + if aperture: if not self.aperture: raise SyntaxError('Interpolation attempted without selecting aperture first') |