From 50b55dce7706a62c3f4f3caff05e8c1d65d7ff5a Mon Sep 17 00:00:00 2001 From: Emory Barlow Date: Tue, 3 May 2022 23:49:02 -0400 Subject: [PATCH] override G80 for prusa specific --- src/pygcode/__init__.py | 4 ++-- src/pygcode/gcodes.py | 41 +++++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/pygcode/__init__.py b/src/pygcode/__init__.py index 27611cb..08b0fb7 100644 --- a/src/pygcode/__init__.py +++ b/src/pygcode/__init__.py @@ -54,7 +54,7 @@ __all__ = [ 'GCodeArcMoveCW', 'GCodeBoringCycleDwellFeedOut', 'GCodeBoringCycleFeedOut', - 'GCodeCancelCannedCycle', + #'GCodeCancelCannedCycle', 'GCodeCancelToolLengthOffset', 'GCodeCannedCycle', 'GCodeCannedCycleReturnPrevLevel', @@ -336,7 +336,7 @@ from .gcodes import ( GCodeArcMoveCW, GCodeBoringCycleDwellFeedOut, GCodeBoringCycleFeedOut, - GCodeCancelCannedCycle, + #GCodeCancelCannedCycle, GCodeCancelToolLengthOffset, GCodeCannedCycle, GCodeCannedCycleReturnPrevLevel, diff --git a/src/pygcode/gcodes.py b/src/pygcode/gcodes.py index 3091123..ede4b4e 100644 --- a/src/pygcode/gcodes.py +++ b/src/pygcode/gcodes.py @@ -508,22 +508,24 @@ class GCodeRigidTapping(GCodeMotion): param_letters = GCodeMotion.param_letters | set('K') word_key = Word('G', 33.1) - -class GCodeCancelCannedCycle(GCodeMotion): - """G80: Cancel Canned Cycle""" - word_key = Word('G', 80) - # Modal Group - # Technically G80 belongs to the motion modal group, however it's often - # expressed in the same line as another motion command. - # This is alowed, but executed just prior to any other motion command - # eg: G00 G80 - # will leave the machine in rapid motion mode - # Just running G80 will leave machine with no motion mode. - modal_group = None - exec_order = 241 - - def _process(self, machine): - machine.mode.motion = None +# +# Conflicts with prusa command +# +#class GCodeCancelCannedCycle(GCodeMotion): +# """G80: Cancel Canned Cycle""" +# word_key = Word('G', 80) +# # Modal Group +# # Technically G80 belongs to the motion modal group, however it's often +# # expressed in the same line as another motion command. +# # This is alowed, but executed just prior to any other motion command +# # eg: G00 G80 +# # will leave the machine in rapid motion mode +# # Just running G80 will leave machine with no motion mode. +# modal_group = None +# exec_order = 241 +# +# def _process(self, machine): +# machine.mode.motion = None # ======================= Canned Cycles ======================= @@ -1375,6 +1377,7 @@ class GCodeUserDefined(GCodeNonModal): # M204 S T Acceleration settings # M221 S T Set extrude factor override percentage # M106 S Set fan speed +# G80 N R V L R F B Mesh-based Z probe class GCodePrintChecking(GCode): exec_order = 999 @@ -1461,6 +1464,12 @@ class GCodeSetFanSpeed(GCode): param_letters = set('S') word_key = Word('M', 106) +class GCodeMeshBasedZProbe(GCode): + exec_order = 999 + modal_group = MODAL_GROUP_MAP['user_defined'] + param_letters = set('NRVLRFB') + word_key = Word('G', 80) + # ======================= Utilities ======================= def _subclasses_level(root_class, recursion_level=0):