Ender 3 V2 Status Line (#21369)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Miguel Risco-Castillo
2021-03-24 10:12:57 -05:00
committed by GitHub
parent d172c71376
commit 930752d46e
20 changed files with 66 additions and 47 deletions

View File

@ -402,7 +402,7 @@ void Draw_Title(const __FlashStringHelper * title) {
}
void Clear_Menu_Area() {
DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y);
DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y - 1);
}
void Clear_Main_Window() {
@ -3794,4 +3794,11 @@ void DWIN_CompletedLeveling() {
if (checkkey == Leveling) Goto_MainMenu();
}
void DWIN_StatusChanged(const char *text) {
DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(text) * MENU_CHR_W) / 2;
DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 2, F(text));
DWIN_UpdateLCD();
}
#endif // DWIN_CREALITY_LCD

View File

@ -377,6 +377,7 @@ void HMI_Init();
void DWIN_Update();
void EachMomentUpdate();
void DWIN_HandleScreen();
void DWIN_StatusChanged(const char *text);
inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }

View File

@ -522,6 +522,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilinear Leveling");
PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling");
PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mesh Leveling");
PROGMEM Language_Str MSG_MESH_DONE = _UxGT("Mesh probing done");
PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Printer Stats");
PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board Info");
PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors");

View File

@ -105,7 +105,6 @@
#define SETCURSOR_RJ(len, row) lcd_moveto(LCD_COL_X_RJ(len), LCD_ROW_Y(row))
#define SETCURSOR_X(col) SETCURSOR(col, _lcdLineNr)
#define SETCURSOR_X_RJ(len) SETCURSOR_RJ(len, _lcdLineNr)
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
int lcd_glyph_height();

View File

@ -44,9 +44,16 @@ MarlinUI ui;
#include "../gcode/queue.h"
#include "fontutils.h"
#include "../sd/cardreader.h"
#if EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD)
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
#endif
#endif
#if ENABLED(DWIN_CREALITY_LCD)
#include "../module/printcounter.h"
#include "../MarlinCore.h"
#include "dwin/e3v2/dwin.h"
#endif
#if HAS_STATUS_MESSAGE
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
#endif
#if LCD_HAS_WAIT_FOR_MOVE
@ -55,25 +62,24 @@ MarlinUI ui;
constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#if HAS_WIRED_LCD
#if ENABLED(STATUS_MESSAGE_SCROLLING)
uint8_t MarlinUI::status_scroll_offset; // = 0
constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
#if HAS_STATUS_MESSAGE
#if HAS_WIRED_LCD
#if ENABLED(STATUS_MESSAGE_SCROLLING)
uint8_t MarlinUI::status_scroll_offset; // = 0
constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
#else
constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
#endif
#else
constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
constexpr uint8_t MAX_MESSAGE_LENGTH = 63;
#endif
#elif EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD)
constexpr uint8_t MAX_MESSAGE_LENGTH = 63;
#endif
#if EITHER(HAS_WIRED_LCD, EXTENSIBLE_UI)
uint8_t MarlinUI::alert_level; // = 0
char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
uint8_t MarlinUI::alert_level; // = 0
#endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
MarlinUI::progress_t MarlinUI::progress_override; // = 0
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
#if ENABLED(USE_M73_REMAINING_TIME)
uint32_t MarlinUI::remaining_time;
#endif
#endif
@ -1461,6 +1467,7 @@ void MarlinUI::update() {
#endif
TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message));
TERN_(DWIN_CREALITY_LCD, DWIN_StatusChanged(status_message));
}
#if ENABLED(STATUS_MESSAGE_SCROLLING)
@ -1581,7 +1588,7 @@ void MarlinUI::update() {
#endif
#else // !HAS_DISPLAY
#elif !HAS_STATUS_MESSAGE // && !HAS_DISPLAY
//
// Send the status line as a host notification
@ -1596,7 +1603,7 @@ void MarlinUI::update() {
TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message));
}
#endif // !HAS_DISPLAY
#endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE
#if ENABLED(SDSUPPORT)