From 4d2719ff972573610244a97585847cda30008b40 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Mon, 1 Dec 2025 05:39:44 +0100 Subject: [PATCH] CAM: Provide correct and more relevant header from Fanuc post processor Fanuc only understand upper case letters, no point in providing the file name in lower case letters. The provided file name is always "-", so drop it completely. The first comment is presented in the Fanuc user interface, it should get more relevant content. Dropped useless semicolon. --- src/Mod/CAM/Path/Post/scripts/fanuc_post.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py index 48b020c8a3..ad10f3bf86 100644 --- a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py @@ -245,17 +245,16 @@ def export(objectslist, filename, argstring): # write header if OUTPUT_HEADER: - gcode += ";\n" + # Get current version info + major = int(FreeCAD.ConfigGet("BuildVersionMajor")) + minor = int(FreeCAD.ConfigGet("BuildVersionMinor")) + + # the filename variable always contain "-", so unable to + # provide more accurate information. + gcode += "(" + "FREECAD-FILENAME-GOES-HERE" + ", " + "JOB-NAME-GOES-HERE" + ")\n" gcode += ( - os.path.split(filename)[-1] - + " (" - + "FREECAD-FILENAME-GOES-HERE" - + ", " - + "JOB-NAME-GOES-HERE" - + ")\n" + linenumber() + "(POST PROCESSOR: FANUC USING FREECAD %d.%d" % (major, minor) + ")\n" ) - gcode += linenumber() + "(" + filename.upper() + ",EXPORTED BY FREECAD!)\n" - gcode += linenumber() + "(POST PROCESSOR: " + __name__.upper() + ")\n" gcode += linenumber() + "(OUTPUT TIME:" + str(now).upper() + ")\n" # Write the preamble