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

[FR] Adding the option to have two types of Mesh Viewers #24710

Closed
classicrocker883 opened this issue Aug 31, 2022 · 3 comments
Closed

[FR] Adding the option to have two types of Mesh Viewers #24710

classicrocker883 opened this issue Aug 31, 2022 · 3 comments
Labels
C: LCD & Controllers T: Feature Request Features requested by users.

Comments

@classicrocker883
Copy link
Contributor

classicrocker883 commented Aug 31, 2022

Is your feature request related to a problem? Please describe.

20220831_011731


20220831_011809

Adding Mesh Viewer - change how the mesh is viewed

enables both options on how the mesh is viewed
with USE_UBL_VIEWER enabled, this gives a check box to alternate type of view for mesh



adding Menu Item
FILE--> dwin.cpp
under Draw AdvancedSettings Menu

  ```MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer);  
  #if ENABLED(USE_UBL_VIEWER)
    EDIT_ITEM_F(ICON_PrintSize, "Change Mesh Viewer", onDrawChkbMenu, SetViewMesh, &BedLevelTools.view_mesh); 
  #endif```


//the function
FILE--> meshviewer.cpp

void MeshViewerClass::Draw(bool withsave /*= false*/) {
  Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER));
  #if ENABLED(USE_UBL_VIEWER)
  if(BedLevelTools.view_mesh) {
    DWINUI::ClearMainArea();
    BedLevelTools.viewer_print_value = true;
    BedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT);}
    else
      DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y);
  #else
    DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y);
  #endif
  if (withsave) {
    DWINUI::Draw_Button(BTN_Save, 26, 305);
    DWINUI::Draw_Button(BTN_Continue, 146, 305);
    Draw_Select_Highlight(HMI_flag.select_flag, 305);
  }
  else
    DWINUI::Draw_Button(BTN_Continue, 86, 305);

  #if ENABLED(USE_UBL_VIEWER)
    if(BedLevelTools.view_mesh) {
      BedLevelTools.Set_Mesh_Viewer_Status();}
    else {
    char str_1[6], str_2[6] = "";
    ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"),
      dtostrf(min, 1, 2, str_1),
      dtostrf(max, 1, 2, str_2)
    );}
  #else
    char str_1[6], str_2[6] = "";
    ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"),
      dtostrf(min, 1, 2, str_1),
      dtostrf(max, 1, 2, str_2)
    );
  #endif


FILE--> settings.cpp

  #if ENABLED(USE_UBL_VIEWER)
    bool view_mesh;
  #endif

//under MarlinSettings::save()

  #if ENABLED(USE_UBL_VIEWER)
    EEPROM_WRITE(BedLevelTools.view_mesh);
  #endif

//under MarlinSettings:_load()

  #if ENABLED(USE_UBL_VIEWER)
    _FIELD_TEST(view_mesh);
    EEPROM_READ(BedLevelTools.view_mesh);
  #endif      

//under MarlinSettings:reset()

  #if ENABLED(USE_UBL_VIEWER)
    BedLevelTools.view_mesh = ENABLED(USE_UBL_VIEWER); //added mesh viewer option
  #endif 


FILE--> bedlevel_tools.cpp

//under

 
  #if ENABLED(USE_UBL_VIEWER)
    static bool viewer_asymmetric_range;
    static bool viewer_print_value;
    static bool view_mesh;
  #endif


FILE--> bedlevel_tools.h

  class BedLevelToolsClass {
public:
  #if ENABLED(USE_UBL_VIEWER)
    static bool viewer_asymmetric_range;
    static bool viewer_print_value;
    static bool view_mesh;
  #endif

Are you looking for hardware support?

No response

Describe the feature you want

This enabled two options of how the mesh is viewed for ProUI

Additional context

If this can somehow be simplified so it doesnt take so much memory having it duplicate the code

@classicrocker883 classicrocker883 added the T: Feature Request Features requested by users. label Aug 31, 2022
@DerAndere1
Copy link
Contributor

DerAndere1 commented Sep 2, 2022

For accessible data visualization, a continuous color ramp is often preferable. See e.g. https://eagereyes.org/basics/rainbow-color-map . Some good diverging color maps can be found at https://www.kennethmoreland.com/color-maps/

@thisiskeithb
Copy link
Member

Implemented in #26181

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: LCD & Controllers T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

3 participants