mirror of
https://git.mirrors.martin98.com/https://github.com/petaflot/pygcode
synced 2025-04-20 12:50:05 +08:00
better subclassin for Marlin. fixed missing six import for LinuxCNC
This commit is contained in:
parent
5692fe233c
commit
ada8ebfa13
@ -14,6 +14,8 @@ for python.
|
|||||||
pip install -e .
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Make sure you set `_DEFAULT_` to the dialect you want to use in `src/pygcode/dialects/__init__.py`
|
||||||
|
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ __all__ = [
|
|||||||
'GCodeCannedCycleReturnPrevLevel',
|
'GCodeCannedCycleReturnPrevLevel',
|
||||||
'GCodeCannedCycleReturnToR',
|
'GCodeCannedCycleReturnToR',
|
||||||
'GCodeCannedReturnMode',
|
'GCodeCannedReturnMode',
|
||||||
'GCodeCoolant',
|
'GCodeCoolantHeaters',
|
||||||
'GCodeCoolantFloodOn',
|
'GCodeCoolantFloodOn',
|
||||||
'GCodeCoolantMistOn',
|
'GCodeCoolantMistOn',
|
||||||
'GCodeCoolantOff',
|
'GCodeCoolantOff',
|
||||||
@ -143,7 +143,7 @@ __all__ = [
|
|||||||
'GCodeSetPredefinedPosition',
|
'GCodeSetPredefinedPosition',
|
||||||
'GCodeSpeedAndFeedOverrideOff',
|
'GCodeSpeedAndFeedOverrideOff',
|
||||||
'GCodeSpeedAndFeedOverrideOn',
|
'GCodeSpeedAndFeedOverrideOn',
|
||||||
'GCodeSpindle',
|
'GCodeToolState',
|
||||||
'GCodeSpindleConstantSurfaceSpeedMode',
|
'GCodeSpindleConstantSurfaceSpeedMode',
|
||||||
'GCodeSpindleRPMMode',
|
'GCodeSpindleRPMMode',
|
||||||
'GCodeSpindleSpeed',
|
'GCodeSpindleSpeed',
|
||||||
@ -157,7 +157,7 @@ __all__ = [
|
|||||||
'GCodeStraightProbe',
|
'GCodeStraightProbe',
|
||||||
'GCodeThreadingCycle',
|
'GCodeThreadingCycle',
|
||||||
'GCodeToolChange',
|
'GCodeToolChange',
|
||||||
'GCodeToolLength',
|
'GCodeToolGeometry',
|
||||||
'GCodeToolLengthOffset',
|
'GCodeToolLengthOffset',
|
||||||
'GCodeToolSetCurrent',
|
'GCodeToolSetCurrent',
|
||||||
'GCodeUnit',
|
'GCodeUnit',
|
||||||
@ -212,7 +212,7 @@ match get_default_dialect():
|
|||||||
# - GCodeCannedReturnMode:
|
# - GCodeCannedReturnMode:
|
||||||
# G98 - GCodeCannedCycleReturnPrevLevel: G98: Canned Cycle Return to the level set prior to cycle start
|
# G98 - GCodeCannedCycleReturnPrevLevel: G98: Canned Cycle Return to the level set prior to cycle start
|
||||||
# G99 - GCodeCannedCycleReturnToR: G99: Canned Cycle Return to the level set by R
|
# G99 - GCodeCannedCycleReturnToR: G99: Canned Cycle Return to the level set by R
|
||||||
# - GCodeCoolant:
|
# - GCodeCoolantHeaters:
|
||||||
# M08 - GCodeCoolantFloodOn: M8: turn flood coolant on
|
# M08 - GCodeCoolantFloodOn: M8: turn flood coolant on
|
||||||
# M07 - GCodeCoolantMistOn: M7: turn mist coolant on
|
# M07 - GCodeCoolantMistOn: M7: turn mist coolant on
|
||||||
# M09 - GCodeCoolantOff: M9: turn all coolant off
|
# M09 - GCodeCoolantOff: M9: turn all coolant off
|
||||||
@ -309,7 +309,7 @@ match get_default_dialect():
|
|||||||
# M60 - GCodePalletChangePause: M60: Pallet Change Pause
|
# M60 - GCodePalletChangePause: M60: Pallet Change Pause
|
||||||
# M00 - GCodePauseProgram: M0: Program Pause
|
# M00 - GCodePauseProgram: M0: Program Pause
|
||||||
# M01 - GCodePauseProgramOptional: M1: Program Pause (optional)
|
# M01 - GCodePauseProgramOptional: M1: Program Pause (optional)
|
||||||
# - GCodeSpindle:
|
# - GCodeToolState:
|
||||||
# M19 - GCodeOrientSpindle: M19: Orient Spindle
|
# M19 - GCodeOrientSpindle: M19: Orient Spindle
|
||||||
# - GCodeSpindleSpeedMode:
|
# - GCodeSpindleSpeedMode:
|
||||||
# G96 - GCodeSpindleConstantSurfaceSpeedMode: G96: Spindle Constant Surface Speed
|
# G96 - GCodeSpindleConstantSurfaceSpeedMode: G96: Spindle Constant Surface Speed
|
||||||
@ -318,7 +318,7 @@ match get_default_dialect():
|
|||||||
# M04 - GCodeStartSpindleCCW: M4: Start Spindle Counter-Clockwise
|
# M04 - GCodeStartSpindleCCW: M4: Start Spindle Counter-Clockwise
|
||||||
# M03 - GCodeStartSpindleCW: M3: Start Spindle Clockwise
|
# M03 - GCodeStartSpindleCW: M3: Start Spindle Clockwise
|
||||||
# M05 - GCodeStopSpindle: M5: Stop Spindle
|
# M05 - GCodeStopSpindle: M5: Stop Spindle
|
||||||
# - GCodeToolLength:
|
# - GCodeToolGeometry:
|
||||||
# G43.2 - GCodeAddToolLengthOffset: G43.2: Appkly Additional Tool Length Offset
|
# G43.2 - GCodeAddToolLengthOffset: G43.2: Appkly Additional Tool Length Offset
|
||||||
# G49 - GCodeCancelToolLengthOffset: G49: Cancel Tool Length Compensation
|
# G49 - GCodeCancelToolLengthOffset: G49: Cancel Tool Length Compensation
|
||||||
# G43.1 - GCodeDynamicToolLengthOffset: G43.1: Dynamic Tool Length Offset
|
# G43.1 - GCodeDynamicToolLengthOffset: G43.1: Dynamic Tool Length Offset
|
||||||
@ -347,7 +347,7 @@ match get_default_dialect():
|
|||||||
GCodeCannedCycleReturnPrevLevel,
|
GCodeCannedCycleReturnPrevLevel,
|
||||||
GCodeCannedCycleReturnToR,
|
GCodeCannedCycleReturnToR,
|
||||||
GCodeCannedReturnMode,
|
GCodeCannedReturnMode,
|
||||||
GCodeCoolant,
|
GCodeCoolantHeaters,
|
||||||
GCodeCoolantFloodOn,
|
GCodeCoolantFloodOn,
|
||||||
GCodeCoolantMistOn,
|
GCodeCoolantMistOn,
|
||||||
GCodeCoolantOff,
|
GCodeCoolantOff,
|
||||||
@ -430,7 +430,7 @@ match get_default_dialect():
|
|||||||
GCodeSetPredefinedPosition,
|
GCodeSetPredefinedPosition,
|
||||||
GCodeSpeedAndFeedOverrideOff,
|
GCodeSpeedAndFeedOverrideOff,
|
||||||
GCodeSpeedAndFeedOverrideOn,
|
GCodeSpeedAndFeedOverrideOn,
|
||||||
GCodeSpindle,
|
GCodeToolState,
|
||||||
GCodeSpindleConstantSurfaceSpeedMode,
|
GCodeSpindleConstantSurfaceSpeedMode,
|
||||||
GCodeSpindleRPMMode,
|
GCodeSpindleRPMMode,
|
||||||
GCodeSpindleSpeed,
|
GCodeSpindleSpeed,
|
||||||
@ -444,7 +444,7 @@ match get_default_dialect():
|
|||||||
GCodeStraightProbe,
|
GCodeStraightProbe,
|
||||||
GCodeThreadingCycle,
|
GCodeThreadingCycle,
|
||||||
GCodeToolChange,
|
GCodeToolChange,
|
||||||
GCodeToolLength,
|
GCodeToolGeometry,
|
||||||
GCodeToolLengthOffset,
|
GCodeToolLengthOffset,
|
||||||
GCodeToolSetCurrent,
|
GCodeToolSetCurrent,
|
||||||
GCodeUnit,
|
GCodeUnit,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# vim: ts=4, number
|
# vim: ts=4 number
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from copy import copy
|
from copy import copy
|
||||||
@ -151,7 +151,7 @@ match get_default_dialect():
|
|||||||
case 'prusa':
|
case 'prusa':
|
||||||
from .gcodes_prusa import *
|
from .gcodes_prusa import *
|
||||||
case _:
|
case _:
|
||||||
from .gcodes_legacy import *
|
from .gcodes_linuxcnc import *
|
||||||
|
|
||||||
# ======================= Utilities =======================
|
# ======================= Utilities =======================
|
||||||
|
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
from .gcodes import MODAL_GROUP_MAP
|
from .gcodes import MODAL_GROUP_MAP
|
||||||
from .words import Word, text2words
|
from .words import Word, text2words
|
||||||
|
import six
|
||||||
|
|
||||||
|
"""
|
||||||
|
These class types can be used by external programs to classify the type of instructions
|
||||||
|
see class comments and marlin_gcode.py for examples.
|
||||||
|
|
||||||
|
The granularity of the class naming, while it has no functional use while parsing, can however
|
||||||
|
be useful when it will come to translating from one dialect to another.
|
||||||
|
|
||||||
|
When unsure what class a command should be a (semantic) subclass off, we try to keeps together
|
||||||
|
things that are related to each other (ie. SD card stuff)
|
||||||
|
"""
|
||||||
|
|
||||||
class GCode(object):
|
class GCode(object):
|
||||||
|
""" base gcode class ; prefer not to use it """
|
||||||
# Defining Word
|
# Defining Word
|
||||||
word_key = None # Word instance to use in lookup
|
word_key = None # Word instance to use in lookup
|
||||||
word_matches = None # function (secondary)
|
word_matches = None # function (secondary)
|
||||||
@ -254,6 +267,8 @@ class GCodeProgramName(GCodeDefinition):
|
|||||||
|
|
||||||
# ======================= Motion =======================
|
# ======================= Motion =======================
|
||||||
class GCodeMotion(GCode):
|
class GCodeMotion(GCode):
|
||||||
|
""" any command that will move the machine and has XYZ... parameters attached
|
||||||
|
ie. the host is able to kow the machine position after such a command """
|
||||||
param_letters = set('XYZABCUVW')
|
param_letters = set('XYZABCUVW')
|
||||||
modal_group = MODAL_GROUP_MAP['motion']
|
modal_group = MODAL_GROUP_MAP['motion']
|
||||||
exec_order = 242
|
exec_order = 242
|
||||||
@ -315,32 +330,42 @@ class GCodeCannedCycle(GCode):
|
|||||||
machine.move_to(**moveto_coords)
|
machine.move_to(**moveto_coords)
|
||||||
|
|
||||||
|
|
||||||
|
# ======================= Return Mode in Canned Cycles =======================
|
||||||
|
class GCodeCannedReturnMode(GCode):
|
||||||
|
modal_group = MODAL_GROUP_MAP['canned_cycles_return']
|
||||||
|
exec_order = 220
|
||||||
|
|
||||||
|
|
||||||
# ======================= Distance Mode =======================
|
# ======================= Distance Mode =======================
|
||||||
class GCodeDistanceMode(GCode):
|
class GCodeDistanceMode(GCode):
|
||||||
|
""" for points of reference to use, and things such as working by radius or diameter (somewhat modal) """
|
||||||
exec_order = 210
|
exec_order = 210
|
||||||
|
|
||||||
|
|
||||||
# ======================= Feed Rate Mode =======================
|
# ======================= Feed Rate Mode =======================
|
||||||
class GCodeFeedRateMode(GCode):
|
class GCodeFeedRateMode(GCode):
|
||||||
|
""" how feedrates will be interpreted """
|
||||||
modal_group = MODAL_GROUP_MAP['feed_rate_mode']
|
modal_group = MODAL_GROUP_MAP['feed_rate_mode']
|
||||||
exec_order = 30
|
exec_order = 30
|
||||||
|
|
||||||
|
|
||||||
# ======================= Spindle Control =======================
|
# ======================= Spindle/Tool Control =======================
|
||||||
class GCodeSpindle(GCode):
|
class GCodeToolState(GCode):
|
||||||
word_letter = 'M'
|
word_letter = 'M'
|
||||||
exec_order = 90
|
exec_order = 90
|
||||||
|
|
||||||
|
|
||||||
# ======================= Coolant =======================
|
# ======================= Coolant & Heaters =======================
|
||||||
class GCodeCoolant(GCode):
|
class GCodeCoolantHeaters(GCode):
|
||||||
|
""" all cooling, heating and ventilation systems EXCEPT nozzle temperatures (see GCodeToolState) """
|
||||||
word_letter = 'M'
|
word_letter = 'M'
|
||||||
modal_group = MODAL_GROUP_MAP['coolant']
|
modal_group = MODAL_GROUP_MAP['coolant']
|
||||||
exec_order = 110
|
exec_order = 110
|
||||||
|
|
||||||
|
|
||||||
# ======================= Tool Length =======================
|
# ======================= Tool Geometry =======================
|
||||||
class GCodeToolLength(GCode):
|
class GCodeToolGeometry(GCode):
|
||||||
|
""" tool lengths and offsets """
|
||||||
modal_group = MODAL_GROUP_MAP['tool_length_offset']
|
modal_group = MODAL_GROUP_MAP['tool_length_offset']
|
||||||
exec_order = 180
|
exec_order = 180
|
||||||
|
|
||||||
@ -353,6 +378,7 @@ class GCodeProgramControl(GCode):
|
|||||||
|
|
||||||
# ======================= Units =======================
|
# ======================= Units =======================
|
||||||
class GCodeUnit(GCode):
|
class GCodeUnit(GCode):
|
||||||
|
""" selects a unit system (somewhat modal) """
|
||||||
modal_group = MODAL_GROUP_MAP['units']
|
modal_group = MODAL_GROUP_MAP['units']
|
||||||
exec_order = 160
|
exec_order = 160
|
||||||
|
|
||||||
@ -381,21 +407,17 @@ class GCodePlaneSelect(GCode):
|
|||||||
normal = None # Vector3
|
normal = None # Vector3
|
||||||
|
|
||||||
# ======================= Cutter Radius Compensation =======================
|
# ======================= Cutter Radius Compensation =======================
|
||||||
class GCodeCutterRadiusComp(GCode):
|
class GCodeCutterRadiusComp(GCodeToolGeometry):
|
||||||
modal_group = MODAL_GROUP_MAP['cutter_diameter_comp']
|
modal_group = MODAL_GROUP_MAP['cutter_diameter_comp']
|
||||||
exec_order = 170
|
exec_order = 170
|
||||||
|
|
||||||
# ======================= Path Control Mode =======================
|
# ======================= Path Control Mode =======================
|
||||||
class GCodePathControlMode(GCode):
|
class GCodePathControlMode(GCode):
|
||||||
|
""" codes that will affect the path and motion either by allowing greater deviation
|
||||||
|
from the theoretical path or by inducing greater deviation (includes acceleration and jerk)"""
|
||||||
modal_group = MODAL_GROUP_MAP['control_mode']
|
modal_group = MODAL_GROUP_MAP['control_mode']
|
||||||
exec_order = 200
|
exec_order = 200
|
||||||
|
|
||||||
# ======================= Return Mode in Canned Cycles =======================
|
|
||||||
class GCodeCannedReturnMode(GCode):
|
|
||||||
modal_group = MODAL_GROUP_MAP['canned_cycles_return']
|
|
||||||
exec_order = 220
|
|
||||||
|
|
||||||
|
|
||||||
# ======================= Other Modal Codes =======================
|
# ======================= Other Modal Codes =======================
|
||||||
class GCodeOtherModal(GCode):
|
class GCodeOtherModal(GCode):
|
||||||
pass
|
pass
|
||||||
@ -410,6 +432,7 @@ class GCodeSelectCoordinateSystem(GCodeOtherModal):
|
|||||||
|
|
||||||
# ======================= Flow-control Codes =======================
|
# ======================= Flow-control Codes =======================
|
||||||
class GCodeIO(GCode):
|
class GCodeIO(GCode):
|
||||||
|
""" pretty much anything that reads and writes on digital pins and not related to motion and temperatures """
|
||||||
word_letter = 'M'
|
word_letter = 'M'
|
||||||
exec_order = 70
|
exec_order = 70
|
||||||
|
|
||||||
@ -424,3 +447,18 @@ class GCodeNonModal(GCode):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# ======================= Machine Configuration and Calibration Codes =======================
|
||||||
|
class GCodeMachineRoutines(GCode):
|
||||||
|
""" standard routines that WILL induce movement such as homing, tool changes.. """
|
||||||
|
|
||||||
|
class GCodeAssistedRoutines(GCodeMachineRoutines):
|
||||||
|
""" machine routines that require user intervention """
|
||||||
|
|
||||||
|
class GCodeCalibrationRoutines(GCode):
|
||||||
|
""" machine routines that are used for calibration purposes """
|
||||||
|
|
||||||
|
class GCodeMachineConfig(GCode):
|
||||||
|
""" configuration parameters that will not significantly alter the machine behaviour """
|
||||||
|
|
||||||
|
class GCodeMachineState(GCode):
|
||||||
|
""" mostly for commands that report the machine state to the host """
|
||||||
|
@ -237,7 +237,7 @@ class GCodeUnitsPerRevolution(GCodeFeedRateMode):
|
|||||||
# M19 Orient Spindle
|
# M19 Orient Spindle
|
||||||
# G96, G97 S D Spindle Control Mode
|
# G96, G97 S D Spindle Control Mode
|
||||||
|
|
||||||
class GCodeStartSpindle(GCodeSpindle):
|
class GCodeStartSpindle(GCodeToolState):
|
||||||
"""M3,M4: Start Spindle Clockwise"""
|
"""M3,M4: Start Spindle Clockwise"""
|
||||||
modal_group = MODAL_GROUP_MAP['spindle']
|
modal_group = MODAL_GROUP_MAP['spindle']
|
||||||
|
|
||||||
@ -253,19 +253,19 @@ class GCodeStartSpindleCCW(GCodeStartSpindle):
|
|||||||
word_key = Word('M', 4)
|
word_key = Word('M', 4)
|
||||||
|
|
||||||
|
|
||||||
class GCodeStopSpindle(GCodeSpindle):
|
class GCodeStopSpindle(GCodeToolState):
|
||||||
"""M5: Stop Spindle"""
|
"""M5: Stop Spindle"""
|
||||||
#param_letters = set('S') # S is it's own gcode, makes no sense to be here
|
#param_letters = set('S') # S is it's own gcode, makes no sense to be here
|
||||||
word_key = Word('M', 5)
|
word_key = Word('M', 5)
|
||||||
modal_group = MODAL_GROUP_MAP['spindle']
|
modal_group = MODAL_GROUP_MAP['spindle']
|
||||||
|
|
||||||
|
|
||||||
class GCodeOrientSpindle(GCodeSpindle):
|
class GCodeOrientSpindle(GCodeToolState):
|
||||||
"""M19: Orient Spindle"""
|
"""M19: Orient Spindle"""
|
||||||
word_key = Word('M', 19)
|
word_key = Word('M', 19)
|
||||||
|
|
||||||
|
|
||||||
class GCodeSpindleSpeedMode(GCodeSpindle):
|
class GCodeSpindleSpeedMode(GCodeToolState):
|
||||||
word_letter = 'G'
|
word_letter = 'G'
|
||||||
modal_group = MODAL_GROUP_MAP['spindle_speed_mode']
|
modal_group = MODAL_GROUP_MAP['spindle_speed_mode']
|
||||||
|
|
||||||
@ -287,17 +287,17 @@ class GCodeSpindleRPMMode(GCodeSpindleSpeedMode):
|
|||||||
# CODE PARAMETERS DESCRIPTION
|
# CODE PARAMETERS DESCRIPTION
|
||||||
# M7, M8, M9 Coolant Control
|
# M7, M8, M9 Coolant Control
|
||||||
|
|
||||||
class GCodeCoolantMistOn(GCodeCoolant):
|
class GCodeCoolantMistOn(GCodeCoolantHeaters):
|
||||||
"""M7: turn mist coolant on"""
|
"""M7: turn mist coolant on"""
|
||||||
word_key = Word('M', 7)
|
word_key = Word('M', 7)
|
||||||
|
|
||||||
|
|
||||||
class GCodeCoolantFloodOn(GCodeCoolant):
|
class GCodeCoolantFloodOn(GCodeCoolantHeaters):
|
||||||
"""M8: turn flood coolant on"""
|
"""M8: turn flood coolant on"""
|
||||||
word_key = Word('M', 8)
|
word_key = Word('M', 8)
|
||||||
|
|
||||||
|
|
||||||
class GCodeCoolantOff(GCodeCoolant):
|
class GCodeCoolantOff(GCodeCoolantHeaters):
|
||||||
"""M9: turn all coolant off"""
|
"""M9: turn all coolant off"""
|
||||||
word_key = Word('M', 9)
|
word_key = Word('M', 9)
|
||||||
|
|
||||||
@ -309,24 +309,24 @@ class GCodeCoolantOff(GCodeCoolant):
|
|||||||
# G43.2 H Apply additional Tool Length Offset
|
# G43.2 H Apply additional Tool Length Offset
|
||||||
# G49 Cancel Tool Length Compensation
|
# G49 Cancel Tool Length Compensation
|
||||||
|
|
||||||
class GCodeToolLengthOffset(GCodeToolLength):
|
class GCodeToolLengthOffset(GCodeToolGeometry):
|
||||||
"""G43: Tool Length Offset"""
|
"""G43: Tool Length Offset"""
|
||||||
param_letters = set('H')
|
param_letters = set('H')
|
||||||
word_key = Word('G', 43)
|
word_key = Word('G', 43)
|
||||||
|
|
||||||
|
|
||||||
class GCodeDynamicToolLengthOffset(GCodeToolLength):
|
class GCodeDynamicToolLengthOffset(GCodeToolGeometry):
|
||||||
"""G43.1: Dynamic Tool Length Offset"""
|
"""G43.1: Dynamic Tool Length Offset"""
|
||||||
word_key = Word('G', 43.1)
|
word_key = Word('G', 43.1)
|
||||||
|
|
||||||
|
|
||||||
class GCodeAddToolLengthOffset(GCodeToolLength):
|
class GCodeAddToolLengthOffset(GCodeToolGeometry):
|
||||||
"""G43.2: Appkly Additional Tool Length Offset"""
|
"""G43.2: Appkly Additional Tool Length Offset"""
|
||||||
param_letters = set('H')
|
param_letters = set('H')
|
||||||
word_key = Word('G', 43.2)
|
word_key = Word('G', 43.2)
|
||||||
|
|
||||||
|
|
||||||
class GCodeCancelToolLengthOffset(GCodeToolLength):
|
class GCodeCancelToolLengthOffset(GCodeToolGeometry):
|
||||||
"""G49: Cancel Tool Length Compensation"""
|
"""G49: Cancel Tool Length Compensation"""
|
||||||
word_key = Word('G', 49)
|
word_key = Word('G', 49)
|
||||||
|
|
@ -1,137 +1,70 @@
|
|||||||
100,104c100,104
|
86,89c86,89
|
||||||
< class GCodeBedLevelingPointg1(GCodeMotion):
|
< class GCodeBedLeveling3Pointg1(GCodeMachineRoutines):
|
||||||
< """G29: Probe the bed and enable leveling compensation."""
|
< """G29: Probe the bed and enable leveling compensation."""
|
||||||
< param_letters = "ACOQEDJV"
|
< param_letters = "ACOQEDJV"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 29)
|
< word_key = Word('G', 29)
|
||||||
---
|
---
|
||||||
> #class GCodeBedLevelingPointg1(GCodeMotion):
|
> #class GCodeBedLeveling3Pointg1(GCodeMachineRoutines):
|
||||||
> # """G29: Probe the bed and enable leveling compensation."""
|
> # """G29: Probe the bed and enable leveling compensation."""
|
||||||
> # param_letters = "ACOQEDJV"
|
> # param_letters = "ACOQEDJV"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 29)
|
> # word_key = Word('G', 29)
|
||||||
112,134c112,134
|
96,109c96,109
|
||||||
< class GCodeBedLevelingLinearg2(GCodeMotion):
|
< class GCodeBedLevelingLinearg2(GCodeMachineRoutines):
|
||||||
< """G29: Probe the bed and enable leveling compensation."""
|
< """G29: Probe the bed and enable leveling compensation."""
|
||||||
< param_letters = "ACOQXYPSEDTHFBLRJV"
|
< param_letters = "ACOQXYPSEDTHFBLRJV"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 29)
|
< word_key = Word('G', 29)
|
||||||
<
|
<
|
||||||
< class GCodeBedLevelingManualm1(GCodeMotion):
|
< class GCodeBedLevelingManualm1(GCodeMachineRoutines):
|
||||||
< """G29: Measure Z heights in a grid, enable leveling compensation"""
|
< """G29: Measure Z heights in a grid, enable leveling compensation"""
|
||||||
< param_letters = "SIJXYZ"
|
< param_letters = "SIJXYZ"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 29)
|
< word_key = Word('G', 29)
|
||||||
<
|
<
|
||||||
< class GCodeBedLeveling(GCodeMotion):
|
< class GCodeBedLeveling(GCodeMachineRoutines):
|
||||||
< """G29: Probe the bed and enable leveling compensation"""
|
< """G29: Probe the bed and enable leveling compensation"""
|
||||||
< param_letters = ""
|
< param_letters = ""
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 29)
|
|
||||||
<
|
|
||||||
< class GCodeBedLevelingUnifiedm3(GCodeMotion):
|
|
||||||
< """G29: Probe the bed and enable leveling compensation."""
|
|
||||||
< param_letters = "ABCDEFHIJKLPQRSTUVWXY"
|
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 29)
|
< word_key = Word('G', 29)
|
||||||
---
|
---
|
||||||
> #class GCodeBedLevelingLinearg2(GCodeMotion):
|
> #class GCodeBedLevelingLinearg2(GCodeMachineRoutines):
|
||||||
> # """G29: Probe the bed and enable leveling compensation."""
|
> # """G29: Probe the bed and enable leveling compensation."""
|
||||||
> # param_letters = "ACOQXYPSEDTHFBLRJV"
|
> # param_letters = "ACOQXYPSEDTHFBLRJV"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 29)
|
> # word_key = Word('G', 29)
|
||||||
>
|
>
|
||||||
> #class GCodeBedLevelingManualm1(GCodeMotion):
|
> #class GCodeBedLevelingManualm1(GCodeMachineRoutines):
|
||||||
> # """G29: Measure Z heights in a grid, enable leveling compensation"""
|
> # """G29: Measure Z heights in a grid, enable leveling compensation"""
|
||||||
> # param_letters = "SIJXYZ"
|
> # param_letters = "SIJXYZ"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 29)
|
> # word_key = Word('G', 29)
|
||||||
>
|
>
|
||||||
> #class GCodeBedLeveling(GCodeMotion):
|
> #class GCodeBedLeveling(GCodeMachineRoutines):
|
||||||
> # """G29: Probe the bed and enable leveling compensation"""
|
> # """G29: Probe the bed and enable leveling compensation"""
|
||||||
> # param_letters = ""
|
> # param_letters = ""
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 29)
|
> # word_key = Word('G', 29)
|
||||||
>
|
136,139c136,139
|
||||||
> #class GCodeBedLevelingUnifiedm3(GCodeMotion):
|
< class GCodeMechanicalGantryCalibrationb(GCodeMachineRoutines):
|
||||||
> # """G29: Probe the bed and enable leveling compensation."""
|
|
||||||
> # param_letters = "ABCDEFHIJKLPQRSTUVWXY"
|
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 29)
|
|
||||||
160,164c160,164
|
|
||||||
< class GCodeMechanicalGantryCalibrationb(GCodeMotion):
|
|
||||||
< """G34: Modern replacement for Průša's TMC_Z_CALIBRATION"""
|
< """G34: Modern replacement for Průša's TMC_Z_CALIBRATION"""
|
||||||
< param_letters = "SZ"
|
< param_letters = "SZ"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('G', 34)
|
< word_key = Word('G', 34)
|
||||||
---
|
---
|
||||||
> #class GCodeMechanicalGantryCalibrationb(GCodeMotion):
|
> #class GCodeMechanicalGantryCalibrationb(GCodeMachineRoutines):
|
||||||
> # """G34: Modern replacement for Průša's TMC_Z_CALIBRATION"""
|
> # """G34: Modern replacement for Průša's TMC_Z_CALIBRATION"""
|
||||||
> # param_letters = "SZ"
|
> # param_letters = "SZ"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('G', 34)
|
> # word_key = Word('G', 34)
|
||||||
425,432c425,426
|
1045,1048c1045,1048
|
||||||
< """M43: Get information about pins."""
|
< class GCodeDeltaConfiguration(GCodeMachineConfig):
|
||||||
< param_letters = "PWETSI"
|
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('M', 43)
|
|
||||||
<
|
|
||||||
< class GCodeTogglePinsb(GCodeDigitalOutput):
|
|
||||||
< """M43T: Get information about pins."""
|
|
||||||
< param_letters = "SLIRW"
|
|
||||||
---
|
|
||||||
> """M43: Get information about pins / set pins"""
|
|
||||||
> param_letters = "PWETSIRL"
|
|
||||||
652c646
|
|
||||||
< class GCodeBaricudaOpen(GCodeDigitalOutput):
|
|
||||||
---
|
|
||||||
> class GCodeBaricuda1Open(GCodeDigitalOutput):
|
|
||||||
658c652
|
|
||||||
< class GCodeBaricudaClose(GCodeDigitalOutput):
|
|
||||||
---
|
|
||||||
> class GCodeBaricuda1Close(GCodeDigitalOutput):
|
|
||||||
664,665c658
|
|
||||||
< # TODO: duplicate class name BaricudaOpen
|
|
||||||
< class GCodeBaricudaOpen(GCodeDigitalOutput):
|
|
||||||
---
|
|
||||||
> class GCodeBaricuda2Open(GCodeDigitalOutput):
|
|
||||||
671,672c664
|
|
||||||
< # TODO: duplicate class name BaricudaClose
|
|
||||||
< class GCodeBaricudaClose(GCodeDigitalOutput):
|
|
||||||
---
|
|
||||||
> class GCodeBaricuda2Close(GCodeDigitalOutput):
|
|
||||||
768,769c760
|
|
||||||
< # TODO: duplicate class name SetLaserCoolerTemperature
|
|
||||||
< class GCodeSetLaserCoolerTemperature(GCodeCoolant):
|
|
||||||
---
|
|
||||||
> class GCodeWaitForLaserCoolerTemperature(GCodeCoolant):
|
|
||||||
775c766
|
|
||||||
< class GCodeSetFilamentDiameter(GCodeOtherModal):
|
|
||||||
---
|
|
||||||
> class GCodeSetFilamentDiameterVolumetric(GCodeOtherModal):
|
|
||||||
1051d1041
|
|
||||||
< # TODO: duplicate class name SetFilamentDiameter
|
|
||||||
1250,1254c1240,1244
|
|
||||||
< class GCodeDeltaConfiguration(GCodeOtherModal):
|
|
||||||
< """M665: Set delta geometry values"""
|
< """M665: Set delta geometry values"""
|
||||||
< param_letters = "HLRSXYZABC"
|
< param_letters = "HLRSXYZABC"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('M', 665)
|
< word_key = Word('M', 665)
|
||||||
---
|
---
|
||||||
> #class GCodeDeltaConfiguration(GCodeOtherModal):
|
> #class GCodeDeltaConfiguration(GCodeMachineConfig):
|
||||||
> # """M665: Set delta geometry values"""
|
> # """M665: Set delta geometry values"""
|
||||||
> # param_letters = "HLRSXYZABC"
|
> # param_letters = "HLRSXYZABC"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('M', 665)
|
> # word_key = Word('M', 665)
|
||||||
1268,1272c1258,1262
|
1060,1063c1060,1063
|
||||||
< class GCodeSetDeltaEndstopAdjustmentsa(GCodeOtherModal):
|
< class GCodeSetDeltaEndstopAdjustmentsa(GCodeMachineConfig):
|
||||||
< """M666: Set Delta endstop adjustments"""
|
< """M666: Set Delta endstop adjustments"""
|
||||||
< param_letters = "XYZ"
|
< param_letters = "XYZ"
|
||||||
< dialects = ['marlin2']
|
|
||||||
< word_key = Word('M', 666)
|
< word_key = Word('M', 666)
|
||||||
---
|
---
|
||||||
> #class GCodeSetDeltaEndstopAdjustmentsa(GCodeOtherModal):
|
> #class GCodeSetDeltaEndstopAdjustmentsa(GCodeMachineConfig):
|
||||||
> # """M666: Set Delta endstop adjustments"""
|
> # """M666: Set Delta endstop adjustments"""
|
||||||
> # param_letters = "XYZ"
|
> # param_letters = "XYZ"
|
||||||
> # dialects = ['marlin2']
|
|
||||||
> # word_key = Word('M', 666)
|
> # word_key = Word('M', 666)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
from .gcodes_base import *
|
from .gcodes_base import *
|
||||||
|
|
||||||
from .gcodes_legacy import *
|
from .gcodes_linuxcnc import *
|
||||||
|
|
||||||
# ======================= Prusa =======================
|
# ======================= Prusa =======================
|
||||||
# CODE PARAMETERS DESCRIPTION
|
# CODE PARAMETERS DESCRIPTION
|
||||||
|
@ -27,7 +27,7 @@ match get_default_dialect():
|
|||||||
GCodeMillimeterUnits as GCodeUseMillimeters,
|
GCodeMillimeterUnits as GCodeUseMillimeters,
|
||||||
)
|
)
|
||||||
case _:
|
case _:
|
||||||
from .gcodes_legacy import (
|
from .gcodes_linuxcnc import (
|
||||||
GCodeIncrementalDistanceMode,
|
GCodeIncrementalDistanceMode,
|
||||||
GCodeUseInches, GCodeUseMillimeters,
|
GCodeUseInches, GCodeUseMillimeters,
|
||||||
)
|
)
|
||||||
|
@ -10,50 +10,50 @@ class_types = {
|
|||||||
# unused: GCodePathControlMode
|
# unused: GCodePathControlMode
|
||||||
# unused: GCodeProgramControl
|
# unused: GCodeProgramControl
|
||||||
'g000': 'GCodeMotion', # LinearMove
|
'g000': 'GCodeMotion', # LinearMove
|
||||||
'g002': 'GCodeArcMove', # ArcOrCircleMove
|
'g002': 'GCodeArcMove', # GCodeMotion > ArcOrCircleMove
|
||||||
'g004': 'GCode', # Dwell
|
'g004': 'GCode', # Dwell
|
||||||
'g005': 'GCodeMotion', # BzierCubicSpline
|
'g005': 'GCodeMotion', # BezierCubicSpline
|
||||||
'g006': 'GCodeMotion', # DirectStepperMove
|
'g006': 'GCodeMotion', # DirectStepperMove
|
||||||
'g010': 'GCode', # Retract
|
'g010': 'GCodeMachineRoutines', # Retract
|
||||||
'g011': 'GCode', # Recover
|
'g011': 'GCodeMachineRoutines', # Recover
|
||||||
'g012': 'GCodeMotion', # CleanTheNozzle
|
'g012': 'GCodeMachineRoutines', # CleanTheNozzle
|
||||||
'g017': 'GCodePlaneSelect', # CncWorkspacePlanes
|
'g017': 'GCodePlaneSelect', # CncWorkspacePlanes
|
||||||
'g020': 'GCodeUnit', # InchUnits
|
'g020': 'GCodeUnit', # InchUnits
|
||||||
'g021': 'GCodeUnit', # MillimeterUnits
|
'g021': 'GCodeUnit', # MillimeterUnits
|
||||||
'g026': 'GCodeMotion', # MeshValidationPattern
|
'g026': 'GCodeAssistedRoutines', # MeshValidationPattern
|
||||||
'g027': 'GCodeMotion', # ParkToolhead
|
'g027': 'GCodeMachineRoutines', # ParkToolhead
|
||||||
'g028': 'GCodeMotion', # AutoHome
|
'g028': 'GCodeMachineRoutines', # AutoHome
|
||||||
'g029': 'GCodeMotion', # BedLeveling
|
'g029': 'GCodeMachineRoutines', # BedLeveling
|
||||||
'g029g1': 'GCodeMotion', # BedLevelingPoint
|
'g029g1': 'GCodeMachineRoutines', # BedLevelingPoint
|
||||||
'g029m2': 'GCodeMotion', # BedLevelingBilinear
|
'g029m2': 'GCodeMachineRoutines', # BedLevelingBilinear
|
||||||
'g029g2': 'GCodeMotion', # BedLevelingLinear
|
'g029g2': 'GCodeMachineRoutines', # BedLevelingLinear
|
||||||
'g029m1': 'GCodeMotion', # BedLevelingManual
|
'g029m1': 'GCodeMachineRoutines', # BedLevelingManual
|
||||||
'g029m3': 'GCodeMotion', # BedLevelingUnified
|
'g029m3': 'GCodeMachineRoutines', # BedLevelingUnified
|
||||||
'g030': 'GCodeMotion', # SingleZProbe
|
'g030': 'GCodeMachineRoutines', # SingleZProbe
|
||||||
'g031': 'GCodeMotion', # DockSled
|
'g031': 'GCodeMachineRoutines', # DockSled
|
||||||
'g032': 'GCodeMotion', # UndockSled
|
'g032': 'GCodeMachineRoutines', # UndockSled
|
||||||
'g033': 'GCodeMotion', # DeltaAutoCalibration
|
'g033': 'GCodeMachineRoutines', # DeltaAutoCalibration
|
||||||
'g034b': 'GCodeMotion', # MechanicalGantryCalibration
|
'g034b': 'GCodeMachineRoutines', # MechanicalGantryCalibration
|
||||||
'g034a': 'GCodeMotion', # ZSteppersAutoAlignment
|
'g034a': 'GCodeMachineRoutines', # ZSteppersAutoAlignment
|
||||||
'g035': 'GCodeMotion', # TrammingAssistant
|
'g035': 'GCodeAssistedRoutines', # TrammingAssistant
|
||||||
'g038': 'GCodeMotion', # ProbeTarget
|
'g038': 'GCodeMachineRoutines', # ProbeTarget
|
||||||
'g042': 'GCodeSelectCoordinateSystem', # MoveToMeshCoordinate
|
'g042': 'GCodeMotion', # MoveToMeshCoordinate
|
||||||
'g053': 'GCodeSelectCoordinateSystem', # MoveInMachineCoordinates
|
'g053': 'GCodeMotion', # MoveInMachineCoordinates
|
||||||
'g054': 'GCodeSelectCoordinateSystem', # WorkspaceCoordinateSystem
|
'g054': 'GCodeSelectCoordinateSystem', # WorkspaceCoordinateSystem
|
||||||
'g060': 'GCode', # SaveCurrentPosition
|
'g060': 'GCodeOtherModal', # SaveCurrentPosition
|
||||||
'g061': 'GCodeMotion', # ReturnToSavedPosition
|
'g061': 'GCodeMotion', # ReturnToSavedPosition
|
||||||
'g076': 'GCodeOtherModal', # ProbeTemperatureCalibration
|
'g076': 'GCodeMachineRoutines', # ProbeTemperatureCalibration
|
||||||
'g080': 'GCode', # CancelCurrentMotionMode
|
'g080': 'GCodeOtherModal', # CancelCurrentMotionMode
|
||||||
'g090': 'GCodeOtherModal', # AbsolutePositioning
|
'g090': 'GCodeOtherModal', # AbsolutePositioning
|
||||||
'g091': 'GCodeOtherModal', # RelativePositioning
|
'g091': 'GCodeOtherModal', # RelativePositioning
|
||||||
'g092': 'GCodeOtherModal', # SetPosition
|
'g092': 'GCodeOtherModal', # SetPosition
|
||||||
'g425': 'GCodeOtherModal', # BacklashCalibration
|
'g425': 'GCodeMachineRoutines', # BacklashCalibration
|
||||||
'm0000': 'GCodeOtherModal', # UnconditionalStop
|
'm0000': 'GCodeProgramControl', # UnconditionalStop
|
||||||
'm0003': 'GCodeSpindle', # SpindleCwLaserOn
|
'm0003': 'GCodeToolState', # SpindleCwLaserOn
|
||||||
'm0004': 'GCodeSpindle', # SpindleCcwLaserOn
|
'm0004': 'GCodeToolState', # SpindleCcwLaserOn
|
||||||
'm0005': 'GCodeSpindle', # SpindleLaserOff
|
'm0005': 'GCodeToolState', # SpindleLaserOff
|
||||||
'm0007': 'GCodeCoolant', # CoolantControls
|
'm0007': 'GCodeCoolantHeaters', # CoolantControls
|
||||||
'm0010': 'GCodeDigitalOutput', # VacuumBlowerControl
|
'm0010': 'GCodeIO', # VacuumBlowerControl
|
||||||
'm0016': 'GCodeOtherModal', # ExpectedPrinterCheck
|
'm0016': 'GCodeOtherModal', # ExpectedPrinterCheck
|
||||||
'm0017': 'GCodeOtherModal', # EnableSteppers
|
'm0017': 'GCodeOtherModal', # EnableSteppers
|
||||||
'm0018': 'GCodeOtherModal', # DisableSteppers
|
'm0018': 'GCodeOtherModal', # DisableSteppers
|
||||||
@ -61,26 +61,26 @@ class_types = {
|
|||||||
'm0021': 'GCodeIO', # InitSdCard
|
'm0021': 'GCodeIO', # InitSdCard
|
||||||
'm0022': 'GCodeIO', # ReleaseSdCard
|
'm0022': 'GCodeIO', # ReleaseSdCard
|
||||||
'm0023': 'GCodeIO', # SelectSdFile
|
'm0023': 'GCodeIO', # SelectSdFile
|
||||||
'm0024': 'GCodeOtherModal', # StartOrResumeSdPrint
|
'm0024': 'GCodeProgramControl', # StartOrResumeSdPrint
|
||||||
'm0025': 'GCodeOtherModal', # PauseSdPrint
|
'm0025': 'GCodeProgramControl', # PauseSdPrint
|
||||||
'm0026': 'GCodeIO', # SetSdPosition
|
'm0026': 'GCodeProgramControl', # SetSdPosition
|
||||||
'm0027': 'GCodeNonModal', # ReportSdPrintStatus
|
'm0027': 'GCodeMachineState', # ReportSdPrintStatus
|
||||||
'm0028': 'GCodeIO', # StartSdWrite
|
'm0028': 'GCodeIO', # StartSdWrite
|
||||||
'm0029': 'GCodeIO', # StopSdWrite
|
'm0029': 'GCodeIO', # StopSdWrite
|
||||||
'm0030': 'GCodeIO', # DeleteSdFile
|
'm0030': 'GCodeIO', # DeleteSdFile
|
||||||
'm0031': 'GCode', # PrintTime
|
'm0031': 'GCodeMachineState', # ReportPrintTime
|
||||||
'm0032': 'GCodeIO', # SelectAndStart
|
'm0032': 'GCodeProgramControl', # SelectAndStart
|
||||||
'm0033': 'GCodeIO', # GetLongPath
|
'm0033': 'GCodeIO', # GetLongPath
|
||||||
'm0034': 'GCodeIO', # SdcardSorting
|
'm0034': 'GCodeIO', # SdcardSorting
|
||||||
'm0042': 'GCodeDigitalOutput', # SetPinState
|
'm0042': 'GCodeIO', # SetPinState
|
||||||
'm0043': 'GCodeIO', # DebugPins
|
'm0043': 'GCodeIO', # DebugPins
|
||||||
'm0043b': 'GCodeDigitalOutput', # TogglePins
|
'm0043b': 'GCodeIO', # TogglePins
|
||||||
'm0048': 'GCodeMotion', # ProbeRepeatabilityTest
|
'm0048': 'GCodeMachineRoutines', # ProbeRepeatabilityTest
|
||||||
'm0073': 'GCode', # SetPrintProgress
|
'm0073': 'GCodeNonModal', # SetPrintProgress
|
||||||
'm0075': 'GCodeOtherModal', # StartPrintJobTimer
|
'm0075': 'GCodeProgramControl', # StartPrintJobTimer
|
||||||
'm0076': 'GCodeOtherModal', # PausePrintJobTimer
|
'm0076': 'GCodeProgramControl', # PausePrintJobTimer
|
||||||
'm0077': 'GCodeOtherModal', # StopPrintJobTimer
|
'm0077': 'GCodeProgramControl', # StopPrintJobTimer
|
||||||
'm0078': 'GCode', # PrintJobStats
|
'm0078': 'GCodeMachineState', # PrintJobStats
|
||||||
'm0080': 'GCodeOtherModal', # PowerOn
|
'm0080': 'GCodeOtherModal', # PowerOn
|
||||||
'm0081': 'GCodeOtherModal', # PowerOff
|
'm0081': 'GCodeOtherModal', # PowerOff
|
||||||
'm0082': 'GCodeOtherModal', # EAbsolute
|
'm0082': 'GCodeOtherModal', # EAbsolute
|
||||||
@ -88,168 +88,168 @@ class_types = {
|
|||||||
'm0085': 'GCodeOtherModal', # InactivityShutdown
|
'm0085': 'GCodeOtherModal', # InactivityShutdown
|
||||||
'm0086': 'GCodeOtherModal', # HotendIdleTimeout
|
'm0086': 'GCodeOtherModal', # HotendIdleTimeout
|
||||||
'm0087': 'GCodeOtherModal', # DisableHotendIdleTimeout
|
'm0087': 'GCodeOtherModal', # DisableHotendIdleTimeout
|
||||||
'm0092': 'GCodeUnit', # SetAxisStepsPerUnit
|
'm0092': 'GCodeOtherModal', # SetAxisStepsPerUnit
|
||||||
'm0100': 'GCodeNonModal', # FreeMemory
|
'm0100': 'GCodeMachineState', # FreeMemory
|
||||||
'm0102': 'GCodeOtherModal', # ConfigureBedDistanceSensor
|
'm0102': 'GCodeMachineRoutines', # ConfigureBedDistanceSensor
|
||||||
'm0104': 'GCodeOtherModal', # SetHotendTemperature
|
'm0104': 'GCodeToolState', # SetHotendTemperature
|
||||||
'm0105': 'GCodeNonModal', # ReportTemperatures
|
'm0105': 'GCodeMachineState', # ReportTemperatures
|
||||||
'm0106': 'GCodeDigitalOutput', # SetFanSpeed
|
'm0106': 'GCodeCoolantHeaters', # SetFanSpeed
|
||||||
'm0107': 'GCodeDigitalOutput', # FanOff
|
'm0107': 'GCodeCoolantHeaters', # FanOff
|
||||||
'm0108': 'GCodeOtherModal', # BreakAndContinue
|
'm0108': 'GCodeProgramControl', # BreakAndContinue
|
||||||
'm0109': 'GCode', # WaitForHotendTemperature
|
'm0109': 'GCodeToolState', # WaitForHotendTemperature
|
||||||
'm0110': 'GCodeOtherModal', # SetLineNumber
|
'm0110': 'GCodeOtherModal', # SetLineNumber
|
||||||
'm0111': 'GCodeOtherModal', # DebugLevel
|
'm0111': 'GCodeOtherModal', # DebugLevel
|
||||||
'm0112': 'GCodeOtherModal', # FullShutdown
|
'm0112': 'GCodeOtherModal', # FullShutdown
|
||||||
'm0113': 'GCode', # HostKeepalive
|
'm0113': 'GCodeMachineState', # HostKeepalive
|
||||||
'm0114': 'GCodeNonModal', # GetCurrentPosition
|
'm0114': 'GCodeMachineState', # GetCurrentPosition
|
||||||
'm0115': 'GCodeNonModal', # FirmwareInfo
|
'm0115': 'GCodeMachineState', # FirmwareInfo
|
||||||
'm0117': 'GCodeIO', # SetLcdMessage
|
'm0117': 'GCodeMachineState', # SetLcdMessage
|
||||||
'm0118': 'GCodeIO', # SerialPrint
|
'm0118': 'GCodeMachineState', # SerialPrint
|
||||||
'm0119': 'GCodeIO', # EndstopStates
|
'm0119': 'GCodeMachineState', # EndstopStates
|
||||||
'm0120': 'GCodeIO', # EnableEndstops
|
'm0120': 'GCodeOtherModal', # EnableEndstops
|
||||||
'm0121': 'GCodeIO', # DisableEndstops
|
'm0121': 'GCodeOtherModal', # DisableEndstops
|
||||||
'm0122': 'GCodeIO', # TmcDebugging
|
'm0122': 'GCodeMachineState', # TmcDebugging
|
||||||
'm0123': 'GCodeIO', # FanTachometers
|
'm0123': 'GCodeMachineState', # FanTachometers
|
||||||
'm0125': 'GCodeMotion', # ParkHead
|
'm0125': 'GCodeMachineRoutines', # ParkHead
|
||||||
'm0126': 'GCodeDigitalOutput', # BaricudaOpen
|
'm0126': 'GCodeDigitalOutput', # Baricuda1Open
|
||||||
'm0127': 'GCodeDigitalOutput', # BaricudaClose
|
'm0127': 'GCodeDigitalOutput', # Baricuda1Close
|
||||||
'm0128': 'GCodeDigitalOutput', # BaricudaOpen
|
'm0128': 'GCodeDigitalOutput', # Baricuda2Open
|
||||||
'm0129': 'GCodeDigitalOutput', # BaricudaClose
|
'm0129': 'GCodeDigitalOutput', # Baricuda2Close
|
||||||
'm0140': 'GCodeOtherModal', # SetBedTemperature
|
'm0140': 'GCodeCoolantHeaters', # SetBedTemperature
|
||||||
'm0141': 'GCodeOtherModal', # SetChamberTemperature
|
'm0141': 'GCodeCoolantHeaters', # SetChamberTemperature
|
||||||
'm0143': 'GCodeCoolant', # SetLaserCoolerTemperature
|
'm0143': 'GCodeCoolantHeaters', # SetLaserCoolerTemperature
|
||||||
'm0145': 'GCodeOtherModal', # SetMaterialPreset
|
'm0145': 'GCodeNonModal', # SetMaterialPreset
|
||||||
'm0149': 'GCodeUnit', # SetTemperatureUnits
|
'm0149': 'GCodeUnit', # SetTemperatureUnits
|
||||||
'm0150': 'GCodeDigitalOutput', # SetRgbWColor
|
'm0150': 'GCodeDigitalOutput', # SetRgbWColor
|
||||||
'm0154': 'GCodeNonModal', # PositionAutoReport
|
'm0154': 'GCodeNonModal', # PositionAutoReport
|
||||||
'm0155': 'GCodeNonModal', # TemperatureAutoReport
|
'm0155': 'GCodeMachineState', # TemperatureAutoReport
|
||||||
'm0163': 'GCodeOtherModal', # SetMixFactor
|
'm0163': 'GCodeOtherModal', # SetMixFactor
|
||||||
'm0164': 'GCodeOtherModal', # SaveMix
|
'm0164': 'GCodeOtherModal', # SaveMix
|
||||||
'm0165': 'GCodeOtherModal', # SetMix
|
'm0165': 'GCodeOtherModal', # SetMix
|
||||||
'm0166': 'GCodeOtherModal', # GradientMix
|
'm0166': 'GCodeOtherModal', # GradientMix
|
||||||
'm0190': 'GCode', # WaitForBedTemperature
|
'm0190': 'GCodeCoolantHeaters', # WaitForBedTemperature
|
||||||
'm0191': 'GCode', # WaitForChamberTemperature
|
'm0191': 'GCodeCoolantHeaters', # WaitForChamberTemperature
|
||||||
'm0192': 'GCode', # WaitForProbeTemperature
|
'm0192': 'GCodeToolState', # WaitForProbeTemperature
|
||||||
'm0193': 'GCodeCoolant', # SetLaserCoolerTemperature
|
'm0193': 'GCodeCoolantHeaters', # SetLaserCoolerTemperature
|
||||||
'm0200': 'GCodeOtherModal', # SetFilamentDiameter
|
'm0200': 'GCodeOtherModal', # SetFilamentDiameter
|
||||||
'm0201': 'GCodeNonModal', # PrintTravelMoveLimits
|
'm0201': 'GCodePathControlMode', # PrintTravelMoveLimits
|
||||||
'm0203': 'GCodeFeedRateMode', # SetMaxFeedrate
|
'm0203': 'GCodePathControlMode', # SetMaxFeedrate
|
||||||
'm0204': 'GCodeOtherModal', # SetStartingAcceleration
|
'm0204': 'GCodePathControlMode', # SetStartingAcceleration
|
||||||
'm0205': 'GCodeOtherModal', # SetAdvancedSettings
|
'm0205': 'GCodePathControlMode', # SetAdvancedSettings
|
||||||
'm0206': 'GCodeOtherModal', # SetHomeOffsets
|
'm0206': 'GCodeMachineConfig', # SetHomeOffsets
|
||||||
'm0207': 'GCodeOtherModal', # SetFirmwareRetraction
|
'm0207': 'GCodeMachineConfig', # FirmwareRetractionSettings
|
||||||
'm0208': 'GCodeOtherModal', # FirmwareRecover
|
'm0208': 'GCodeMachineConfig', # FirmwareRecoverSettings
|
||||||
'm0209': 'GCodeOtherModal', # SetAutoRetract
|
'm0209': 'GCodeMachineConfig', # SetAutoRetract
|
||||||
'm0211': 'GCodeOtherModal', # SoftwareEndstops
|
'm0211': 'GCodeOtherModal', # SoftwareEndstops
|
||||||
'm0217': 'GCodeOtherModal', # FilamentSwapParameters
|
'm0217': 'GCodeMachineConfig', # FilamentSwapParameters
|
||||||
'm0218': 'GCodeOtherModal', # SetHotendOffset
|
'm0218': 'GCodeToolGeometry', # SetHotendOffset
|
||||||
'm0220': 'GCodeFeedRateMode', # SetFeedratePercentage
|
'm0220': 'GCodeFeedRateMode', # SetFeedratePercentage
|
||||||
'm0221': 'GCodeOtherModal', # SetFlowPercentage
|
'm0221': 'GCodeFeedRateMode', # SetFlowPercentage
|
||||||
'm0226': 'GCodeIO', # WaitForPinState
|
'm0226': 'GCodeIO', # WaitForPinState
|
||||||
'm0240': 'GCodeIO', # TriggerCamera
|
'm0240': 'GCodeDigitalOutput', # TriggerCamera
|
||||||
'm0250': 'GCodeIO', # LcdContrast
|
'm0250': 'GCodeDigitalOutput', # LcdContrast
|
||||||
'm0255': 'GCodeIO', # LcdSleepBacklightTimeout
|
'm0255': 'GCodeDigitalOutput', # LcdSleepBacklightTimeout
|
||||||
'm0256': 'GCodeIO', # LcdBrightness
|
'm0256': 'GCodeDigitalOutput', # LcdBrightness
|
||||||
'm0260': 'GCodeDigitalOutput', # ICSend
|
'm0260': 'GCodeIO', # I2CSend
|
||||||
'm0261': 'GCodeIO', # ICRequest
|
'm0261': 'GCodeIO', # I2CRequest
|
||||||
'm0280': 'GCodeIO', # ServoPosition
|
'm0280': 'GCodeIO', # ServoPosition
|
||||||
'm0281': 'GCodeOtherModal', # EditServoAngles
|
'm0281': 'GCodeIO', # EditServoAngles
|
||||||
'm0282': 'GCodeOtherModal', # DetachServo
|
'm0282': 'GCodeIO', # DetachServo
|
||||||
'm0290': 'GCodeMotion', # Babystep
|
'm0290': 'GCodeMotion', # Babystep
|
||||||
'm0300': 'GCodeDigitalOutput', # PlayTone
|
'm0300': 'GCodeDigitalOutput', # PlayTone
|
||||||
'm0301': 'GCodeOtherModal', # SetHotendPid
|
'm0301': 'GCodeMachineConfig', # SetHotendPid
|
||||||
'm0302': 'GCodeOtherModal', # ColdExtrude
|
'm0302': 'GCodeOtherModal', # ColdExtrude
|
||||||
'm0303': 'GCodeOtherModal', # PidAutotune
|
'm0303': 'GCodeCalibrationRoutines', # PidAutotune
|
||||||
'm0304': 'GCodeOtherModal', # SetBedPid
|
'm0304': 'GCodeMachineConfig', # SetBedPid
|
||||||
'm0305': 'GCodeOtherModal', # UserThermistorParameters
|
'm0305': 'GCodeMachineConfig', # UserThermistorParameters
|
||||||
'm0306': 'GCodeOtherModal', # ModelPredictiveTempControl
|
'm0306': 'GCodeMachineConfig', # ModelPredictiveTempControl
|
||||||
'm0350': 'GCodeOtherModal', # SetMicroStepping
|
'm0350': 'GCodeMachineConfig', # SetMicroStepping
|
||||||
'm0351': 'GCodeOtherModal', # SetMicrostepPins
|
'm0351': 'GCodeMachineConfig', # SetMicrostepPins
|
||||||
'm0355': 'GCodeDigitalOutput', # CaseLightControl
|
'm0355': 'GCodeDigitalOutput', # CaseLightControl
|
||||||
'm0360': 'GCodeMotion', # ScaraThetaA
|
'm0360': 'GCodeCalibrationRoutines', # ScaraThetaA
|
||||||
'm0361': 'GCodeMotion', # ScaraThetaB
|
'm0361': 'GCodeCalibrationRoutines', # ScaraThetaB
|
||||||
'm0362': 'GCodeMotion', # ScaraPsiA
|
'm0362': 'GCodeCalibrationRoutines', # ScaraPsiA
|
||||||
'm0363': 'GCodeMotion', # ScaraPsiB
|
'm0363': 'GCodeCalibrationRoutines', # ScaraPsiB
|
||||||
'm0364': 'GCodeMotion', # ScaraPsiC
|
'm0364': 'GCodeCalibrationRoutines', # ScaraPsiC
|
||||||
'm0380': 'GCodeDigitalOutput', # ActivateSolenoid
|
'm0380': 'GCodeDigitalOutput', # ActivateSolenoid
|
||||||
'm0381': 'GCodeDigitalOutput', # DeactivateSolenoids
|
'm0381': 'GCodeDigitalOutput', # DeactivateSolenoids
|
||||||
'm0400': 'GCodeOtherModal', # FinishMoves
|
'm0400': 'GCodeNonModal', # FinishMoves
|
||||||
'm0401': 'GCodeDigitalOutput', # DeployProbe
|
'm0401': 'GCodeDigitalOutput', # DeployProbe
|
||||||
'm0402': 'GCodeDigitalOutput', # StowProbe
|
'm0402': 'GCodeDigitalOutput', # StowProbe
|
||||||
'm0403': 'GCodeOtherModal', # MmuFilamentType
|
'm0403': 'GCodeMachineConfig', # Mmu2FilamentType
|
||||||
'm0404': 'GCodeOtherModal', # SetFilamentDiameter
|
'm0404': 'GCodeMachineConfig', # SetFilamentDiameter
|
||||||
'm0405': 'GCodeOtherModal', # FilamentWidthSensorOn
|
'm0405': 'GCodeMachineConfig', # FilamentWidthSensorOn
|
||||||
'm0406': 'GCodeOtherModal', # FilamentWidthSensorOff
|
'm0406': 'GCodeMachineConfig', # FilamentWidthSensorOff
|
||||||
'm0407': 'GCodeNonModal', # FilamentWidth
|
'm0407': 'GCodeMachineConfig', # FilamentWidth
|
||||||
'm0410': 'GCodeOtherModal', # Quickstop
|
'm0410': 'GCodeProgramControl', # Quickstop
|
||||||
'm0412': 'GCodeOtherModal', # FilamentRunout
|
'm0412': 'GCodeMachineConfig', # FilamentRunout
|
||||||
'm0413': 'GCodeOtherModal', # PowerLossRecovery
|
'm0413': 'GCodeMachineConfig', # PowerLossRecovery
|
||||||
'm0420': 'GCodeNonModal', # BedLevelingState
|
'm0420': 'GCodeMachineConfig', # BedLevelingState
|
||||||
'm0421': 'GCodeOtherModal', # SetMeshValue
|
'm0421': 'GCodeMachineConfig', # SetMeshValue
|
||||||
'm0422': 'GCodeOtherModal', # SetZMotorXy
|
'm0422': 'GCodeMachineConfig', # SetZMotorXy
|
||||||
'm0423': 'GCodeOtherModal', # XTwistCompensation
|
'm0423': 'GCodeMachineConfig', # XTwistCompensation
|
||||||
'm0425': 'GCodeOtherModal', # BacklashCompensation
|
'm0425': 'GCodeMachineConfig', # BacklashCompensation
|
||||||
'm0428': 'GCodeOtherModal', # HomeOffsetsHere
|
'm0428': 'GCodeMachineConfig', # HomeOffsetsHere
|
||||||
'm0430': 'GCodeOtherModal', # PowerMonitor
|
'm0430': 'GCodeNonModal', # PowerMonitor
|
||||||
'm0486': 'GCodeOtherModal', # CancelObjects
|
'm0486': 'GCodeProgramControl', # CancelObjects
|
||||||
'm0493': 'GCodeOtherModal', # FixedTimeMotion
|
'm0493': 'GCodePathControlMode', # FixedTimeMotion
|
||||||
'm0500': 'GCodeNonModal', # SaveSettings
|
'm0500': 'GCodeMachineConfig', # SaveSettings
|
||||||
'm0501': 'GCodeOtherModal', # RestoreSettings
|
'm0501': 'GCodeMachineConfig', # RestoreSettings
|
||||||
'm0502': 'GCodeOtherModal', # FactoryReset
|
'm0502': 'GCodeMachineConfig', # FactoryReset
|
||||||
'm0503': 'GCodeNonModal', # ReportSettings
|
'm0503': 'GCodeMachineConfig', # ReportSettings
|
||||||
'm0504': 'GCodeNonModal', # ValidateEepromContents
|
'm0504': 'GCodeNonModal', # ValidateEepromContents
|
||||||
'm0510': 'GCodeOtherModal', # LockMachine
|
'm0510': 'GCodeOtherModal', # LockMachine
|
||||||
'm0511': 'GCodeOtherModal', # UnlockMachine
|
'm0511': 'GCodeOtherModal', # UnlockMachine
|
||||||
'm0512': 'GCodeNonModal', # SetPasscode
|
'm0512': 'GCodeMachineConfig', # SetPasscode
|
||||||
'm0524': 'GCodeOtherModal', # AbortSdPrint
|
'm0524': 'GCodeProgramControl', # AbortSdPrint
|
||||||
'm0540': 'GCodeNonModal', # EndstopsAbortSd
|
'm0540': 'GCodeMachineConfig', # EndstopsAbortSd
|
||||||
'm0569': 'GCodeOtherModal', # SetTmcSteppingMode
|
'm0569': 'GCodeMachineConfig', # SetTmcSteppingMode
|
||||||
'm0575': 'GCodeOtherModal', # SerialBaudRate
|
'm0575': 'GCodeMachineConfig', # SerialBaudRate
|
||||||
'm0592': 'GCodeOtherModal', # NonlinearExtrusionControl
|
'm0592': 'GCodeMachineConfig', # NonlinearExtrusionControl
|
||||||
'm0593': 'GCodeOtherModal', # ZvInputShaping
|
'm0593': 'GCodeCalibrationRoutines', # ZvInputShaping
|
||||||
'm0600': 'GCode', # FilamentChange
|
'm0600': 'GCodeMachineRoutines', # FilamentChange
|
||||||
'm0603': 'GCodeOtherModal', # ConfigureFilamentChange
|
'm0603': 'GCodeMachineConfig', # ConfigureFilamentChange
|
||||||
'm0605': 'GCodeOtherModal', # MultiNozzleMode
|
'm0605': 'GCodeMachineConfig', # MultiNozzleMode
|
||||||
'm0665': 'GCodeOtherModal', # DeltaConfiguration
|
'm0665': 'GCodeMachineConfig', # DeltaConfiguration
|
||||||
'm0665b': 'GCodeOtherModal', # ScaraConfiguration
|
'm0665b': 'GCodeMachineConfig', # ScaraConfiguration
|
||||||
'm0666b': 'GCodeOtherModal', # SetDualEndstopOffsets
|
'm0666b': 'GCodeMachineConfig', # SetDualEndstopOffsets
|
||||||
'm0666a': 'GCodeOtherModal', # SetDeltaEndstopAdjustments
|
'm0666a': 'GCodeMachineConfig', # SetDeltaEndstopAdjustments
|
||||||
'm0672': 'GCodeOtherModal', # DuetSmartEffectorSensitivity
|
'm0672': 'GCodeMachineConfig', # DuetSmartEffectorSensitivity
|
||||||
'm0701': 'GCodeOtherModal', # LoadFilament
|
'm0701': 'GCodeMachineRoutines', # LoadFilament
|
||||||
'm0702': 'GCodeOtherModal', # UnloadFilament
|
'm0702': 'GCodeMachineRoutines', # UnloadFilament
|
||||||
'm0710': 'GCodeOtherModal', # ControllerFanSettings
|
'm0710': 'GCodeMachineConfig', # ControllerFanSettings
|
||||||
'm7219': 'GCodeDigitalOutput', # MaxControl
|
'm7219': 'GCodeDigitalOutput', # MAX7219Control
|
||||||
'm0808': 'GCodeOtherModal', # RepeatMarker
|
'm0808': 'GCodeProgramControl', # RepeatMarker
|
||||||
'm0810': 'GCodeOtherModal', # GCodeMacros
|
'm0810': 'GCodeProgramControl', # GCodeMacros
|
||||||
'm0851': 'GCodeOtherModal', # XyzProbeOffset
|
'm0851': 'GCodeToolGeometry', # XyzProbeOffset
|
||||||
'm0852': 'GCodeOtherModal', # BedSkewCompensation
|
'm0852': 'GCodeMachineConfig', # BedSkewCompensation
|
||||||
'm0860': 'GCodeOtherModal', # ICPositionEncoders
|
'm0860': 'GCodeMachineConfig', # I2CPositionEncoders
|
||||||
'm0871': 'GCodeOtherModal', # ProbeTemperatureConfig
|
'm0871': 'GCodeMachineConfig', # ProbeTemperatureConfig
|
||||||
'm0876': 'GCode', # HandlePromptResponse
|
'm0876': 'GCodeMachineConfig', # HandlePromptResponse
|
||||||
'm0900': 'GCodeOtherModal', # LinearAdvanceFactor
|
'm0900': 'GCodeMachineConfig', # LinearAdvanceFactor
|
||||||
'm0906': 'GCodeOtherModal', # StepperMotorCurrent
|
'm0906': 'GCodeMachineConfig', # TrinamicStepperMotorCurrent
|
||||||
'm0907': 'GCodeOtherModal', # SetMotorCurrent
|
'm0907': 'GCodeMachineConfig', # TrimpotStepperMotorCurrent
|
||||||
'm0908': 'GCodeOtherModal', # SetTrimpotPins
|
'm0908': 'GCodeMachineConfig', # SetTrimpotPins
|
||||||
'm0909': 'GCodeNonModal', # DacPrintValues
|
'm0909': 'GCodeMachineState', # ReportDacStepperCurrent
|
||||||
'm0910': 'GCodeNonModal', # CommitDacToEeprom
|
'm0910': 'GCodeMachineState', # CommitDacToEeprom
|
||||||
'm0911': 'GCode', # TmcOtPreWarnCondition
|
'm0911': 'GCodeMachineState', # TmcOtPreWarnCondition
|
||||||
'm0912': 'GCode', # ClearTmcOtPreWarn
|
'm0912': 'GCodeMachineState', # ClearTmcOtPreWarn
|
||||||
'm0913': 'GCodeOtherModal', # SetHybridThresholdSpeed
|
'm0913': 'GCodeMachineConfig', # SetHybridThresholdSpeed
|
||||||
'm0914': 'GCodeOtherModal', # TmcBumpSensitivity
|
'm0914': 'GCodeMachineConfig', # TmcBumpSensitivity
|
||||||
'm0915': 'GCode', # TmcZAxisCalibration
|
'm0915': 'GCodeCalibrationRoutines', # TmcZAxisCalibration
|
||||||
'm0916': 'GCode', # LThermalWarningTest
|
'm0916': 'GCodeCalibrationRoutines', # L6474ThermalWarningTest
|
||||||
'm0917': 'GCode', # LOvercurrentWarningTest
|
'm0917': 'GCodeCalibrationRoutines', # L6474OvercurrentWarningTest
|
||||||
'm0918': 'GCode', # LSpeedWarningTest
|
'm0918': 'GCodeCalibrationRoutines', # L6474SpeedWarningTest
|
||||||
'm0919': 'GCodeOtherModal', # TmcChopperTiming
|
'm0919': 'GCodeMachineConfig', # TmcChopperTiming
|
||||||
'm0928': 'GCodeIO', # StartSdLogging
|
'm0928': 'GCodeIO', # StartSdLogging
|
||||||
'm0951': 'GCodeOtherModal', # MagneticParkingExtruder
|
'm0951': 'GCodeMachineConfig', # MagneticParkingExtruder
|
||||||
'm0993': 'GCodeIO', # BackUpFlashSettingsToSd
|
'm0993': 'GCodeIO', # BackUpFlashSettingsToSd
|
||||||
'm0994': 'GCodeIO', # RestoreFlashFromSd
|
'm0994': 'GCodeIO', # RestoreFlashFromSd
|
||||||
'm0995': 'GCodeIO', # TouchScreenCalibration
|
'm0995': 'GCodeIO', # TouchScreenCalibration
|
||||||
'm0997': 'GCode', # FirmwareUpdate
|
'm0997': 'GCodeMachineConfig', # FirmwareUpdate
|
||||||
'm0999': 'GCodeOtherModal', # StopRestart
|
'm0999': 'GCodeOtherModal', # StopRestart
|
||||||
't0000': 'GCodeOtherModal', # SelectOrReportTool
|
't0000': 'GCodeOtherModal', # SelectOrReportTool
|
||||||
't0001': 'GCode', # MmuSpecialCommands
|
't0001': 'GCodeOtherModal', # MmuSpecialCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
extra_attributes = {
|
extra_attributes = {
|
||||||
@ -257,8 +257,13 @@ extra_attributes = {
|
|||||||
'g021': ['unit_id = 1'], # MillimeterUnits
|
'g021': ['unit_id = 1'], # MillimeterUnits
|
||||||
}
|
}
|
||||||
|
|
||||||
|
valid_chars = ascii_letters + '_' + ''.join(str(i) for i in range(10))
|
||||||
|
|
||||||
def sanitize(string):
|
def sanitize(string):
|
||||||
return ''.join([char if char in ascii_letters else '' for char in string])
|
""" clean a string so it's suitable to act as a class name
|
||||||
|
NOTE: does not replace accented characters by their closest equivalent """
|
||||||
|
x = lambda w: w[0].upper() + w[1:]
|
||||||
|
return ''.join([char if char in valid_chars else '' for char in ''.join([x(word) for word in string.split(' ')])])
|
||||||
|
|
||||||
def code_val(string):
|
def code_val(string):
|
||||||
try:
|
try:
|
||||||
@ -291,7 +296,7 @@ def extract_data(filename):
|
|||||||
code = int(code)
|
code = int(code)
|
||||||
elif line.startswith('title: '):
|
elif line.startswith('title: '):
|
||||||
title = line[7:].rstrip()
|
title = line[7:].rstrip()
|
||||||
class_name = sanitize(title.title())
|
class_name = sanitize(title)
|
||||||
elif line.startswith('codes: '):
|
elif line.startswith('codes: '):
|
||||||
codes = line[8:-2].replace(' ','').split(',')
|
codes = line[8:-2].replace(' ','').split(',')
|
||||||
elif line.startswith('brief: '):
|
elif line.startswith('brief: '):
|
||||||
@ -305,7 +310,6 @@ def extract_data(filename):
|
|||||||
out += f'''class {comment}GCode{class_name}{name_suffix}({class_types[tag]}):
|
out += f'''class {comment}GCode{class_name}{name_suffix}({class_types[tag]}):
|
||||||
"""{', '.join(codes)}: {brief}"""
|
"""{', '.join(codes)}: {brief}"""
|
||||||
param_letters = "{''.join(param_letters)}"
|
param_letters = "{''.join(param_letters)}"
|
||||||
dialects = ['marlin2']
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
if len(codes) > 1:
|
if len(codes) > 1:
|
||||||
@ -333,7 +337,7 @@ if __name__ == '__main__':
|
|||||||
all_classes = []
|
all_classes = []
|
||||||
|
|
||||||
print("# DO NOT EDIT - file generated with pygcode/src/pygcode/tools/marlin_parse_MarlinDocumentation.py\nfrom .gcodes_base import *\n")
|
print("# DO NOT EDIT - file generated with pygcode/src/pygcode/tools/marlin_parse_MarlinDocumentation.py\nfrom .gcodes_base import *\n")
|
||||||
print("# TODO: manual changes have been made! see pygcode/src/pygcode/gcode_marlin.patch", file=stderr)
|
print("# NOTE: it is likely manual changes have been made to the previous output! see pygcode/src/pygcode/gcode_marlin.patch", file=stderr)
|
||||||
|
|
||||||
for filename in argv[1:]:
|
for filename in argv[1:]:
|
||||||
name, body = extract_data(filename)
|
name, body = extract_data(filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user