Fix where 'ACCEL_CHIP' required double quoting#235
Fix where 'ACCEL_CHIP' required double quoting#235Contomo wants to merge 1 commit intoFrix-x:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors three gcode macros in dummy_macros.cfg to replace manual parameter filtering and loop-based attribute construction with params.update() and xmlattr rendering, ensuring ACCEL_CHIP and other optional parameters are correctly quoted. Sequence diagram for macro parameter handling in gcode macrossequenceDiagram
participant Macro as gcode_macro
participant Params as params
participant Render as xmlattr
Macro->>Params: update() with macro variables
Macro->>Render: Render params as xmlattr
Render-->>Macro: Quoted attributes for command
Macro->>Macro: Execute command with quoted params
Class diagram for updated macro parameter handlingclassDiagram
class Params {
+update(dict)
+xmlattr
}
class gcode_macro {
-macro variables
+params: Params
+command execution
}
gcode_macro --> Params: uses
Params --> xmlattr: renders attributes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks a lot for the issue and PR! It indeed solves the quoting issue with spaces in string parameters (like ACCEL_CHIP="adxl345 T0"), which I agree is a problem with the current dummy macros. However, switching everything to {params|xmlattr} also introduces a side effect with optional parameters that will stay empty and be emmited like Z_HEIGHT="" and that will break the Python side, since gcmd.get_float() tries to parse "" and fails. So that's why in my current macros, I've got the things done like this with those optional values skipped entirely when not provided. So I won’t merge this version as-is, but if you are OK, I’ll adapt it into a combined solution that:
|
|
Can you have a look at #239 and see if it's working for you? |
When is that the issue? or rather, when is that the case? The only way i can get this issue is when manually entering "" Or may that be a fluid specific quirk? (im using mainsail) Ill try out your fix once the printer is not in pieces anymore ^^ |
possible fix for issue ticket #234
Summary by Sourcery
Update Shaketune dummy_macros.cfg to simplify parameter handling in gcode macros by using params.update and xmlattr filter, fixing ACCEL_CHIP quoting issue
Bug Fixes:
Enhancements: