diff --git a/Marlin/src/inc/Conditionals-5-post.h b/Marlin/src/inc/Conditionals-5-post.h index 55d91c4b81dc..39368b46b106 100644 --- a/Marlin/src/inc/Conditionals-5-post.h +++ b/Marlin/src/inc/Conditionals-5-post.h @@ -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 */ diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index e4b6fb72a03d..aef6af9979c1 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -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; diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h index a0da0ceeb356..acf2291eae28 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h @@ -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; @@ -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 diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e483d4a5ce41..470428fa94d0 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -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 @@ -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, ¤t_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); @@ -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); @@ -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); } diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 38d0af4f82ef..3397d0264dd0 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -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 @@ -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); @@ -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); } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 29b5a1bed396..8a631bb88832 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -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"); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 51677fdec6b8..a9e0e925c1fb 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -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 @@ -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 // @@ -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 @@ -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 // @@ -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 // @@ -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 diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 638465f3b9eb..64302905ac8a 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -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 // @@ -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 diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 507372771eb2..49e6111187a2 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -22,9 +22,6 @@ #pragma once /** - * ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ - * ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ - * ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ * Pin assignments for 32-bit JGAurora A5S & A1 * * https://jgaurorawiki.com/_media/jgaurora_a5s_a1_pinout.png