From 0f1d1c3a29017ea82e1f0f7795798405ef346706 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sat, 5 Mar 2016 14:56:08 +0800 Subject: Remove some testing code from gerber writer. More implementation for excellon writer - not working yet --- gerber/excellon_statements.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gerber/excellon_statements.py') 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' @@ -321,6 +337,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 -- cgit