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

Enabled 2 mesh viewers #26181

Open
wants to merge 80 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 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
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
6 changes: 6 additions & 0 deletions Marlin/src/inc/Conditionals-5-post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3360,6 +3360,12 @@
#define HAS_FIXED_3POINT 1 // Points are defined for ABL/UBL. Else calculated in probe.get_three_points.
#endif

#if ENABLED(DWIN_LCD_PROUI) && HAS_MESH
#ifndef USE_GRID_MESHVIEWER
#define USE_GRID_MESHVIEWER 1
#endif
#endif

/**
* Buzzer/Speaker
*/
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
BedLevelTools bedLevelTools;

#if ENABLED(USE_GRID_MESHVIEWER)
bool BedLevelTools::view_mesh = false;
bool BedLevelTools::viewer_print_value = false;
#endif
bool BedLevelTools::goto_mesh_value = false;
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@

class BedLevelTools {
public:
#if ENABLED(USE_GRID_MESHVIEWER)
static bool viewer_asymmetric_range;
#if USE_GRID_MESHVIEWER
static bool view_mesh;
static bool viewer_print_value;
#endif
static bool goto_mesh_value;
Expand All @@ -69,7 +69,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
18 changes: 13 additions & 5 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2283,9 +2283,11 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
#endif

#if ENABLED(SOUND_MENU_ITEM)
void setEnableSound() {
toggleCheckboxLine(ui.sound_on);
}
void setEnableSound() { toggleCheckboxLine(ui.sound_on); }
#endif

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

#if HAS_HOME_OFFSET
Expand Down Expand Up @@ -3639,12 +3641,15 @@ void drawFilamentManMenu() {

void drawManualMeshMenu() {
checkkey = ID_Menu;
if (SET_MENU(manualMeshMenu, MSG_UBL_MANUAL_MESH, 6)) {
if (SET_MENU(manualMeshMenu, 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, onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
#endif
MENU_ITEM(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, manualMeshSave);
}
updateMenu(manualMeshMenu);
Expand Down Expand Up @@ -4205,7 +4210,7 @@ void drawMaxAccelMenu() {

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 @@ -4228,6 +4233,9 @@ void drawMaxAccelMenu() {
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, onDrawChkbMenu, setViewMesh, &bedLevelTools.view_mesh);
#endif
}
updateMenu(meshMenu);
}
Expand Down
31 changes: 18 additions & 13 deletions Marlin/src/lcd/e3v2/proui/meshviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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 @@ -112,14 +112,20 @@ 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);
#else

const bool see_mesh = TERN0(USE_GRID_MESHVIEWER, bedLevelTools.view_mesh);
if (see_mesh) {
#if USE_GRID_MESHVIEWER
DWINUI::clearMainArea();
bedLevelTools.viewer_print_value = true;
bedLevelTools.drawBedMesh(-1, 1, 8, 10 + TITLE_HEIGHT);
#endif
}
else {
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 @@ -128,12 +134,11 @@ 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));
#endif
if (see_mesh) {
TERN_(USE_GRID_MESHVIEWER, bedLevelTools.setMeshViewerStatus());
}
else // TODO: in marlinui.h set_status_and_level was defined to (..., const int8_t level=0); remove ", 0" when pulling other PR
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 @@ -197,6 +197,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 = _UxGT("Normal 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
36 changes: 33 additions & 3 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@ typedef struct SettingsDataStruct {
touch_calibration_t touch_calibration_data;
#endif

//
// Ethernet settings
//
#if HAS_ETHERNET
bool ethernet_hardware_enabled; // M552 S
uint32_t ethernet_ip, // M552 P
Expand All @@ -601,6 +603,13 @@ typedef struct SettingsDataStruct {
bool sound_on;
#endif

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

//
// Fan tachometer check
//
Expand All @@ -618,6 +627,9 @@ typedef struct SettingsDataStruct {
celsius_t mks_min_extrusion_temp; // Min E Temp (shadow M302 value)
#endif

//
// LCD has Language > 1
//
#if HAS_MULTI_LANGUAGE
uint8_t ui_language; // M414 S
#endif
Expand Down Expand Up @@ -1727,6 +1739,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 @@ -2848,6 +2867,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 @@ -3407,9 +3434,12 @@ void MarlinSettings::reset() {
//
// Buzzer enable/disable
//
#if ENABLED(SOUND_MENU_ITEM)
ui.sound_on = ENABLED(SOUND_ON_DEFAULT);
#endif
TERN_(SOUND_MENU_ITEM, ui.sound_on = ENABLED(SOUND_ON_DEFAULT));

//
// Toggle the meshviewer
//
TERN_(USE_GRID_MESHVIEWER, bedLevelTools.view_mesh = false);

//
// Magnetic Parking Extruder
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/mega/pins_HJC2560C_REV2.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
#define HEATER_BED_PIN 4

#ifndef FAN0_PIN
#define FAN0_PIN 7 //默认不使用PWM_FAN冷却喷嘴,如果需要,则取消注释
#define FAN0_PIN 7 // PWM_FAN
#endif

//
Expand All @@ -104,7 +104,7 @@
//#define LED_PIN 8

#ifndef CASE_LIGHT_PIN
#define CASE_LIGHT_PIN 8 // 8 默认挤出机风扇作为Case LED,如果需要PWM FAN,则需要将FAN_PIN置为7,LED_PIN置为8
#define CASE_LIGHT_PIN 8 // 8 Case LED,PWM FAN, FAN_PIN,LED_PIN 8
#endif

//#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#pragma once

/**
* ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐
* ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││
* ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴
* Pin assignments for 32-bit JGAurora A5S & A1
*
* https://jgaurorawiki.com/_media/jgaurora_a5s_a1_pinout.png
Expand Down