diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-19 22:23:00 -0400 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-19 22:23:00 -0400 |
commit | 18e3b87625ddb739faeddffcaed48e12db6c7e8b (patch) | |
tree | 8b27aa49e431d67e4940d053c2fd640854bd945a /gerber/cam.py | |
parent | 6d2db67e6d0973ce26ce3a6700ca44295f73fea7 (diff) | |
download | gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.tar.gz gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.tar.bz2 gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.zip |
Test update
Diffstat (limited to 'gerber/cam.py')
-rw-r--r-- | gerber/cam.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gerber/cam.py b/gerber/cam.py index 4c19588..051c3b5 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -59,6 +59,33 @@ class FileSettings(object): else: raise KeyError() + def __setitem__(self, key, value): + if key == 'notation': + if value not in ['absolute', 'incremental']: + raise ValueError('Notation must be either \ + absolute or incremental') + self.notation = value + elif key == 'units': + if value not in ['inch', 'metric']: + raise ValueError('Units must be either inch or metric') + self.units = value + elif key == 'zero_suppression': + if value not in ['leading', 'trailing']: + raise ValueError('Zero suppression must be either leading or \ + trailling') + self.zero_suppression = value + elif key == 'format': + if len(value) != 2: + raise ValueError('Format must be a tuple(n=2) of integers') + self.format = value + + def __eq__(self, other): + return (self.notation == other.notation and + self.units == other.units and + self.zero_suppression == other.zero_suppression and + self.format == other.format) + + class CamFile(object): """ Base class for Gerber/Excellon files. @@ -127,6 +154,12 @@ class CamFile(object): return FileSettings(self.notation, self.units, self.zero_suppression, self.format) + @property + def bounds(self): + """ File baundaries + """ + pass + def render(self, ctx, filename=None): """ Generate image of layer. |