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

Add get_status() method to screws_tilt_adjust #5921

Merged
merged 5 commits into from
Dec 17, 2022
Merged

Add get_status() method to screws_tilt_adjust #5921

merged 5 commits into from
Dec 17, 2022

Conversation

theophile
Copy link
Contributor

This is a resubmission of my earlier PR #4634 with additional work to fix the previously identified whitespace issues and to add the required documentation. Here's the explanation from the original PR:

This adds a get_status() method to the screws_tilt_adjust.py module so that gcode macros and menu elements can read the results from the screws_tilt_calculate command. This creates a new printer.screws_tilt_adjust object with two properties:

error: False by default, but True if the screws_tilt_calculate command triggered the "bed level exceeds configured limits" error.
results: Until the screws_tilt_calculate command is run, this is an empty python list. But once screws_tilt_calculate has completed successfully, this is a list containing a python dictionary for each configured bed screw. Each of those dictionaries contains the following keys:

  • name: Value is the name of the screw from the config file
  • x: Value is the configured X coordinate of the screw
  • y: Value is the configured Y coordinate of the screw
  • z: Value is the measured Z probe height above the screw
  • sign:* Value is either "CW" for clockwise or "CCW" for counter-clockwise
  • adjust:* Value is the amount the screw must be adjusted, expressed in the same "time" format as is output in the console. (e.g. 01:15 for one full turn plus a quarter turn)

*The dictionary for the "base" screw does not have the sign or adjust keys because the calculation assumes the base screw will not be adjusted.

I have successfully used this new get_status() method together with a handful of macros, custom menus, display groups, and even a couple of custom glyphs to enable Z-probe bed tramming directly from the printer LCD, with a rudimentary GUI and everything.

@KevinOConnor
Copy link
Collaborator

Thanks. In general it seems fine to me. As a high-level comment though, have some keys missing from a dictionary is really annoying to deal with - might be better to just add dummy {'sign': 'CW', 'adjust': '00:00'} values to it.

@matthewlloyd - do you have any comments on this?

-Kevin

@KevinOConnor KevinOConnor self-assigned this Dec 12, 2022
@KevinOConnor KevinOConnor added the pending feedback Topic is pending feedback from submitter label Dec 12, 2022
@theophile
Copy link
Contributor Author

Thanks. I went ahead and added the dummy values.

@KevinOConnor KevinOConnor merged commit 2a25733 into Klipper3d:master Dec 17, 2022
@KevinOConnor
Copy link
Collaborator

Thanks.

-Kevin

@pedrolamas
Copy link
Contributor

Hi @theophile, thank you for your work on this!

I didn't notice this PR at the time, but as I am looking into adding support for this in Fluidd and I wonder if instead of suffixing ' (base)' to the base screw, wouldn't it make more sense to have a base boolean property as part of the screw dictionary?

As it stands "base" is an English word yet the names of the screws can be whatever users want to call them, but having a boolean would allow the UI's (and macro's) to better handle the "base" screw.

What do you think of this?

eliasbakken pushed a commit to intelligent-agent/klipper that referenced this pull request Jan 31, 2023
Gi7mo pushed a commit to Gi7mo/klipper that referenced this pull request Feb 15, 2023
SoftFever pushed a commit to SoftFever/klipper that referenced this pull request Mar 14, 2023
SoftFever added a commit to SoftFever/klipper that referenced this pull request Mar 14, 2023
SoftFever added a commit to SoftFever/klipper that referenced this pull request Mar 14, 2023
stephas pushed a commit to stephas/klipper that referenced this pull request Mar 21, 2023
tntclaus pushed a commit to tntclaus/klipper that referenced this pull request May 29, 2023
revilo196 pushed a commit to revilo196/klipper that referenced this pull request Jun 24, 2023
rogerlz referenced this pull request in KalicoCrew/kalico Dec 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending feedback Topic is pending feedback from submitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants