feat(macros): new commands to make temporary on-the-fly changes to heatsoak configuration easier#126
Conversation
… variables easier - adds _SHOW_GCODE_VARIABLES and _RESET_GCODE_VARIABLES
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new heatsoaking macro file providing adaptive (beacon-aware) and fixed heat soak modes with validation and runtime controls, plus two utility macros to reset and display gcode macro variables. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
configuration/macros/util.cfg (1)
507-507: Trim each variable name after splittingVARIABLES.On Line 507 and Line 556,
split(",")keeps whitespace. Inputs likeVARIABLES=a, bmakebbecome" b"and fail lookup.Proposed fix
- {% set vars = params.VARIABLES.split(",") %} + {% set vars = params.VARIABLES.split(",")|map("trim")|list %} ... - {% set vars = params.VARIABLES.split(",") %} + {% set vars = params.VARIABLES.split(",")|map("trim")|list %}Also applies to: 556-556
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@configuration/macros/util.cfg` at line 507, When splitting params.VARIABLES into vars (the expression {% set vars = params.VARIABLES.split(",") %}), each item may retain surrounding whitespace (e.g., " b") and fail lookups; change the logic to trim whitespace from each element after split (map/strip each item) so vars contains cleaned names, and apply the same change to the other occurrence where params.VARIABLES.split(",") is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@configuration/macros/heatsoaking.cfg`:
- Around line 67-69: The validation message for duration_mins incorrectly says
"must be a positive number" while DURATION=0 is allowed (used by
USE_NO_HEATSOAK); update the error text in the duration_mins check (the block
that calls action_raise_error when duration_mins < 0) to say "must be a
non-negative number specifying the heatsoak duration in minutes" so it matches
accepted value 0 and references DURATION/USE_NO_HEATSOAK semantics.
- Around line 42-43: The Jinja2 filter order is wrong: change occurrences where
settings.variable_beacon_adaptive_heat_soak_layer_quality (and the similar
setting on the other occurrence) are currently using |int|default(...) to
instead apply |default(...) before |int (e.g.
settings.variable_beacon_adaptive_heat_soak_layer_quality|default(3)|int) so
undefined or non-convertible values get a safe default before integer
conversion; update both places mentioned (the second occurrence at the other
adaptive heat soak setting) accordingly.
---
Nitpick comments:
In `@configuration/macros/util.cfg`:
- Line 507: When splitting params.VARIABLES into vars (the expression {% set
vars = params.VARIABLES.split(",") %}), each item may retain surrounding
whitespace (e.g., " b") and fail lookups; change the logic to trim whitespace
from each element after split (map/strip each item) so vars contains cleaned
names, and apply the same change to the other occurrence where
params.VARIABLES.split(",") is used.
- provides default RatOS macro variables for bed_heat_soak_time and hotend_heat_soak_time. These deafults (0) were previously implied at each point of use. However, actual variables are required to allow the values to be dynamically changed at runtime via SET_GCODE_VARIABLE. - add helper macros HEATSOAK_SETTINGS, RESET_HEATSOAK_SETTINGS, USE_ADPATIVE_HEATSOAK, USE_FIXED_HEATSOAK and USE_NO_HEATSOAK that make it easier to apply temporary override of bed heatsoak settings.
f1ea261 to
edd43cf
Compare
Uh oh!
There was an error while loading. Please reload this page.