Skip to content

Commit c94f04b

Browse files
committed
use has_mesh
1 parent 884027a commit c94f04b

6 files changed

Lines changed: 15 additions & 19 deletions

File tree

Marlin/src/inc/Conditionals_post.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,9 +2498,6 @@
24982498
#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
24992499
#define PROUI_TUNING_GRAPH 1
25002500
#endif
2501-
#if HAS_MESH
2502-
#define GRID_MESH_VIEWER 1
2503-
#endif
25042501
#endif
25052502

25062503
// Thermal protection

Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
BedLevelTools bedLevelTools;
6767

68-
#if ENABLED(USE_GRID_MESHVIEWER)
68+
#if HAS_MESH
6969
bool BedLevelTools::view_mesh = false;
7070
bool BedLevelTools::viewer_print_value = false;
7171
#endif
@@ -212,7 +212,7 @@ bool BedLevelTools::meshValidate() {
212212
return true;
213213
}
214214

215-
#if ENABLED(USE_GRID_MESHVIEWER)
215+
#if HAS_MESH
216216

217217
constexpr uint8_t meshfont = TERN(TJC_DISPLAY, font8x16, font6x12);
218218

@@ -290,6 +290,6 @@ bool BedLevelTools::meshValidate() {
290290
drawing_mesh = false;
291291
}
292292

293-
#endif // USE_GRID_MESHVIEWER
293+
#endif // HAS_MESH
294294

295295
#endif // DWIN_LCD_PROUI && HAS_LEVELING

Marlin/src/lcd/e3v2/proui/bedlevel_tools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
class BedLevelTools {
5454
public:
55-
#if ENABLED(USE_GRID_MESHVIEWER)
55+
#if HAS_MESH
5656
static bool view_mesh;
5757
static bool viewer_print_value;
5858
#endif
@@ -75,7 +75,7 @@ class BedLevelTools {
7575
static float getMaxValue();
7676
static float getMinValue();
7777
static bool meshValidate();
78-
#if ENABLED(USE_GRID_MESHVIEWER)
78+
#if HAS_MESH
7979
static void drawBedMesh(int16_t selected=-1, uint8_t gridline_width=1, uint16_t padding_x=8, uint16_t padding_y_top=(40 + 53 - 7));
8080
static void setMeshViewerStatus();
8181
#endif

Marlin/src/lcd/e3v2/proui/dwin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
21882188
}
21892189
#endif
21902190

2191-
#if HAS_MESH && USE_GRID_MESHVIEWER
2191+
#if HAS_MESH
21922192
void setViewMesh() {
21932193
toggleCheckboxLine(bedLevelTools.view_mesh);
21942194
}
@@ -3489,7 +3489,7 @@ void drawMotionMenu() {
34893489
mMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, setMMeshMoveZ, &current_position.z);
34903490
MENU_ITEM(ICON_Axis, MSG_UBL_CONTINUE_MESH, onDrawMenuItem, manualMeshContinue);
34913491
MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, dwinMeshViewer);
3492-
#if USE_GRID_MESHVIEWER
3492+
#if HAS_MESH
34933493
EDIT_ITEM_F(ICON_PrintSize, "Change Mesh Viewer", onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
34943494
#endif
34953495
MENU_ITEM(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, manualMeshSave);
@@ -4014,7 +4014,7 @@ void drawStepsMenu() {
40144014
MENU_ITEM(ICON_MeshEdit, MSG_EDIT_MESH, onDrawSubMenu, drawEditMeshMenu);
40154015
#endif
40164016
MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, dwinMeshViewer);
4017-
#if USE_GRID_MESHVIEWER
4017+
#if HAS_MESH
40184018
EDIT_ITEM_F(ICON_PrintSize, "Change Mesh Viewer", onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
40194019
#endif
40204020
}

Marlin/src/lcd/e3v2/proui/meshviewer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "../../../feature/bedlevel/bedlevel.h"
3939
#include "meshviewer.h"
4040

41-
#if ENABLED(USE_GRID_MESHVIEWER)
41+
#if HAS_MESH
4242
#include "bedlevel_tools.h"
4343
#endif
4444

@@ -119,7 +119,7 @@ void MeshViewer::drawMesh(const bed_mesh_t zval, const uint8_t csizex, const uin
119119

120120
void MeshViewer::draw(const bool withsave/*=false*/, const bool redraw/*=true*/) {
121121
title.showCaption(GET_TEXT_F(MSG_MESH_VIEWER));
122-
#if ENABLED(USE_GRID_MESHVIEWER)
122+
#if HAS_MESH
123123
if(bedLevelTools.view_mesh) {
124124
DWINUI::clearMainArea();
125125
bedLevelTools.viewer_print_value = true;
@@ -141,7 +141,7 @@ void MeshViewer::draw(const bool withsave/*=false*/, const bool redraw/*=true*/)
141141
else
142142
DWINUI::drawButton(BTN_Continue, 86, 305);
143143

144-
#if ENABLED(USE_GRID_MESHVIEWER)
144+
#if HAS_MESH
145145
if(bedLevelTools.view_mesh) {
146146
bedLevelTools.setMeshViewerStatus();
147147
}

Marlin/src/module/settings.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,10 @@ typedef struct SettingsDataStruct {
583583
//
584584
// Toggle the meshviwer
585585
//
586-
#if ENABLED(USE_GRID_MESHVIEWER)
586+
#if HAS_MESH
587587
bool view_mesh;
588588
#endif
589589

590-
591590
//
592591
// Fan tachometer check
593592
//
@@ -1680,7 +1679,7 @@ void MarlinSettings::postprocess() {
16801679
//
16811680
// Toggle the meshviewer
16821681
//
1683-
#if ENABLED(USE_GRID_MESHVIEWER)
1682+
#if HAS_MESH
16841683
EEPROM_WRITE(bedLevelTools.view_mesh);
16851684
#endif
16861685

@@ -2747,7 +2746,7 @@ void MarlinSettings::postprocess() {
27472746
//
27482747
// Toggle the meshviewer
27492748
//
2750-
#if ENABLED(USE_GRID_MESHVIEWER)
2749+
#if HAS_MESH
27512750
_FIELD_TEST(view_mesh);
27522751
EEPROM_READ(bedLevelTools.view_mesh);
27532752
#endif
@@ -3214,7 +3213,7 @@ void MarlinSettings::reset() {
32143213
//
32153214
// Toggle the meshviewer
32163215
//
3217-
#if ENABLED(USE_GRID_MESHVIEWER)
3216+
#if HAS_MESH
32183217
bedLevelTools.view_mesh = false;
32193218
#endif
32203219

0 commit comments

Comments
 (0)