summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/cam.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-12-30 16:40:14 +0100
committerjaseg <git@jaseg.de>2021-12-30 16:40:14 +0100
commitf4b2e74923cc95c683cd7f5c4732d92e4aafd3ba (patch)
treef713a247d3cc2c11463be1af54ff42b0cd9dfb44 /gerbonara/gerber/cam.py
parente4941dd5e371e8c9e729a72b8ec30d021bceb0cc (diff)
downloadgerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.tar.gz
gerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.tar.bz2
gerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.zip
Fix rotation bugs, all tests run through
Diffstat (limited to 'gerbonara/gerber/cam.py')
-rw-r--r--gerbonara/gerber/cam.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gerbonara/gerber/cam.py b/gerbonara/gerber/cam.py
index d00194b..fa38382 100644
--- a/gerbonara/gerber/cam.py
+++ b/gerbonara/gerber/cam.py
@@ -31,19 +31,19 @@ class FileSettings:
`zeros='trailing'`
'''
notation : str = 'absolute'
- units : str = 'inch'
- angle_units : str = 'degrees'
+ unit : str = 'inch'
+ angle_unit : str = 'degree'
zeros : bool = None
number_format : tuple = (2, 5)
# input validation
def __setattr__(self, name, value):
- if name == 'units' and value not in ['inch', 'mm']:
- raise ValueError(f'Units must be either "inch" or "mm", not {value}')
+ if name == 'unit' and value not in ['inch', 'mm']:
+ raise ValueError(f'Unit must be either "inch" or "mm", not {value}')
elif name == 'notation' and value not in ['absolute', 'incremental']:
raise ValueError(f'Notation must be either "absolute" or "incremental", not {value}')
- elif name == 'angle_units' and value not in ('degrees', 'radians'):
- raise ValueError(f'Angle units may be "degrees" or "radians", not {value}')
+ elif name == 'angle_unit' and value not in ('degree', 'radian'):
+ raise ValueError(f'Angle unit may be "degree" or "radian", not {value}')
elif name == 'zeros' and value not in [None, 'leading', 'trailing']:
raise ValueError(f'zeros must be either "leading" or "trailing" or None, not {value}')
elif name == 'number_format':
@@ -60,7 +60,7 @@ class FileSettings:
return deepcopy(self)
def __str__(self):
- return f'<File settings: units={self.units}/{self.angle_units} notation={self.notation} zeros={self.zeros} number_format={self.number_format}>'
+ return f'<File settings: unit={self.unit}/{self.angle_unit} notation={self.notation} zeros={self.zeros} number_format={self.number_format}>'
def parse_gerber_value(self, value):
if not value: