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

Override CARTOGRAPHER_THRESHOLD_SCAN to tell user if their printer is set to scan mode #540

Open
pellcorp opened this issue Feb 11, 2025 · 1 comment

Comments

@pellcorp
Copy link
Owner

Something like this should work, just needs some testing

[gcode_macro CARTOGRAPHER_THRESHOLD_SCAN]
rename_existing: _CARTOGRAPHER_THRESHOLD_SCAN
gcode:
    {% set mode = printer.configfile.settings["scanner"].mode|default('scan') %}
    {% if mode == 'touch' %}
      _CARTOGRAPHER_THRESHOLD_SCAN {rawparams}
    {% else %}
      RESPOND TYPE=error MSG='Cartographer is configured for scan, not touch!'
    {% endif %}

So then if someone has accidentally set cartographer to scan mode, will show a more informative error, hopefully we can get rid of this in a later release.

@pellcorp
Copy link
Owner Author

This might work as long as printer.configfile.settings["scanner"].mode|default('scan') takes into account a mode change in save config, need to check that.

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

No branches or pull requests

1 participant