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

ProUI feature utilization / Misc. Fixes #26434

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
73693bb
Fix typo in stm32f4.ini
classicrocker883 Nov 17, 2023
f60abea
Add ProUI feature options
classicrocker883 Nov 17, 2023
3d8088b
fix `SDSORT_GCODE false` warning
classicrocker883 Nov 17, 2023
3a46132
include #ifdef in MarlinConfigPre.h
classicrocker883 Nov 19, 2023
9fe4190
enabled
thinkyhead Nov 20, 2023
d715ff0
Merge branch 'bugfix-2.1.x' into pr/26434
thinkyhead Nov 20, 2023
cc17151
tweak errors
thinkyhead Nov 20, 2023
28b8571
clarify
thinkyhead Nov 20, 2023
7f2c141
Merge branch 'bugfix-2.1.x' into pr/26434
thinkyhead Nov 20, 2023
b707878
Fix warning: narrowing conversion
classicrocker883 Nov 20, 2023
2920b3d
fix file wrappers
thinkyhead Nov 21, 2023
3f2df7e
Merge branch 'bugfix-2.1.x-Nov3' of https://github.com/classicrocker8…
classicrocker883 Nov 21, 2023
8a5faf1
Fix warning: narrowing conversion in JyersUI
classicrocker883 Nov 21, 2023
031eecc
fixes for dwin.cpp
classicrocker883 Nov 21, 2023
6358ade
indent
classicrocker883 Nov 21, 2023
10bea42
add brief and param to Menu Line Spacing
classicrocker883 Nov 21, 2023
ea9c430
update dwin_defines.h
classicrocker883 Nov 21, 2023
e109c3c
undo extraneous changes
thinkyhead Nov 21, 2023
758ebab
rename UBL_Z_OFFSET_MIN/MAX to Z_OFFSET_MIN/MAX
classicrocker883 Nov 21, 2023
6dd992b
Merge branch 'bugfix-2.1.x-Nov3' of https://github.com/classicrocker8…
classicrocker883 Nov 21, 2023
1b41c4b
forgot indent bedlevel_tools.cpp
classicrocker883 Nov 21, 2023
41081cc
unindent
thinkyhead Nov 21, 2023
86819bb
move to dwin_defines
thinkyhead Nov 21, 2023
43ff659
rgb type, some case fix
thinkyhead Nov 21, 2023
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
8 changes: 1 addition & 7 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2491,15 +2491,9 @@
// PID heating
#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER)
#define HAS_PID_HEATING 1
#endif

#if ENABLED(DWIN_LCD_PROUI)
#if ANY(PIDTEMP, PIDTEMPBED)
#if ENABLED(DWIN_LCD_PROUI) && ANY(PIDTEMP, PIDTEMPBED)
#define PROUI_PID_TUNE 1
#endif
#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define PROUI_TUNING_GRAPH 1
#endif
#endif

// Thermal protection
Expand Down
16 changes: 3 additions & 13 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1533,15 +1533,15 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
* Allow only one bed leveling option to be defined
*/
#if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif

/**
* Bed Leveling Requirements
*/

#if IS_SCARA && ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
#error "SCARA machines can only use AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING leveling."
#error "SCARA machines can only use AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING."
#elif ENABLED(AUTO_BED_LEVELING_LINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 2, 255) && WITHIN(GRID_MAX_POINTS_Y, 2, 255))
#error "GRID_MAX_POINTS_[XY] must be between 2 and 255 with AUTO_BED_LEVELING_LINEAR."
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255))
Expand Down Expand Up @@ -1610,7 +1610,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
#error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
#elif ENABLED(MESH_EDIT_MENU) && !HAS_MESH
#error "MESH_EDIT_MENU requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#error "MESH_EDIT_MENU requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif
#endif

