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

feat: add _CLIENT_LINEAR_MOVE macro #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

meteyou
Copy link
Member

@meteyou meteyou commented Nov 14, 2024

This PR will add the macro _CLIENT_LINEAR_MOVE. This will make the console less noisy for UI movements.

This PR fixes #38

@meteyou meteyou changed the title feat: add _CLIENT_AXIS_MOVE and _CLIENT_EXTRUDER_MOVE macros feat: add _CLIENT_LINEAR_MOVE macro Nov 15, 2024
client.cfg Outdated Show resolved Hide resolved
@meteyou
Copy link
Member Author

meteyou commented Nov 16, 2024

@pedrolamas thx for the hint and your suggestion sound future proof and has no negative impact right now. I commit it.

Comment on lines +306 to +311
{% if 'X' in params or 'Y' in params or 'Z' in params %}
G9{ 0 if ABSOLUTE else 1 }
{% endif %}
{% if 'E' in params %}
M8{ 2 if ABSOLUTE_E else 3 }
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just checking if the parameter exists or not, not if it is empty (we can do _CLIENT_LINEAR_MOVE X= and Klipper will be just fine with that, so this is not correct)

So we need to check for param exists AND ensure that the value is NOT empty.

I took it a step further and just checked for the movement parts we are sending.

Suggested change
{% if 'X' in params or 'Y' in params or 'Z' in params %}
G9{ 0 if ABSOLUTE else 1 }
{% endif %}
{% if 'E' in params %}
M8{ 2 if ABSOLUTE_E else 3 }
{% endif %}
{% if x_move or y_move or z_move %}
G9{ 0 if ABSOLUTE else 1 }
{% endif %}
{% if e_move %}
M8{ 2 if ABSOLUTE_E else 3 }
{% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helper macro to mitigate "noise" from restoring state after UI move
2 participants