From c461af19c3085b4507757e84a90df99203d843bf Mon Sep 17 00:00:00 2001 From: jim Date: Tue, 4 Jan 2022 22:23:15 -0800 Subject: [PATCH] check for gcode comments that contain controller-specific commands to include --- src/Mod/Path/PathScripts/post/grbl_post.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/Path/PathScripts/post/grbl_post.py b/src/Mod/Path/PathScripts/post/grbl_post.py index 9064e8f821..a6cc85fca5 100755 --- a/src/Mod/Path/PathScripts/post/grbl_post.py +++ b/src/Mod/Path/PathScripts/post/grbl_post.py @@ -31,6 +31,7 @@ import argparse import datetime import shlex import PathScripts.PathUtil as PathUtil +import regex TOOLTIP = """ @@ -578,6 +579,12 @@ def parse(pathobj): if len(outstring) >= 1: out += linenumber() + format_outstring(outstring) + "\n" + # Check for comments containing machine-specific commands to pass literally to the controller + m = regex.match(r'^\(MC_RUN_COMMAND: ([^)]+)\)$', command) + if m: + raw_command = m.group(1) + out += linenumber() + raw_command + "\n" + return out