summaryrefslogtreecommitdiff
path: root/gerbonara/aperture_macros/expression.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-11-09 20:08:26 +0100
committerjaseg <git@jaseg.de>2023-11-14 21:52:12 +0100
commit11325b213b6ef7cebcdcf0c79f966cda3ce61a89 (patch)
tree90922e50e32b30fb1d7431de9e48d8b5aa5e51ad /gerbonara/aperture_macros/expression.py
parent74fb384c4c0899f4d6f153da8db748a7a49e78ee (diff)
downloadgerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.tar.gz
gerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.tar.bz2
gerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.zip
Calculate out all aperture macros by default.
There are just too many severely buggy implementations around. Today I ran into problems with both gerbv and with whatever JLC uses. You can still export macros with raw expressions by setting a flag in the export FileSettings.
Diffstat (limited to 'gerbonara/aperture_macros/expression.py')
-rw-r--r--gerbonara/aperture_macros/expression.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/gerbonara/aperture_macros/expression.py b/gerbonara/aperture_macros/expression.py
index c9c0470..7c291cb 100644
--- a/gerbonara/aperture_macros/expression.py
+++ b/gerbonara/aperture_macros/expression.py
@@ -31,9 +31,6 @@ class Expression:
def converted(self, unit):
return self
- def replace_mixed_subexpressions(self, unit):
- return self
-
def calculate(self, variable_binding={}, unit=None):
expr = self.converted(unit).optimized(variable_binding)
if not isinstance(expr, ConstantExpression):
@@ -104,9 +101,6 @@ class UnitExpression(Expression):
def __repr__(self):
return f'<UE {self.expr.to_gerber()} {self.unit}>'
- def replace_mixed_subexpressions(self, unit):
- return self.converted(unit).replace_mixed_subexpressions(unit)
-
def converted(self, unit):
if self.unit is None or unit is None or self.unit == unit:
return self.expr
@@ -198,9 +192,6 @@ class VariableExpression(Expression):
def __eq__(self, other):
return type(self) == type(other) and self.expr == other.expr
- def replace_mixed_subexpressions(self, unit):
- return VariableExpression(self.expr.replace_mixed_subexpressions(unit))
-
def to_gerber(self, register_variable=None, unit=None):
if register_variable is None:
return self.expr.to_gerber(None, unit)
@@ -356,17 +347,6 @@ class OperatorExpression(Expression):
return expr(rv).optimized(variable_binding)
- def replace_mixed_subexpressions(self, unit):
- l = self.l.replace_mixed_subexpressions(unit)
- if l._operator not in (None, self.op):
- l = VariableExpression(self.l)
-
- r = self.r.replace_mixed_subexpressions(unit)
- if r._operator not in (None, self.op):
- r = VariableExpression(self.r)
-
- return OperatorExpression(self.op, l, r)
-
def to_gerber(self, register_variable=None, unit=None):
lval = self.l.to_gerber(register_variable, unit)
rval = self.r.to_gerber(register_variable, unit)