Expand Down Expand Up @@ -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) && DISABLED(SDCARD_SORT_ALPHA)
#error "MEDIASORT_MENU_ITEM requires SDCARD_SORT_ALPHA."
#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

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class TextScroller {

// Draw value text on
if (viewer_print_value) {
xy_int8_t offset { 0, cell_height_px / 2 - 6 };
xy_long_t offset { 0, cell_height_px / 2 - 6 };
if (isnan(bedlevel.z_values[x][y])) { // undefined
dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X"));
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bool BedLevelTools::meshValidate() {
// Draw value text on
const uint8_t fs = DWINUI::fontWidth(meshfont);
if (viewer_print_value) {
xy_int8_t offset { 0, cell_height_px / 2 - fs };
xy_long_t offset { 0, cell_height_px / 2 - fs };
if (isnan(bedlevel.z_values[x][y])) { // undefined
dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X"));
}
Expand Down
28 changes: 14 additions & 14 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#if ENABLED(DWIN_LCD_PROUI)

#include "dwin.h"
#include "menus.h"
#include "dwin_popup.h"

#include "../../utf8.h"
#include "../../marlinui.h"
#include "../../../MarlinCore.h"
Expand Down Expand Up @@ -105,10 +109,6 @@
#include "../../../feature/tmc_util.h"
#endif

#include "dwin.h"
#include "menus.h"
#include "dwin_popup.h"

#if HAS_GCODE_PREVIEW
#include "gcode_preview.h"
#endif
Expand Down Expand Up @@ -268,7 +268,7 @@ Menu *stepsMenu = nullptr;
#endif
#if HAS_MESH
Menu *meshMenu = nullptr;
#if ENABLED(MESH_EDIT_MENU)
#if ENABLED(PROUI_MESH_EDIT)
Menu *editMeshMenu = nullptr;
#endif
#endif
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3952,7 +3952,7 @@ void drawStepsMenu() {
void setBedLevT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); }
#endif

#if ENABLED(MESH_EDIT_MENU)
#if ENABLED(PROUI_MESH_EDIT)
#define Z_OFFSET_MIN -3
#define Z_OFFSET_MAX 3

Expand Down Expand Up @@ -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(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
Expand All @@ -4038,7 +4038,7 @@ void drawStepsMenu() {
updateMenu(meshMenu);
}

#if ENABLED(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);
Expand Down
19 changes: 13 additions & 6 deletions Marlin/src/lcd/e3v2/proui/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,25 @@ typedef struct {
#if ENABLED(BAUD_RATE_GCODE)
bool baud115K = false;
#endif

bool fullManualTramming = false;
bool mediaSort = true;
#if ALL(LCD_BED_TRAMMING, HAS_BED_PROBE)
bool fullManualTramming = false;
#endif
#if ENABLED(PROUI_MEDIASORT)
bool mediaSort = true;
#endif
bool mediaAutoMount = ENABLED(HAS_SD_EXTENDER);
#if ALL(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING)
uint8_t zAfterHoming = DEF_Z_AFTER_HOMING;
#endif
#if ALL(LED_CONTROL_MENU, HAS_COLOR_LEDS)
LEDColor ledColor = defColorLeds;
#endif
bool adaptiveStepSmoothing = true;
bool enablePreview = true;
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
bool adaptiveStepSmoothing = true;
#endif
#if HAS_GCODE_PREVIEW
bool enablePreview = true;
#endif
} hmi_data_t;

extern hmi_data_t hmiData;
Expand Down Expand Up @@ -336,7 +343,7 @@ void drawStepsMenu();
#endif
#if HAS_MESH
void drawMeshSetMenu();
#if ENABLED(MESH_EDIT_MENU)
#if ENABLED(PROUI_MESH_EDIT)
void drawEditMeshMenu();
#endif
#endif
Expand Down
26 changes: 26 additions & 0 deletions Marlin/src/lcd/e3v2/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,29 @@
#define DEF_BEDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 60)
#define DEF_PIDCYCLES 5

/**
* ProUI internal feature flags
*/
#if ALL(SDCARD_SORT_ALPHA, SDSORT_GCODE)
#define PROUI_MEDIASORT
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#define PROUI_ITEM_PLR // Tune > Power-loss Recovery
#endif
#if ENABLED(HAS_JUNCTION_DEVIATION)
#define PROUI_ITEM_JD // Tune > Junction Deviation
#endif
#if ENABLED(LIN_ADVANCE)
#define PROUI_ITEM_ADVK // Tune > Linear Advance
#endif
#if HAS_MESH
#define PROUI_MESH_EDIT // Add a menu to edit mesh points
#endif
#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define PROUI_TUNING_GRAPH 1
#endif
#define HAS_GCODE_PREVIEW 1
#define HAS_CUSTOM_COLORS 1 // Change display colors
#define HAS_ESDIAG 1 // View End-stop/Runout switch continuity
#define HAS_LOCKSCREEN 1 // Simple lockscreen
#define HAS_SD_EXTENDER 1 // Enable to support SD card extender cables
11 changes: 7 additions & 4 deletions Marlin/src/lcd/e3v2/proui/endstop_diag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@

#include "../../../inc/MarlinConfigPre.h"

#if ALL(DWIN_LCD_PROUI, HAS_ESDIAG)
#if ENABLED(DWIN_LCD_PROUI)

#include "endstop_diag.h"
#include "dwin_defines.h"

#if HAS_ESDIAG

#include "../../../core/types.h"
#include "endstop_diag.h"
#include "../../marlinui.h"
#include "dwin.h"
#include "dwin_popup.h"
Expand Down Expand Up @@ -87,4 +89,5 @@ void ESDiag::update() {
dwinUpdateLCD();
}

#endif // DWIN_LCD_PROUI && HAS_ESDIAG
#endif // HAS_ESDIAG
#endif // DWIN_LCD_PROUI
10 changes: 7 additions & 3 deletions Marlin/src/lcd/e3v2/proui/gcode_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@

#include "../../../inc/MarlinConfigPre.h"

#if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW)
#if ENABLED(DWIN_LCD_PROUI)

#include "dwin_defines.h"

#if HAS_GCODE_PREVIEW

#include "gcode_preview.h"

#include "../../../core/types.h"
#include "../../marlinui.h"
#include "../../../sd/cardreader.h"
#include "../../../MarlinCore.h" // for wait_for_user
Expand Down Expand Up @@ -226,4 +229,5 @@ void Preview::show() {
dwinIconShow(xpos, ypos, 0x00);
}

#endif // DWIN_LCD_PROUI && HAS_GCODE_PREVIEW
#endif // HAS_GCODE_PREVIEW
#endif // DWIN_LCD_PROUI
9 changes: 6 additions & 3 deletions Marlin/src/lcd/e3v2/proui/lockscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

#include "../../../inc/MarlinConfigPre.h"

#if ALL(DWIN_LCD_PROUI, HAS_LOCKSCREEN)
#if ENABLED(DWIN_LCD_PROUI)

#include "dwin_defines.h"
#include "dwinui.h"

#if HAS_LOCKSCREEN

#include "dwin.h"
#include "lockscreen.h"

Expand Down Expand Up @@ -72,4 +74,5 @@ void LockScreen::onEncoder(EncoderState encoder_diffState) {
dwinUpdateLCD();
}

#endif // DWIN_LCD_PROUI && HAS_LOCKSCREEN
#endif // HAS_LOCKSCREEN
#endif // DWIN_LCD_PROUI
10 changes: 7 additions & 3 deletions Marlin/src/lcd/e3v2/proui/plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@

#include "../../../inc/MarlinConfig.h"

#if ALL(DWIN_LCD_PROUI, PROUI_TUNING_GRAPH)
#if ENABLED(DWIN_LCD_PROUI)

#include "dwin_defines.h"

#if PROUI_TUNING_GRAPH

#include "dwin.h"
#include "../../../core/types.h"
#include "../../marlinui.h"
#include "plot.h"

Expand Down Expand Up @@ -75,4 +78,5 @@ void Plot::update(const_float_t value) {
#endif
}

#endif // DWIN_LCD_PROUI && PROUI_TUNING_GRAPH
#endif // PROUI_TUNING_GRAPH
#endif // DWIN_LCD_PROUI