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

Fix ProUI and Jyers unused and cleanup #26078

Merged
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 @@ -416,7 +416,7 @@ class TextScroller {
}
}

void setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead
void JyersDWIN::setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead
float v1, v2,
v_min = abs(getMinValue()),
v_max = abs(getMaxValue());
Expand Down
60 changes: 43 additions & 17 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@
#include "lockscreen.h"
#endif

#define DEBUG_OUT ENABLED(DEBUG_DWIN)
#include "../../../core/debug_out.h"

#ifndef MACHINE_SIZE
#define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS)
#endif
Expand Down Expand Up @@ -2203,10 +2200,14 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
void setProbeOffsetX() { setPFloatOnClick(-60, 60, UNITFDIGITS); }
void setProbeOffsetY() { setPFloatOnClick(-60, 60, UNITFDIGITS); }
void setProbeOffsetZ() { setPFloatOnClick(-10, 10, 2); }
void probeTest() {
LCD_MESSAGE(MSG_M48_TEST);
queue.inject(F("G28O\nM48 P10"));
}

#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
void probeTest() {
LCD_MESSAGE(MSG_M48_TEST);
queue.inject(F("G28O\nM48 P10"));
}
#endif

void probeStow() { probe.stow(); }
void probeDeploy() { probe.deploy(); }

Expand Down Expand Up @@ -3038,7 +3039,7 @@ void drawPrepareMenu() {

void drawControlMenu() {
checkkey = ID_Menu;
if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 10)) {
if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 11)) {
BACK_ITEM(gotoMainMenu);
MENU_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawTempSubMenu, drawTemperatureMenu);
MENU_ITEM(ICON_Motion, MSG_MOTION, onDrawMotionSubMenu, drawMotionMenu);
Expand All @@ -3058,6 +3059,9 @@ void drawControlMenu() {
#if ENABLED(LED_CONTROL_MENU)
MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu);
#endif
#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
MENU_ITEM(ICON_Host, MSG_HOST_SHUTDOWN, onDrawMenuItem, HostShutDown);
#endif
MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, gotoInfoMenu);
}
ui.reset_status(true);
Expand All @@ -3066,7 +3070,7 @@ void drawControlMenu() {

void drawAdvancedSettingsMenu() {
checkkey = ID_Menu;
if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 22)) {
if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 23)) {
BACK_ITEM(gotoMainMenu);
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM);
Expand All @@ -3077,6 +3081,9 @@ void drawAdvancedSettingsMenu() {
#if HAS_BED_PROBE
MENU_ITEM(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu);
#endif
#if HAS_HOME_OFFSET
MENU_ITEM(ICON_ProbeSet, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu);
#endif
MENU_ITEM(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, drawFilSetMenu);
#if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU)
MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, drawHotendPIDMenu);
Expand Down Expand Up @@ -3156,7 +3163,7 @@ void drawMoveMenu() {
void drawHomeOffsetMenu() {
checkkey = ID_Menu;
if (SET_MENU(homeOffsetMenu, MSG_SET_HOME_OFFSETS, 4)) {
BACK_ITEM(drawPhySetMenu);
BACK_ITEM(drawAdvancedSettingsMenu);
#if HAS_X_AXIS
EDIT_ITEM(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, setHomeOffsetX, &home_offset.x);
#endif
Expand Down Expand Up @@ -3195,7 +3202,9 @@ void drawMoveMenu() {
EDIT_ITEM(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, setHSMode, &bltouch.high_speed_mode);
#endif
#endif
MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, probeTest);
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, probeTest);
#endif
}
updateMenu(ProbeSetMenu);
}
Expand Down Expand Up @@ -3794,9 +3803,9 @@ void drawStepsMenu() {
EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles);
#endif
#if ENABLED(PID_EDIT_MENU)
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd);
#endif
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM);
Expand Down Expand Up @@ -3824,9 +3833,9 @@ void drawStepsMenu() {
EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles);
#endif
#if ENABLED(PID_EDIT_MENU)
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki);
EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd);
#endif
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM);
Expand Down Expand Up @@ -4020,4 +4029,21 @@ void drawStepsMenu() {

#endif // HAS_MESH

//=============================================================================
// More Host support
//=============================================================================

//#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)

void popupHostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); }
void onClickHostShutDown() {
if (hmiFlag.select_flag) { hostui.shutdown(); }
hmiReturnScreen();
}
void hostShutDown() { gotoPopup(popupHostShutDown, onClickHostShutDown); }

//#endif

//=============================================================================

#endif // DWIN_LCD_PROUI
37 changes: 18 additions & 19 deletions Marlin/src/lcd/e3v2/proui/dwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ void doCoolDown();
#if HAS_LCD_BRIGHTNESS
void turnOffBacklight();
#endif
void applyExtMinT();
void parkHead();
#if ENABLED(PREVENT_COLD_EXTRUSION)
void applyExtMinT();
#endif
#if ENABLED(NOZZLE_PARK_FEATURE)
void parkHead();
#endif
#if HAS_ONESTEP_LEVELING
void trammingwizard();
#endif
Expand All @@ -238,7 +242,7 @@ void gotoMainMenu();
void gotoInfoMenu();
void gotoPowerLossRecovery();
void gotoConfirmToPrint();
void dwinDrawDashboard(const bool with_update); // Status Area
void dwinDrawDashboard(); // Status Area
void drawMainArea(); // Redraw main area
void dwinDrawStatusLine(const char *text = ""); // Draw simple status text
void dwinRedrawDash(); // Redraw Dash and Status line
Expand Down Expand Up @@ -291,15 +295,9 @@ void dwinRebootScreen();
#if HAS_MESH
void dwinMeshViewer();
#endif
#if HAS_GCODE_PREVIEW
void hmiConfirmToPrint();
#endif
#if HAS_ESDIAG
void drawEndStopDiag();
#endif
#if ENABLED(PRINTCOUNTER)
void drawPrintStats();
#endif

// Menu drawing functions
void drawPrintFileMenu();
Expand All @@ -315,10 +313,6 @@ void drawTrammingMenu();
void drawProbeSetMenu();
#endif
void drawFilSetMenu();
#if ENABLED(NOZZLE_PARK_FEATURE)
void drawParkPosMenu();
#endif
void drawPhySetMenu();
#if ALL(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)
void drawCaseLightMenu();
#endif
Expand Down Expand Up @@ -371,6 +365,9 @@ void drawStepsMenu();
#include "../../../module/temperature.h"
void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp);
void dwinPidTuning(tempcontrol_t result);
#if PROUI_TUNING_GRAPH
void dwinDrawPIDMPCPopup();
#endif
#endif
#if ENABLED(PIDTEMP)
#if ENABLED(PID_AUTOTUNE_MENU)
Expand All @@ -390,9 +387,11 @@ void drawStepsMenu();
#endif

// MPC
#if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
void drawHotendMPCMenu();
#endif
#if ENABLED(MPC_AUTOTUNE)
void dwinMPCTuning(tempcontrol_t result);
#endif
#if ENABLED(MPCTEMP)
#if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
void drawHotendMPCMenu();
#endif
#if ENABLED(MPC_AUTOTUNE)
void dwinMPCTuning(tempcontrol_t result);
#endif
#endif
2 changes: 0 additions & 2 deletions Marlin/src/lcd/e3v2/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
* Date: 2022/08/08
*/

//#define DEBUG_DWIN 1

#if defined(__STM32F1__) || defined(STM32F1)
#define DASH_REDRAW 1
#endif
Expand Down