Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
47bfe07
fix gcode preview
classicrocker883 Aug 17, 2023
8c2f232
add 2nd mesh viewer option
classicrocker883 Aug 17, 2023
8a67bfc
add missing env to pins.h (CREALITY_V4)
classicrocker883 Aug 17, 2023
c725f0e
optimize cardreader.h - OPTARG
classicrocker883 Aug 17, 2023
1929c2e
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Aug 18, 2023
884027a
Update Conditionals_post.h
classicrocker883 Aug 18, 2023
c94f04b
use has_mesh
thinkyhead Aug 18, 2023
aece6f5
translatable
thinkyhead Aug 18, 2023
77fdb58
format
thinkyhead Aug 18, 2023
699c598
Mesh without mesh viewer
thinkyhead Aug 18, 2023
270122e
tweak drawing
thinkyhead Aug 18, 2023
e813b70
tweak alert print
thinkyhead Aug 18, 2023
5a5f4bd
viewer_asymmetric_range still referenced
thinkyhead Aug 18, 2023
a882d17
better for intellisense
thinkyhead Aug 18, 2023
dc9ac72
optional level
thinkyhead Aug 18, 2023
e00b3e5
tweak print
thinkyhead Aug 18, 2023
6cc92cc
cleanup
thinkyhead Aug 18, 2023
bcba732
no more viewer_asymmetric_range ?
thinkyhead Aug 18, 2023
77ccf54
string update
thinkyhead Aug 18, 2023
e9f7742
misc. cleanup
thinkyhead Aug 18, 2023
e22e9cc
revert gcode_preview.cpp
classicrocker883 Aug 19, 2023
bbc91e0
revert gcode_preview.cpp
classicrocker883 Aug 19, 2023
6a3c9cf
revert gcode_preview.cpp
classicrocker883 Aug 19, 2023
98ae726
revert gcode_preview.h
classicrocker883 Aug 19, 2023
6764626
Merge branch 'bugfix-2.1.x' into pr/26181
thinkyhead Aug 19, 2023
3ee47a2
tweak style
thinkyhead Aug 19, 2023
8e741cc
exit avrdude.conf - optimize spacing
classicrocker883 Aug 22, 2023
93c66eb
renamed to "Normal Mesh Viewer"
classicrocker883 Aug 22, 2023
a0557c5
small tweaks
classicrocker883 Aug 22, 2023
7bec91e
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Aug 22, 2023
100bb82
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-redo
classicrocker883 Aug 29, 2023
98fd495
typo in config_adv.h
classicrocker883 Sep 3, 2023
675061b
rename to MSG_CHANGE_MESH - add language support
classicrocker883 Sep 3, 2023
ebceff1
had issue with "floating" Flow%, this a good fix??
classicrocker883 Sep 4, 2023
17fb167
remove/replace MSG_UBL_LEVEL_BED
classicrocker883 Sep 4, 2023
58e7eff
enum Buttons
classicrocker883 Sep 4, 2023
fecab96
should be "purge_length", not "extrude_length"
classicrocker883 Sep 5, 2023
5af8197
fix for `HAS_MARLINUI_MENU` unsigned int (Flow%)
classicrocker883 Sep 5, 2023
3335b0c
test
classicrocker883 Sep 5, 2023
020a22d
fix for `HAS_MARLINUI_MENU` unsigned int (Flow%)
classicrocker883 Sep 5, 2023
6451b2a
Merge branch 'bugfix-2.1.x-redo' of https://github.com/classicrocker8…
classicrocker883 Sep 5, 2023
73e46a7
revert test
classicrocker883 Sep 5, 2023
4c51e4d
revert flow_percentage (needs more research)
classicrocker883 Sep 5, 2023
9275010
revert Buttons
classicrocker883 Oct 27, 2023
8012d70
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x-redo
classicrocker883 Nov 18, 2023
2c7b4a0
revert language_xx.h, MSG_UBL_LEVEL_BED
classicrocker883 Nov 18, 2023
671bc8c
Merge branch 'bugfix-2.1.x-redo' of https://github.com/classicrocker8…
classicrocker883 Nov 18, 2023
595f5a1
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Nov 28, 2023
67158da
fix USE_GRID_MESHVIEWER bedlevelTools
classicrocker883 Nov 28, 2023
4242ca1
forgot #endif
classicrocker883 Nov 28, 2023
4b76ed7
Update language_en.h, add MSG_CHANGE_MESH
classicrocker883 Dec 4, 2023
c21eacc
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Dec 4, 2023
c8a1534
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Dec 13, 2023
996fe86
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 4, 2024
d677952
Merge https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x-redo
classicrocker883 Jan 5, 2024
44705e1
Update bedlevel_tools.cpp, fix error
classicrocker883 Jan 6, 2024
a496bae
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 6, 2024
47d34fa
change to !
classicrocker883 Jan 7, 2024
b59769d
revert - transfer various to Various small fixes PR
classicrocker883 Jan 7, 2024
d0abcd5
temp fix for error (read TODO:)
classicrocker883 Jan 7, 2024
de66cd9
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.…
classicrocker883 Jan 10, 2024
bf55c79
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 11, 2024
056af4a
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 16, 2024
e2e2a6c
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 20, 2024
b07ce9b
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 21, 2024
6015ca0
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Feb 9, 2024
13337ec
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Feb 22, 2024
3625019
Update Conditionals_post.h define meshviewer
classicrocker883 Feb 22, 2024
dc8c0b0
Update dwin.cpp ALL()
classicrocker883 Feb 22, 2024
bff5153
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Mar 14, 2024
7d8c400
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Apr 6, 2024
8fb56e3
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Apr 14, 2024
bdfda6d
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Apr 24, 2024
6975a53
remove characters causing issue with make format-pins
classicrocker883 Apr 24, 2024
6f4c7bc
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x-redo
classicrocker883 Apr 25, 2024
96819d2
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 May 29, 2024
9b81b2f
Merge https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x-redo
classicrocker883 Jun 27, 2024
2d30a57
Merge https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x-redo
classicrocker883 Aug 2, 2024
ba743c3
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-redo
classicrocker883 Aug 17, 2024
b10e1a8
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Oct 21, 2024
56d6f66
Merge https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x-redo
classicrocker883 Nov 21, 2024
377f8ff
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jan 27, 2025
b1b75aa
Merge https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x-redo
classicrocker883 Feb 25, 2025
5991d79
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-redo
classicrocker883 Mar 13, 2025
e9d14cc
Merge branch 'bugfix-2.1.x' into pr/26181
thinkyhead Mar 19, 2025
01225d0
Misc. cleanups
thinkyhead Mar 19, 2025
e25521c
use known item counts
thinkyhead Mar 19, 2025
8071549
move
thinkyhead Mar 19, 2025
6f4342c
minimal menu item alloc
thinkyhead Mar 19, 2025
485b94d
Merge branch 'bugfix-2.1.x' into pr/26181
thinkyhead Mar 19, 2025
5a98db4
rename
thinkyhead Mar 19, 2025
4d76a4e
"Use Grid Style"
thinkyhead Mar 19, 2025
a0d892d
simplify
thinkyhead Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ void GcodeSuite::M48() {

#if HAS_STATUS_MESSAGE
// Display M48 results in the status bar
char sigma_str[8];
ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6)));
#endif
}

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/gcode/host/M114.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@
#if ENABLED(M114_DETAIL)

