summaryrefslogtreecommitdiff
path: root/gerber/excellon_statements.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-03-05 14:56:08 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-03-05 14:56:08 +0800
commit0f1d1c3a29017ea82e1f0f7795798405ef346706 (patch)
tree605a4c07276e5d63dd249cf2feec0fe83f560a2f /gerber/excellon_statements.py
parent5cb60d6385f167e814df7a608321a4f33da0e193 (diff)
downloadgerbonara-0f1d1c3a29017ea82e1f0f7795798405ef346706.tar.gz
gerbonara-0f1d1c3a29017ea82e1f0f7795798405ef346706.tar.bz2
gerbonara-0f1d1c3a29017ea82e1f0f7795798405ef346706.zip
Remove some testing code from gerber writer. More implementation for excellon writer - not working yet
Diffstat (limited to 'gerber/excellon_statements.py')
-rw-r--r--gerber/excellon_statements.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/gerber/excellon_statements.py b/gerber/excellon_statements.py
index d2ba233..66641a1 100644
--- a/gerber/excellon_statements.py
+++ b/gerber/excellon_statements.py
@@ -220,6 +220,22 @@ class ExcellonTool(ExcellonStatement):
def _hit(self):
self.hit_count += 1
+
+ def equivalent(self, other):
+ """
+ Is the other tool equal to this, ignoring the tool number, and other file specified properties
+ """
+
+ if type(self) != type(other):
+ return False
+
+ return (self.diameter == other.diameter
+ and self.feed_rate == other.feed_rate
+ and self.retract_rate == other.retract_rate
+ and self.rpm == other.rpm
+ and self.depth_offset == other.depth_offset
+ and self.max_hit_count == other.max_hit_count
+ and self.settings.units == other.settings.units)
def __repr__(self):
unit = 'in.' if self.settings.units == 'inch' else 'mm'
@@ -322,6 +338,10 @@ class ZAxisInfeedRateStmt(ExcellonStatement):
class CoordinateStmt(ExcellonStatement):
@classmethod
+ def from_point(cls, point):
+ return cls(point[0], point[1])
+
+ @classmethod
def from_excellon(cls, line, settings, **kwargs):
x_coord = None
y_coord = None