Merge pull request #25638 from LarryWoestman/linuxcnc_preamble

CAM:  fix for linuxcnc ignoring --preamble argument, with test
This commit is contained in:
sliptonic
2025-11-25 09:03:09 -06:00
committed by GitHub
2 changed files with 12 additions and 4 deletions

View File

@@ -188,3 +188,14 @@ class TestLinuxCNCPost(PathTestUtils.PathTestBase):
lines = gcode.splitlines()
has_g64_without_p = any("G64" in line and "P" not in line for line in lines)
self.assertTrue(has_g64_without_p, "Expected G64 without P parameter when tolerance is 0")
def test_blend_interaction_with_preamble_argument(self):
"""Test interaction with a --preamble command line argument."""
self.profile_op.Path = Path.Path([])
self.job.PostProcessorArgs = (
'--no-header --no-comments --blend-mode BLEND --preamble="G80 G90" --no-show-editor'
)
gcode = self.post.export()[0][1]
lines = gcode.splitlines()
self.assertEqual(lines[0], "G80 G90")
self.assertEqual(lines[1], "G64")

View File

@@ -172,10 +172,7 @@ M2"""
# Update PREAMBLE with blend command
blend_cmd = self._get_blend_command()
self.values[
"PREAMBLE"
] = f"""G17 G54 G40 G49 G80 G90
{blend_cmd}"""
self.values["PREAMBLE"] += f"\n{blend_cmd}"
return flag, args