CAM: snapmaker clean output_header()

This commit is contained in:
jalapenopuzzle
2025-03-29 12:30:03 +11:00
parent 7e54513e5e
commit 42636926ca
2 changed files with 3 additions and 8 deletions

View File

@@ -78,7 +78,7 @@ class TestSnapmakerPost(PathTestUtils.PathTestBase):
;header_type: cnc
;machine: Snapmaker 2 A350 50W CNC module
;Post Processor: snapmaker_post
;Cam File: boxtest.fcstd
;CAM File: boxtest.fcstd
;Output Time: \\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{0,6}
;thumbnail: deactivated."""

View File

@@ -565,8 +565,6 @@ class Snapmaker(Path.Post.Processor.PostProcessor):
def output_header(self, gcode: List[str]):
"""custom method derived from Path.Post.UtilsExport.output_header"""
cam_file: str
comment: str
nl: str = "\n"
if not self.values["OUTPUT_HEADER"]:
return
@@ -580,15 +578,12 @@ class Snapmaker(Path.Post.Processor.PostProcessor):
add_comment("Header Start")
add_comment("header_type: cnc")
add_comment(f'machine: {self.values["MACHINE_NAME"]}')
comment = Path.Post.UtilsParse.create_comment(
self.values, f'Post Processor: {self.values["POSTPROCESSOR_FILE_NAME"]}'
)
gcode.append(f"{Path.Post.UtilsParse.linenumber(self.values)}{comment}{nl}")
add_comment(f'Post Processor: {self.values["POSTPROCESSOR_FILE_NAME"]}')
if FreeCAD.ActiveDocument:
cam_file = os.path.basename(FreeCAD.ActiveDocument.FileName)
else:
cam_file = "<None>"
add_comment(f"Cam File: {cam_file}")
add_comment(f"CAM File: {cam_file}")
add_comment(f"Output Time: {datetime.datetime.now()}")
add_comment(self.get_thumbnail())