void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) {
char str[12];
for (uint8_t a = 0; a < n; ++a) {
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]));
if (pos[a] >= 0) SERIAL_CHAR(' ');
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
SERIAL_ECHO(p_float_t(pos[a], precision));
}
SERIAL_EOL();
}
inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }

void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
char str[12];
LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str));
LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision));
SERIAL_EOL();
}

Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,9 @@
#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define PROUI_TUNING_GRAPH 1
#endif
#if HAS_MESH && !defined(USE_GRID_MESHVIEWER)
#define USE_GRID_MESHVIEWER 1
#endif
#endif

// Thermal protection
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@

BedLevelTools bedLevelTools;

#if ENABLED(USE_GRID_MESHVIEWER)
#if USE_GRID_MESHVIEWER
bool BedLevelTools::viewer_asymmetric_range = false;
bool BedLevelTools::view_mesh = false;
bool BedLevelTools::viewer_print_value = false;
#endif
bool BedLevelTools::goto_mesh_value = false;
Expand Down Expand Up @@ -212,7 +213,7 @@ bool BedLevelTools::meshValidate() {
return true;
}

#if ENABLED(USE_GRID_MESHVIEWER)
#if USE_GRID_MESHVIEWER

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

Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@

class BedLevelTools {
public:
#if ENABLED(USE_GRID_MESHVIEWER)
#if USE_GRID_MESHVIEWER
static bool viewer_asymmetric_range;
static bool view_mesh;
static bool viewer_print_value;
#endif
static bool goto_mesh_value;
Expand All @@ -75,7 +76,7 @@ class BedLevelTools {
static float getMaxValue();
static float getMinValue();
static bool meshValidate();
#if ENABLED(USE_GRID_MESHVIEWER)
#if USE_GRID_MESHVIEWER
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));
static void setMeshViewerStatus();
#endif
Expand Down
19 changes: 15 additions & 4 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,6 @@ void dwinRedrawScreen() {
void onClickConfirmToPrint() {
dwinResetStatusLine();
if (hmiFlag.select_flag) { // Confirm
gotoMainMenu();
return card.openAndPrintFile(card.filename);
}
else
Expand Down Expand Up @@ -2189,6 +2188,12 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
}
#endif

#if HAS_MESH && USE_GRID_MESHVIEWER
void setViewMesh() {
toggleCheckboxLine(bedLevelTools.view_mesh);
}
#endif

#if HAS_HOME_OFFSET
void applyHomeOffset() { set_home_offset(hmiValue.axis, menuData.value / MINUNITMULT); }
void setHomeOffsetX() { hmiValue.axis = X_AXIS; setPFloatOnClick(-50, 50, UNITFDIGITS, applyHomeOffset); }
Expand Down Expand Up @@ -3478,12 +3483,15 @@ void drawMotionMenu() {

void drawManualMeshMenu() {
checkkey = ID_Menu;
if (SET_MENU(manualMesh, MSG_UBL_MANUAL_MESH, 6)) {
if (SET_MENU(manualMesh, MSG_UBL_MANUAL_MESH, 7)) {
BACK_ITEM(drawPrepareMenu);
MENU_ITEM(ICON_ManualMesh, MSG_LEVEL_BED, onDrawMenuItem, manualMeshStart);
mMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, setMMeshMoveZ, &current_position.z);
MENU_ITEM(ICON_Axis, MSG_UBL_CONTINUE_MESH, onDrawMenuItem, manualMeshContinue);
MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, dwinMeshViewer);
#if USE_GRID_MESHVIEWER
EDIT_ITEM(ICON_PrintSize, MSG_CHANGE_MESH_VIEWER, onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what way does this "change" the mesh viewer?

Copy link
Contributor Author

@classicrocker883 classicrocker883 Aug 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are two types of ways to view the mesh

This shows the two types of meshviewer as an example

you can toggle between with the checkbox

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The display with solid colors is much nicer. The display with circles seems noisy and inferior, but is it useful for people with color blindness?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, you get my point. The label "Change Mesh Viewer" with a checkbox next to it is unclear and therefore bad UI design. The label should indicate what type of mesh viewer will be seen when the checkbox is checked. For example, the label "Ugly Mesh View" would make it clear that when the checkbox is checked the mesh viewer will be the "ugly" version, as opposed to the "normal" version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The display with solid colors is much nicer. The display with circles seems noisy and inferior, but is it useful for people with color blindness?

That's a valid point. I'm not partial to either, just offering making the options more available. I just wanted to say the picture examples posted aren't reminiscent of a true bed level, merely did a quick manual edit of the values to give a quick example of how it can be displayed.

this above image is more a true representation of a typical mesh.

anyway it is what it is. and as for calling it "Normal Mesh View" or something like that is a good idea. Having the checkbox enabled means to have the Square block style. default would be the box unchecked and Circle colorful style.

#endif
MENU_ITEM(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, manualMeshSave);
}
updateMenu(manualMesh);
Expand Down Expand Up @@ -3983,7 +3991,7 @@ void drawStepsMenu() {

void drawMeshSetMenu() {
checkkey = ID_Menu;
if (SET_MENU(meshMenu, MSG_MESH_LEVELING, 14)) {
if (SET_MENU(meshMenu, MSG_MESH_LEVELING, 15)) {
BACK_ITEM(drawAdvancedSettingsMenu);
#if ENABLED(PREHEAT_BEFORE_LEVELING)
EDIT_ITEM(ICON_Temperature, MSG_UBL_SET_TEMP_BED, onDrawPIntMenu, setBedLevT, &hmiData.bedLevT);
Expand All @@ -4006,6 +4014,9 @@ void drawStepsMenu() {
MENU_ITEM(ICON_MeshEdit, MSG_EDIT_MESH, onDrawSubMenu, drawEditMeshMenu);
#endif
MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, dwinMeshViewer);
#if USE_GRID_MESHVIEWER
EDIT_ITEM(ICON_PrintSize, MSG_CHANGE_MESH_VIEWER, onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
#endif
}
updateMenu(meshMenu);
}
Expand All @@ -4020,7 +4031,7 @@ void drawStepsMenu() {
BACK_ITEM(drawMeshSetMenu);
EDIT_ITEM(ICON_MeshEditX, MSG_MESH_X, onDrawPInt8Menu, setEditMeshX, &bedLevelTools.mesh_x);
EDIT_ITEM(ICON_MeshEditY, MSG_MESH_Y, onDrawPInt8Menu, setEditMeshY, &bedLevelTools.mesh_y);
editZValueItem = EDIT_ITEM(ICON_MeshEditZ, MSG_MESH_EDIT_Z, onDrawPFloat2Menu, setEditZValue, &bedlevel.z_values[bedLevelTools.mesh_x][bedLevelTools.mesh_y]);
editZValueItem = EDIT_ITEM(ICON_MeshEditZ, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, setEditZValue, &bedlevel.z_values[bedLevelTools.mesh_x][bedLevelTools.mesh_y]);
}
updateMenu(editMeshMenu);
}
Expand Down
16 changes: 0 additions & 16 deletions Marlin/src/lcd/e3v2/proui/gcode_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@
#define THUMBWIDTH 230
#define THUMBHEIGHT 180

typedef struct {
char name[13] = ""; //8.3 + null
uint32_t thumbstart = 0;
int thumbsize = 0;
int thumbheight = 0;
int thumbwidth = 0;
uint8_t *thumbdata = nullptr;
float time = 0;
float filament = 0;
float layer = 0;
float width = 0;
float height = 0;
float length = 0;
void setname(const char * const fn);
void clear();
} fileprop_t;
fileprop_t fileprop;

void fileprop_t::setname(const char * const fn) {
Expand Down
19 changes: 19 additions & 0 deletions Marlin/src/lcd/e3v2/proui/gcode_preview.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@
* Date: 2022/09/03
*/

typedef struct {
char name[13] = ""; //8.3 + null
uint32_t thumbstart = 0;
int thumbsize = 0;
int thumbheight = 0;
int thumbwidth = 0;
uint8_t *thumbdata = nullptr;
float time = 0;
float filament = 0;
float layer = 0;
float width = 0;
float height = 0;
float length = 0;
void setname(const char * const fn);
void clear();
} fileprop_t;

extern fileprop_t fileprop;

void Preview_DrawFromSD();
void Preview_Invalidate();
bool Preview_Valid();
Expand Down
31 changes: 20 additions & 11 deletions Marlin/src/lcd/e3v2/proui/meshviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "../../../feature/bedlevel/bedlevel.h"
#include "meshviewer.h"

#if ENABLED(USE_GRID_MESHVIEWER)
#if USE_GRID_MESHVIEWER
#include "bedlevel_tools.h"
#endif

Expand Down Expand Up @@ -119,14 +119,23 @@ void MeshViewer::drawMesh(const bed_mesh_t zval, const uint8_t csizex, const uin

void MeshViewer::draw(const bool withsave/*=false*/, const bool redraw/*=true*/) {
title.showCaption(GET_TEXT_F(MSG_MESH_VIEWER));
#if ENABLED(USE_GRID_MESHVIEWER)
DWINUI::clearMainArea();
bedLevelTools.viewer_print_value = true;
bedLevelTools.drawBedMesh(-1, 1, 8, 10 + TITLE_HEIGHT);

#if USE_GRID_MESHVIEWER
const bool see_mesh = bedLevelTools.view_mesh;
if (see_mesh) {
DWINUI::clearMainArea();
bedLevelTools.viewer_print_value = true;
bedLevelTools.drawBedMesh(-1, 1, 8, 10 + TITLE_HEIGHT);
}
#else
constexpr bool see_mesh = false;
#endif

if (!see_mesh) {
if (redraw) drawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y);
else DWINUI::drawBox(1, hmiData.colorBackground, { 89, 305, 99, 38 });
#endif
}

if (withsave) {
DWINUI::drawButton(BTN_Save, 26, 305);
DWINUI::drawButton(BTN_Continue, 146, 305);
Expand All @@ -135,12 +144,12 @@ void MeshViewer::draw(const bool withsave/*=false*/, const bool redraw/*=true*/)
else
DWINUI::drawButton(BTN_Continue, 86, 305);

#if ENABLED(USE_GRID_MESHVIEWER)
bedLevelTools.setMeshViewerStatus();
#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));
#if USE_GRID_MESHVIEWER
if (see_mesh) bedLevelTools.setMeshViewerStatus();
#endif

if (!see_mesh)
ui.set_status_and_level(MString<30>(F("Mesh Z min: "), p_float_t(min, 2), F(", max: "), p_float_t(max, 2)), 0);
}

void drawMeshViewer() { meshViewer.draw(true, meshredraw); }
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ namespace LanguageNarrow_en {
LSTR MSG_MESH_VIEWER = _UxGT("Mesh Viewer");
LSTR MSG_EDIT_MESH = _UxGT("Edit Mesh");
LSTR MSG_MESH_VIEW = _UxGT("View Mesh");
LSTR MSG_CHANGE_MESH_VIEWER = _UxGT("Change Mesh Viewer");
LSTR MSG_EDITING_STOPPED = _UxGT("Mesh Editing Stopped");
LSTR MSG_NO_VALID_MESH = _UxGT("No valid mesh");
LSTR MSG_ACTIVATE_MESH = _UxGT("Activate Leveling");
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,8 @@ void MarlinUI::host_notify(const char * const cstr) {
pgm ? host_notify_P(ustr) : host_notify(ustr);
}
void MarlinUI::status_printf_P(int8_t level, PGM_P const fmt, ...) {
if (set_alert_level(level)) return;

MString<30> msg;

va_list args;
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,23 @@ class MarlinUI {
* @param fstr A constant F-string to set as the status.
* @param level Alert level. Negative to ignore and reset the level. Non-zero never expires.
*/
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); }

/**
* @brief Set Status with a P-string and alert level.
*
* @param ustr A C- or P-string, according to pgm.
* @param level Alert level. Negative to ignore and reset the level. Non-zero never expires.
*/
static void set_status_and_level_P(PGM_P const pstr, const int8_t level) { _set_status_and_level(pstr, level, true); }
static void set_status_and_level_P(PGM_P const pstr, const int8_t level=0) { _set_status_and_level(pstr, level, true); }

/**
* @brief Set Status with a fixed string and alert level.
*
* @param fstr A constant F-string to set as the status.
* @param level Alert level. Negative to ignore and reset the level. Non-zero never expires.
*/
static void set_status_and_level(FSTR_P const fstr, const int8_t level) { set_status_and_level_P(FTOP(fstr), level); }
static void set_status_and_level(FSTR_P const fstr, const int8_t level=0) { set_status_and_level_P(FTOP(fstr), level); }

static void set_max_status(FSTR_P const fstr) { set_status_and_level(fstr, 127); }
static void set_min_status(FSTR_P const fstr) { set_status_and_level(fstr, -1); }
Expand Down
29 changes: 29 additions & 0 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,13 @@ typedef struct SettingsDataStruct {
bool sound_on;
#endif

//
// Toggle the meshviwer
//
#if USE_GRID_MESHVIEWER
bool view_mesh;
#endif

//
// Fan tachometer check
//
Expand Down Expand Up @@ -1669,6 +1676,13 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(ui.sound_on);
#endif

//
// Toggle the meshviewer
//
#if USE_GRID_MESHVIEWER
EEPROM_WRITE(bedLevelTools.view_mesh);
#endif

//
// Fan tachometer check
//
Expand Down Expand Up @@ -2729,6 +2743,14 @@ void MarlinSettings::postprocess() {
EEPROM_READ(ui.sound_on);
#endif

//
// Toggle the meshviewer
//
#if USE_GRID_MESHVIEWER
_FIELD_TEST(view_mesh);
EEPROM_READ(bedLevelTools.view_mesh);
#endif

//
// Fan tachometer check
//
Expand Down Expand Up @@ -3188,6 +3210,13 @@ void MarlinSettings::reset() {
ui.sound_on = ENABLED(SOUND_ON_DEFAULT);
#endif

//
// Toggle the meshviewer
//
#if USE_GRID_MESHVIEWER
bedLevelTools.view_mesh = false;
#endif

//
// Magnetic Parking Extruder
//
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,13 @@
#elif MB(CHITU3D_V9)
#include "stm32f1/pins_CHITU3D_V9.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple
#elif MB(CREALITY_V4)
#include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple
#include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple env:STM32F103RC_creality_maple
#elif MB(CREALITY_V4210)
#include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple
#elif MB(CREALITY_V425)
#include "stm32f1/pins_CREALITY_V425.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple
#elif MB(CREALITY_V422)
#include "stm32f1/pins_CREALITY_V422.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple
#include "stm32f1/pins_CREALITY_V422.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple env:STM32F103RC_creality_maple
#elif MB(CREALITY_V423)
#include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer
#elif MB(CREALITY_V427)
Expand Down