From: Jeff E. <cv...@cv...> - 2007-08-31 14:47:27
|
Modified file emc2/lib/python/rs274/glcanon.py Full file: <http://cvs.linuxcnc.org/cvs/emc2/lib/python/rs274/glcanon.py?rev=1.11> Difference: <http://cvs.linuxcnc.org/cvs/emc2/lib/python/rs274/glcanon.py.diff?r1=1.10;r2=1.11> Branch: TRUNK Log: revision 1.11 date: 2007/08/31 14:47:25; author: jepler; state: Exp; lines: +6 -0 special comments (AXIS,hide) and (AXIS,show) allow parts of the program to be hidden in the preview. This is useful for instance to hide the "probe for tool length" actions; hidden motions also do not contribute to the program bounding box, so this feature must be used with care --- glcanon.py 2007/08/25 01:20:19 1.10 +++ glcanon.py 2007/08/31 14:47:25 1.11 @@ -42,6 +42,7 @@ self.in_arc = 0 self.xo = self.zo = 0 self.dwell_time = 0 + self.suppress = 0 def message(self, message): pass @@ -110,6 +111,7 @@ self.offset_z = offset_z def straight_traverse(self, x,y,z, a,b,c, u, v, w): + if self.suppress: return l = (x + self.offset_x,y + self.offset_y,z + self.offset_z) if not self.first_move: self.traverse_append((self.lineno, self.lo, l, self.xo, self.zo)) @@ -117,12 +119,14 @@ self.lo = l def rigid_tap(self, x, y, z): + if self.suppress: return l = (x + self.offset_x,y + self.offset_y,z + self.offset_z) self.feed_append((self.lineno, self.lo, l, self.feedrate, self.xo, self.zo)) self.dwells_append((self.lineno, self.colors['dwell'], x,y,z, 0)) self.feed_append((self.lineno, l, self.lo, self.feedrate, self.xo, self.zo)) def arc_feed(self, *args): + if self.suppress: return self.in_arc = True try: ArcsToSegmentsMixin.arc_feed(self, *args) @@ -140,10 +144,12 @@ straight_probe = straight_feed def user_defined_function(self, i, p, q): + if self.suppress: return color = self.colors['m1xx'] self.dwells_append((self.lineno, color, self.lo[0], self.lo[1], self.lo[2], self.state.plane/10-17)) def dwell(self, arg): + if self.suppress: return self.dwell_time += arg color = self.colors['dwell'] self.dwells_append((self.lineno, color, self.lo[0], self.lo[1], self.lo[2], self.state.plane/10-17)) |