Skip to content

Commit 878f171

Browse files
authored
Merge pull request #3858 from Sigma1912/patch-1
Make gremlin preview respect current tool position
2 parents 93547c9 + dd93728 commit 878f171

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/emc/usr_intf/gremlin/gremlin.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,18 @@ def load(self,filename = None):
327327
canon.parameter_file = temp_parameter
328328

329329
unitcode = "G%d" % (20 + (s.linear_units == 1))
330-
initcode = ""
330+
initcode = "G53 G0 "
331+
for i in range(9):
332+
if s.axis_mask & (1<<i):
333+
axis = "XYZABCUVW"[i]
334+
if (axis == "A" and a_axis_wrapped) or\
335+
(axis == "B" and b_axis_wrapped) or\
336+
(axis == "C" and c_axis_wrapped):
337+
pos = s.position[i] % 360.000
338+
else:
339+
pos = s.position[i]
340+
position = " %s%.8f" % (axis, pos)
341+
initcode += position
331342
result, seq = self.load_preview(filename, canon, unitcode, initcode)
332343
if result > gcode.MIN_ERROR:
333344
self.report_gcode_error(result, seq, filename)

0 commit comments

Comments
 (0)