Merge pull request #6872 from JanneKro/master

#6871 - Certain PostProcessors spam errors and other output
This commit is contained in:
sliptonic
2022-05-11 10:43:34 -05:00
committed by GitHub
5 changed files with 17 additions and 20 deletions

View File

@@ -436,6 +436,3 @@ def parse(pathobj):
out = out.strip() + "\n"
return out
print(__name__ + " gcode postprocessor loaded.")

View File

@@ -51,7 +51,6 @@ Arguments for centroid:
--axis-precision=4 ... number of digits of precision for axis moves. Default=4
--inches ... Convert output for US imperial mode (G20)
"""
now = datetime.datetime.now()
# These globals set common customization preferences
OUTPUT_COMMENTS = True
@@ -79,13 +78,19 @@ SPINDLE_DECIMALS = 0
COMMENT = ";"
HEADER = """
;Exported by FreeCAD
# gCode header with information about CAD-software, post-processor
# and date/time
if FreeCAD.ActiveDocument:
cam_file = FreeCAD.ActiveDocument.FileName
else:
cam_file = "<None>"
HEADER = """;Exported by FreeCAD
;Post Processor: {}
;CAM file: {}
;Output Time: {}
""".format(
__name__, FreeCAD.ActiveDocument.FileName, str(now)
__name__, cam_file, str(datetime.datetime.now())
)
# Preamble text will appear at the beginning of the GCODE output file.
@@ -354,6 +359,3 @@ def parse(pathobj):
out = out.strip() + "\n"
return out
print(__name__ + " gcode postprocessor loaded.")

View File

@@ -143,5 +143,3 @@ def parse(pathobj):
return objlist
print(__name__ + " gcode postprocessor loaded.")

View File

@@ -21,7 +21,7 @@
# * *
# ****************************************************************************/
"""Postprocessor to output real GCode for Max Computer GmbH nccad9."""
import FreeCAD as App
import FreeCAD
from PathScripts import PostUtils
import datetime
@@ -43,10 +43,8 @@ import nccad_post
nccad_post.export([object], "/path/to/file.knc", "")
"""
MACHINE_NAME = """Max Computer GmbH nccad9 MCS/KOSY"""
# gCode for changing tools
# M01 <String> ; Displays <String> and waits for user interaction
TOOL_CHANGE = """G77 ; Move to release position
@@ -63,12 +61,17 @@ M10 O6.0 ; Stop spindle"""
# gCode header with information about CAD-software, post-processor
# and date/time
if FreeCAD.ActiveDocument:
cam_file = FreeCAD.ActiveDocument.FileName
else:
cam_file = "<None>"
HEADER = """;Exported by FreeCAD
;Post Processor: {}
;CAM file: {}
;Output Time: {}
""".format(
__name__, App.ActiveDocument.FileName, str(datetime.datetime.now())
__name__, FreeCAD.ActiveDocument.FileName, str(datetime.datetime.now())
)
@@ -116,7 +119,7 @@ def export(objectslist, filename, argstring):
gcode += POSTAMBLE + "\n"
# Open editor window
if App.GuiUp:
if FreeCAD.GuiUp:
dia = PostUtils.GCodeEditorDialog()
dia.editor.setText(gcode)
result = dia.exec_()

View File

@@ -694,6 +694,3 @@ def parse(pathobj):
out = out.strip() + "\n"
return out
print(__name__ + " for " + GCODE_PROCESSOR + " loaded.")