CAM: Multiline POSTAMBLE and PREAMBLE arguments in old postprocessors (#20715)

* CAM Multiline POSTAMBLE and PREAMBLE in old postprocessors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* CAM: Fix preamble and postamble help text

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
tarman3
2025-04-10 13:05:48 +03:00
committed by GitHub
parent f869bace95
commit b91c5ef2af
15 changed files with 50 additions and 50 deletions

View File

@@ -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="G17\nG90"',
help='set commands to be issued before the first command, default="%\\nG17 G21 G40 G49 G80 G90\\nM08"',
)
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 M09\\nG17 G90 G80 G40\\nM30"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -156,9 +156,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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"',
)
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"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G70)"
@@ -173,9 +173,9 @@ def processArguments(argstring):
if args.precision is not None:
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G70"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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"',
)
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"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -176,9 +176,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -179,9 +179,9 @@ def processArguments(argstring):
SHOW_EDITOR = False
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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="G17\nG90"'
"--preamble", help='set commands to be issued before the first command, default="G90"'
)
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="M8\\nG90 G40\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -156,9 +156,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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\nG90"',
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
)
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 G54 G90 G80 G40\\nM6 T0\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -161,9 +161,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -127,7 +127,7 @@ parser.add_argument(
)
parser.add_argument(
"--postamble",
help='set commands to be issued after the last command, default="M5\nG17 G90\n;M2"',
help='set commands to be issued after the last command, default="M5\\nG17 G90\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -215,9 +215,9 @@ def processArguments(argstring):
SHOW_EDITOR = True
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.no_translate_drill:
TRANSLATE_DRILL_CYCLES = False
if args.translate_drill:

View File

@@ -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"',
)
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"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -155,9 +155,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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\nG90"',
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
)
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 G54 G90 G80 G40\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -148,9 +148,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -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\nG90"',
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
)
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 G54 G90 G80 G40\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -148,9 +148,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -262,9 +262,9 @@ def processArguments(argstring):
if args.show_editor:
SHOW_EDITOR = True
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.no_translate_drill:
TRANSLATE_DRILL_CYCLES = False
if args.translate_drill:

View File

@@ -260,9 +260,9 @@ def processArguments(argstring):
if args.show_editor:
SHOW_EDITOR = True
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.no_translate_drill:
TRANSLATE_DRILL_CYCLES = False
if args.translate_drill:

View File

@@ -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"',
)
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"',
)
parser.add_argument("--IP_ADDR", help="IP Address for machine target machine")
parser.add_argument(
@@ -172,9 +172,9 @@ def processArguments(argstring):
print("Show editor = %d" % SHOW_EDITOR)
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"

View File

@@ -336,14 +336,14 @@ def processArguments(argstring):
PRECISION = args.precision
if args.preamble is not None:
PREAMBLE = args.preamble
PREAMBLE = args.preamble.replace("\\n", "\n")
elif OUTPUT_COMMENTS:
PREAMBLE = PREAMBLE_DEFAULT
else:
PREAMBLE = PREAMBLE_DEFAULT_NO_COMMENT
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
elif OUTPUT_COMMENTS:
POSTAMBLE = POSTAMBLE_DEFAULT
else:

View File

@@ -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\nG90"',
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
)
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 G54 G90 G80 G40\\nM2"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -208,7 +208,7 @@ def processArguments(argstring):
if args.preamble is not None:
PREAMBLE = args.preamble.replace("\\n", "\n")
if args.postamble is not None:
POSTAMBLE = args.postamble
POSTAMBLE = args.postamble.replace("\\n", "\n")
if args.inches:
UNITS = "G20"
UNIT_SPEED_FORMAT = "in/min"