1. use the status reference instead of regex matching (this was coded before the status existed)
2. change icons to reflect the rotation direction
3. change icon to reflect that the adjustment is good enough (according to klipper docs below 6 minutes)
4. auto open the panel when screws_tilt_calculate finished
close#1231
improves performance and makes the code cleaner
* add parameters instead of calling methods afterwards
* remove a a lot of size requests
* remove parameters that are being set to the default value
* simplify dialogs containers
this removes create_panel function from panels and mandates a class name Panel
remove panel_type param and only use a panel_name that is it's filename
remove load_panel dict
always reinit panel, (simpler and safer but slower)
* Use max_distance for fitting screws to buttons
The max distance is at most 1/3 of the diagonal,
depending on how many screws are there in horizontal or
vertical orientation.
This is a safe guard to prevent assigning screws to buttons
that would confuse the users, for very skewed screw configs.
use a smaller button scale fixes#891
Co-authored-by: alfrix <alfredomonclus@gmail.com>
Co-authored-by: czaky <jendrzej.w@lczak.net>
Use f-strings
Avoid unnecessary casts to str()bool()int()
Ensure file closure
Merge nested ifs
Simplify for-assigns-appends with comprehensions and internal functions
Avoid shadowing internal function names
Initialize variables
Return value directly instead of assign then return
Make some methods static
Fixes#443 on my printer with 6 bed screws.
It seemed to work with 3, 4, and 6 bed screws defined in printer.cfg
Also, added if statement to check for "screws_tilt_adjust" to avoid throwing an error when the section is not present.