Clean up DWIN code
This commit is contained in:
parent
2d33a9fd7c
commit
e78f19bc87
5 changed files with 1123 additions and 1101 deletions
|
@ -1776,7 +1776,10 @@
|
|||
// Shorthand for common combinations
|
||||
#if HAS_TEMP_BED && HAS_HEATER_BED
|
||||
#define HAS_HEATED_BED 1
|
||||
#define BED_MAX_TARGET (BED_MAXTEMP - 10)
|
||||
#ifndef BED_OVERSHOOT
|
||||
#define BED_OVERSHOOT 10
|
||||
#endif
|
||||
#define BED_MAX_TARGET (BED_MAXTEMP - (BED_OVERSHOOT))
|
||||
#endif
|
||||
#if HAS_HEATED_BED || HAS_TEMP_CHAMBER
|
||||
#define BED_OR_CHAMBER 1
|
||||
|
|
|
@ -63,6 +63,16 @@
|
|||
|
||||
#include "../../libs/buzzer.h"
|
||||
|
||||
#ifndef MACHINE_SIZE
|
||||
#define MACHINE_SIZE "220x220x250"
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_C
|
||||
#define CORP_WEBSITE_C "www.cxsw3d.com"
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_E
|
||||
#define CORP_WEBSITE_E "www.creality.com"
|
||||
#endif
|
||||
|
||||
#define PAUSE_HEAT true
|
||||
|
||||
#define USE_STRING_HEADINGS
|
||||
|
@ -71,6 +81,41 @@
|
|||
#define STAT_FONT font10x20
|
||||
#define HEADER_FONT font10x20
|
||||
|
||||
#define MENU_CHAR_LIMIT 24
|
||||
|
||||
// Fan speed limit
|
||||
#define FANON 255
|
||||
#define FANOFF 0
|
||||
|
||||
// Print speed limit
|
||||
#define MAX_PRINT_SPEED 999
|
||||
#define MIN_PRINT_SPEED 10
|
||||
|
||||
// Temp limits
|
||||
#if HAS_HOTEND
|
||||
#define MAX_E_TEMP (HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT))
|
||||
#define MIN_E_TEMP HEATER_0_MINTEMP
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
#define MIN_BED_TEMP BED_MINTEMP
|
||||
#endif
|
||||
|
||||
// Feedspeed limit (max feedspeed = DEFAULT_MAX_FEEDRATE * 2)
|
||||
#define MIN_MAXFEEDSPEED 1
|
||||
#define MIN_MAXACCELERATION 1
|
||||
#define MIN_MAXCORNER 0.1
|
||||
#define MIN_STEP 1
|
||||
|
||||
#define FEEDRATE_E (60)
|
||||
|
||||
// Mininum unit (0.1) : multiple (10)
|
||||
#define MINUNITMULT 10
|
||||
|
||||
#define ENCODER_WAIT 20
|
||||
#define DWIN_SCROLL_UPDATE_INTERVAL 2000
|
||||
#define DWIN_REMAIN_TIME_UPDATE_INTERVAL 20000
|
||||
|
||||
constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, // Total rows, and other-than-Back
|
||||
TITLE_HEIGHT = 30, // Title bar height
|
||||
MLINE = 53, // Menu line height
|
||||
|
@ -133,17 +178,12 @@ float last_temp_hotend_target = 0, last_temp_bed_target = 0;
|
|||
float last_temp_hotend_current = 0, last_temp_bed_current = 0;
|
||||
uint8_t last_fan_speed = 0;
|
||||
uint16_t last_speed = 0;
|
||||
|
||||
float last_E_scale = 0;
|
||||
|
||||
bool DWIN_lcd_sd_status = 0;
|
||||
|
||||
bool pause_action_flag = 0;
|
||||
|
||||
int temphot = 0, tempbed = 0;
|
||||
|
||||
float zprobe_zoffset = 0.00;
|
||||
float last_zoffset = 0.00, last_probe_zoffset = 0.00;
|
||||
float zprobe_zoffset = 0;
|
||||
float last_zoffset = 0, last_probe_zoffset = 0;
|
||||
|
||||
#define FONT_EEPROM_OFFSET 0
|
||||
|
||||
|
@ -474,8 +514,9 @@ inline void Prepare_Item_Offset(const uint8_t row) {
|
|||
}
|
||||
|
||||
inline void Prepare_Item_PLA(const uint8_t row) {
|
||||
if (HMI_flag.language_flag)
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 100, 89, 271 - 93 - 27, 479 - 378, LBLX, MBASE(row));
|
||||
}
|
||||
else {
|
||||
DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat"
|
||||
DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX + 49 + 3, MBASE(row)); // "PLA"
|
||||
|
@ -484,8 +525,9 @@ inline void Prepare_Item_PLA(const uint8_t row) {
|
|||
}
|
||||
|
||||
inline void Prepare_Item_ABS(const uint8_t row) {
|
||||
if (HMI_flag.language_flag)
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 180, 89, 271 - 11 - 27, 479 - 379, LBLX, MBASE(row));
|
||||
}
|
||||
else {
|
||||
DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat"
|
||||
DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX + 49 + 3, MBASE(row)); // "ABS"
|
||||
|
@ -520,8 +562,9 @@ inline void Draw_Prepare_Menu() {
|
|||
#define PSCROL(L) (scroll + (L))
|
||||
#define PVISI(L) WITHIN(PSCROL(L), 0, MROWS)
|
||||
|
||||
if (HMI_flag.language_flag)
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 133, 1, 271 - 111, 479 - 465 - 1, 14, 8); // "Prepare"
|
||||
}
|
||||
else {
|
||||
#ifdef USE_STRING_HEADINGS
|
||||
Draw_Title("Prepare"); // TODO: GET_TEXT_F
|
||||
|
@ -898,8 +941,9 @@ void Goto_MainMenu(void) {
|
|||
|
||||
Clear_Main_Window();
|
||||
|
||||
if (HMI_flag.language_flag)
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 2, 2, 271 - 244, 479 - 465, 14, 9); // "Home"
|
||||
}
|
||||
else {
|
||||
#ifdef USE_STRING_HEADINGS
|
||||
Draw_Title("Home"); // TODO: GET_TEXT
|
||||
|
@ -920,17 +964,19 @@ inline ENCODER_DiffState get_encoder_state() {
|
|||
const millis_t ms = millis();
|
||||
if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO;
|
||||
const ENCODER_DiffState state = Encoder_ReceiveAnalyze();
|
||||
if (state != ENCODER_DIFF_NO) Encoder_ms = ms + Encoder_wait;
|
||||
if (state != ENCODER_DIFF_NO) Encoder_ms = ms + ENCODER_WAIT;
|
||||
return state;
|
||||
}
|
||||
|
||||
void HMI_Move_X(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Move_X_scale += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Move_X_scale -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
checkkey = AxisMove;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -943,8 +989,8 @@ void HMI_Move_X(void) {
|
|||
DWIN_UpdateLCD();
|
||||
return;
|
||||
}
|
||||
if (HMI_ValueStruct.Move_X_scale < X_MIN_POS*MinUnitMult) HMI_ValueStruct.Move_X_scale = X_MIN_POS*MinUnitMult;
|
||||
else if (HMI_ValueStruct.Move_X_scale > X_MAX_POS*MinUnitMult) HMI_ValueStruct.Move_X_scale = X_MAX_POS*MinUnitMult;
|
||||
NOLESS(HMI_ValueStruct.Move_X_scale, (X_MIN_POS) * MINUNITMULT);
|
||||
NOMORE(HMI_ValueStruct.Move_X_scale, (X_MAX_POS) * MINUNITMULT);
|
||||
current_position[X_AXIS] = HMI_ValueStruct.Move_X_scale / 10;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale);
|
||||
DWIN_UpdateLCD();
|
||||
|
@ -954,10 +1000,12 @@ void HMI_Move_X(void) {
|
|||
void HMI_Move_Y(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Move_Y_scale += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Move_Y_scale -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
checkkey = AxisMove;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -970,8 +1018,8 @@ void HMI_Move_Y(void) {
|
|||
DWIN_UpdateLCD();
|
||||
return;
|
||||
}
|
||||
if (HMI_ValueStruct.Move_Y_scale < Y_MIN_POS*MinUnitMult) HMI_ValueStruct.Move_Y_scale = Y_MIN_POS*MinUnitMult;
|
||||
else if (HMI_ValueStruct.Move_Y_scale > Y_MAX_POS*MinUnitMult) HMI_ValueStruct.Move_Y_scale = Y_MAX_POS*MinUnitMult;
|
||||
NOLESS(HMI_ValueStruct.Move_Y_scale, (Y_MIN_POS) * MINUNITMULT);
|
||||
NOMORE(HMI_ValueStruct.Move_Y_scale, (Y_MAX_POS) * MINUNITMULT);
|
||||
current_position[Y_AXIS] = HMI_ValueStruct.Move_Y_scale / 10;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale);
|
||||
DWIN_UpdateLCD();
|
||||
|
@ -981,10 +1029,12 @@ void HMI_Move_Y(void) {
|
|||
void HMI_Move_Z(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Move_Z_scale += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Move_Z_scale -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
checkkey = AxisMove;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -997,10 +1047,8 @@ void HMI_Move_Z(void) {
|
|||
DWIN_UpdateLCD();
|
||||
return;
|
||||
}
|
||||
if (HMI_ValueStruct.Move_Z_scale < Z_MIN_POS*MinUnitMult)
|
||||
HMI_ValueStruct.Move_Z_scale = Z_MIN_POS*MinUnitMult;
|
||||
else if (HMI_ValueStruct.Move_Z_scale > Z_MAX_POS*MinUnitMult)
|
||||
HMI_ValueStruct.Move_Z_scale = Z_MAX_POS*MinUnitMult;
|
||||
NOLESS(HMI_ValueStruct.Move_Z_scale, Z_MIN_POS * MINUNITMULT);
|
||||
NOMORE(HMI_ValueStruct.Move_Z_scale, Z_MAX_POS * MINUNITMULT);
|
||||
current_position[Z_AXIS] = HMI_ValueStruct.Move_Z_scale / 10;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale);
|
||||
DWIN_UpdateLCD();
|
||||
|
@ -1010,10 +1058,12 @@ void HMI_Move_Z(void) {
|
|||
void HMI_Move_E(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Move_E_scale += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Move_E_scale -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
checkkey = AxisMove;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1026,10 +1076,10 @@ void HMI_Move_E(void) {
|
|||
DWIN_UpdateLCD();
|
||||
return;
|
||||
}
|
||||
if ((HMI_ValueStruct.Move_E_scale-last_E_scale) > EXTRUDE_MAXLENGTH*MinUnitMult)
|
||||
HMI_ValueStruct.Move_E_scale = last_E_scale + EXTRUDE_MAXLENGTH*MinUnitMult;
|
||||
else if ((last_E_scale-HMI_ValueStruct.Move_E_scale) > EXTRUDE_MAXLENGTH*MinUnitMult)
|
||||
HMI_ValueStruct.Move_E_scale = last_E_scale - EXTRUDE_MAXLENGTH*MinUnitMult;
|
||||
if ((HMI_ValueStruct.Move_E_scale - last_E_scale) > (EXTRUDE_MAXLENGTH) * MINUNITMULT)
|
||||
HMI_ValueStruct.Move_E_scale = last_E_scale + (EXTRUDE_MAXLENGTH) * MINUNITMULT;
|
||||
else if ((last_E_scale - HMI_ValueStruct.Move_E_scale) > (EXTRUDE_MAXLENGTH) * MINUNITMULT)
|
||||
HMI_ValueStruct.Move_E_scale = last_E_scale - (EXTRUDE_MAXLENGTH) * MINUNITMULT;
|
||||
current_position.e = HMI_ValueStruct.Move_E_scale / 10;
|
||||
show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
|
||||
DWIN_UpdateLCD();
|
||||
|
@ -1040,10 +1090,12 @@ void HMI_Zoffset(void) {
|
|||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
last_zoffset = zprobe_zoffset;
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.offset_value += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.offset_value -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
zprobe_zoffset = HMI_ValueStruct.offset_value / 100;
|
||||
|
@ -1083,10 +1135,12 @@ void HMI_Zoffset(void) {
|
|||
void HMI_ETemp(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.E_Temp += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.E_Temp -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
if (HMI_ValueStruct.show_mode == -1) { // temperature
|
||||
|
@ -1113,8 +1167,8 @@ void HMI_Zoffset(void) {
|
|||
return;
|
||||
}
|
||||
// E_Temp limit
|
||||
NOMORE(HMI_ValueStruct.E_Temp, max_E_Temp);
|
||||
NOLESS(HMI_ValueStruct.E_Temp, min_E_Temp);
|
||||
NOMORE(HMI_ValueStruct.E_Temp, MAX_E_TEMP);
|
||||
NOLESS(HMI_ValueStruct.E_Temp, MIN_E_TEMP);
|
||||
// E_Temp value
|
||||
if (HMI_ValueStruct.show_mode >= 0) // tune
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2 + MROWS - index_tune), HMI_ValueStruct.E_Temp);
|
||||
|
@ -1123,17 +1177,19 @@ void HMI_Zoffset(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // if HAS_HOTEND
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
|
||||
void HMI_BedTemp(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Bed_Temp += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Bed_Temp -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
if (HMI_ValueStruct.show_mode == -1) {
|
||||
|
@ -1160,8 +1216,8 @@ void HMI_Zoffset(void) {
|
|||
return;
|
||||
}
|
||||
// Bed_Temp limit
|
||||
NOMORE(HMI_ValueStruct.Bed_Temp, max_Bed_Temp);
|
||||
NOLESS(HMI_ValueStruct.Bed_Temp, min_Bed_Temp);
|
||||
NOMORE(HMI_ValueStruct.Bed_Temp, BED_MAX_TARGET);
|
||||
NOLESS(HMI_ValueStruct.Bed_Temp, MIN_BED_TEMP);
|
||||
// Bed_Temp value
|
||||
if (HMI_ValueStruct.show_mode >= 0) // tune page
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3 + MROWS - index_tune), HMI_ValueStruct.Bed_Temp);
|
||||
|
@ -1170,17 +1226,19 @@ void HMI_Zoffset(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // if HAS_HEATED_BED
|
||||
|
||||
#if HAS_FAN
|
||||
|
||||
void HMI_FanSpeed(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Fan_speed += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Fan_speed -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
if (HMI_ValueStruct.show_mode == -1) {
|
||||
|
@ -1207,8 +1265,8 @@ void HMI_Zoffset(void) {
|
|||
return;
|
||||
}
|
||||
// Fan_speed limit
|
||||
NOMORE(HMI_ValueStruct.Fan_speed, FanOn);
|
||||
NOLESS(HMI_ValueStruct.Fan_speed, FanOff);
|
||||
NOMORE(HMI_ValueStruct.Fan_speed, FANON);
|
||||
NOLESS(HMI_ValueStruct.Fan_speed, FANOFF);
|
||||
// Fan_speed value
|
||||
if (HMI_ValueStruct.show_mode >= 0) // tune page
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(4 + MROWS - index_tune), HMI_ValueStruct.Fan_speed);
|
||||
|
@ -1217,15 +1275,17 @@ void HMI_Zoffset(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // if HAS_FAN
|
||||
|
||||
void HMI_PrintSpeed(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.print_speed += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.print_speed -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
checkkey = Tune;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1234,8 +1294,8 @@ void HMI_PrintSpeed(void) {
|
|||
return;
|
||||
}
|
||||
// print_speed limit
|
||||
NOMORE(HMI_ValueStruct.print_speed, max_print_speed);
|
||||
NOLESS(HMI_ValueStruct.print_speed, min_print_speed);
|
||||
NOMORE(HMI_ValueStruct.print_speed, MAX_PRINT_SPEED);
|
||||
NOLESS(HMI_ValueStruct.print_speed, MIN_PRINT_SPEED);
|
||||
// print_speed value
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), HMI_ValueStruct.print_speed);
|
||||
}
|
||||
|
@ -1244,10 +1304,12 @@ void HMI_PrintSpeed(void) {
|
|||
void HMI_MaxFeedspeedXYZE(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Max_Feedspeed += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Max_Feedspeed -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
checkkey = MaxSpeed;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1267,7 +1329,7 @@ void HMI_MaxFeedspeedXYZE(void) {
|
|||
#if HAS_HOTEND
|
||||
else if (HMI_flag.feedspeed_flag == E_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[E_AXIS] * 2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[E_AXIS] * 2; }
|
||||
#endif
|
||||
if (HMI_ValueStruct.Max_Feedspeed < min_MaxFeedspeed) HMI_ValueStruct.Max_Feedspeed = min_MaxFeedspeed;
|
||||
if (HMI_ValueStruct.Max_Feedspeed < MIN_MAXFEEDSPEED) HMI_ValueStruct.Max_Feedspeed = MIN_MAXFEEDSPEED;
|
||||
// MaxFeedspeed value
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed);
|
||||
}
|
||||
|
@ -1276,8 +1338,8 @@ void HMI_MaxFeedspeedXYZE(void) {
|
|||
void HMI_MaxAccelerationXYZE(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) HMI_ValueStruct.Max_Acceleration += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) HMI_ValueStruct.Max_Acceleration -= EncoderRate.encoderMoveValue;
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) { HMI_ValueStruct.Max_Acceleration += EncoderRate.encoderMoveValue;}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) { HMI_ValueStruct.Max_Acceleration -= EncoderRate.encoderMoveValue;}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
checkkey = MaxAcceleration;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1297,7 +1359,7 @@ void HMI_MaxAccelerationXYZE(void) {
|
|||
#if HAS_HOTEND
|
||||
else if (HMI_flag.acc_flag == E_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[E_AXIS] * 2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[E_AXIS] * 2; }
|
||||
#endif
|
||||
if (HMI_ValueStruct.Max_Acceleration < min_MaxAcceleration) HMI_ValueStruct.Max_Acceleration = min_MaxAcceleration;
|
||||
if (HMI_ValueStruct.Max_Acceleration < MIN_MAXACCELERATION) HMI_ValueStruct.Max_Acceleration = MIN_MAXACCELERATION;
|
||||
// MaxAcceleration value
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration);
|
||||
}
|
||||
|
@ -1306,10 +1368,12 @@ void HMI_MaxAccelerationXYZE(void) {
|
|||
void HMI_MaxCornerXYZE(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Max_Corner += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Max_Corner -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
checkkey = MaxCorner;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1321,11 +1385,15 @@ void HMI_MaxCornerXYZE(void) {
|
|||
return;
|
||||
}
|
||||
// MaxCorner limit
|
||||
if (HMI_flag.corner_flag == X_AXIS) {if (HMI_ValueStruct.Max_Corner > default_max_jerk[X_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Corner = default_max_jerk[X_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.corner_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Corner > default_max_jerk[Y_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Corner = default_max_jerk[Y_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.corner_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Corner > default_max_jerk[Z_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Corner = default_max_jerk[Z_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.corner_flag == E_AXIS) {if (HMI_ValueStruct.Max_Corner > default_max_jerk[E_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Corner = default_max_jerk[E_AXIS]*2*MinUnitMult;}
|
||||
if (HMI_ValueStruct.Max_Corner < min_MaxCorner*MinUnitMult) HMI_ValueStruct.Max_Corner = min_MaxCorner*MinUnitMult;
|
||||
if (HMI_flag.corner_flag == X_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[X_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.corner_flag == Y_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[Y_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.corner_flag == Z_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[Z_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.corner_flag == E_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[E_AXIS] * 2 * MINUNITMULT);
|
||||
NOLESS(HMI_ValueStruct.Max_Corner, (MIN_MAXCORNER) * MINUNITMULT);
|
||||
// MaxCorner value
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
||||
}
|
||||
|
@ -1334,10 +1402,12 @@ void HMI_MaxCornerXYZE(void) {
|
|||
void HMI_StepXYZE(void) {
|
||||
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
||||
if (encoder_diffState != ENCODER_DIFF_NO) {
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
HMI_ValueStruct.Max_Step += EncoderRate.encoderMoveValue;
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
HMI_ValueStruct.Max_Step -= EncoderRate.encoderMoveValue;
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
||||
checkkey = Step;
|
||||
EncoderRate.encoderRateEnabled = 0;
|
||||
|
@ -1349,11 +1419,15 @@ void HMI_StepXYZE(void) {
|
|||
return;
|
||||
}
|
||||
// Step limit
|
||||
if (HMI_flag.step_flag == X_AXIS) {if (HMI_ValueStruct.Max_Step > default_axis_steps_per_unit[X_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Step = default_axis_steps_per_unit[X_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.step_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Step > default_axis_steps_per_unit[Y_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Step = default_axis_steps_per_unit[Y_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.step_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Step > default_axis_steps_per_unit[Z_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Step = default_axis_steps_per_unit[Z_AXIS]*2*MinUnitMult;}
|
||||
else if (HMI_flag.step_flag == E_AXIS) {if (HMI_ValueStruct.Max_Step > default_axis_steps_per_unit[E_AXIS]*2*MinUnitMult) HMI_ValueStruct.Max_Step = default_axis_steps_per_unit[E_AXIS]*2*MinUnitMult;}
|
||||
if (HMI_ValueStruct.Max_Step < min_Step) HMI_ValueStruct.Max_Step = min_Step;
|
||||
if (HMI_flag.step_flag == X_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[X_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.step_flag == Y_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[Y_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.step_flag == Z_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[Z_AXIS] * 2 * MINUNITMULT);
|
||||
else if (HMI_flag.step_flag == E_AXIS)
|
||||
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[E_AXIS] * 2 * MINUNITMULT);
|
||||
NOLESS(HMI_ValueStruct.Max_Step, MIN_STEP);
|
||||
// Step value
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
||||
}
|
||||
|
@ -1362,12 +1436,10 @@ void HMI_StepXYZE(void) {
|
|||
void update_variable(void) {
|
||||
/* Tune page temperature update */
|
||||
if (checkkey == Tune) {
|
||||
if (last_temp_hotend_target != thermalManager.temp_hotend[0].target) {
|
||||
if (last_temp_hotend_target != thermalManager.temp_hotend[0].target)
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2 + MROWS - index_tune), thermalManager.temp_hotend[0].target);
|
||||
}
|
||||
if (last_temp_bed_target != thermalManager.temp_bed.target) {
|
||||
if (last_temp_bed_target != thermalManager.temp_bed.target)
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3 + MROWS - index_tune), thermalManager.temp_bed.target);
|
||||
}
|
||||
if (last_fan_speed != thermalManager.fan_speed[0]) {
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(4 + MROWS - index_tune), thermalManager.fan_speed[0]);
|
||||
last_fan_speed = thermalManager.fan_speed[0];
|
||||
|
@ -1376,12 +1448,10 @@ void update_variable(void) {
|
|||
|
||||
/* Temperature page temperature update */
|
||||
if (checkkey == TemperatureID) {
|
||||
if (last_temp_hotend_target != thermalManager.temp_hotend[0].target) {
|
||||
if (last_temp_hotend_target != thermalManager.temp_hotend[0].target)
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target);
|
||||
}
|
||||
if (last_temp_bed_target != thermalManager.temp_bed.target) {
|
||||
if (last_temp_bed_target != thermalManager.temp_bed.target)
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), thermalManager.temp_bed.target);
|
||||
}
|
||||
if (last_fan_speed != thermalManager.fan_speed[0]) {
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), thermalManager.fan_speed[0]);
|
||||
last_fan_speed = thermalManager.fan_speed[0];
|
||||
|
@ -1578,8 +1648,9 @@ void HMI_SDCardUpdate(void) {
|
|||
}
|
||||
else {
|
||||
// clean file icon
|
||||
if (checkkey == SelectFile)
|
||||
if (checkkey == SelectFile) {
|
||||
Redraw_SD_List();
|
||||
}
|
||||
else if (checkkey == PrintProcess || checkkey == Tune || printingIsActive()) {
|
||||
// TODO: Move card removed abort handling
|
||||
// to CardReader::manage_media.
|
||||
|
@ -1625,16 +1696,6 @@ void HMI_StartFrame(const bool with_update) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef MACHINE_SIZE
|
||||
#define MACHINE_SIZE "220x220x250"
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_C
|
||||
#define CORP_WEBSITE_C "www.cxsw3d.com"
|
||||
#endif
|
||||
#ifndef CORP_WEBSITE_E
|
||||
#define CORP_WEBSITE_E "www.creality.com"
|
||||
#endif
|
||||
|
||||
inline void Draw_Info_Menu() {
|
||||
Clear_Main_Window();
|
||||
|
||||
|
@ -1672,8 +1733,9 @@ inline void Draw_Info_Menu() {
|
|||
inline void Draw_Print_File_Menu() {
|
||||
Clear_Title_Bar();
|
||||
|
||||
if (HMI_flag.language_flag)
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 0, 31, 271 - 216, 479 - 435, 14, 8);
|
||||
}
|
||||
else {
|
||||
#ifdef USE_STRING_HEADINGS
|
||||
Draw_Title("Print file"); // TODO: GET_TEXT_F
|
||||
|
@ -1812,9 +1874,10 @@ void HMI_SelectFile(void) {
|
|||
Draw_Back_First();
|
||||
shift_ms = 0;
|
||||
}
|
||||
else
|
||||
else {
|
||||
Draw_SDItem(itemnum, 0); // Draw the item (and init shift name)
|
||||
}
|
||||
}
|
||||
else {
|
||||
Move_Highlight(-1, select_file.now + MROWS - index_file); // Just move highlight
|
||||
Init_Shift_Name(); // ...and init the shift name
|
||||
|
@ -1858,7 +1921,7 @@ void HMI_SelectFile(void) {
|
|||
// All fans on for Ender 3 v2 ?
|
||||
// The slicer should manage this for us.
|
||||
// for (uint8_t i = 0; i < FAN_COUNT; i++)
|
||||
// thermalManager.fan_speed[i] = FanOn;
|
||||
// thermalManager.fan_speed[i] = FANON;
|
||||
#endif
|
||||
|
||||
Goto_PrintProcess();
|
||||
|
@ -1963,10 +2026,12 @@ void HMI_PauseOrStop(void) {
|
|||
ENCODER_DiffState encoder_diffState = get_encoder_state();
|
||||
if (encoder_diffState == ENCODER_DIFF_NO) return;
|
||||
|
||||
if (encoder_diffState == ENCODER_DIFF_CW)
|
||||
if (encoder_diffState == ENCODER_DIFF_CW) {
|
||||
Draw_Select_Highlight(false);
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
||||
}
|
||||
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 (HMI_flag.select_flag) {
|
||||
|
@ -2004,10 +2069,11 @@ void HMI_PauseOrStop(void) {
|
|||
abort_flag = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
else {
|
||||
Goto_PrintProcess(); // cancel stop
|
||||
}
|
||||
}
|
||||
}
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
|
||||
|
@ -2016,7 +2082,6 @@ inline void Draw_Move_Menu() {
|
|||
|
||||
if (HMI_flag.language_flag) {
|
||||
DWIN_Frame_AreaCopy(1, 192, 1, 271 - 38, 479 - 465, 14, 8);
|
||||
|
||||
DWIN_Frame_AreaCopy(1, 58, 118, 271 - 165, 479 - 347, LBLX, MBASE(1));
|
||||
DWIN_Frame_AreaCopy(1, 109, 118, 271 - 114, 479 - 347, LBLX, MBASE(2));
|
||||
DWIN_Frame_AreaCopy(1, 160, 118, 271 - 62, 479 - 347, LBLX, MBASE(3));
|
||||
|
@ -2062,10 +2127,11 @@ void HMI_Prepare(void) {
|
|||
else if (index_prepare == 7) Prepare_Item_Cool(MROWS);
|
||||
else if (index_prepare == 8) Prepare_Item_Lang(MROWS);
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(1, select_prepare.now + MROWS - index_prepare);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
if (select_prepare.dec()) {
|
||||
if (select_prepare.now < index_prepare - MROWS) {
|
||||
|
@ -2083,10 +2149,11 @@ void HMI_Prepare(void) {
|
|||
else if (index_prepare == 7) Prepare_Item_Disable(0);
|
||||
else if (index_prepare == 8) Prepare_Item_Home(0);
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(-1, select_prepare.now + MROWS - index_prepare);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
switch (select_prepare.now) {
|
||||
case 0: // back
|
||||
|
@ -2100,10 +2167,10 @@ void HMI_Prepare(void) {
|
|||
|
||||
queue.inject_P(PSTR("G92 E0"));
|
||||
current_position.e = HMI_ValueStruct.Move_E_scale = 0;
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(1), current_position[X_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(2), current_position[Y_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(3), current_position[Z_AXIS]*MinUnitMult);
|
||||
show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), current_position.e*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(1), current_position[X_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(2), current_position[Y_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(3), current_position[Z_AXIS] * MINUNITMULT);
|
||||
show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), current_position.e * MINUNITMULT);
|
||||
break;
|
||||
case 2: // close motion
|
||||
queue.inject_P(PSTR("M84"));
|
||||
|
@ -2230,10 +2297,11 @@ void HMI_Control(void) {
|
|||
DWIN_Frame_AreaCopy(1, 0, 104, 271 - 247, 479 - 365, LBLX, MBASE(5));
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(1, select_control.now + MROWS - index_control);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
if (select_control.dec()) {
|
||||
if (select_control.now < index_control - MROWS) {
|
||||
|
@ -2246,10 +2314,11 @@ void HMI_Control(void) {
|
|||
Draw_More_Icon(0 + MROWS - index_control + 1); // Temperature >
|
||||
Draw_More_Icon(1 + MROWS - index_control + 1); // Motion >
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(-1, select_control.now + MROWS - index_control);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
switch (select_control.now) {
|
||||
case 0: // back
|
||||
|
@ -2272,14 +2341,15 @@ void HMI_Control(void) {
|
|||
buzzer.tone(100, 659);
|
||||
buzzer.tone(100, 698);
|
||||
}
|
||||
else buzzer.tone(20, 440);
|
||||
else
|
||||
buzzer.tone(20, 440);
|
||||
break;
|
||||
case 4: // read EEPROM
|
||||
if (settings.load()) {
|
||||
buzzer.tone(100, 659);
|
||||
buzzer.tone(100, 698);
|
||||
}
|
||||
else buzzer.tone(20, 440);
|
||||
else {buzzer.tone(20, 440);}
|
||||
break;
|
||||
case 5: // resume EEPROM
|
||||
settings.reset();
|
||||
|
@ -2345,19 +2415,19 @@ void HMI_AxisMove(void) {
|
|||
break;
|
||||
case 1: // X axis move
|
||||
checkkey = Move_X;
|
||||
HMI_ValueStruct.Move_X_scale = current_position[X_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Move_X_scale = current_position[X_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 2: // Y axis move
|
||||
checkkey = Move_Y;
|
||||
HMI_ValueStruct.Move_Y_scale = current_position[Y_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Move_Y_scale = current_position[Y_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 3: // Z axis move
|
||||
checkkey = Move_Z;
|
||||
HMI_ValueStruct.Move_Z_scale = current_position[Z_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Move_Z_scale = current_position[Z_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
|
@ -2373,7 +2443,7 @@ void HMI_AxisMove(void) {
|
|||
}
|
||||
#endif
|
||||
checkkey = Extruder;
|
||||
HMI_ValueStruct.Move_E_scale = current_position.e*MinUnitMult;
|
||||
HMI_ValueStruct.Move_E_scale = current_position.e * MINUNITMULT;
|
||||
show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
|
@ -2429,7 +2499,6 @@ void HMI_Temperature(void) {
|
|||
#endif
|
||||
#if HAS_HOTEND
|
||||
case 4: // PLA preheat setting
|
||||
|
||||
checkkey = PLAPreheat;
|
||||
select_PLA.reset();
|
||||
HMI_ValueStruct.show_mode = -2;
|
||||
|
@ -2477,8 +2546,8 @@ void HMI_Temperature(void) {
|
|||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[0].fan_speed);
|
||||
|
||||
break;
|
||||
case 5: // ABS preheat setting
|
||||
|
||||
case 5: // ABS preheat setting
|
||||
checkkey = ABSPreheat;
|
||||
select_ABS.reset();
|
||||
HMI_ValueStruct.show_mode = -3;
|
||||
|
@ -2528,7 +2597,7 @@ void HMI_Temperature(void) {
|
|||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed);
|
||||
|
||||
break;
|
||||
#endif
|
||||
#endif // if HAS_HOTEND
|
||||
}
|
||||
}
|
||||
DWIN_UpdateLCD();
|
||||
|
@ -2679,10 +2748,10 @@ inline void Draw_Max_Jerk_Menu() {
|
|||
Draw_Back_First();
|
||||
LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxSpeedCornerX + i);
|
||||
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(1), planner.max_jerk[X_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(2), planner.max_jerk[Y_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(3), planner.max_jerk[Z_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(1), planner.max_jerk[X_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(2), planner.max_jerk[Y_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(3), planner.max_jerk[Z_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS] * MINUNITMULT);
|
||||
}
|
||||
|
||||
inline void Draw_Steps_Menu() {
|
||||
|
@ -2715,10 +2784,10 @@ inline void Draw_Steps_Menu() {
|
|||
Draw_Back_First();
|
||||
LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_StepX + i);
|
||||
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(1), planner.settings.axis_steps_per_mm[X_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(2), planner.settings.axis_steps_per_mm[Y_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(3), planner.settings.axis_steps_per_mm[Z_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 210, MBASE(4), planner.settings.axis_steps_per_mm[E_AXIS]*MinUnitMult);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(1), planner.settings.axis_steps_per_mm[X_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(2), planner.settings.axis_steps_per_mm[Y_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(3), planner.settings.axis_steps_per_mm[Z_AXIS] * MINUNITMULT);
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(4), planner.settings.axis_steps_per_mm[E_AXIS] * MINUNITMULT);
|
||||
}
|
||||
|
||||
/* Motion */
|
||||
|
@ -2798,10 +2867,11 @@ void HMI_Tune(void) {
|
|||
Scroll_Menu(DWIN_SCROLL_UP);
|
||||
Prepare_Item_Lang(5);
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(1, select_tune.now + MROWS - index_tune);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
||||
if (select_tune.dec()) {
|
||||
if (select_tune.now < index_tune - MROWS) {
|
||||
|
@ -2809,24 +2879,26 @@ void HMI_Tune(void) {
|
|||
Scroll_Menu(DWIN_SCROLL_DOWN);
|
||||
if (index_tune == MROWS) Draw_Back_First();
|
||||
}
|
||||
else
|
||||
else {
|
||||
Move_Highlight(-1, select_tune.now + MROWS - index_tune);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
||||
switch (select_tune.now) {
|
||||
case 0: { // back
|
||||
case 0: { // Back
|
||||
select_print.set(0);
|
||||
Goto_PrintProcess();
|
||||
} break;
|
||||
case 1: // print speed
|
||||
}
|
||||
break;
|
||||
case 1: // Print speed
|
||||
checkkey = PrintSpeed;
|
||||
HMI_ValueStruct.print_speed = feedrate_percentage;
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), feedrate_percentage);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
#if HAS_HOTEND
|
||||
case 2: // nozzle temp
|
||||
case 2: // Nozzle temp
|
||||
checkkey = ETemp;
|
||||
HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target;
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2 + MROWS - index_tune), thermalManager.temp_hotend[0].target);
|
||||
|
@ -2834,7 +2906,7 @@ void HMI_Tune(void) {
|
|||
break;
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
case 3: // bed temp
|
||||
case 3: // Bed temp
|
||||
checkkey = BedTemp;
|
||||
HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target;
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3 + MROWS - index_tune), thermalManager.temp_bed.target);
|
||||
|
@ -2842,21 +2914,21 @@ void HMI_Tune(void) {
|
|||
break;
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
case 4: // fan speed
|
||||
case 4: // Fan speed
|
||||
checkkey = FanSpeed;
|
||||
HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0];
|
||||
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(4 + MROWS - index_tune), thermalManager.fan_speed[0]);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
#endif
|
||||
case 5: // z-offset
|
||||
case 5: // Z-offset
|
||||
checkkey = Homeoffset;
|
||||
HMI_ValueStruct.offset_value = BABY_Z_VAR * 100;
|
||||
show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(5 + MROWS - index_tune), HMI_ValueStruct.offset_value);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 6: // language
|
||||
/* select language */
|
||||
case 6: // Language
|
||||
// Select language
|
||||
HMI_flag.language_flag = !HMI_flag.language_flag;
|
||||
|
||||
Clear_Main_Window();
|
||||
|
@ -2928,7 +3000,8 @@ void HMI_PLAPreheatSetting(void) {
|
|||
buzzer.tone(100, 659);
|
||||
buzzer.tone(100, 698);
|
||||
}
|
||||
else buzzer.tone(20, 440);
|
||||
else
|
||||
buzzer.tone(20, 440);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
@ -2985,7 +3058,8 @@ void HMI_ABSPreheatSetting(void) {
|
|||
buzzer.tone(100, 659);
|
||||
buzzer.tone(100, 698);
|
||||
}
|
||||
else buzzer.tone(20, 440);
|
||||
else
|
||||
buzzer.tone(20, 440);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -3124,28 +3198,28 @@ void HMI_MaxCorner(void) {
|
|||
case 1: // max corner X
|
||||
checkkey = MaxCorner_value;
|
||||
HMI_flag.corner_flag = X_AXIS;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[X_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[X_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 2: // max corner Y
|
||||
checkkey = MaxCorner_value;
|
||||
HMI_flag.corner_flag = Y_AXIS;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[Y_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[Y_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 3: // max corner Z
|
||||
checkkey = MaxCorner_value;
|
||||
HMI_flag.corner_flag = Z_AXIS;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[Z_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[Z_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 4: // max corner E
|
||||
checkkey = MaxCorner_value;
|
||||
HMI_flag.corner_flag = E_AXIS;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[E_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Corner = planner.max_jerk[E_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
|
@ -3178,28 +3252,28 @@ void HMI_Step(void) {
|
|||
case 1: // max step X
|
||||
checkkey = Step_value;
|
||||
HMI_flag.step_flag = X_AXIS;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[X_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[X_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 2: // max step Y
|
||||
checkkey = Step_value;
|
||||
HMI_flag.step_flag = Y_AXIS;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Y_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Y_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 3: // max step Z
|
||||
checkkey = Step_value;
|
||||
HMI_flag.step_flag = Z_AXIS;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Z_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Z_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
case 4: // max step E
|
||||
checkkey = Step_value;
|
||||
HMI_flag.step_flag = E_AXIS;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[E_AXIS]*MinUnitMult;
|
||||
HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[E_AXIS] * MINUNITMULT;
|
||||
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
||||
EncoderRate.encoderRateEnabled = 1;
|
||||
break;
|
||||
|
@ -3231,14 +3305,9 @@ void HMI_Init(void) {
|
|||
}
|
||||
|
||||
void DWIN_Update(void) {
|
||||
/* status update */
|
||||
EachMomentUpdate();
|
||||
|
||||
/* sdcard update */
|
||||
HMI_SDCardUpdate();
|
||||
|
||||
/* rotary encoder update */
|
||||
DWIN_HandleScreen();
|
||||
EachMomentUpdate(); // Status update
|
||||
HMI_SDCardUpdate(); // SD card update
|
||||
DWIN_HandleScreen(); // Rotary encoder update
|
||||
}
|
||||
|
||||
void EachMomentUpdate(void) {
|
||||
|
@ -3377,6 +3446,7 @@ void EachMomentUpdate(void) {
|
|||
}
|
||||
else
|
||||
update_selection(encoder_diffState == ENCODER_DIFF_CCW);
|
||||
|
||||
DWIN_UpdateLCD();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,45 +31,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MACHINE_SIZE "220x220x250"
|
||||
#define CORP_WEBSITE_C "www.cxsw3d.com"
|
||||
#define CORP_WEBSITE_E "www.creality.com"
|
||||
|
||||
/*********************************/
|
||||
|
||||
#define MENU_CHAR_LIMIT 24
|
||||
|
||||
/*fan speed limit*/
|
||||
#define FanOn 255
|
||||
#define FanOff 0
|
||||
|
||||
/*print speed limit*/
|
||||
#define max_print_speed 999
|
||||
#define min_print_speed 10
|
||||
|
||||
/*Temp limit*/
|
||||
#define max_E_Temp (HEATER_0_MAXTEMP - 15)
|
||||
#define min_E_Temp HEATER_0_MINTEMP
|
||||
#define max_Bed_Temp (BED_MAXTEMP - 10)
|
||||
#define min_Bed_Temp BED_MINTEMP
|
||||
|
||||
/*Feedspeed limit*/ // max feedspeed = DEFAULT_MAX_FEEDRATE * 2
|
||||
#define min_MaxFeedspeed 1
|
||||
#define min_MaxAcceleration 1
|
||||
#define min_MaxCorner 0.1
|
||||
#define min_Step 1
|
||||
|
||||
#define FEEDRATE_E (60)
|
||||
|
||||
// mininum unit (0.1) : multiple (10)
|
||||
#define MinUnitMult 10
|
||||
|
||||
#define Encoder_wait 20
|
||||
#define DWIN_SCROLL_UPDATE_INTERVAL 2000
|
||||
#define DWIN_REMAIN_TIME_UPDATE_INTERVAL 20000
|
||||
|
||||
enum processID {
|
||||
/*Process ID*/
|
||||
// Process ID
|
||||
MainMenu,
|
||||
SelectFile,
|
||||
Prepare,
|
||||
|
@ -94,14 +57,14 @@ enum processID {
|
|||
Step,
|
||||
Step_value,
|
||||
|
||||
/*Last Process ID*/
|
||||
// Last Process ID
|
||||
Last_Prepare,
|
||||
|
||||
/*Back Process ID*/
|
||||
// Back Process ID
|
||||
Back_Main,
|
||||
Back_Print,
|
||||
|
||||
/*Date variable ID*/
|
||||
// Date variable ID
|
||||
Move_X,
|
||||
Move_Y,
|
||||
Move_Z,
|
||||
|
@ -118,17 +81,17 @@ enum processID {
|
|||
#endif
|
||||
PrintSpeed,
|
||||
|
||||
/*Window ID*/
|
||||
// Window ID
|
||||
Print_window,
|
||||
Popup_Window
|
||||
};
|
||||
|
||||
/*Picture ID*/
|
||||
// Picture ID
|
||||
#define Start_Process 0
|
||||
#define Language_English 1
|
||||
#define Language_Chinese 2
|
||||
|
||||
/*ICON ID*/
|
||||
// ICON ID
|
||||
#define ICON 0x09
|
||||
#define ICON_LOGO 0
|
||||
#define ICON_Print_0 1
|
||||
|
@ -227,8 +190,8 @@ enum processID {
|
|||
#define ICON_Info_0 90
|
||||
#define ICON_Info_1 91
|
||||
|
||||
/*
|
||||
* 3-.0:字号大小,0x00-0x09,对应字体大小于下:
|
||||
/**
|
||||
* 3-.0:The font size, 0x00-0x09, corresponds to the font size below:
|
||||
* 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28
|
||||
* 0x05=16*32 0x06=20*40 0x07=24*48 0x08=28*56 0x09=32*64
|
||||
*/
|
||||
|
@ -243,17 +206,17 @@ enum processID {
|
|||
#define font28x56 0x08
|
||||
#define font32x64 0x09
|
||||
|
||||
/* Colour */
|
||||
// Color
|
||||
#define White 0xFFFF
|
||||
#define Background_window 0x31E8 // 弹窗背景色
|
||||
#define Background_blue 0x1125 // 暗蓝背景色
|
||||
#define Background_black 0x0841 // 黑色背景色
|
||||
#define Font_window 0xD6BA // 弹窗字体背景色
|
||||
#define Line_Color 0x3A6A // 分割线颜色
|
||||
#define Rectangle_Color 0xEE2F // 蓝色方块光标颜色
|
||||
#define Percent_Color 0xFE29 // 百分比颜色
|
||||
#define BarFill_Color 0x10E4 // 进度条填充色
|
||||
#define Select_Color 0x33BB // 选中色
|
||||
#define Background_window 0x31E8 // Popup background color
|
||||
#define Background_blue 0x1125 // Dark blue background color
|
||||
#define Background_black 0x0841 // black background color
|
||||
#define Font_window 0xD6BA // Popup font background color
|
||||
#define Line_Color 0x3A6A // Split line color
|
||||
#define Rectangle_Color 0xEE2F // blue square cursor color
|
||||
#define Percent_Color 0xFE29 // percentage color
|
||||
#define BarFill_Color 0x10E4 // fill color of progress bar
|
||||
#define Select_Color 0x33BB // selected color
|
||||
|
||||
extern int checkkey, last_checkkey;
|
||||
extern float zprobe_zoffset;
|
||||
|
@ -262,15 +225,9 @@ extern char print_filename[16];
|
|||
extern millis_t dwin_heat_time;
|
||||
|
||||
typedef struct {
|
||||
#if HAS_HOTEND
|
||||
int16_t E_Temp = 0;
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
int16_t Bed_Temp = 0;
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
int16_t Fan_speed = 0;
|
||||
#endif
|
||||
TERN_(HAS_HOTEND, int16_t E_Temp = 0);
|
||||
TERN_(HAS_HEATED_BED, int16_t Bed_Temp = 0);
|
||||
TERN_(HAS_FAN, int16_t Fan_speed = 0);
|
||||
int16_t print_speed = 100;
|
||||
float Max_Feedspeed = 0;
|
||||
float Max_Acceleration = 0;
|
||||
|
@ -311,12 +268,12 @@ typedef struct {
|
|||
extern HMI_value_t HMI_ValueStruct;
|
||||
extern HMI_Flag HMI_flag;
|
||||
|
||||
/* Language */
|
||||
// Language
|
||||
void lcd_select_language(void);
|
||||
void set_english_to_eeprom(void);
|
||||
void set_chinese_to_eeprom(void);
|
||||
|
||||
/* Show ICON*/
|
||||
// Show ICO
|
||||
void ICON_Print(bool show);
|
||||
void ICON_Prepare(bool show);
|
||||
void ICON_Control(bool show);
|
||||
|
@ -328,7 +285,7 @@ void ICON_Pause(bool show);
|
|||
void ICON_Continue(bool show);
|
||||
void ICON_Stop(bool show);
|
||||
|
||||
/* Popup window tips */
|
||||
// Popup window tips
|
||||
#if HAS_HOTEND
|
||||
void Popup_Window_Temperature(const bool toohigh);
|
||||
void Popup_Window_ETempTooLow(void);
|
||||
|
@ -341,7 +298,7 @@ void Popup_Window_Leveling(void);
|
|||
void Goto_PrintProcess(void);
|
||||
void Goto_MainMenu(void);
|
||||
|
||||
/* Variable control */
|
||||
// Variable control
|
||||
void HMI_Move_X(void);
|
||||
void HMI_Move_Y(void);
|
||||
void HMI_Move_Z(void);
|
||||
|
@ -349,15 +306,10 @@ void HMI_Move_E(void);
|
|||
|
||||
void HMI_Zoffset(void);
|
||||
|
||||
#if HAS_HOTEND
|
||||
void HMI_ETemp(void);
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
void HMI_BedTemp(void);
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
void HMI_FanSpeed(void);
|
||||
#endif
|
||||
TERN_(HAS_HOTEND, void HMI_ETemp(void));
|
||||
TERN_(HAS_HEATED_BED, void HMI_BedTemp(void));
|
||||
TERN_(HAS_FAN, void HMI_FanSpeed(void));
|
||||
|
||||
void HMI_PrintSpeed(void);
|
||||
|
||||
void HMI_MaxFeedspeedXYZE(void);
|
||||
|
@ -368,40 +320,40 @@ void HMI_StepXYZE(void);
|
|||
void update_variable(void);
|
||||
void show_plus_or_minus(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value);
|
||||
|
||||
/* SD Card */
|
||||
// SD Card
|
||||
void HMI_SDCardInit(void);
|
||||
void HMI_SDCardUpdate(void);
|
||||
|
||||
/* Main Process */
|
||||
// Main Process
|
||||
void Icon_print(bool value);
|
||||
void Icon_control(bool value);
|
||||
void Icon_temperature(bool value);
|
||||
void Icon_leveling(bool value);
|
||||
|
||||
/* Other */
|
||||
// Other
|
||||
bool Pause_HeatStatus();
|
||||
void HMI_StartFrame(const bool with_update); // 开机画面
|
||||
void HMI_MainMenu(void); // 主进程画面
|
||||
void HMI_SelectFile(void); // 文件页
|
||||
void HMI_Printing(void); // 打印页
|
||||
void HMI_Prepare(void); // 准备页
|
||||
void HMI_Control(void); // 控制页
|
||||
void HMI_Leveling(void); // 调平页
|
||||
void HMI_AxisMove(void); // 轴移动菜单
|
||||
void HMI_Temperature(void); // 温度菜单
|
||||
void HMI_Motion(void); // 运动菜单
|
||||
void HMI_Info(void); // 信息菜单
|
||||
void HMI_Tune(void); // 调整菜单
|
||||
void HMI_StartFrame(const bool with_update); // startup screen
|
||||
void HMI_MainMenu(void); // main process screen
|
||||
void HMI_SelectFile(void); // file page
|
||||
void HMI_Printing(void); // print page
|
||||
void HMI_Prepare(void); // prepare page
|
||||
void HMI_Control(void); // control page
|
||||
void HMI_Leveling(void); // Level the page
|
||||
void HMI_AxisMove(void); // Axis movement menu
|
||||
void HMI_Temperature(void); // Temperature menu
|
||||
void HMI_Motion(void); // Sports menu
|
||||
void HMI_Info(void); // Information menu
|
||||
void HMI_Tune(void); // Adjust the menu
|
||||
|
||||
#if HAS_HOTEND
|
||||
void HMI_PLAPreheatSetting(void); // PLA预热设置
|
||||
void HMI_ABSPreheatSetting(void); // ABS预热设置
|
||||
void HMI_PLAPreheatSetting(void); // PLA warm-up setting
|
||||
void HMI_ABSPreheatSetting(void); // ABS warm-up setting
|
||||
#endif
|
||||
|
||||
void HMI_MaxSpeed(void); // 最大速度子菜单
|
||||
void HMI_MaxAcceleration(void); // 最大加速度子菜单
|
||||
void HMI_MaxCorner(void); // 最大拐角速度子菜单
|
||||
void HMI_Step(void); // 传动比
|
||||
void HMI_MaxSpeed(void); // Maximum speed submenu
|
||||
void HMI_MaxAcceleration(void); // Maximum acceleration submenu
|
||||
void HMI_MaxCorner(void); // Maximum corner speed submenu
|
||||
void HMI_Step(void); // transmission ratio
|
||||
|
||||
void HMI_Init(void);
|
||||
void DWIN_Update(void);
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
|
||||
/******************** IIC ********************/
|
||||
|
||||
//IO方向设置
|
||||
//IO direction setting
|
||||
#define SDA_IN() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 8 << 12; }while(0)
|
||||
#define SDA_OUT() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 3 << 12; }while(0)
|
||||
|
||||
//IO操作函数
|
||||
//IO operation function
|
||||
#define IIC_SCL_0() WRITE(IIC_EEPROM_SCL, LOW)
|
||||
#define IIC_SCL_1() WRITE(IIC_EEPROM_SCL, HIGH)
|
||||
#define IIC_SDA_0() WRITE(IIC_EEPROM_SDA, LOW)
|
||||
|
@ -43,18 +43,18 @@
|
|||
|
||||
class BL24CXX;
|
||||
|
||||
// IIC所有操作函数
|
||||
// All operation functions of IIC
|
||||
class IIC {
|
||||
friend class BL24CXX;
|
||||
protected:
|
||||
static void init(); // 初始化IIC的IO口
|
||||
static void start(); // 发送IIC开始信号
|
||||
static void stop(); // 发送IIC停止信号
|
||||
static void send_byte(uint8_t txd); // IIC发送一个字节
|
||||
static uint8_t read_byte(unsigned char ack); // IIC读取一个字节
|
||||
static uint8_t wait_ack(); // IIC等待ACK信号
|
||||
static void ack(); // IIC发送ACK信号
|
||||
static void nAck(); // IIC不发送ACK信号
|
||||
static void init(); // Initialize the IO port of IIC
|
||||
static void start(); // Send IIC start signal
|
||||
static void stop(); // Send IIC stop signal
|
||||
static void send_byte(uint8_t txd); // IIC sends a byte
|
||||
static uint8_t read_byte(unsigned char ack); // IIC reads a byte
|
||||
static uint8_t wait_ack(); // IIC waits for ACK signal
|
||||
static void ack(); // IIC sends ACK signal
|
||||
static void nAck(); // IIC does not send ACK signal
|
||||
|
||||
static void write_one_byte(uint8_t daddr, uint8_t addr, uint8_t data);
|
||||
static uint8_t read_one_byte(uint8_t daddr, uint8_t addr);
|
||||
|
@ -75,12 +75,12 @@ protected:
|
|||
|
||||
class BL24CXX {
|
||||
public:
|
||||
static void init(); //初始化IIC
|
||||
static uint8_t check(); //检查器件
|
||||
static uint8_t readOneByte(uint16_t ReadAddr); //指定地址读取一个字节
|
||||
static void writeOneByte(uint16_t WriteAddr, uint8_t DataToWrite); //指定地址写入一个字节
|
||||
static void writeLenByte(uint16_t WriteAddr, uint32_t DataToWrite, uint8_t Len);//指定地址开始写入指定长度的数据
|
||||
static uint32_t readLenByte(uint16_t ReadAddr, uint8_t Len); //指定地址开始读取指定长度数据
|
||||
static void write(uint16_t WriteAddr, uint8_t *pBuffer, uint16_t NumToWrite); //从指定地址开始写入指定长度的数据
|
||||
static void read(uint16_t ReadAddr, uint8_t *pBuffer, uint16_t NumToRead); //从指定地址开始读出指定长度的数据
|
||||
static void init(); // Initialize IIC
|
||||
static uint8_t check(); // Check the device
|
||||
static uint8_t readOneByte(uint16_t ReadAddr); // Read a byte at the specified address
|
||||
static void writeOneByte(uint16_t WriteAddr, uint8_t DataToWrite); // Write a byte at the specified address
|
||||
static void writeLenByte(uint16_t WriteAddr, uint32_t DataToWrite, uint8_t Len);// The specified address begins to write the data of the specified length
|
||||
static uint32_t readLenByte(uint16_t ReadAddr, uint8_t Len); // The specified address starts to read the data of the specified length
|
||||
static void write(uint16_t WriteAddr, uint8_t *pBuffer, uint16_t NumToWrite); // Write the specified length of data from the specified address
|
||||
static void read(uint16_t ReadAddr, uint8_t *pBuffer, uint16_t NumToRead); // Read the data of the specified length from the specified address
|
||||
};
|
||||
|
|
|
@ -314,10 +314,7 @@ void menu_cancelobject();
|
|||
#undef PID_BED_MENU_SECTION
|
||||
#endif
|
||||
#if ENABLED(PID_AUTOTUNE_MENU)
|
||||
#ifndef BED_OVERSHOOT
|
||||
#define BED_OVERSHOOT 5
|
||||
#endif
|
||||
EDIT_ITEM_FAST_N(int3, -1, MSG_PID_AUTOTUNE_E, &autotune_temp_bed, PREHEAT_1_TEMP_BED, BED_MAXTEMP - BED_OVERSHOOT, []{ _lcd_autotune(-1); });
|
||||
EDIT_ITEM_FAST_N(int3, -1, MSG_PID_AUTOTUNE_E, &autotune_temp_bed, PREHEAT_1_TEMP_BED, BED_MAX_TARGET, []{ _lcd_autotune(-1); });
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
Reference in a new issue