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

Mesh Editor - Overhaul #2737

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Conversation

kisslorand
Copy link
Contributor

This PR is an overhaul of the "MeshEdit" menu.

Bugfix:

  • in case of mesh parsing error a popup would appear, the preparation of that popup's text could have easily cause an overflow with unpredictable outcome, most probably a corrupted memory and/or freeze; it's fixed now
  • in calculating the dots shade there are some unsigned variables which could have negative values assigned to them resulting an undefined behaviour; it's fixed now

GUI changes:

  • the navigation between the mesh points is circular, rows and columns are incremented/decremented in a circular way, they do not stop at their min/max position

Functionality:

  • the full GUI is drew only if the full mesh data is loaded
  • no more empty mash data menu in case of invalid mesh data
  • in case of invalid mesh data now there's a popup announcing it to the user (not a GUI with no mesh data, leaving the user unaware what's the issue)
  • the probed mesh points are reached at the speed defined in "config.ini" by the "level_feedrate" parameter, not crawling as a lazy snail

Behind the scene:

This PR changes the logic of the retrieved mesh data organization in the memory. The data is saved in the right order of the rows even if it is retrieved in reverse order. It makes navigation through mesh data, accessing its data straight forward. Previously a continual recalculation with persistent and multiple checks of inversed rows were made for every mesh point access, even at a simple navigation through them. Now the only time when the reversing of the rows order has to be taken into account is when a mesh point is edited. In other words the rows inversion is checked only when mesh data exchange is taking place between the TFT and mainboard.
The current logic made possible to get rid of a ton of functions needed for that perpetual and multiple rows inversion check. This and some other logic related changes resulted in reduction of size by 500 bytes despite the newly introduced GUI and functionality enhancements.

@kisslorand kisslorand force-pushed the Mesh-edit-cleanup branch 3 times, most recently from 56d8220 to e057f61 Compare March 3, 2023 12:58
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.

2 participants