Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

Enabled 2 mesh viewers

Open classicrocker883 opened this issue 2 years ago • 9 comments
trafficstars

Description

for ProUI:

This adds the option to enable two types of mesh viewers.
Toggle between the older "Red ..0.. Green" square block style and the newer rainbow color round style.

  • add menu option to view 2 ways to view mesh.
  • renamed to MSG_CHANGE_MESH from MSG_CHANGE_MESH_VIEWER

changed in Conditionals_post.h so USE_GRID_MESHVIEWER is defined when ProUI is used, because bedlevelTools is. in settings.cpp, also added a couple relevant comments to other things in settings.cpp.

Requirements

DWIN_LCD_PROUI HAS_MESH

Benefits

gives the user the option to toggle between the two ways to view the mesh.

Configurations

Related Issues

[!NOTE] in meshviewer.cpp I wrote a TODO: comment because set_status_and_level was changed in marlinui.h (which is now in the other PR).

I'm not sure which is right... either leaving how this function is defined, and just changing how it is used in meshviewer.cpp (by adding , 0) to the end of it OR level=0 as its defined).

-   ui.set_status_and_level(MString<30>(F("Mesh Z min: "), p_float_t(min, 2), F(", max: "), p_float_t(max, 2)));
// with change in marlin.h -- level=0
+   ui.set_status_and_level(MString<30>(F("Mesh Z min: "), p_float_t(min, 2), F(", max: "), p_float_t(max, 2)), 0);
// without changes 

as example

-  static void set_status_and_level(const char * const cstr, const int8_t level) { _set_status_and_level(cstr, level, false); }
+  static void set_status_and_level(const char * const cstr, const int8_t level=0) { _set_status_and_level(cstr, level, false); }

classicrocker883 avatar Aug 17 '23 04:08 classicrocker883

@thisiskeithb @thinkyhead Prusa/MK3S-BigTreeTech-BTT002 has caused an issue with pull requests

(BIGTREE_BTT002) (pull_request) fails and with the given error:

Marlin\src\sd\cardreader.cpp:996:28: error: 'IS_DIR' was not declared in this scope; did you mean 'EISDIR'? Marlin\src\sd\cardreader.cpp:1014:30: error: 'IS_DIR' was not declared in this scope; did you mean 'EISDIR'? Marlin\src\sd\cardreader.cpp:1365:11: error: 'isDir' was not declared in this scope; did you mean 'isDigit'?

HAS_FOLDER_SORTING should be enabled, because FOLDER_SORTING became undefined in the recent push to example configs.

classicrocker883 avatar Aug 17 '23 04:08 classicrocker883

Thinkyhead will need to push a follow-up commit after checking existing configs that were broken after https://github.com/MarlinFirmware/Configurations/commit/65c51209d4cccdd4f4709d2af71bea675d4d9d1f.

thisiskeithb avatar Aug 17 '23 05:08 thisiskeithb

The viewer_asymmetric_range flag is still referenced, so that cannot be removed just yet. If it is no longer relevant then the code that refers to it must be updated. Check with @mriscoc for advice on whether it should be retained.

thinkyhead avatar Aug 18 '23 19:08 thinkyhead

The viewer_asymmetric_range flag is still referenced, so that cannot be removed just yet. If it is no longer relevant then the code that refers to it must be updated. Check with @mriscoc for advice on whether it should be retained.

I didn't see what was wrong with the thumbnail preview. Proper definitions should be ensured to allow people to choose between having a normal mesh viewer, a grid mesh viewer, or a selectable one; otherwise, we're increasing the program memory usage for no real benefit.

mriscoc avatar Aug 18 '23 20:08 mriscoc

I didn't see what was wrong with the thumbnail preview.

it wasnt working when I tried before I made the changes. unless I imagined it. but it was working fine after.

update: not sure what happened. thumbnail previews are working without changes made. so disregard.

classicrocker883 avatar Aug 19 '23 02:08 classicrocker883

I didn't see what was wrong with the thumbnail preview.

@mriscoc — If you look at the current bugfix-2.1.x code you will see that viewer_asymmetric_range exists as part of ProUI but it never changes; it is always false. It seems to be a remnant of JyersUI that should have been removed. Or maybe viewer_asymmetric_range was meant to be used but no interface has been created yet to toggle it.

thinkyhead avatar Aug 19 '23 21:08 thinkyhead

you will see that viewer_asymmetric_range exists as part of ProUI but it never changes

viewer_asymmetric_range was kept to allow to JYERSUI to use the bed_level_tools in the future but it is currently not used in ProUI.

mriscoc avatar Aug 21 '23 22:08 mriscoc

I made some changes to this PR which should be easier to merge now. take a look at the Note in description for a small concern/issue

classicrocker883 avatar Jan 07 '24 07:01 classicrocker883

@thinkyhead I believe we can merge this now if you dont mind taking a quick review

classicrocker883 avatar Feb 22 '24 05:02 classicrocker883