🚸 DWIN Enhanced improve, fix, and extend (#23240)
- Offset icon change to show mesh leveling status - Reset extruder position when enter to Move menu - New live end-stop diagnostic page - Editable firmware retracts settings for Tune and filament settings menu - Print Statistics page accessible from the Advanced Settings menu - Reset printer draws the boot image - Adds individual axes homing menu - Adds probe deploy/stow to Probe Settings menu - Updates lock screen - Rebuilds main buttons to support text caption in other languages - Increases probe offset limits to 60 mm - Fix M303 PID variable update - Fix Resume/Pause button update - Fix redraw of print done - Fix very large file name bug - Fix bug in bed manual leveling
This commit is contained in:
committed by
Scott Lahteine
parent
430c5da54c
commit
06c2ed3c99
File diff suppressed because it is too large
Load Diff
@ -24,8 +24,8 @@
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.7.1
|
||||
* Date: 2021/11/09
|
||||
* Version: 3.9.1
|
||||
* Date: 2021/11/21
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
@ -45,7 +45,7 @@
|
||||
#define HAS_ZOFFSET_ITEM 1
|
||||
#endif
|
||||
|
||||
static constexpr size_t eeprom_data_size = 64;
|
||||
#include "dwin_defines.h"
|
||||
|
||||
enum processID : uint8_t {
|
||||
// Process ID
|
||||
@ -59,11 +59,16 @@ enum processID : uint8_t {
|
||||
SelectFile,
|
||||
PrintProcess,
|
||||
PrintDone,
|
||||
PwrlossRec,
|
||||
Reboot,
|
||||
Info,
|
||||
|
||||
// Popup Windows
|
||||
Homing,
|
||||
Leveling,
|
||||
PidProcess,
|
||||
ESDiagProcess,
|
||||
PrintStatsProcess,
|
||||
PauseOrStop,
|
||||
FilamentPurge,
|
||||
WaitResponse,
|
||||
@ -97,39 +102,6 @@ typedef struct {
|
||||
void (*LiveUpdate)() = nullptr; // Auxiliar live update function
|
||||
} HMI_value_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t Background_Color = Def_Background_Color;
|
||||
uint16_t Cursor_color = Def_Cursor_color;
|
||||
uint16_t TitleBg_color = Def_TitleBg_color;
|
||||
uint16_t TitleTxt_color = Def_TitleTxt_color;
|
||||
uint16_t Text_Color = Def_Text_Color;
|
||||
uint16_t Selected_Color = Def_Selected_Color;
|
||||
uint16_t SplitLine_Color = Def_SplitLine_Color;
|
||||
uint16_t Highlight_Color = Def_Highlight_Color;
|
||||
uint16_t StatusBg_Color = Def_StatusBg_Color;
|
||||
uint16_t StatusTxt_Color = Def_StatusTxt_Color;
|
||||
uint16_t PopupBg_color = Def_PopupBg_color;
|
||||
uint16_t PopupTxt_Color = Def_PopupTxt_Color;
|
||||
uint16_t AlertBg_Color = Def_AlertBg_Color;
|
||||
uint16_t AlertTxt_Color = Def_AlertTxt_Color;
|
||||
uint16_t PercentTxt_Color = Def_PercentTxt_Color;
|
||||
uint16_t Barfill_Color = Def_Barfill_Color;
|
||||
uint16_t Indicator_Color = Def_Indicator_Color;
|
||||
uint16_t Coordinate_Color = Def_Coordinate_Color;
|
||||
#if HAS_PREHEAT
|
||||
#ifdef PREHEAT_1_TEMP_HOTEND
|
||||
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
|
||||
int16_t PidCycles = 10;
|
||||
#endif
|
||||
#ifdef PREHEAT_1_TEMP_BED
|
||||
int16_t BedPidT = PREHEAT_1_TEMP_BED;
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
int16_t ExtMinT = EXTRUDE_MINTEMP;
|
||||
#endif
|
||||
} HMI_data_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t language;
|
||||
bool pause_flag:1; // printing is paused
|
||||
@ -138,15 +110,24 @@ typedef struct {
|
||||
bool select_flag:1; // Popup button selected
|
||||
bool home_flag:1; // homing in course
|
||||
bool heat_flag:1; // 0: heating done 1: during heating
|
||||
bool lock_flag:1; // 0: lock called from AdvSet 1: lock called from Tune
|
||||
} HMI_flag_t;
|
||||
|
||||
extern HMI_value_t HMI_value;
|
||||
extern HMI_flag_t HMI_flag;
|
||||
extern HMI_data_t HMI_data;
|
||||
extern uint8_t checkkey;
|
||||
extern millis_t dwin_heat_time;
|
||||
|
||||
// Popups
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
void DWIN_Popup_Temperature(const bool toohigh);
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
void Popup_Window_ETempTooLow();
|
||||
#endif
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void Popup_PowerLossRecovery();
|
||||
#endif
|
||||
|
||||
// SD Card
|
||||
void HMI_SDCardInit();
|
||||
void HMI_SDCardUpdate();
|
||||
@ -154,8 +135,8 @@ void HMI_SDCardUpdate();
|
||||
// Other
|
||||
void Goto_PrintProcess();
|
||||
void Goto_Main_Menu();
|
||||
void Goto_InfoMenu();
|
||||
void Draw_Select_Highlight(const bool sel);
|
||||
void Goto_Info_Menu();
|
||||
void Goto_PowerLossRecovery();
|
||||
void Draw_Status_Area(const bool with_update); // Status Area
|
||||
void Draw_Main_Area(); // Redraw main area;
|
||||
void DWIN_Redraw_screen(); // Redraw all screen elements
|
||||
@ -204,11 +185,18 @@ void DWIN_RebootScreen();
|
||||
#endif
|
||||
|
||||
// Utility and extensions
|
||||
void DWIN_LockScreen();
|
||||
void DWIN_UnLockScreen();
|
||||
void HMI_LockScreen();
|
||||
void DWIN_LockScreen(const bool flag = true);
|
||||
#if HAS_MESH
|
||||
void DWIN_MeshViewer();
|
||||
#endif
|
||||
#if HAS_ESDIAG
|
||||
void Draw_EndStopDiag();
|
||||
#endif
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
void Draw_PrintStats();
|
||||
#endif
|
||||
|
||||
// HMI user control functions
|
||||
void HMI_Menu();
|
||||
@ -262,23 +250,6 @@ void Draw_Steps_Menu();
|
||||
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
|
||||
void Draw_ZOffsetWiz_Menu();
|
||||
#endif
|
||||
|
||||
// Popup windows
|
||||
|
||||
void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button=0);
|
||||
void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1=nullptr, FSTR_P const fmsg2=nullptr, uint8_t button=0);
|
||||
|
||||
template<typename T, typename U>
|
||||
void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) {
|
||||
HMI_SaveProcessID(WaitResponse);
|
||||
DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
#if HAS_HOTEND || HAS_HEATED_BED
|
||||
void DWIN_Popup_Temperature(const bool toohigh);
|
||||
#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
|
||||
void Draw_Homing_Menu();
|
||||
#endif
|
||||
#if HAS_HOTEND
|
||||
void Popup_Window_ETempTooLow();
|
||||
#endif
|
||||
void Popup_Window_Resume();
|
||||
|
92
Marlin/src/lcd/e3v2/enhanced/dwin_defines.h
Normal file
92
Marlin/src/lcd/e3v2/enhanced/dwin_defines.h
Normal file
@ -0,0 +1,92 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN general defines and data structs
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.9.1
|
||||
* Date: 2021/11/21
|
||||
*/
|
||||
|
||||
#include "../../../core/types.h"
|
||||
#include "../common/dwin_color.h"
|
||||
|
||||
#define Def_Background_Color RGB( 1, 12, 8)
|
||||
#define Def_Cursor_color RGB(20, 49, 31)
|
||||
#define Def_TitleBg_color RGB( 0, 23, 16)
|
||||
#define Def_TitleTxt_color Color_White
|
||||
#define Def_Text_Color Color_White
|
||||
#define Def_Selected_Color Select_Color
|
||||
#define Def_SplitLine_Color RGB( 0, 23, 16)
|
||||
#define Def_Highlight_Color Color_White
|
||||
#define Def_StatusBg_Color RGB( 0, 23, 16)
|
||||
#define Def_StatusTxt_Color Color_Yellow
|
||||
#define Def_PopupBg_color Color_Bg_Window
|
||||
#define Def_PopupTxt_Color Popup_Text_Color
|
||||
#define Def_AlertBg_Color Color_Bg_Red
|
||||
#define Def_AlertTxt_Color Color_Yellow
|
||||
#define Def_PercentTxt_Color Percent_Color
|
||||
#define Def_Barfill_Color BarFill_Color
|
||||
#define Def_Indicator_Color Color_White
|
||||
#define Def_Coordinate_Color Color_White
|
||||
|
||||
#define HAS_ESDIAG 1
|
||||
#define DEFAULT_LCD_BRIGHTNESS 127
|
||||
|
||||
typedef struct {
|
||||
// Color settings
|
||||
uint16_t Background_Color = Def_Background_Color;
|
||||
uint16_t Cursor_color = Def_Cursor_color;
|
||||
uint16_t TitleBg_color = Def_TitleBg_color;
|
||||
uint16_t TitleTxt_color = Def_TitleTxt_color;
|
||||
uint16_t Text_Color = Def_Text_Color;
|
||||
uint16_t Selected_Color = Def_Selected_Color;
|
||||
uint16_t SplitLine_Color = Def_SplitLine_Color;
|
||||
uint16_t Highlight_Color = Def_Highlight_Color;
|
||||
uint16_t StatusBg_Color = Def_StatusBg_Color;
|
||||
uint16_t StatusTxt_Color = Def_StatusTxt_Color;
|
||||
uint16_t PopupBg_color = Def_PopupBg_color;
|
||||
uint16_t PopupTxt_Color = Def_PopupTxt_Color;
|
||||
uint16_t AlertBg_Color = Def_AlertBg_Color;
|
||||
uint16_t AlertTxt_Color = Def_AlertTxt_Color;
|
||||
uint16_t PercentTxt_Color = Def_PercentTxt_Color;
|
||||
uint16_t Barfill_Color = Def_Barfill_Color;
|
||||
uint16_t Indicator_Color = Def_Indicator_Color;
|
||||
uint16_t Coordinate_Color = Def_Coordinate_Color;
|
||||
//
|
||||
#if defined(PREHEAT_1_TEMP_HOTEND) && HAS_HOTEND
|
||||
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
|
||||
#endif
|
||||
#if defined(PREHEAT_1_TEMP_BED) && HAS_HEATED_BED
|
||||
int16_t BedPidT = PREHEAT_1_TEMP_BED;
|
||||
#endif
|
||||
#if ANY(HAS_HOTEND, HAS_HEATED_BED)
|
||||
int16_t PidCycles = 10;
|
||||
#endif
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
int16_t ExtMinT = EXTRUDE_MINTEMP;
|
||||
#endif
|
||||
} HMI_data_t;
|
||||
|
||||
static constexpr size_t eeprom_data_size = 64;
|
||||
extern HMI_data_t HMI_data;
|
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.7.1
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/09
|
||||
*/
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.7.1
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/09
|
||||
*/
|
||||
|
||||
|
55
Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp
Normal file
55
Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
#include "dwin.h"
|
||||
#include "dwin_popup.h"
|
||||
|
||||
void Draw_Select_Highlight(const bool sel) {
|
||||
HMI_flag.select_flag = sel;
|
||||
const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color,
|
||||
c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color;
|
||||
DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318);
|
||||
DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319);
|
||||
DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318);
|
||||
DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319);
|
||||
}
|
||||
|
||||
void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) {
|
||||
HMI_SaveProcessID(WaitResponse);
|
||||
DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) {
|
||||
DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2);
|
||||
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
|
||||
DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
|
||||
Draw_Select_Highlight(true);
|
||||
DWIN_UpdateLCD();
|
||||
}
|
62
Marlin/src/lcd/e3v2/enhanced/dwin_popup.h
Normal file
62
Marlin/src/lcd/e3v2/enhanced/dwin_popup.h
Normal file
@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
#include "dwinui.h"
|
||||
#include "dwin.h"
|
||||
|
||||
// Popup windows
|
||||
|
||||
void Draw_Select_Highlight(const bool sel);
|
||||
|
||||
inline void Draw_Popup_Bkgd() {
|
||||
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330);
|
||||
DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 60, 258, 330);
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) {
|
||||
DWINUI::ClearMenuArea();
|
||||
Draw_Popup_Bkgd();
|
||||
if (icon) DWINUI::Draw_Icon(icon, 101, 105);
|
||||
if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1);
|
||||
if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2);
|
||||
if (button) DWINUI::Draw_Icon(button, 86, 280);
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) {
|
||||
HMI_SaveProcessID(WaitResponse);
|
||||
DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2);
|
||||
|
||||
void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2);
|
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.7.1
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/09
|
||||
*/
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include "../../../inc/MarlinConfig.h"
|
||||
#include "dwin_lcd.h"
|
||||
#include "dwinui.h"
|
||||
#include "dwin_defines.h"
|
||||
|
||||
//#define DEBUG_OUT 1
|
||||
#include "../../../core/debug_out.h"
|
||||
|
@ -24,8 +24,8 @@
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.7.1
|
||||
* Date: 2021/11/09
|
||||
* Version: 3.9.1
|
||||
* Date: 2021/11/21
|
||||
*/
|
||||
|
||||
#include "dwin_lcd.h"
|
||||
@ -38,12 +38,20 @@
|
||||
#define ICON_Cancel ICON_StockConfiguration
|
||||
#define ICON_CustomPreheat ICON_SetEndTemp
|
||||
#define ICON_Error ICON_TempTooHigh
|
||||
#define ICON_ESDiag ICON_Info
|
||||
#define ICON_ExtrudeMinT ICON_HotendTemp
|
||||
#define ICON_FilLoad ICON_WriteEEPROM
|
||||
#define ICON_FilMan ICON_ResumeEEPROM
|
||||
#define ICON_FilSet ICON_ResumeEEPROM
|
||||
#define ICON_FilUnload ICON_ReadEEPROM
|
||||
#define ICON_Flow ICON_StepE
|
||||
#define ICON_FWRetLength ICON_StepE
|
||||
#define ICON_FWRetSpeed ICON_Setspeed
|
||||
#define ICON_FWRetZRaise ICON_MoveZ
|
||||
#define ICON_FWRecSpeed ICON_Setspeed
|
||||
#define ICON_HomeX ICON_MoveX
|
||||
#define ICON_HomeY ICON_MoveY
|
||||
#define ICON_HomeZ ICON_MoveZ
|
||||
#define ICON_LevBed ICON_SetEndTemp
|
||||
#define ICON_Lock ICON_Cool
|
||||
#define ICON_ManualMesh ICON_HotendTemp
|
||||
@ -52,9 +60,14 @@
|
||||
#define ICON_MeshViewer ICON_HotendTemp
|
||||
#define ICON_MoveZ0 ICON_HotendTemp
|
||||
#define ICON_Park ICON_Motion
|
||||
#define ICON_PIDbed ICON_SetBedTemp
|
||||
#define ICON_PIDcycles ICON_ResumeEEPROM
|
||||
#define ICON_PIDValue ICON_Contact
|
||||
#define ICON_PrintStats ICON_PrintTime
|
||||
#define ICON_PrintStatsReset ICON_RemainTime
|
||||
#define ICON_ProbeDeploy ICON_SetEndTemp
|
||||
#define ICON_ProbeSet ICON_SetEndTemp
|
||||
#define ICON_ProbeStow ICON_SetEndTemp
|
||||
#define ICON_ProbeTest ICON_SetEndTemp
|
||||
#define ICON_Pwrlossr ICON_Motion
|
||||
#define ICON_Reboot ICON_ResumeEEPROM
|
||||
@ -63,25 +76,11 @@
|
||||
#define ICON_SetCustomPreheat ICON_SetEndTemp
|
||||
#define ICON_Sound ICON_Cool
|
||||
|
||||
// Default UI Colors
|
||||
#define Def_Background_Color Color_Bg_Black
|
||||
#define Def_Cursor_color Rectangle_Color
|
||||
#define Def_TitleBg_color Color_Bg_Blue
|
||||
#define Def_TitleTxt_color Color_White
|
||||
#define Def_Text_Color Color_White
|
||||
#define Def_Selected_Color Select_Color
|
||||
#define Def_SplitLine_Color Line_Color
|
||||
#define Def_Highlight_Color Color_White
|
||||
#define Def_StatusBg_Color RGB(0,20,20)
|
||||
#define Def_StatusTxt_Color Color_Yellow
|
||||
#define Def_PopupBg_color Color_Bg_Window
|
||||
#define Def_PopupTxt_Color Popup_Text_Color
|
||||
#define Def_AlertBg_Color Color_Bg_Red
|
||||
#define Def_AlertTxt_Color Color_Yellow
|
||||
#define Def_PercentTxt_Color Percent_Color
|
||||
#define Def_Barfill_Color BarFill_Color
|
||||
#define Def_Indicator_Color Color_White
|
||||
#define Def_Coordinate_Color Color_White
|
||||
// Extended and default UI Colors
|
||||
#define Color_Black 0
|
||||
#define Color_Green RGB(0,63,0)
|
||||
#define Color_Aqua RGB(0,63,31)
|
||||
#define Color_Blue RGB(0,0,31)
|
||||
|
||||
// UI element defines and constants
|
||||
#define DWIN_FONT_MENU font8x16
|
||||
@ -197,9 +196,11 @@ namespace DWINUI {
|
||||
|
||||
// Get font character width
|
||||
uint8_t fontWidth(uint8_t cfont);
|
||||
inline uint8_t fontWidth() { return fontWidth(font); };
|
||||
|
||||
// Get font character height
|
||||
uint8_t fontHeight(uint8_t cfont);
|
||||
inline uint8_t fontHeight() { return fontHeight(font); };
|
||||
|
||||
// Get screen x coordinates from text column
|
||||
uint16_t ColToX(uint8_t col);
|
||||
@ -412,6 +413,14 @@ namespace DWINUI {
|
||||
Draw_CenteredString(false, font, textcolor, backcolor, y, title);
|
||||
}
|
||||
|
||||
// Draw a box
|
||||
// mode: 0=frame, 1=fill, 2=XOR fill
|
||||
// color: Rectangle color
|
||||
// frame: Box coordinates and size
|
||||
inline void Draw_Box(uint8_t mode, uint16_t color, frame_rect_t frame) {
|
||||
DWIN_Draw_Box(mode, color, frame.x, frame.y, frame.w, frame.h);
|
||||
}
|
||||
|
||||
// Draw a circle
|
||||
// Color: circle color
|
||||
// x: abscissa of the center of the circle
|
||||
|
109
Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp
Normal file
109
Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp
Normal file
@ -0,0 +1,109 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DWIN End Stops diagnostic page
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 1.0
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
#include "dwin_defines.h"
|
||||
|
||||
#if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_ESDIAG)
|
||||
|
||||
#include "endstop_diag.h"
|
||||
|
||||
#include "../../../core/types.h"
|
||||
#include "../../marlinui.h"
|
||||
#include "dwin_lcd.h"
|
||||
#include "dwinui.h"
|
||||
#include "dwin_popup.h"
|
||||
#include "dwin.h"
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#include "../../../feature/runout.h"
|
||||
#endif
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
#include "../../../module/probe.h"
|
||||
#endif
|
||||
|
||||
ESDiagClass ESDiag;
|
||||
|
||||
void draw_es_label(FSTR_P const flabel=nullptr) {
|
||||
DWINUI::cursor.x = 40;
|
||||
if (flabel) DWINUI::Draw_String(F(flabel));
|
||||
DWINUI::Draw_String(F(": "));
|
||||
DWINUI::MoveBy(0, 25);
|
||||
}
|
||||
|
||||
void draw_es_state(const bool is_hit) {
|
||||
const uint8_t LM = 130;
|
||||
DWINUI::cursor.x = LM;
|
||||
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20);
|
||||
is_hit ? DWINUI::Draw_String(RGB(31,31,16), F(STR_ENDSTOP_HIT)) : DWINUI::Draw_String(RGB(16,63,16), F(STR_ENDSTOP_OPEN));
|
||||
DWINUI::MoveBy(0, 25);
|
||||
}
|
||||
|
||||
void ESDiagClass::Draw() {
|
||||
Title.ShowCaption(F("End-stops Diagnostic"));
|
||||
DWINUI::ClearMenuArea();
|
||||
Draw_Popup_Bkgd();
|
||||
DWINUI::Draw_Icon(ICON_Continue_E, 86, 250);
|
||||
DWINUI::cursor.y = 80;
|
||||
#define ES_LABEL(S) draw_es_label(F(STR_##S))
|
||||
#if HAS_X_MIN
|
||||
ES_LABEL(X_MIN);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
ES_LABEL(Y_MIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
ES_LABEL(Z_MIN);
|
||||
#endif
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
draw_es_label(F(STR_FILAMENT));
|
||||
#endif
|
||||
Update();
|
||||
}
|
||||
|
||||
void ESDiagClass::Update() {
|
||||
DWINUI::cursor.y = 80;
|
||||
#define ES_REPORT(S) draw_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING)
|
||||
#if HAS_X_MIN
|
||||
ES_REPORT(X_MIN);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
ES_REPORT(Y_MIN);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
ES_REPORT(Z_MIN);
|
||||
#endif
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE);
|
||||
#endif
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH
|
37
Marlin/src/lcd/e3v2/enhanced/endstop_diag.h
Normal file
37
Marlin/src/lcd/e3v2/enhanced/endstop_diag.h
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN End Stops diagnostic page
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 1.0
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
class ESDiagClass {
|
||||
public:
|
||||
void Draw();
|
||||
void Update();
|
||||
};
|
||||
|
||||
extern ESDiagClass ESDiag;
|
@ -21,10 +21,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Lock screen implementation for DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.6.3
|
||||
* Date: 2021/09/08
|
||||
* Version: 2.1
|
||||
* Date: 2021/11/09
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
@ -41,6 +41,7 @@ LockScreenClass lockScreen;
|
||||
|
||||
uint8_t LockScreenClass::lock_pos = 0;
|
||||
bool LockScreenClass::unlocked = false;
|
||||
uint8_t LockScreenClass::rprocess = 0;
|
||||
|
||||
void LockScreenClass::init() {
|
||||
lock_pos = 0;
|
||||
|
@ -22,10 +22,10 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN UI Enhanced implementation
|
||||
* Lock screen implementation for DWIN UI Enhanced implementation
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.6.3
|
||||
* Date: 2021/09/08
|
||||
* Version: 2.1
|
||||
* Date: 2021/11/09
|
||||
*/
|
||||
|
||||
#include "../common/encoder.h"
|
||||
@ -36,6 +36,7 @@ private:
|
||||
static bool unlocked;
|
||||
static uint8_t lock_pos;
|
||||
public:
|
||||
static uint8_t rprocess;
|
||||
static void init();
|
||||
static void onEncoder(EncoderState encoder_diffState);
|
||||
static void draw();
|
||||
|
@ -1,12 +1,13 @@
|
||||
/**
|
||||
* DWIN Mesh Viewer
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the License, or
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -14,11 +15,18 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DWIN Mesh Viewer
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_MESH)
|
||||
|
@ -1,12 +1,13 @@
|
||||
/**
|
||||
* DWIN Mesh Viewer
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the License, or
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@ -14,12 +15,19 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN Mesh Viewer
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 3.8.1
|
||||
* Date: 2021/11/06
|
||||
*/
|
||||
|
||||
class MeshViewerClass {
|
||||
public:
|
||||
void Draw();
|
||||
|
76
Marlin/src/lcd/e3v2/enhanced/printstats.cpp
Normal file
76
Marlin/src/lcd/e3v2/enhanced/printstats.cpp
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DWIN Print Stats page
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 1.0
|
||||
* Date: 2021/11/21
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if BOTH(DWIN_CREALITY_LCD_ENHANCED, PRINTCOUNTER)
|
||||
|
||||
#include "printstats.h"
|
||||
|
||||
#include "../../../core/types.h"
|
||||
#include "../../marlinui.h"
|
||||
#include "../../../module/printcounter.h"
|
||||
#include "dwin_lcd.h"
|
||||
#include "dwinui.h"
|
||||
#include "dwin_popup.h"
|
||||
#include "dwin.h"
|
||||
|
||||
PrintStatsClass PrintStats;
|
||||
|
||||
void PrintStatsClass::Draw() {
|
||||
char buf[50] = "";
|
||||
char str[30] = "";
|
||||
constexpr int8_t MRG = 30;
|
||||
|
||||
Title.ShowCaption(GET_TEXT_F(MSG_INFO_STATS_MENU));
|
||||
DWINUI::ClearMenuArea();
|
||||
Draw_Popup_Bkgd();
|
||||
DWINUI::Draw_Icon(ICON_Continue_E, 86, 250);
|
||||
printStatistics ps = print_job_timer.getStats();
|
||||
|
||||
sprintf_P(buf, PSTR("%s: %i"), GET_TEXT(MSG_INFO_PRINT_COUNT), ps.totalPrints);
|
||||
DWINUI::Draw_String(MRG, 80, buf);
|
||||
sprintf_P(buf, PSTR("%s: %i"), GET_TEXT(MSG_INFO_COMPLETED_PRINTS), ps.finishedPrints);
|
||||
DWINUI::Draw_String(MRG, 100, buf);
|
||||
duration_t(print_job_timer.getStats().printTime).toDigital(str, true);
|
||||
sprintf_P(buf, PSTR("%s: %s"), GET_TEXT(MSG_INFO_PRINT_TIME), str);
|
||||
DWINUI::Draw_String(MRG, 120, buf);
|
||||
duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true);
|
||||
sprintf_P(buf, PSTR("%s: %s"), GET_TEXT(MSG_INFO_PRINT_LONGEST), str);
|
||||
DWINUI::Draw_String(MRG, 140, buf);
|
||||
sprintf_P(buf, PSTR("%s: %s m"), GET_TEXT(MSG_INFO_PRINT_FILAMENT), dtostrf(ps.filamentUsed / 1000, 1, 2, str));
|
||||
DWINUI::Draw_String(MRG, 160, buf);
|
||||
}
|
||||
|
||||
void PrintStatsClass::Reset() {
|
||||
print_job_timer.initStats();
|
||||
HMI_AudioFeedback();
|
||||
}
|
||||
|
||||
#endif // DWIN_CREALITY_LCD_ENHANCED && PRINTCOUNTER
|
37
Marlin/src/lcd/e3v2/enhanced/printstats.h
Normal file
37
Marlin/src/lcd/e3v2/enhanced/printstats.h
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DWIN Print Stats page
|
||||
* Author: Miguel A. Risco-Castillo
|
||||
* Version: 1.0
|
||||
* Date: 2021/11/21
|
||||
*/
|
||||
|
||||
class PrintStatsClass {
|
||||
public:
|
||||
void Draw();
|
||||
static void Reset();
|
||||
};
|
||||
|
||||
extern PrintStatsClass PrintStats;
|
Reference in New Issue
Block a user