|
|
@ -63,6 +63,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "../../libs/buzzer.h"
|
|
|
|
#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 PAUSE_HEAT true
|
|
|
|
|
|
|
|
|
|
|
|
#define USE_STRING_HEADINGS
|
|
|
|
#define USE_STRING_HEADINGS
|
|
|
@ -71,6 +81,41 @@
|
|
|
|
#define STAT_FONT font10x20
|
|
|
|
#define STAT_FONT font10x20
|
|
|
|
#define HEADER_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
|
|
|
|
constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, // Total rows, and other-than-Back
|
|
|
|
TITLE_HEIGHT = 30, // Title bar height
|
|
|
|
TITLE_HEIGHT = 30, // Title bar height
|
|
|
|
MLINE = 53, // Menu line 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;
|
|
|
|
float last_temp_hotend_current = 0, last_temp_bed_current = 0;
|
|
|
|
uint8_t last_fan_speed = 0;
|
|
|
|
uint8_t last_fan_speed = 0;
|
|
|
|
uint16_t last_speed = 0;
|
|
|
|
uint16_t last_speed = 0;
|
|
|
|
|
|
|
|
|
|
|
|
float last_E_scale = 0;
|
|
|
|
float last_E_scale = 0;
|
|
|
|
|
|
|
|
|
|
|
|
bool DWIN_lcd_sd_status = 0;
|
|
|
|
bool DWIN_lcd_sd_status = 0;
|
|
|
|
|
|
|
|
|
|
|
|
bool pause_action_flag = 0;
|
|
|
|
bool pause_action_flag = 0;
|
|
|
|
|
|
|
|
|
|
|
|
int temphot = 0, tempbed = 0;
|
|
|
|
int temphot = 0, tempbed = 0;
|
|
|
|
|
|
|
|
float zprobe_zoffset = 0;
|
|
|
|
float zprobe_zoffset = 0.00;
|
|
|
|
float last_zoffset = 0, last_probe_zoffset = 0;
|
|
|
|
float last_zoffset = 0.00, last_probe_zoffset = 0.00;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FONT_EEPROM_OFFSET 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) {
|
|
|
|
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));
|
|
|
|
DWIN_Frame_AreaCopy(1, 100, 89, 271 - 93 - 27, 479 - 378, LBLX, MBASE(row));
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat"
|
|
|
|
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"
|
|
|
|
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) {
|
|
|
|
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));
|
|
|
|
DWIN_Frame_AreaCopy(1, 180, 89, 271 - 11 - 27, 479 - 379, LBLX, MBASE(row));
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat"
|
|
|
|
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"
|
|
|
|
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 PSCROL(L) (scroll + (L))
|
|
|
|
#define PVISI(L) WITHIN(PSCROL(L), 0, MROWS)
|
|
|
|
#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"
|
|
|
|
DWIN_Frame_AreaCopy(1, 133, 1, 271 - 111, 479 - 465 - 1, 14, 8); // "Prepare"
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
Draw_Title("Prepare"); // TODO: GET_TEXT_F
|
|
|
|
Draw_Title("Prepare"); // TODO: GET_TEXT_F
|
|
|
@ -898,8 +941,9 @@ void Goto_MainMenu(void) {
|
|
|
|
|
|
|
|
|
|
|
|
Clear_Main_Window();
|
|
|
|
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"
|
|
|
|
DWIN_Frame_AreaCopy(1, 2, 2, 271 - 244, 479 - 465, 14, 9); // "Home"
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
Draw_Title("Home"); // TODO: GET_TEXT
|
|
|
|
Draw_Title("Home"); // TODO: GET_TEXT
|
|
|
@ -920,17 +964,19 @@ inline ENCODER_DiffState get_encoder_state() {
|
|
|
|
const millis_t ms = millis();
|
|
|
|
const millis_t ms = millis();
|
|
|
|
if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO;
|
|
|
|
if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO;
|
|
|
|
const ENCODER_DiffState state = Encoder_ReceiveAnalyze();
|
|
|
|
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;
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HMI_Move_X(void) {
|
|
|
|
void HMI_Move_X(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Move_X_scale -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
checkkey = AxisMove;
|
|
|
|
checkkey = AxisMove;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -943,8 +989,8 @@ void HMI_Move_X(void) {
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (HMI_ValueStruct.Move_X_scale < X_MIN_POS*MinUnitMult) HMI_ValueStruct.Move_X_scale = X_MIN_POS*MinUnitMult;
|
|
|
|
NOLESS(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;
|
|
|
|
NOMORE(HMI_ValueStruct.Move_X_scale, (X_MAX_POS) * MINUNITMULT);
|
|
|
|
current_position[X_AXIS] = HMI_ValueStruct.Move_X_scale / 10;
|
|
|
|
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_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale);
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
@ -954,10 +1000,12 @@ void HMI_Move_X(void) {
|
|
|
|
void HMI_Move_Y(void) {
|
|
|
|
void HMI_Move_Y(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Move_Y_scale -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
checkkey = AxisMove;
|
|
|
|
checkkey = AxisMove;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -970,8 +1018,8 @@ void HMI_Move_Y(void) {
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (HMI_ValueStruct.Move_Y_scale < Y_MIN_POS*MinUnitMult) HMI_ValueStruct.Move_Y_scale = Y_MIN_POS*MinUnitMult;
|
|
|
|
NOLESS(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;
|
|
|
|
NOMORE(HMI_ValueStruct.Move_Y_scale, (Y_MAX_POS) * MINUNITMULT);
|
|
|
|
current_position[Y_AXIS] = HMI_ValueStruct.Move_Y_scale / 10;
|
|
|
|
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_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale);
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
@ -981,10 +1029,12 @@ void HMI_Move_Y(void) {
|
|
|
|
void HMI_Move_Z(void) {
|
|
|
|
void HMI_Move_Z(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Move_Z_scale -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
checkkey = AxisMove;
|
|
|
|
checkkey = AxisMove;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -997,10 +1047,8 @@ void HMI_Move_Z(void) {
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (HMI_ValueStruct.Move_Z_scale < Z_MIN_POS*MinUnitMult)
|
|
|
|
NOLESS(HMI_ValueStruct.Move_Z_scale, Z_MIN_POS * MINUNITMULT);
|
|
|
|
HMI_ValueStruct.Move_Z_scale = Z_MIN_POS*MinUnitMult;
|
|
|
|
NOMORE(HMI_ValueStruct.Move_Z_scale, Z_MAX_POS * MINUNITMULT);
|
|
|
|
else if (HMI_ValueStruct.Move_Z_scale > Z_MAX_POS*MinUnitMult)
|
|
|
|
|
|
|
|
HMI_ValueStruct.Move_Z_scale = Z_MAX_POS*MinUnitMult;
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = HMI_ValueStruct.Move_Z_scale / 10;
|
|
|
|
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_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale);
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
@ -1010,10 +1058,12 @@ void HMI_Move_Z(void) {
|
|
|
|
void HMI_Move_E(void) {
|
|
|
|
void HMI_Move_E(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Move_E_scale -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
checkkey = AxisMove;
|
|
|
|
checkkey = AxisMove;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1026,10 +1076,10 @@ void HMI_Move_E(void) {
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((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;
|
|
|
|
HMI_ValueStruct.Move_E_scale = last_E_scale + (EXTRUDE_MAXLENGTH) * MINUNITMULT;
|
|
|
|
else if ((last_E_scale-HMI_ValueStruct.Move_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;
|
|
|
|
HMI_ValueStruct.Move_E_scale = last_E_scale - (EXTRUDE_MAXLENGTH) * MINUNITMULT;
|
|
|
|
current_position.e = HMI_ValueStruct.Move_E_scale / 10;
|
|
|
|
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);
|
|
|
|
show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
@ -1040,10 +1090,12 @@ void HMI_Zoffset(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
last_zoffset = zprobe_zoffset;
|
|
|
|
last_zoffset = zprobe_zoffset;
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.offset_value += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.offset_value -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
zprobe_zoffset = HMI_ValueStruct.offset_value / 100;
|
|
|
|
zprobe_zoffset = HMI_ValueStruct.offset_value / 100;
|
|
|
@ -1083,10 +1135,12 @@ void HMI_Zoffset(void) {
|
|
|
|
void HMI_ETemp(void) {
|
|
|
|
void HMI_ETemp(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.E_Temp += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.E_Temp -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) { // temperature
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) { // temperature
|
|
|
@ -1113,8 +1167,8 @@ void HMI_Zoffset(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// E_Temp limit
|
|
|
|
// E_Temp limit
|
|
|
|
NOMORE(HMI_ValueStruct.E_Temp, max_E_Temp);
|
|
|
|
NOMORE(HMI_ValueStruct.E_Temp, MAX_E_TEMP);
|
|
|
|
NOLESS(HMI_ValueStruct.E_Temp, min_E_Temp);
|
|
|
|
NOLESS(HMI_ValueStruct.E_Temp, MIN_E_TEMP);
|
|
|
|
// E_Temp value
|
|
|
|
// E_Temp value
|
|
|
|
if (HMI_ValueStruct.show_mode >= 0) // tune
|
|
|
|
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);
|
|
|
|
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
|
|
|
|
#if HAS_HEATED_BED
|
|
|
|
|
|
|
|
|
|
|
|
void HMI_BedTemp(void) {
|
|
|
|
void HMI_BedTemp(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.Bed_Temp += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Bed_Temp -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) {
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) {
|
|
|
@ -1160,8 +1216,8 @@ void HMI_Zoffset(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Bed_Temp limit
|
|
|
|
// Bed_Temp limit
|
|
|
|
NOMORE(HMI_ValueStruct.Bed_Temp, max_Bed_Temp);
|
|
|
|
NOMORE(HMI_ValueStruct.Bed_Temp, BED_MAX_TARGET);
|
|
|
|
NOLESS(HMI_ValueStruct.Bed_Temp, min_Bed_Temp);
|
|
|
|
NOLESS(HMI_ValueStruct.Bed_Temp, MIN_BED_TEMP);
|
|
|
|
// Bed_Temp value
|
|
|
|
// Bed_Temp value
|
|
|
|
if (HMI_ValueStruct.show_mode >= 0) // tune page
|
|
|
|
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);
|
|
|
|
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
|
|
|
|
#if HAS_FAN
|
|
|
|
|
|
|
|
|
|
|
|
void HMI_FanSpeed(void) {
|
|
|
|
void HMI_FanSpeed(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.Fan_speed += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Fan_speed -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) {
|
|
|
|
if (HMI_ValueStruct.show_mode == -1) {
|
|
|
@ -1207,8 +1265,8 @@ void HMI_Zoffset(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Fan_speed limit
|
|
|
|
// Fan_speed limit
|
|
|
|
NOMORE(HMI_ValueStruct.Fan_speed, FanOn);
|
|
|
|
NOMORE(HMI_ValueStruct.Fan_speed, FANON);
|
|
|
|
NOLESS(HMI_ValueStruct.Fan_speed, FanOff);
|
|
|
|
NOLESS(HMI_ValueStruct.Fan_speed, FANOFF);
|
|
|
|
// Fan_speed value
|
|
|
|
// Fan_speed value
|
|
|
|
if (HMI_ValueStruct.show_mode >= 0) // tune page
|
|
|
|
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);
|
|
|
|
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) {
|
|
|
|
void HMI_PrintSpeed(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.print_speed += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.print_speed -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
checkkey = Tune;
|
|
|
|
checkkey = Tune;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1234,8 +1294,8 @@ void HMI_PrintSpeed(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// print_speed limit
|
|
|
|
// print_speed limit
|
|
|
|
NOMORE(HMI_ValueStruct.print_speed, max_print_speed);
|
|
|
|
NOMORE(HMI_ValueStruct.print_speed, MAX_PRINT_SPEED);
|
|
|
|
NOLESS(HMI_ValueStruct.print_speed, min_print_speed);
|
|
|
|
NOLESS(HMI_ValueStruct.print_speed, MIN_PRINT_SPEED);
|
|
|
|
// print_speed value
|
|
|
|
// print_speed value
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), HMI_ValueStruct.print_speed);
|
|
|
|
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) {
|
|
|
|
void HMI_MaxFeedspeedXYZE(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.Max_Feedspeed += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Max_Feedspeed -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
checkkey = MaxSpeed;
|
|
|
|
checkkey = MaxSpeed;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1267,7 +1329,7 @@ void HMI_MaxFeedspeedXYZE(void) {
|
|
|
|
#if HAS_HOTEND
|
|
|
|
#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; }
|
|
|
|
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
|
|
|
|
#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
|
|
|
|
// MaxFeedspeed value
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed);
|
|
|
|
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) {
|
|
|
|
void HMI_MaxAccelerationXYZE(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) 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_CCW) { HMI_ValueStruct.Max_Acceleration -= EncoderRate.encoderMoveValue;}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
checkkey = MaxAcceleration;
|
|
|
|
checkkey = MaxAcceleration;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1297,7 +1359,7 @@ void HMI_MaxAccelerationXYZE(void) {
|
|
|
|
#if HAS_HOTEND
|
|
|
|
#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; }
|
|
|
|
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
|
|
|
|
#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
|
|
|
|
// MaxAcceleration value
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration);
|
|
|
|
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) {
|
|
|
|
void HMI_MaxCornerXYZE(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.Max_Corner += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Max_Corner -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
checkkey = MaxCorner;
|
|
|
|
checkkey = MaxCorner;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1321,11 +1385,15 @@ void HMI_MaxCornerXYZE(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MaxCorner limit
|
|
|
|
// 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;}
|
|
|
|
if (HMI_flag.corner_flag == X_AXIS)
|
|
|
|
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;}
|
|
|
|
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[X_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 == Y_AXIS)
|
|
|
|
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;}
|
|
|
|
NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[Y_AXIS] * 2 * MINUNITMULT);
|
|
|
|
if (HMI_ValueStruct.Max_Corner < min_MaxCorner*MinUnitMult) HMI_ValueStruct.Max_Corner = min_MaxCorner*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
|
|
|
|
// MaxCorner value
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
|
|
|
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) {
|
|
|
|
void HMI_StepXYZE(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState != ENCODER_DIFF_NO) {
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
HMI_ValueStruct.Max_Step += EncoderRate.encoderMoveValue;
|
|
|
|
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;
|
|
|
|
HMI_ValueStruct.Max_Step -= EncoderRate.encoderMoveValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
|
|
|
|
checkkey = Step;
|
|
|
|
checkkey = Step;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
|
EncoderRate.encoderRateEnabled = 0;
|
|
|
@ -1349,11 +1419,15 @@ void HMI_StepXYZE(void) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Step limit
|
|
|
|
// 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;}
|
|
|
|
if (HMI_flag.step_flag == X_AXIS)
|
|
|
|
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;}
|
|
|
|
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[X_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 == Y_AXIS)
|
|
|
|
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;}
|
|
|
|
NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[Y_AXIS] * 2 * MINUNITMULT);
|
|
|
|
if (HMI_ValueStruct.Max_Step < min_Step) HMI_ValueStruct.Max_Step = min_Step;
|
|
|
|
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
|
|
|
|
// Step value
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
|
|
|
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) {
|
|
|
|
void update_variable(void) {
|
|
|
|
/* Tune page temperature update */
|
|
|
|
/* Tune page temperature update */
|
|
|
|
if (checkkey == Tune) {
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
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]) {
|
|
|
|
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]);
|
|
|
|
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];
|
|
|
|
last_fan_speed = thermalManager.fan_speed[0];
|
|
|
@ -1376,12 +1448,10 @@ void update_variable(void) {
|
|
|
|
|
|
|
|
|
|
|
|
/* Temperature page temperature update */
|
|
|
|
/* Temperature page temperature update */
|
|
|
|
if (checkkey == TemperatureID) {
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
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]) {
|
|
|
|
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]);
|
|
|
|
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];
|
|
|
|
last_fan_speed = thermalManager.fan_speed[0];
|
|
|
@ -1578,8 +1648,9 @@ void HMI_SDCardUpdate(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// clean file icon
|
|
|
|
// clean file icon
|
|
|
|
if (checkkey == SelectFile)
|
|
|
|
if (checkkey == SelectFile) {
|
|
|
|
Redraw_SD_List();
|
|
|
|
Redraw_SD_List();
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (checkkey == PrintProcess || checkkey == Tune || printingIsActive()) {
|
|
|
|
else if (checkkey == PrintProcess || checkkey == Tune || printingIsActive()) {
|
|
|
|
// TODO: Move card removed abort handling
|
|
|
|
// TODO: Move card removed abort handling
|
|
|
|
// to CardReader::manage_media.
|
|
|
|
// 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() {
|
|
|
|
inline void Draw_Info_Menu() {
|
|
|
|
Clear_Main_Window();
|
|
|
|
Clear_Main_Window();
|
|
|
|
|
|
|
|
|
|
|
@ -1672,8 +1733,9 @@ inline void Draw_Info_Menu() {
|
|
|
|
inline void Draw_Print_File_Menu() {
|
|
|
|
inline void Draw_Print_File_Menu() {
|
|
|
|
Clear_Title_Bar();
|
|
|
|
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);
|
|
|
|
DWIN_Frame_AreaCopy(1, 0, 31, 271 - 216, 479 - 435, 14, 8);
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
#ifdef USE_STRING_HEADINGS
|
|
|
|
Draw_Title("Print file"); // TODO: GET_TEXT_F
|
|
|
|
Draw_Title("Print file"); // TODO: GET_TEXT_F
|
|
|
@ -1812,9 +1874,10 @@ void HMI_SelectFile(void) {
|
|
|
|
Draw_Back_First();
|
|
|
|
Draw_Back_First();
|
|
|
|
shift_ms = 0;
|
|
|
|
shift_ms = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Draw_SDItem(itemnum, 0); // Draw the item (and init shift name)
|
|
|
|
Draw_SDItem(itemnum, 0); // Draw the item (and init shift name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
Move_Highlight(-1, select_file.now + MROWS - index_file); // Just move highlight
|
|
|
|
Move_Highlight(-1, select_file.now + MROWS - index_file); // Just move highlight
|
|
|
|
Init_Shift_Name(); // ...and init the shift name
|
|
|
|
Init_Shift_Name(); // ...and init the shift name
|
|
|
@ -1858,7 +1921,7 @@ void HMI_SelectFile(void) {
|
|
|
|
// All fans on for Ender 3 v2 ?
|
|
|
|
// All fans on for Ender 3 v2 ?
|
|
|
|
// The slicer should manage this for us.
|
|
|
|
// The slicer should manage this for us.
|
|
|
|
// for (uint8_t i = 0; i < FAN_COUNT; i++)
|
|
|
|
// for (uint8_t i = 0; i < FAN_COUNT; i++)
|
|
|
|
// thermalManager.fan_speed[i] = FanOn;
|
|
|
|
// thermalManager.fan_speed[i] = FANON;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
Goto_PrintProcess();
|
|
|
|
Goto_PrintProcess();
|
|
|
@ -1963,10 +2026,12 @@ void HMI_PauseOrStop(void) {
|
|
|
|
ENCODER_DiffState encoder_diffState = get_encoder_state();
|
|
|
|
ENCODER_DiffState encoder_diffState = get_encoder_state();
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_NO) return;
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_NO) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
|
|
|
if (encoder_diffState == ENCODER_DIFF_CW) {
|
|
|
|
Draw_Select_Highlight(false);
|
|
|
|
Draw_Select_Highlight(false);
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
Draw_Select_Highlight(true);
|
|
|
|
Draw_Select_Highlight(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
if (select_print.now == 1) { // pause window
|
|
|
|
if (select_print.now == 1) { // pause window
|
|
|
|
if (HMI_flag.select_flag) {
|
|
|
|
if (HMI_flag.select_flag) {
|
|
|
@ -2004,10 +2069,11 @@ void HMI_PauseOrStop(void) {
|
|
|
|
abort_flag = true;
|
|
|
|
abort_flag = true;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Goto_PrintProcess(); // cancel stop
|
|
|
|
Goto_PrintProcess(); // cancel stop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2016,7 +2082,6 @@ inline void Draw_Move_Menu() {
|
|
|
|
|
|
|
|
|
|
|
|
if (HMI_flag.language_flag) {
|
|
|
|
if (HMI_flag.language_flag) {
|
|
|
|
DWIN_Frame_AreaCopy(1, 192, 1, 271 - 38, 479 - 465, 14, 8);
|
|
|
|
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, 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, 109, 118, 271 - 114, 479 - 347, LBLX, MBASE(2));
|
|
|
|
DWIN_Frame_AreaCopy(1, 160, 118, 271 - 62, 479 - 347, LBLX, MBASE(3));
|
|
|
|
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 == 7) Prepare_Item_Cool(MROWS);
|
|
|
|
else if (index_prepare == 8) Prepare_Item_Lang(MROWS);
|
|
|
|
else if (index_prepare == 8) Prepare_Item_Lang(MROWS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(1, select_prepare.now + MROWS - index_prepare);
|
|
|
|
Move_Highlight(1, select_prepare.now + MROWS - index_prepare);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
if (select_prepare.dec()) {
|
|
|
|
if (select_prepare.dec()) {
|
|
|
|
if (select_prepare.now < index_prepare - MROWS) {
|
|
|
|
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 == 7) Prepare_Item_Disable(0);
|
|
|
|
else if (index_prepare == 8) Prepare_Item_Home(0);
|
|
|
|
else if (index_prepare == 8) Prepare_Item_Home(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(-1, select_prepare.now + MROWS - index_prepare);
|
|
|
|
Move_Highlight(-1, select_prepare.now + MROWS - index_prepare);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
switch (select_prepare.now) {
|
|
|
|
switch (select_prepare.now) {
|
|
|
|
case 0: // back
|
|
|
|
case 0: // back
|
|
|
@ -2100,10 +2167,10 @@ void HMI_Prepare(void) {
|
|
|
|
|
|
|
|
|
|
|
|
queue.inject_P(PSTR("G92 E0"));
|
|
|
|
queue.inject_P(PSTR("G92 E0"));
|
|
|
|
current_position.e = HMI_ValueStruct.Move_E_scale = 0;
|
|
|
|
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(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(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);
|
|
|
|
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);
|
|
|
|
show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), current_position.e * MINUNITMULT);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: // close motion
|
|
|
|
case 2: // close motion
|
|
|
|
queue.inject_P(PSTR("M84"));
|
|
|
|
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));
|
|
|
|
DWIN_Frame_AreaCopy(1, 0, 104, 271 - 247, 479 - 365, LBLX, MBASE(5));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(1, select_control.now + MROWS - index_control);
|
|
|
|
Move_Highlight(1, select_control.now + MROWS - index_control);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
if (select_control.dec()) {
|
|
|
|
if (select_control.dec()) {
|
|
|
|
if (select_control.now < index_control - MROWS) {
|
|
|
|
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(0 + MROWS - index_control + 1); // Temperature >
|
|
|
|
Draw_More_Icon(1 + MROWS - index_control + 1); // Motion >
|
|
|
|
Draw_More_Icon(1 + MROWS - index_control + 1); // Motion >
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(-1, select_control.now + MROWS - index_control);
|
|
|
|
Move_Highlight(-1, select_control.now + MROWS - index_control);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
switch (select_control.now) {
|
|
|
|
switch (select_control.now) {
|
|
|
|
case 0: // back
|
|
|
|
case 0: // back
|
|
|
@ -2272,14 +2341,15 @@ void HMI_Control(void) {
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else buzzer.tone(20, 440);
|
|
|
|
else
|
|
|
|
|
|
|
|
buzzer.tone(20, 440);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4: // read EEPROM
|
|
|
|
case 4: // read EEPROM
|
|
|
|
if (settings.load()) {
|
|
|
|
if (settings.load()) {
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else buzzer.tone(20, 440);
|
|
|
|
else {buzzer.tone(20, 440);}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5: // resume EEPROM
|
|
|
|
case 5: // resume EEPROM
|
|
|
|
settings.reset();
|
|
|
|
settings.reset();
|
|
|
@ -2345,19 +2415,19 @@ void HMI_AxisMove(void) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 1: // X axis move
|
|
|
|
case 1: // X axis move
|
|
|
|
checkkey = Move_X;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: // Y axis move
|
|
|
|
case 2: // Y axis move
|
|
|
|
checkkey = Move_Y;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3: // Z axis move
|
|
|
|
case 3: // Z axis move
|
|
|
|
checkkey = Move_Z;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2373,7 +2443,7 @@ void HMI_AxisMove(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
checkkey = Extruder;
|
|
|
|
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);
|
|
|
|
show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2429,7 +2499,6 @@ void HMI_Temperature(void) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_HOTEND
|
|
|
|
#if HAS_HOTEND
|
|
|
|
case 4: // PLA preheat setting
|
|
|
|
case 4: // PLA preheat setting
|
|
|
|
|
|
|
|
|
|
|
|
checkkey = PLAPreheat;
|
|
|
|
checkkey = PLAPreheat;
|
|
|
|
select_PLA.reset();
|
|
|
|
select_PLA.reset();
|
|
|
|
HMI_ValueStruct.show_mode = -2;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[0].fan_speed);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5: // ABS preheat setting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 5: // ABS preheat setting
|
|
|
|
checkkey = ABSPreheat;
|
|
|
|
checkkey = ABSPreheat;
|
|
|
|
select_ABS.reset();
|
|
|
|
select_ABS.reset();
|
|
|
|
HMI_ValueStruct.show_mode = -3;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif // if HAS_HOTEND
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
@ -2679,10 +2748,10 @@ inline void Draw_Max_Jerk_Menu() {
|
|
|
|
Draw_Back_First();
|
|
|
|
Draw_Back_First();
|
|
|
|
LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxSpeedCornerX + i);
|
|
|
|
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(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(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(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(4), planner.max_jerk[E_AXIS] * MINUNITMULT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void Draw_Steps_Menu() {
|
|
|
|
inline void Draw_Steps_Menu() {
|
|
|
@ -2715,10 +2784,10 @@ inline void Draw_Steps_Menu() {
|
|
|
|
Draw_Back_First();
|
|
|
|
Draw_Back_First();
|
|
|
|
LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_StepX + i);
|
|
|
|
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(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(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(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(4), planner.settings.axis_steps_per_mm[E_AXIS] * MINUNITMULT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Motion */
|
|
|
|
/* Motion */
|
|
|
@ -2798,10 +2867,11 @@ void HMI_Tune(void) {
|
|
|
|
Scroll_Menu(DWIN_SCROLL_UP);
|
|
|
|
Scroll_Menu(DWIN_SCROLL_UP);
|
|
|
|
Prepare_Item_Lang(5);
|
|
|
|
Prepare_Item_Lang(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(1, select_tune.now + MROWS - index_tune);
|
|
|
|
Move_Highlight(1, select_tune.now + MROWS - index_tune);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_CCW) {
|
|
|
|
if (select_tune.dec()) {
|
|
|
|
if (select_tune.dec()) {
|
|
|
|
if (select_tune.now < index_tune - MROWS) {
|
|
|
|
if (select_tune.now < index_tune - MROWS) {
|
|
|
@ -2809,24 +2879,26 @@ void HMI_Tune(void) {
|
|
|
|
Scroll_Menu(DWIN_SCROLL_DOWN);
|
|
|
|
Scroll_Menu(DWIN_SCROLL_DOWN);
|
|
|
|
if (index_tune == MROWS) Draw_Back_First();
|
|
|
|
if (index_tune == MROWS) Draw_Back_First();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
Move_Highlight(-1, select_tune.now + MROWS - index_tune);
|
|
|
|
Move_Highlight(-1, select_tune.now + MROWS - index_tune);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
else if (encoder_diffState == ENCODER_DIFF_ENTER) {
|
|
|
|
switch (select_tune.now) {
|
|
|
|
switch (select_tune.now) {
|
|
|
|
case 0: { // back
|
|
|
|
case 0: { // Back
|
|
|
|
select_print.set(0);
|
|
|
|
select_print.set(0);
|
|
|
|
Goto_PrintProcess();
|
|
|
|
Goto_PrintProcess();
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
case 1: // print speed
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: // Print speed
|
|
|
|
checkkey = PrintSpeed;
|
|
|
|
checkkey = PrintSpeed;
|
|
|
|
HMI_ValueStruct.print_speed = feedrate_percentage;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), feedrate_percentage);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#if HAS_HOTEND
|
|
|
|
#if HAS_HOTEND
|
|
|
|
case 2: // nozzle temp
|
|
|
|
case 2: // Nozzle temp
|
|
|
|
checkkey = ETemp;
|
|
|
|
checkkey = ETemp;
|
|
|
|
HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target;
|
|
|
|
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);
|
|
|
|
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;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_HEATED_BED
|
|
|
|
#if HAS_HEATED_BED
|
|
|
|
case 3: // bed temp
|
|
|
|
case 3: // Bed temp
|
|
|
|
checkkey = BedTemp;
|
|
|
|
checkkey = BedTemp;
|
|
|
|
HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target;
|
|
|
|
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);
|
|
|
|
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;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_FAN
|
|
|
|
#if HAS_FAN
|
|
|
|
case 4: // fan speed
|
|
|
|
case 4: // Fan speed
|
|
|
|
checkkey = FanSpeed;
|
|
|
|
checkkey = FanSpeed;
|
|
|
|
HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0];
|
|
|
|
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]);
|
|
|
|
DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(4 + MROWS - index_tune), thermalManager.fan_speed[0]);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
case 5: // z-offset
|
|
|
|
case 5: // Z-offset
|
|
|
|
checkkey = Homeoffset;
|
|
|
|
checkkey = Homeoffset;
|
|
|
|
HMI_ValueStruct.offset_value = BABY_Z_VAR * 100;
|
|
|
|
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);
|
|
|
|
show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(5 + MROWS - index_tune), HMI_ValueStruct.offset_value);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 6: // language
|
|
|
|
case 6: // Language
|
|
|
|
/* select language */
|
|
|
|
// Select language
|
|
|
|
HMI_flag.language_flag = !HMI_flag.language_flag;
|
|
|
|
HMI_flag.language_flag = !HMI_flag.language_flag;
|
|
|
|
|
|
|
|
|
|
|
|
Clear_Main_Window();
|
|
|
|
Clear_Main_Window();
|
|
|
@ -2928,7 +3000,8 @@ void HMI_PLAPreheatSetting(void) {
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else buzzer.tone(20, 440);
|
|
|
|
else
|
|
|
|
|
|
|
|
buzzer.tone(20, 440);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2985,7 +3058,8 @@ void HMI_ABSPreheatSetting(void) {
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 659);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
buzzer.tone(100, 698);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else buzzer.tone(20, 440);
|
|
|
|
else
|
|
|
|
|
|
|
|
buzzer.tone(20, 440);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -3124,28 +3198,28 @@ void HMI_MaxCorner(void) {
|
|
|
|
case 1: // max corner X
|
|
|
|
case 1: // max corner X
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
HMI_flag.corner_flag = X_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: // max corner Y
|
|
|
|
case 2: // max corner Y
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
HMI_flag.corner_flag = Y_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3: // max corner Z
|
|
|
|
case 3: // max corner Z
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
HMI_flag.corner_flag = Z_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4: // max corner E
|
|
|
|
case 4: // max corner E
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
checkkey = MaxCorner_value;
|
|
|
|
HMI_flag.corner_flag = E_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -3178,28 +3252,28 @@ void HMI_Step(void) {
|
|
|
|
case 1: // max step X
|
|
|
|
case 1: // max step X
|
|
|
|
checkkey = Step_value;
|
|
|
|
checkkey = Step_value;
|
|
|
|
HMI_flag.step_flag = X_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: // max step Y
|
|
|
|
case 2: // max step Y
|
|
|
|
checkkey = Step_value;
|
|
|
|
checkkey = Step_value;
|
|
|
|
HMI_flag.step_flag = Y_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3: // max step Z
|
|
|
|
case 3: // max step Z
|
|
|
|
checkkey = Step_value;
|
|
|
|
checkkey = Step_value;
|
|
|
|
HMI_flag.step_flag = Z_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4: // max step E
|
|
|
|
case 4: // max step E
|
|
|
|
checkkey = Step_value;
|
|
|
|
checkkey = Step_value;
|
|
|
|
HMI_flag.step_flag = E_AXIS;
|
|
|
|
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);
|
|
|
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step);
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
EncoderRate.encoderRateEnabled = 1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -3231,14 +3305,9 @@ void HMI_Init(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DWIN_Update(void) {
|
|
|
|
void DWIN_Update(void) {
|
|
|
|
/* status update */
|
|
|
|
EachMomentUpdate(); // Status update
|
|
|
|
EachMomentUpdate();
|
|
|
|
HMI_SDCardUpdate(); // SD card update
|
|
|
|
|
|
|
|
DWIN_HandleScreen(); // Rotary encoder update
|
|
|
|
/* sdcard update */
|
|
|
|
|
|
|
|
HMI_SDCardUpdate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* rotary encoder update */
|
|
|
|
|
|
|
|
DWIN_HandleScreen();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void EachMomentUpdate(void) {
|
|
|
|
void EachMomentUpdate(void) {
|
|
|
@ -3377,6 +3446,7 @@ void EachMomentUpdate(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
update_selection(encoder_diffState == ENCODER_DIFF_CCW);
|
|
|
|
update_selection(encoder_diffState == ENCODER_DIFF_CCW);
|
|
|
|
|
|
|
|
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|