CAM: Fix postprocessors Help arguments --postamble and --preamble (#20792)
This commit is contained in:
@@ -68,11 +68,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="%\\nG17 G21 G40 G49 G80 G90\\nM08"',
|
||||
help='set commands to be issued before the first command, default="%\\nG17 G21 G40 G49 G80 G90\\nM08\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05 M09\\nG17 G90 G80 G40\\nM30"',
|
||||
help='set commands to be issued after the last command, default="M05 M09\\nG17 G90 G80 G40\\nM30\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -202,7 +202,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -247,8 +247,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -193,8 +193,8 @@ def export(objectslist, filename, argstring):
|
||||
):
|
||||
gcode += ";T{}={}\n".format(item.ToolNumber, item.Name)
|
||||
gcode += linenumber() + ";begin preamble\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -221,8 +221,8 @@ def export(objectslist, filename, argstring):
|
||||
gcode += linenumber() + line
|
||||
for line in SAFETYBLOCK.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -59,11 +59,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17\\nG90\\nG80\\nG40"',
|
||||
help='set commands to be issued before the first command, default="G17\\nG90\\nG80\\nG40\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M09\\nM05\\nG80\\nG40\\nG17\\nG90\\nM30"',
|
||||
help='set commands to be issued after the last command, default="M09\\nM05\\nG80\\nG40\\nG17\\nG90\\nM30\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G70)"
|
||||
@@ -225,8 +225,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(T)" + "BEGIN PREAMBLE$\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
for obj in objectslist:
|
||||
@@ -289,8 +289,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(T)" + "BEGIN POSTAMBLE$\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
# Following is required by Dynapath Controls to signify "EOF" when loading in to control
|
||||
# from external media. The control strips the "E" off as part of the load process.
|
||||
gcode += "E\n"
|
||||
|
||||
@@ -86,11 +86,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17\\nG90\\nG80\\nG40"',
|
||||
help='set commands to be issued before the first command, default="G17\\nG90\\nG80\\nG40\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M09\\nM05\\nG80\\nG40\\nG17\\nG90\\nM30"',
|
||||
help='set commands to be issued after the last command, default="M09\\nM05\\nG80\\nG40\\nG17\\nG90\\nM30\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -231,8 +231,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
for obj in objectslist:
|
||||
@@ -255,8 +255,8 @@ def export(objectslist, filename, argstring):
|
||||
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
print("show editor: {}".format(SHOW_EDITOR))
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
|
||||
@@ -114,11 +114,11 @@ parser.add_argument(
|
||||
)
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help="set commands to be issued before the first command",
|
||||
help='set commands to be issued before the first command, default=""',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help="set commands to be issued after the last command",
|
||||
help='set commands to be issued after the last command, default="M5\\n"',
|
||||
)
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument("--inches", action="store_true", help="convert output for US imperial mode")
|
||||
@@ -235,8 +235,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
# verify if PREAMBLE have changed UNITS
|
||||
if "G21" in PREAMBLE:
|
||||
UNITS = "G21"
|
||||
@@ -310,8 +310,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# show the gCode result dialog
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
|
||||
@@ -160,8 +160,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
for obj in objectslist:
|
||||
|
||||
@@ -183,8 +183,8 @@ def export(objectslist, filename, argstring):
|
||||
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -65,11 +65,11 @@ parser.add_argument(
|
||||
)
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble", help='set commands to be issued before the first command, default="G90"'
|
||||
"--preamble", help='set commands to be issued before the first command, default="G90\\n"'
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M8\\nG90 G40\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M8\\nG90 G40\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -207,7 +207,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -251,8 +251,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -60,11 +60,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM6 T0\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM6 T0\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -220,7 +220,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(BEGIN PREAMBLE)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -276,8 +276,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(BEGIN POSTAMBLE)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += "%\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
|
||||
@@ -123,11 +123,11 @@ parser.add_argument(
|
||||
)
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17 G90"',
|
||||
help='set commands to be issued before the first command, default="G17 G90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M5\\nG17 G90\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M5\\nG17 G90\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -283,8 +283,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
# verify if PREAMBLE have changed MOTION_MODE or UNITS
|
||||
if "G90" in PREAMBLE:
|
||||
MOTION_MODE = "G90"
|
||||
@@ -370,8 +370,8 @@ def export(objectslist, filename, argstring):
|
||||
gcode += linenumber() + "(Block-enable: 1)\n"
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# show the gCode result dialog
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
|
||||
@@ -56,11 +56,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="M05 S0\\nG90"',
|
||||
help='set commands to be issued before the first command, default="M05 S0\\nG90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05 S0\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05 S0\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -198,7 +198,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -221,8 +221,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -56,11 +56,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -196,7 +196,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -252,8 +252,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
final = gcode
|
||||
|
||||
@@ -56,11 +56,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -196,7 +196,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
@@ -255,8 +255,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -156,7 +156,7 @@ parser.add_argument(
|
||||
"--preamble", help='set commands to be issued before the first command, default=""'
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble", help='set commands to be issued after the last command, default="M5"'
|
||||
"--postamble", help='set commands to be issued after the last command, default="M5\\n"'
|
||||
)
|
||||
parser.add_argument("--tool-change", action="store_true", help="Insert M6 for all tool changes")
|
||||
parser.add_argument(
|
||||
@@ -334,8 +334,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble:
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# Write these settings AFTER the preamble,
|
||||
# to prevent the preamble from changing these:
|
||||
@@ -409,8 +409,8 @@ def export(objectslist, filename, argstring):
|
||||
gcode += linenumber() + "(Block-enable: 1)\n"
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# Optionally add a final XYZ position to the end of the gcode:
|
||||
if RETURN_TO:
|
||||
|
||||
@@ -154,7 +154,7 @@ parser.add_argument(
|
||||
"--preamble", help='set commands to be issued before the first command, default=""'
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble", help='set commands to be issued after the last command, default="M5"'
|
||||
"--postamble", help='set commands to be issued after the last command, default="M5\\n"'
|
||||
)
|
||||
parser.add_argument("--tool-change", action="store_true", help="Insert M6 for all tool changes")
|
||||
parser.add_argument(
|
||||
@@ -332,8 +332,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble:
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# Write these settings AFTER the preamble,
|
||||
# to prevent the preamble from changing these:
|
||||
@@ -407,8 +407,8 @@ def export(objectslist, filename, argstring):
|
||||
gcode += linenumber() + "(Block-enable: 1)\n"
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(Begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
# Optionally add a final XYZ position to the end of the gcode:
|
||||
if RETURN_TO:
|
||||
|
||||
@@ -68,11 +68,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="4", help="number of digits of precision, default=4")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17\\nG90"',
|
||||
help='set commands to be issued before the first command, default="G17\\nG90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G90\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G90\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument("--IP_ADDR", help="IP Address for machine target machine")
|
||||
parser.add_argument(
|
||||
@@ -228,8 +228,8 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
for obj in objectslist:
|
||||
@@ -252,8 +252,8 @@ def export(objectslist, filename, argstring):
|
||||
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
|
||||
@@ -256,11 +256,11 @@ parser.add_argument(
|
||||
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17\nG90\nG54"',
|
||||
help='set commands to be issued before the first command, default="G17\\nG54\\G40\\nG49\\nG90\\nG80\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\nM30"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17\\nG54\\nG0\\nG90\\nG80\\nM30\\n"',
|
||||
)
|
||||
parser.add_argument("--inches", action="store_true", help="lengths in [in], G20")
|
||||
parser.add_argument("--metric", action="store_true", help="lengths in [mm], G21")
|
||||
@@ -443,7 +443,7 @@ def export(objectslist, filename, argstring):
|
||||
# if isinstance(obj.Proxy, Path.Tool.Controller.ToolController):
|
||||
# gcode += append("(T{}={})\n".format(obj.ToolNumber, item.Name))
|
||||
# error: global name 'PathScripts' is not defined
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += append(line + "\n")
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += append("(preamble: done)\n")
|
||||
|
||||
@@ -68,11 +68,11 @@ parser.add_argument("--precision", default="3", help="number of digits of precis
|
||||
parser.add_argument("--fixed-length", default="0", help="use fixed length coordinates, default=0")
|
||||
parser.add_argument(
|
||||
"--preamble",
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
|
||||
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--postamble",
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2"',
|
||||
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2\\n"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
|
||||
@@ -271,7 +271,7 @@ def export(objectslist, filename, argstring):
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + COMMENT_CHAR + "(begin preamble)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
for line in PREAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
if not OMIT_UNITS:
|
||||
gcode += linenumber() + UNITS + ENDLINE + "\n"
|
||||
@@ -353,8 +353,8 @@ def export(objectslist, filename, argstring):
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + COMMENT_CHAR + "(begin postamble)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
for line in POSTAMBLE.splitlines():
|
||||
gcode += linenumber() + line + "\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
final = gcode
|
||||
|
||||
Reference in New Issue
Block a user