From 4b74c5375f3868279c88d02b4790a7515290defc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Nov 2023 02:06:59 -0600 Subject: [PATCH] clarify more --- Marlin/src/inc/SanityCheck.h | 10 --------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 20 +++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.h | 4 ++-- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 26 ++++++++---------------- 4 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 102036efb396a..3b08e6635f339 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2746,16 +2746,6 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." #elif ALL(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY." - #elif ENABLED(MEDIASORT_MENU_ITEM) && !ALL(SDCARD_SORT_ALPHA, SDSORT_GCODE) - #error "MEDIASORT_MENU_ITEM requires SDCARD_SORT_ALPHA and SDSORT_GCODE." - #elif ENABLED(RUNOUT_TUNE_ITEM) && DISABLED(HAS_FILAMENT_SENSOR) - #error "RUNOUT_TUNE_ITEM requires HAS_FILAMENT_SENSOR." - #elif ENABLED(PLR_TUNE_ITEM) && DISABLED(POWER_LOSS_RECOVERY) - #error "PLR_TUNE_ITEM requires POWER_LOSS_RECOVERY." - #elif ENABLED(JD_TUNE_ITEM) && DISABLED(HAS_JUNCTION_DEVIATION) - #error "JD_TUNE_ITEM requires HAS_JUNCTION_DEVIATION." - #elif ENABLED(ADVK_TUNE_ITEM) && DISABLED(LIN_ADVANCE) - #error "ADVK_TUNE_ITEM requires LIN_ADVANCE." #endif #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 9bb585dea62c7..a585f254de821 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -268,7 +268,7 @@ Menu *stepsMenu = nullptr; #endif #if HAS_MESH Menu *meshMenu = nullptr; - #if ENABLED(PROUI_MESH_EDIT_MENU) + #if ENABLED(PROUI_MESH_EDIT) Menu *editMeshMenu = nullptr; #endif #endif @@ -847,7 +847,7 @@ void updateVariable() { bool DWIN_lcd_sd_status = false; -#if ENABLED(MEDIASORT_MENU_ITEM) +#if ENABLED(PROUI_MEDIASORT) void setMediaSort() { toggleCheckboxLine(hmiData.mediaSort); card.setSortOn(hmiData.mediaSort ? TERN(SDSORT_REVERSE, AS_REV, AS_FWD) : AS_OFF); @@ -1759,7 +1759,7 @@ void dwinSetDataDefaults() { #if ALL(LCD_BED_TRAMMING, HAS_BED_PROBE) hmiData.fullManualTramming = DISABLED(BED_TRAMMING_USE_PROBE); #endif - #if ENABLED(MEDIASORT_MENU_ITEM) + #if ENABLED(PROUI_MEDIASORT) hmiData.mediaSort = true; card.setSortOn(TERN(SDSORT_REVERSE, AS_REV, AS_FWD)); #endif @@ -3130,7 +3130,7 @@ void drawAdvancedSettingsMenu() { #if HAS_GCODE_PREVIEW EDIT_ITEM(ICON_File, MSG_HAS_PREVIEW, onDrawChkbMenu, setPreview, &hmiData.enablePreview); #endif - #if ENABLED(MEDIASORT_MENU_ITEM) + #if ENABLED(PROUI_MEDIASORT) EDIT_ITEM(ICON_File, MSG_MEDIA_SORT, onDrawChkbMenu, setMediaSort, &hmiData.mediaSort); #endif EDIT_ITEM(ICON_File, MSG_MEDIA_UPDATE, onDrawChkbMenu, setMediaAutoMount, &hmiData.mediaAutoMount); @@ -3323,16 +3323,16 @@ void drawTuneMenu() { #if HAS_FILAMENT_SENSOR EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled); #endif - #if ENABLED(PLR_TUNE_ITEM) + #if ENABLED(PROUI_ITEM_PLR) EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, setPwrLossr, &recovery.enabled); #endif #if ENABLED(FWRETRACT) MENU_ITEM(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, drawFWRetractMenu); #endif - #if ENABLED(JD_TUNE_ITEM) + #if ENABLED(PROUI_ITEM_JD) EDIT_ITEM(ICON_JDmm, MSG_JUNCTION_DEVIATION, onDrawPFloat3Menu, setJDmm, &planner.junction_deviation_mm); #endif - #if ENABLED(ADVK_TUNE_ITEM) + #if ENABLED(PROUI_ITEM_ADVK) EDIT_ITEM(ICON_MaxAccelerated, MSG_ADVANCE_K, onDrawPFloat3Menu, setLA_K, &planner.extruder_advance_K[0]); #endif #if HAS_LOCKSCREEN @@ -3952,7 +3952,7 @@ void drawStepsMenu() { void setBedLevT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif - #if ENABLED(PROUI_MESH_EDIT_MENU) + #if ENABLED(PROUI_MESH_EDIT) #define Z_OFFSET_MIN -3 #define Z_OFFSET_MAX 3 @@ -4029,7 +4029,7 @@ void drawStepsMenu() { MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, ublMeshTilt); MENU_ITEM(ICON_UBLSmartFill, MSG_UBL_SMART_FILLIN, onDrawMenuItem, ublSmartFillMesh); #endif - #if ENABLED(PROUI_MESH_EDIT_MENU) + #if ENABLED(PROUI_MESH_EDIT) MENU_ITEM(ICON_MeshReset, MSG_MESH_RESET, onDrawMenuItem, ResetMesh); MENU_ITEM(ICON_MeshEdit, MSG_EDIT_MESH, onDrawSubMenu, drawEditMeshMenu); #endif @@ -4038,7 +4038,7 @@ void drawStepsMenu() { updateMenu(meshMenu); } - #if ENABLED(PROUI_MESH_EDIT_MENU) + #if ENABLED(PROUI_MESH_EDIT) void drawEditMeshMenu() { if (!leveling_is_valid()) { LCD_MESSAGE(MSG_UBL_MESH_INVALID); return; } set_bed_leveling_enabled(false); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index f746a28c9da1f..26b7fec5fda85 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -137,7 +137,7 @@ typedef struct { #if ALL(LCD_BED_TRAMMING, HAS_BED_PROBE) bool fullManualTramming = false; #endif - #if ENABLED(MEDIASORT_MENU_ITEM) + #if ENABLED(PROUI_MEDIASORT) bool mediaSort = true; #endif bool mediaAutoMount = ENABLED(HAS_SD_EXTENDER); @@ -343,7 +343,7 @@ void drawStepsMenu(); #endif #if HAS_MESH void drawMeshSetMenu(); - #if ENABLED(PROUI_MESH_EDIT_MENU) + #if ENABLED(PROUI_MESH_EDIT) void drawEditMeshMenu(); #endif #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 33d8b8de19544..df4196edfef09 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -79,33 +79,23 @@ #define DEF_PIDCYCLES 5 /** -* ProUI Menu Options -* Choose which feature you would like to Enable or Disable -*/ -#if ENABLED(SDCARD_SORT_ALPHA) - #define MEDIASORT_MENU_ITEM - #if ENABLED(MEDIASORT_MENU_ITEM) && (SDSORT_GCODE == false) - // MEDIASORT_MENU_ITEM needs SDSORT_GCODE to be 'true' - #undef SDSORT_GCODE - #define SDSORT_GCODE true - #endif -#endif -#if ENABLED(HAS_FILAMENT_SENSOR) - #define RUNOUT_TUNE_ITEM + * ProUI internal feature flags + */ +#if ALL(SDCARD_SORT_ALPHA, SDSORT_GCODE) + #define PROUI_MEDIASORT #endif #if ENABLED(POWER_LOSS_RECOVERY) - #define PLR_TUNE_ITEM // Power-loss Recovery option in Tune Menu + #define PROUI_ITEM_PLR // Tune > Power-loss Recovery #endif #if ENABLED(HAS_JUNCTION_DEVIATION) - #define JD_TUNE_ITEM // Juntion Deviation item in Tune Menu + #define PROUI_ITEM_JD // Tune > Junction Deviation #endif #if ENABLED(LIN_ADVANCE) - #define ADVK_TUNE_ITEM // Linear Advance item in Tune Menu + #define PROUI_ITEM_ADVK // Tune > Linear Advance #endif #if HAS_MESH - #define PROUI_MESH_EDIT_MENU // Add a menu to edit mesh points + #define PROUI_MESH_EDIT // Add a menu to edit mesh points #endif - #define HAS_GCODE_PREVIEW 1 #define HAS_CUSTOM_COLORS 1 // Change display colors #define HAS_ESDIAG 1 // View End-stop/Runout switch continuity