From e5f166526684500e5b007431772c1715a6b5f423 Mon Sep 17 00:00:00 2001 From: Mikkel Schmidt Date: Tue, 3 Dec 2024 21:37:49 +0100 Subject: [PATCH] Macros: fix START/END_FEATURE for use with PS Find: (;TYPE:((?:\w+|[[:blank:]])+)\n)(((.|\s|)(?!M204(\w|\s)+;TYPE:))+) Replace with: ${1}START_FEATURE FEATURE="${2}"\n${3}\nEND_FEATURE FEATURE="${2}"\n This encapsulates all gcode marked by ;TYPE in START_FEATURE and END_FEATURE. --- macros/util.cfg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/macros/util.cfg b/macros/util.cfg index 80eaa3c5..d43b911f 100644 --- a/macros/util.cfg +++ b/macros/util.cfg @@ -312,14 +312,14 @@ gcode: [gcode_macro START_FEATURE] gcode: - RATOS_DEBUG PREFIX="G-Code" MSG="Start {params.FEATURE} feature gcode" - {% set scv = printer.toolhead.square_corner_velocity %} - {% set accel = printer.toolhead.accel %} - {% set ratio = printer.toolhead.minimum_cruise_ratio %} - SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="scv" VALUE={scv} - SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="accel" VALUE={accel} - SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="ratio" VALUE={ratio} - _USER_START_FEATURE FEATURE={params.FEATURE} + DEBUG_ECHO PREFIX="G-Code" MSG="Start {params.FEATURE} feature gcode" + {% set scv = printer.toolhead.square_corner_velocity|int|default(5) %} + {% set accel = printer.toolhead.max_accel|int|default(10000) %} + {% set ratio = printer.toolhead.minimum_cruise_ratio|float|default(0.5) %} + SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="scv" VALUE={scv} + SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="accel" VALUE={accel} + SET_GCODE_VARIABLE MACRO="END_FEATURE" VARIABLE="ratio" VALUE={ratio} + _USER_START_FEATURE FEATURE="{params.FEATURE}" [gcode_macro END_FEATURE] @@ -327,9 +327,9 @@ variable_scv: 5 variable_accel: 10000 # internal use only. Do not touch! variable_ratio: 0.5 # internal use only. Do not touch! gcode: - RATOS_DEBUG PREFIX="G-Code" MSG="End {params.FEATURE} feature gcode" - SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={scv} ACCEL={accel} MINIMUM_CRUISE_RATIO={ratio} - _USER_END_FEATURE FEATURE={params.FEATURE} SCV={scv} ACCEL={accel} RATIO={ratio} + DEBUG_ECHO PREFIX="G-Code" MSG="End {params.FEATURE} feature gcode" + SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={scv} ACCEL={accel} MINIMUM_CRUISE_RATIO={ratio} + _USER_END_FEATURE FEATURE="{params.FEATURE}" SCV={scv} ACCEL={accel} RATIO={ratio} [gcode_macro _ON_LAYER_CHANGE]