Skip to content

Commit

Permalink
Merge branch 'master' into patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptonic authored Oct 2, 2023
2 parents d9090d4 + d8a30d5 commit 047334f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/Mod/Path/Path/Post/scripts/centroid_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
--feed-precision=1 ... number of digits of precision for feed rate. Default=1
--axis-precision=4 ... number of digits of precision for axis moves. Default=4
--inches ... Convert output for US imperial mode (G20)
--no-tlo ... Suppress tool length offset (G43) following tool changes
"""

# These globals set common customization preferences
Expand All @@ -63,7 +62,6 @@
else:
SHOW_EDITOR = False
MODAL = False # if true commands are suppressed if the same as previous line.
USE_TLO = True # if true G43 will be output following tool changes

COMMAND_SPACE = " "
LINENR = 100 # line number starting value
Expand Down Expand Up @@ -141,7 +139,6 @@ def processArguments(argstring):
global UNIT_SPEED_FORMAT
global UNIT_FORMAT
global UNITS
global USE_TLO

for arg in argstring.split():
if arg == "--header":
Expand All @@ -168,8 +165,6 @@ def processArguments(argstring):
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"
UNIT_FORMAT = "in"
elif arg == "--no-tlo":
USE_TLO = False


def export(objectslist, filename, argstring):
Expand Down Expand Up @@ -347,8 +342,6 @@ def parse(pathobj):
# out += linenumber() + "(begin toolchange)\n"
for line in TOOL_CHANGE.splitlines(True):
out += linenumber() + line
if USE_TLO:
out += linenumber() + "G43 H" + str(int(c.Parameters["T"])) + "\n"

# if command == "message":
# if OUTPUT_COMMENTS is False:
Expand Down
9 changes: 5 additions & 4 deletions src/Mod/Path/PathTests/TestCentroidPost.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,16 @@ def test080(self):

args = "--no-header --no-show-editor"
gcode = postprocessor.export(postables, "gcode.tmp", args)
self.assertEqual(gcode.splitlines()[5], "G43 H2")
self.assertEqual(gcode.splitlines()[6], "M6 T2")
self.assertEqual(gcode.splitlines()[7], "M3 S3000")
self.assertEqual(gcode.splitlines()[5], "M6 T2")
self.assertEqual(gcode.splitlines()[6], "M3 S3000")

# suppress TLO
#
# The original centroid postprocessor does not have an
# --no-tlo option. We end up with the original gcode.
#
args = "--no-header --no-tlo --no-show-editor"
gcode = postprocessor.export(postables, "gcode.tmp", args)
self.assertEqual(gcode.splitlines()[5], "G43 H2")
self.assertEqual(gcode.splitlines()[6], "M3 S3000")

def test090(self):
Expand Down

0 comments on commit 047334f

Please sign in to comment.