CAM: respect SHOW_OPERATION_LABELS in post-operation information

This commit is contained in:
jffmichi
2025-05-07 04:55:03 +02:00
parent 1e87d8e668
commit f4d853e5dc
5 changed files with 56 additions and 52 deletions

View File

@@ -587,7 +587,8 @@ def init_shared_values(values: Values) -> None:
#
values["SHOW_MACHINE_UNITS"] = True
#
# If True then the current operation label is output just before the PRE_OPERATION.
# If True then the current operation label is output just before the PRE_OPERATION
# and just before the POST_OPERATION.
#
values["SHOW_OPERATION_LABELS"] = True
#

View File

@@ -154,9 +154,12 @@ def output_postop(values: Values, gcode: Gcode, obj) -> None:
nl: str = "\n"
if values["OUTPUT_COMMENTS"]:
comment = PostUtilsParse.create_comment(
values, f'{values["FINISH_LABEL"]} operation: {obj.Label}'
)
if values["SHOW_OPERATION_LABELS"]:
comment = PostUtilsParse.create_comment(
values, f'{values["FINISH_LABEL"]} operation: {obj.Label}'
)
else:
comment = PostUtilsParse.create_comment(values, f'{values["FINISH_LABEL"]} operation')
gcode.append(f"{PostUtilsParse.linenumber(values)}{comment}{nl}")
for line in values["POST_OPERATION"].splitlines(False):
gcode.append(f"{PostUtilsParse.linenumber(values)}{line}{nl}")