Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improves macro param default value handling #524

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

pedrolamas
Copy link
Member

@pedrolamas pedrolamas commented Feb 18, 2022

Improves the regular expression used to detect macro parameter defaults. This should be a bit more permissive with white-space and multiple params on the Jinja2 default function.

Tested with the following example:

[gcode_macro TEST]
gcode:
  {% set A = params.A | default(0, true) | float %}
  {% set B = params.B | int | default(0.005, true) | float %}
  {% set C = params.C | default("PLA", true) %}
  {% set D = params.D | default("PLA") %}
  {% set E = params.E | int | default(0.2) %}

The above example macro will show like this:

image

Fixes #376

Signed-off-by: Pedro Lamas [email protected]

Copy link
Member

@matmen matmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pedrolamas pedrolamas merged commit 06c05d2 into fluidd-core:develop Feb 18, 2022
@pedrolamas pedrolamas deleted the pedrolamas/376 branch February 18, 2022 17:35
@matmen matmen added this to the Release: 1.17 milestone Feb 22, 2022
matmen pushed a commit to matmen/fluidd that referenced this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI - QoL Improvements to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Macro parameter inputs aren't populated if floats are used.
2 participants