|
|
@ -86,9 +86,6 @@ |
|
|
|
|
|
|
|
#define PAUSE_HEAT |
|
|
|
|
|
|
|
#define USE_STRING_HEADINGS |
|
|
|
#define USE_STRING_TITLES |
|
|
|
|
|
|
|
#define MENU_CHAR_LIMIT 24 |
|
|
|
|
|
|
|
// Print speed limit
|
|
|
@ -133,8 +130,20 @@ HMI_data_t HMI_data; |
|
|
|
|
|
|
|
millis_t dwin_heat_time = 0; |
|
|
|
|
|
|
|
uint8_t checkkey = MainMenu; |
|
|
|
uint8_t last_checkkey = MainMenu; |
|
|
|
uint8_t checkkey = MainMenu, last_checkkey = MainMenu; |
|
|
|
|
|
|
|
enum SelectItem : uint8_t { |
|
|
|
PAGE_PRINT = 0, |
|
|
|
PAGE_PREPARE, |
|
|
|
PAGE_CONTROL, |
|
|
|
PAGE_INFO_LEVELING, |
|
|
|
PAGE_COUNT, |
|
|
|
|
|
|
|
PRINT_SETUP = 0, |
|
|
|
PRINT_PAUSE_RESUME, |
|
|
|
PRINT_STOP, |
|
|
|
PRINT_COUNT |
|
|
|
}; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
uint8_t now, last; |
|
|
@ -266,7 +275,7 @@ void ICON_Print() { |
|
|
|
{ 1, { 417, 449 }, 30, 14 }, |
|
|
|
{ 1, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_page.now == 0, ICON_Print_0, ico, txt); |
|
|
|
ICON_Button(select_page.now == PAGE_PRINT, ICON_Print_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -278,7 +287,7 @@ void ICON_Prepare() { |
|
|
|
{ 33, { 417, 449 }, 51, 14 }, |
|
|
|
{ 31, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_page.now == 1, ICON_Prepare_0, ico, txt); |
|
|
|
ICON_Button(select_page.now == PAGE_PREPARE, ICON_Prepare_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -290,7 +299,7 @@ void ICON_Control() { |
|
|
|
{ 85, { 417, 449 }, 46, 14 }, |
|
|
|
{ 61, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_page.now == 2, ICON_Control_0, ico, txt); |
|
|
|
ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -302,7 +311,7 @@ void ICON_StartInfo() { |
|
|
|
{ 133, { 417, 449 }, 23, 14 }, |
|
|
|
{ 91, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_page.now == 3, ICON_Info_0, ico, txt); |
|
|
|
ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -314,7 +323,7 @@ void ICON_Leveling() { |
|
|
|
{ 88, { 433, 464 }, 36, 14 }, |
|
|
|
{ 211, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_page.now == 3, ICON_Leveling_0, ico, txt); |
|
|
|
ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -326,7 +335,7 @@ void ICON_Tune() { |
|
|
|
{ 0, { 433, 464 }, 32, 14 }, |
|
|
|
{ 121, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_print.now == 0, ICON_Setup_0, ico, txt); |
|
|
|
ICON_Button(select_print.now == PRINT_SETUP, ICON_Setup_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -338,7 +347,7 @@ void ICON_Pause() { |
|
|
|
{ 157, { 417, 449 }, 39, 14 }, |
|
|
|
{ 181, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_print.now == 1, ICON_Pause_0, ico, txt); |
|
|
|
ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Pause_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -350,7 +359,7 @@ void ICON_Resume() { |
|
|
|
{ 33, { 433, 464 }, 53, 14 }, |
|
|
|
{ 1, { 405, 447 }, 27, 15 } |
|
|
|
}; |
|
|
|
ICON_Button(select_print.now == 1, ICON_Continue_0, ico, txt); |
|
|
|
ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Continue_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -362,7 +371,7 @@ void ICON_Stop() { |
|
|
|
{ 196, { 417, 449 }, 29, 14 }, |
|
|
|
{ 151, { 405, 447 }, 27, 12 } |
|
|
|
}; |
|
|
|
ICON_Button(select_print.now == 2, ICON_Stop_0, ico, txt); |
|
|
|
ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt); |
|
|
|
} |
|
|
|
|
|
|
|
void Draw_Menu_Cursor(const uint8_t line) { |
|
|
@ -537,14 +546,14 @@ void Popup_window_PauseOrStop() { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
DWINUI::ClearMenuArea(); |
|
|
|
Draw_Popup_Bkgd_60(); |
|
|
|
if (select_print.now == 1) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); |
|
|
|
else if (select_print.now == 2) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); |
|
|
|
if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); |
|
|
|
else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); |
|
|
|
DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); |
|
|
|
DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); |
|
|
|
DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); |
|
|
|
} |
|
|
|
else { |
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Please confirm",(select_print.now == 1) ? GET_TEXT(MSG_PAUSE_PRINT) : GET_TEXT(MSG_STOP_PRINT)); |
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Please confirm", select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT(MSG_PAUSE_PRINT) : GET_TEXT(MSG_STOP_PRINT)); |
|
|
|
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); |
|
|
|
DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); |
|
|
|
} |
|
|
@ -589,16 +598,9 @@ void Draw_Print_Labels() { |
|
|
|
DWIN_Frame_AreaCopy(1, 65, 72, 128, 86, 176, 173); // Remain
|
|
|
|
} |
|
|
|
else { |
|
|
|
#ifdef USE_STRING_TITLES |
|
|
|
Title.ShowCaption(GET_TEXT(MSG_PRINTING)); |
|
|
|
DWINUI::Draw_String( 46, 173, F("Print Time")); |
|
|
|
DWINUI::Draw_String(181, 173, F("Remain")); |
|
|
|
#else |
|
|
|
const uint16_t y = 168; |
|
|
|
Title.FrameCopy(42, 0, 47, 14); // "Printing"
|
|
|
|
DWIN_Frame_AreaCopy(1, 0, 44, 96, 58, 41, y); // Printing Time
|
|
|
|
DWIN_Frame_AreaCopy(1, 98, 44, 152, 58, 176, y); // Remain
|
|
|
|
#endif |
|
|
|
Title.ShowCaption(GET_TEXT(MSG_PRINTING)); |
|
|
|
DWINUI::Draw_String( 46, 173, F("Print Time")); |
|
|
|
DWINUI::Draw_String(181, 173, F("Remain")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -678,13 +680,8 @@ void Draw_Main_Menu() { |
|
|
|
|
|
|
|
if (HMI_IsChinese()) |
|
|
|
Title.FrameCopy(2, 2, 26, 13); // "Home" etc
|
|
|
|
else { |
|
|
|
#ifdef USE_STRING_HEADINGS |
|
|
|
Title.ShowCaption(MACHINE_NAME); |
|
|
|
#else |
|
|
|
Title.FrameCopy(0, 2, 40, 11); // "Home"
|
|
|
|
#endif |
|
|
|
} |
|
|
|
else |
|
|
|
Title.ShowCaption(MACHINE_NAME); |
|
|
|
|
|
|
|
DWINUI::Draw_Icon(ICON_LOGO, 71, 52); // CREALITY logo
|
|
|
|
|
|
|
@ -1075,11 +1072,7 @@ void Draw_Info_Menu() { |
|
|
|
DWIN_Frame_AreaCopy(1, 58, 164, 113, 176, 105, 248); // "Contact Details"
|
|
|
|
} |
|
|
|
else { |
|
|
|
#ifdef USE_STRING_HEADINGS |
|
|
|
Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); |
|
|
|
#else |
|
|
|
Title.FrameCopy(192, 15, 23, 12); // "Info"
|
|
|
|
#endif |
|
|
|
Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); |
|
|
|
|
|
|
|
DWIN_Frame_AreaCopy(1, 120, 150, 146, 161, 124, 102); // "Size"
|
|
|
|
DWIN_Frame_AreaCopy(1, 146, 151, 254, 161, 82, 175); // "Firmware Version"
|
|
|
@ -1098,13 +1091,8 @@ void Draw_Info_Menu() { |
|
|
|
void Draw_Print_File_Menu() { |
|
|
|
if (HMI_IsChinese()) |
|
|
|
Title.FrameCopy(0, 31, 56, 14); // "Print file"
|
|
|
|
else { |
|
|
|
#ifdef USE_STRING_HEADINGS |
|
|
|
Title.ShowCaption(GET_TEXT_F(MSG_MEDIA_MENU)); |
|
|
|
#else |
|
|
|
Title.FrameCopy(52, 31, 86, 11); // "Print file"
|
|
|
|
#endif |
|
|
|
} |
|
|
|
else |
|
|
|
Title.ShowCaption(GET_TEXT_F(MSG_MEDIA_MENU)); |
|
|
|
Redraw_SD_List(); |
|
|
|
} |
|
|
|
|
|
|
@ -1114,43 +1102,39 @@ void HMI_MainMenu() { |
|
|
|
if (encoder_diffState == ENCODER_DIFF_NO) return; |
|
|
|
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) { |
|
|
|
if (select_page.inc(4)) { |
|
|
|
if (select_page.inc(PAGE_COUNT)) { |
|
|
|
switch (select_page.now) { |
|
|
|
case 0: ICON_Print(); break; |
|
|
|
case 1: ICON_Print(); ICON_Prepare(); break; |
|
|
|
case 2: ICON_Prepare(); ICON_Control(); break; |
|
|
|
case 3: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
case PAGE_PRINT: ICON_Print(); break; |
|
|
|
case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break; |
|
|
|
case PAGE_CONTROL: ICON_Prepare(); ICON_Control(); break; |
|
|
|
case PAGE_INFO_LEVELING: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) { |
|
|
|
if (select_page.dec()) { |
|
|
|
switch (select_page.now) { |
|
|
|
case 0: ICON_Print(); ICON_Prepare(); break; |
|
|
|
case 1: ICON_Prepare(); ICON_Control(); break; |
|
|
|
case 2: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
case 3: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break; |
|
|
|
case PAGE_PREPARE: ICON_Prepare(); ICON_Control(); break; |
|
|
|
case PAGE_CONTROL: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
case PAGE_INFO_LEVELING: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { |
|
|
|
switch (select_page.now) { |
|
|
|
case 0: // Print File
|
|
|
|
case PAGE_PRINT: |
|
|
|
checkkey = SelectFile; |
|
|
|
Draw_Print_File_Menu(); |
|
|
|
break; |
|
|
|
|
|
|
|
case 1: // Prepare
|
|
|
|
Draw_Prepare_Menu(); |
|
|
|
break; |
|
|
|
case PAGE_PREPARE: Draw_Prepare_Menu(); break; |
|
|
|
|
|
|
|
case 2: // Control
|
|
|
|
Draw_Control_Menu(); |
|
|
|
break; |
|
|
|
case PAGE_CONTROL: Draw_Control_Menu(); break; |
|
|
|
|
|
|
|
case 3: // Leveling or Info
|
|
|
|
case PAGE_INFO_LEVELING: |
|
|
|
#if HAS_ONESTEP_LEVELING |
|
|
|
queue.inject_P(PSTR("G28XYO\nG28Z\nG29")); |
|
|
|
queue.inject_P(PSTR("G28XYO\nG28Z\nG29")); // TODO: 'G29' should be homing when needed. Does it make sense for every LCD to do this differently?
|
|
|
|
#else |
|
|
|
checkkey = Info; |
|
|
|
Draw_Info_Menu(); |
|
|
@ -1238,8 +1222,8 @@ void HMI_SelectFile() { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { |
|
|
|
if (select_file.now == 0) { // Back
|
|
|
|
select_page.set(0); |
|
|
|
if (select_file.now == 0) { |
|
|
|
select_page.set(PAGE_PRINT); |
|
|
|
Goto_Main_Menu(); |
|
|
|
} |
|
|
|
else if (hasUpDir && select_file.now == 1) { // CD-Up
|
|
|
@ -1276,7 +1260,8 @@ void HMI_SelectFile() { |
|
|
|
DWIN_Print_Started(true); |
|
|
|
} |
|
|
|
} |
|
|
|
HMI_SelectFileExit: |
|
|
|
|
|
|
|
HMI_SelectFileExit: |
|
|
|
DWIN_UpdateLCD(); |
|
|
|
} |
|
|
|
|
|
|
@ -1286,44 +1271,30 @@ void HMI_Printing() { |
|
|
|
if (encoder_diffState == ENCODER_DIFF_NO) return; |
|
|
|
// Avoid flicker by updating only the previous menu
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) { |
|
|
|
if (select_print.inc(3)) { |
|
|
|
if (select_print.inc(PRINT_COUNT)) { |
|
|
|
switch (select_print.now) { |
|
|
|
case 0: ICON_Tune(); break; |
|
|
|
case 1: |
|
|
|
ICON_Tune(); |
|
|
|
ICON_ResumeOrPause(); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
ICON_ResumeOrPause(); |
|
|
|
ICON_Stop(); |
|
|
|
break; |
|
|
|
case PRINT_SETUP: ICON_Tune(); break; |
|
|
|
case PRINT_PAUSE_RESUME: ICON_Tune(); ICON_ResumeOrPause(); break; |
|
|
|
case PRINT_STOP: ICON_ResumeOrPause(); ICON_Stop(); break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) { |
|
|
|
if (select_print.dec()) { |
|
|
|
switch (select_print.now) { |
|
|
|
case 0: |
|
|
|
ICON_Tune(); |
|
|
|
ICON_ResumeOrPause(); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
ICON_ResumeOrPause(); |
|
|
|
ICON_Stop(); |
|
|
|
break; |
|
|
|
case 2: ICON_Stop(); break; |
|
|
|
case PRINT_SETUP: ICON_Tune(); ICON_ResumeOrPause(); break; |
|
|
|
case PRINT_PAUSE_RESUME: ICON_ResumeOrPause(); ICON_Stop(); break; |
|
|
|
case PRINT_STOP: ICON_Stop(); break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { |
|
|
|
switch (select_print.now) { |
|
|
|
case 0: // Tune
|
|
|
|
Draw_Tune_Menu(); |
|
|
|
break; |
|
|
|
case 1: // Pause
|
|
|
|
case PRINT_SETUP: Draw_Tune_Menu(); break; |
|
|
|
case PRINT_PAUSE_RESUME: |
|
|
|
if (HMI_flag.pause_flag) { |
|
|
|
ICON_Pause(); |
|
|
|
#ifndef ADVANCED_PAUSE_FEATURE |
|
|
|
#if DISABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
char cmd[40]; |
|
|
|
cmd[0] = '\0'; |
|
|
|
#if BOTH(HAS_HEATED_BED, PAUSE_HEAT) |
|
|
@ -1346,7 +1317,7 @@ void HMI_Printing() { |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case 2: // Stop
|
|
|
|
case PRINT_STOP: |
|
|
|
HMI_flag.select_flag = true; |
|
|
|
checkkey = PauseOrStop; |
|
|
|
Popup_window_PauseOrStop(); |
|
|
@ -1378,7 +1349,7 @@ void HMI_PauseOrStop() { |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) |
|
|
|
Draw_Select_Highlight(true); |
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { |
|
|
|
if (select_print.now == 1) { // pause window
|
|
|
|
if (select_print.now == PRINT_PAUSE_RESUME) { |
|
|
|
if (HMI_flag.select_flag) { |
|
|
|
HMI_flag.pause_action = true; |
|
|
|
ICON_Resume(); |
|
|
@ -1389,7 +1360,7 @@ void HMI_PauseOrStop() { |
|
|
|
} |
|
|
|
Goto_PrintProcess(); |
|
|
|
} |
|
|
|
else if (select_print.now == 2) { // stop window
|
|
|
|
else if (select_print.now == PRINT_STOP) { |
|
|
|
if (HMI_flag.select_flag) { |
|
|
|
checkkey = MainMenu; |
|
|
|
if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!
|
|
|
@ -1511,22 +1482,12 @@ void EachMomentUpdate() { |
|
|
|
if (HMI_flag.pause_action && printingIsPaused() && !planner.has_blocks_queued()) { |
|
|
|
HMI_flag.pause_action = false; |
|
|
|
#if ENABLED(PAUSE_HEAT) |
|
|
|
if (sdprint) { |
|
|
|
TERN_(HAS_HOTEND, resume_hotend_temp = thermalManager.degTargetHotend(0)); |
|
|
|
TERN_(HAS_HEATED_BED, resume_bed_temp = thermalManager.degTargetBed()); |
|
|
|
} |
|
|
|
else { |
|
|
|
TERN_(HAS_HOTEND, resume_hotend_temp = thermalManager.wholeDegHotend(0)); |
|
|
|
TERN_(HAS_HEATED_BED, resume_bed_temp = thermalManager.wholeDegBed()); |
|
|
|
} |
|
|
|
TERN_(HAS_HOTEND, resume_hotend_temp = sdprint ? thermalManager.degTargetHotend(0) : thermalManager.wholeDegHotend(0)); |
|
|
|
TERN_(HAS_HEATED_BED, resume_bed_temp = sdprint ? thermalManager.degTargetBed() : thermalManager.wholeDegBed()); |
|
|
|
TERN_(HAS_FAN, resume_fan = thermalManager.fan_speed[0]); |
|
|
|
#endif |
|
|
|
#if DISABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
thermalManager.disable_all_heaters(); |
|
|
|
#endif |
|
|
|
#if DISABLED(PARK_HEAD_ON_PAUSE) |
|
|
|
queue.inject_P(PSTR("G1 F1200 X0 Y0")); |
|
|
|
#endif |
|
|
|
IF_DISABLED(ADVANCED_PAUSE_FEATURE, thermalManager.disable_all_heaters()); |
|
|
|
IF_DISABLED(PARK_HEAD_ON_PAUSE, queue.inject_P(PSTR("G1 F1200 X0 Y0"))); |
|
|
|
} |
|
|
|
|
|
|
|
if (checkkey == PrintProcess) { // print process
|
|
|
@ -1565,7 +1526,7 @@ void EachMomentUpdate() { |
|
|
|
else if (dwin_abort_flag && !HMI_flag.home_flag) { // Print Stop
|
|
|
|
dwin_abort_flag = false; |
|
|
|
dwin_zoffset = BABY_Z_VAR; |
|
|
|
select_page.set(0); |
|
|
|
select_page.set(PAGE_PRINT); |
|
|
|
Goto_Main_Menu(); |
|
|
|
} |
|
|
|
|
|
|
@ -1615,7 +1576,7 @@ void EachMomentUpdate() { |
|
|
|
watchdog_refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
select_print.set(0); |
|
|
|
select_print.set(PRINT_SETUP); |
|
|
|
queue.inject_P(PSTR("M1000")); |
|
|
|
sdprint = true; |
|
|
|
Goto_PrintProcess(); |
|
|
@ -1735,7 +1696,6 @@ void DWIN_PidTuning(pidresult_t result) { |
|
|
|
|
|
|
|
// Update filename on print
|
|
|
|
void DWIN_Print_Header(const char *text = nullptr) { |
|
|
|
|
|
|
|
static char headertxt[31] = ""; // Print header text
|
|
|
|
|
|
|
|
if (text != nullptr) { |
|
|
@ -1917,6 +1877,7 @@ void DWIN_Redraw_screen() { |
|
|
|
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); |
|
|
|
DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); |
|
|
|
Draw_Select_Highlight(true); |
|
|
|
DWIN_UpdateLCD(); |
|
|
|
} |
|
|
|
|
|
|
|
// Handle responses such as:
|
|
|
@ -1981,7 +1942,6 @@ void DWIN_LockScreen(const bool flag) { |
|
|
|
// LiveUpdate: live update function when the encoder changes
|
|
|
|
// Apply: update function when the encoder is pressed
|
|
|
|
void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { |
|
|
|
last_checkkey = Menu; |
|
|
|
checkkey = process; |
|
|
|
HMI_value.MinValue = lo; |
|
|
|
HMI_value.MaxValue = hi; |
|
|
@ -2092,13 +2052,9 @@ void Goto_InfoMenu(){ |
|
|
|
Draw_Info_Menu(); |
|
|
|
} |
|
|
|
|
|
|
|
void DisableMotors() { |
|
|
|
queue.inject_P(PSTR("M84")); |
|
|
|
} |
|
|
|
void DisableMotors() { queue.inject_P(PSTR("M84")); } |
|
|
|
|
|
|
|
void AutoHome() { |
|
|
|
queue.inject_P(G28_STR); |
|
|
|
} |
|
|
|
void AutoHome() { queue.inject_P(G28_STR); } |
|
|
|
|
|
|
|
void SetHome() { |
|
|
|
// Apply workspace offset, making the current position 0,0,0
|
|
|
@ -2116,9 +2072,11 @@ void SetHome() { |
|
|
|
if (BABYSTEP_ALLOWED()) babystep.add_mm(Z_AXIS, dwin_zoffset - last_zoffset); |
|
|
|
#endif |
|
|
|
} |
|
|
|
#if EITHER(HAS_BED_PROBE, BABYSTEPPING) |
|
|
|
void SetZOffset() { SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); } |
|
|
|
#endif |
|
|
|
#if EITHER(HAS_BED_PROBE, BABYSTEPPING) |
|
|
|
void SetZOffset() { |
|
|
|
SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_PREHEAT |
|
|
@ -2233,9 +2191,7 @@ void SetPID(celsius_t t, heater_id_t h) { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void Goto_LockScreen() { |
|
|
|
DWIN_LockScreen(true); |
|
|
|
} |
|
|
|
void Goto_LockScreen() { DWIN_LockScreen(true); } |
|
|
|
|
|
|
|
#if HAS_HOME_OFFSET |
|
|
|
void ApplyHomeOffset() { set_home_offset(HMI_value.axis, HMI_value.Value / MINUNITMULT); } |
|
|
@ -2327,6 +2283,7 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
|
|
|
|
void ChangeFilament() { |
|
|
|
HMI_SaveProcessID(NothingToDo); |
|
|
|
queue.inject_P(PSTR("M600 B2")); |
|
|
@ -2348,7 +2305,8 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } |
|
|
|
queue.inject_P(PSTR("M701 Z20")); |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // ADVANCED_PAUSE_FEATURE
|
|
|
|
|
|
|
|
void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW); } |
|
|
|
|
|
|
@ -2414,6 +2372,7 @@ void LevBedBL() { LevBed(3); } |
|
|
|
void LevBedC () { LevBed(4); } |
|
|
|
|
|
|
|
#if ENABLED(MESH_BED_LEVELING) |
|
|
|
|
|
|
|
void ManualMeshStart(){ |
|
|
|
ui.set_status_P(GET_TEXT(MSG_UBL_BUILD_MESH_MENU)); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G28 XYO\nG28 Z\nM211 S0\nG29S1")); |
|
|
@ -2443,7 +2402,8 @@ void LevBedC () { LevBed(4); } |
|
|
|
ui.set_status_P(GET_TEXT(MSG_UBL_STORAGE_MESH_MENU)); |
|
|
|
queue.inject_P(PSTR("M211 S1\nM500")); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // MESH_BED_LEVELING
|
|
|
|
|
|
|
|
#if HAS_PREHEAT |
|
|
|
#if HAS_HOTEND |
|
|
@ -2516,6 +2476,7 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP |
|
|
|
SetFloatOnClick(0, 1000, 2, value, ApplyPIDd); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
// Menuitem Drawing functions =================================================
|
|
|
|
|
|
|
|
void onDrawMenuItem(MenuItemClass* menuitem, int8_t line) { |
|
|
@ -2721,7 +2682,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { |
|
|
|
void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); } |
|
|
|
void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast<MenuItemPtrClass*>(menuitem)->value)); } |
|
|
|
|
|
|
|
|
|
|
|
void onDrawSpeedItem(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 116, 164, 171, 176); |
|
|
|
onDrawPIntMenu(menuitem, line); |
|
|
@ -2748,30 +2708,6 @@ void onDrawSpeedItem(MenuItemClass* menuitem, int8_t line) { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 173, 133, 228, 147); |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
|
|
|
|
void onDrawAcc(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration
|
|
|
|
} |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
|
|
|
|
#if HAS_CLASSIC_JERK |
|
|
|
void onDrawJerk(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ...
|
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 54, MBASE(line)); // ...Jerk
|
|
|
|
} |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void onDrawSteps(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 153, 148, 194, 161); |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
@ -2786,10 +2722,10 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
#if HAS_PREHEAT |
|
|
|
#if HAS_HOTEND |
|
|
|
void onDrawSetPreheatHotend(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 1, 134, 56, 146); |
|
|
|
onDrawPIntMenu(menuitem, line); |
|
|
|
} |
|
|
|
void onDrawSetPreheatHotend(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 1, 134, 56, 146); |
|
|
|
onDrawPIntMenu(menuitem, line); |
|
|
|
} |
|
|
|
#endif |
|
|
|
#if HAS_HEATED_BED |
|
|
|
void onDrawSetPreheatBed(MenuItemClass* menuitem, int8_t line) { |
|
|
@ -2811,7 +2747,13 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 260, 100); |
|
|
|
onDrawSubMenu(menuitem,line); |
|
|
|
} |
|
|
|
#endif // HAS_HOTEND
|
|
|
|
#endif // HAS_PREHEAT
|
|
|
|
|
|
|
|
void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) |
|
|
|
menuitem->SetFrame(1, 173, 133, 228, 147); |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
|
|
|
|
void onDrawMaxSpeedX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
@ -2847,9 +2789,17 @@ void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void onDrawAcc(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration
|
|
|
|
} |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
|
|
|
|
void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 71, MBASE(line)); // X
|
|
|
|
} |
|
|
@ -2858,7 +2808,7 @@ void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 71, MBASE(line)); // Y
|
|
|
|
} |
|
|
@ -2867,7 +2817,7 @@ void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 71, MBASE(line)); // Z
|
|
|
|
} |
|
|
@ -2877,7 +2827,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
#if HAS_HOTEND |
|
|
|
void onDrawMaxAccelE(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 71, MBASE(line)); // E
|
|
|
|
} |
|
|
@ -2886,9 +2836,19 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_CLASSIC_JERK |
|
|
|
|
|
|
|
void onDrawJerk(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ...
|
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 54, MBASE(line)); // ...Jerk
|
|
|
|
} |
|
|
|
onDrawSubMenu(menuitem, line); |
|
|
|
} |
|
|
|
|
|
|
|
void onDrawMaxJerkX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 83, MBASE(line)); |
|
|
@ -2898,7 +2858,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawMaxJerkY(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 83, MBASE(line)); |
|
|
@ -2908,7 +2868,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawMaxJerkZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 83, MBASE(line)); |
|
|
@ -2919,7 +2879,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
#if HAS_HOTEND |
|
|
|
void onDrawMaxJerkE(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 173, 133, 200, 147); |
|
|
|
menuitem->SetFrame(1, 173, 133, 200, 147); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(line)); |
|
|
|
DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 83, MBASE(line)); |
|
|
@ -2927,11 +2887,12 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
onDrawPFloatMenu(menuitem, line); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_CLASSIC_JERK
|
|
|
|
|
|
|
|
void onDrawStepsX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 153, 148, 194, 161); |
|
|
|
menuitem->SetFrame(1, 153, 148, 194, 161); |
|
|
|
DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 44, MBASE(line)); // X
|
|
|
|
} |
|
|
|
onDrawPFloatMenu(menuitem, line); |
|
|
@ -2939,7 +2900,7 @@ void onDrawStepsX(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawStepsY(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 153, 148, 194, 161); |
|
|
|
menuitem->SetFrame(1, 153, 148, 194, 161); |
|
|
|
DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 44, MBASE(line)); // Y
|
|
|
|
} |
|
|
|
onDrawPFloatMenu(menuitem, line); |
|
|
@ -2947,7 +2908,7 @@ void onDrawStepsY(MenuItemClass* menuitem, int8_t line) { |
|
|
|
|
|
|
|
void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 153, 148, 194, 161); |
|
|
|
menuitem->SetFrame(1, 153, 148, 194, 161); |
|
|
|
DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 44, MBASE(line)); // Z
|
|
|
|
} |
|
|
|
onDrawPFloatMenu(menuitem, line); |
|
|
@ -2956,7 +2917,7 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { |
|
|
|
#if HAS_HOTEND |
|
|
|
void onDrawStepsE(MenuItemClass* menuitem, int8_t line) { |
|
|
|
if (HMI_IsChinese()) { |
|
|
|
menuitem->SetFrame (1, 153, 148, 194, 161); |
|
|
|
menuitem->SetFrame(1, 153, 148, 194, 161); |
|
|
|
DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 44, MBASE(line)); // E
|
|
|
|
} |
|
|
|
onDrawPFloatMenu(menuitem, line); |
|
|
@ -2986,7 +2947,7 @@ int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { |
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) { |
|
|
|
if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { |
|
|
|
EncoderRate.enabled = false; |
|
|
|
checkkey = last_checkkey; |
|
|
|
checkkey = Menu; |
|
|
|
return 2; |
|
|
|
} |
|
|
|
LIMIT(HMI_value.Value, lo, hi); |
|
|
@ -3008,7 +2969,7 @@ int8_t HMI_GetInt(const int32_t lo, const int32_t hi) { |
|
|
|
if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { |
|
|
|
EncoderRate.enabled = false; |
|
|
|
DWINUI::Draw_Int(HMI_data.Text_Color, HMI_data.Background_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, HMI_value.Value); |
|
|
|
checkkey = last_checkkey; |
|
|
|
checkkey = Menu; |
|
|
|
return 2; |
|
|
|
} |
|
|
|
LIMIT(HMI_value.Value, lo, hi); |
|
|
@ -3048,7 +3009,7 @@ void HMI_SetPInt() { |
|
|
|
} else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); |
|
|
|
} |
|
|
|
|
|
|
|
// Get an scaled float value using the encoder
|
|
|
|
// Get a scaled float value using the encoder
|
|
|
|
// dp: decimal places
|
|
|
|
// lo: scaled low limit
|
|
|
|
// hi: scaled high limit
|
|
|
@ -3062,7 +3023,7 @@ int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { |
|
|
|
if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { |
|
|
|
EncoderRate.enabled = false; |
|
|
|
DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::Get_font_width(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), HMI_value.Value / POW(10, dp)); |
|
|
|
checkkey = last_checkkey; |
|
|
|
checkkey = Menu; |
|
|
|
return 2; |
|
|
|
} |
|
|
|
LIMIT(HMI_value.Value, lo, hi); |
|
|
@ -3072,38 +3033,34 @@ int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
// Set an scaled float using the encoder
|
|
|
|
// Set a scaled float using the encoder
|
|
|
|
void HMI_SetFloat() { |
|
|
|
int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); |
|
|
|
const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); |
|
|
|
switch (val) { |
|
|
|
case 0: return; break; |
|
|
|
case 0: return; |
|
|
|
case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; |
|
|
|
case 2: if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Set an scaled float pointer variable using the encoder
|
|
|
|
// Set a scaled float pointer variable using the encoder
|
|
|
|
void HMI_SetPFloat() { |
|
|
|
int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); |
|
|
|
const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); |
|
|
|
if (!val) return; |
|
|
|
else if (val == 2) { // Apply
|
|
|
|
if (val == 2) { // Apply
|
|
|
|
*HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); |
|
|
|
if (HMI_value.Apply != nullptr) HMI_value.Apply(); |
|
|
|
} else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); |
|
|
|
} |
|
|
|
else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); |
|
|
|
} |
|
|
|
|
|
|
|
// Menu Creation and Drawing functions ======================================================
|
|
|
|
|
|
|
|
void SetMenuTitle(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* text) { |
|
|
|
if (HMI_IsChinese() && (cn.w != 0)) |
|
|
|
CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h); |
|
|
|
else { |
|
|
|
#ifdef USE_STRING_HEADINGS |
|
|
|
CurrentMenu->MenuTitle.SetCaption(text); |
|
|
|
#else |
|
|
|
if (en.w != 0) CurrentMenu->MenuTitle.SetFrame(en.x, en.y, en.w, en.h); |
|
|
|
#endif |
|
|
|
} |
|
|
|
if (HMI_IsChinese() && (cn.w != 0)) |
|
|
|
CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h); |
|
|
|
else |
|
|
|
CurrentMenu->MenuTitle.SetCaption(text); |
|
|
|
} |
|
|
|
|
|
|
|
void Draw_Prepare_Menu() { |
|
|
@ -3301,7 +3258,8 @@ void Draw_Move_Menu() { |
|
|
|
} |
|
|
|
CurrentMenu->Draw(); |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif // HAS_FILAMENT_SENSOR
|
|
|
|
|
|
|
|
void Draw_SelectColors_Menu() { |
|
|
|
checkkey = Menu; |
|
|
|
if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass(); |
|
|
@ -3441,6 +3399,7 @@ void Draw_Motion_Menu() { |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_PREHEAT |
|
|
|
|
|
|
|
void Draw_Preheat_Menu(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* text) { |
|
|
|
checkkey = Menu; |
|
|
|
if (CurrentMenu != PreheatMenu) { |
|
|
@ -3485,7 +3444,7 @@ void Draw_Motion_Menu() { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif // HAS_PREHEAT
|
|
|
|
|
|
|
|
void Draw_Temperature_Menu() { |
|
|
|
checkkey = Menu; |
|
|
@ -3653,5 +3612,4 @@ void Draw_Steps_Menu() { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#endif // DWIN_CREALITY_LCD_ENHANCED
|
|
|
|