From c10e788367b970aa0a34beaabd0acea2c94d5ba8 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:39:49 +0100 Subject: [PATCH] Add coolant to the linuxcnc_post --- .../Path/PathScripts/post/linuxcnc_post.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index 01007e04ce..450048c748 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -205,6 +205,18 @@ def export(objectslist, filename, argstring): for line in PRE_OPERATION.splitlines(True): gcode += linenumber() + line + # turn coolant on if required + if hasattr(obj, "CoolantMode"): + coolantMode = obj.CoolantMode + if OUTPUT_COMMENTS: + if not coolantMode == 'None': + gcode += linenumber() + '(Coolant On:' + coolantMode + ')\n' + if coolantMode == 'Flood': + gcode += linenumber() + 'M8' + '\n' + if coolantMode == 'Mist': + gcode += linenumber() + 'M7' + '\n' + + # process the operation gcode gcode += parse(obj) # do the post_op @@ -213,6 +225,14 @@ def export(objectslist, filename, argstring): for line in POST_OPERATION.splitlines(True): gcode += linenumber() + line + # turn coolant off if required + if hasattr(obj, "CoolantMode"): + coolantMode = obj.CoolantMode + if not coolantMode == 'None': + if OUTPUT_COMMENTS: + gcode += linenumber() + '(Coolant Off:' + coolantMode + ')\n' + gcode += linenumber() +'M9' + '\n' + # do the post_amble if OUTPUT_COMMENTS: gcode += "(begin postamble)\n"