Fix issues with no hotend / bed / fan (#18395)

This commit is contained in:
Scott Lahteine 2020-06-24 19:44:50 -05:00 committed by GitHub
parent b0aad414ec
commit 4275466f49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 732 additions and 585 deletions

View file

@ -541,7 +541,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 120: M120(); break; // M120: Enable endstops case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops case 121: M121(); break; // M121: Disable endstops
#if HAS_HOTEND && HAS_LCD_MENU #if PREHEAT_COUNT
case 145: M145(); break; // M145: Set material heatup parameters case 145: M145(); break; // M145: Set material heatup parameters
#endif #endif

View file

@ -608,7 +608,7 @@ private:
static void M191(); static void M191();
#endif #endif
#if HAS_HOTEND && HAS_LCD_MENU #if PREHEAT_COUNT
static void M145(); static void M145();
#endif #endif

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_HOTEND && HAS_LCD_MENU #if PREHEAT_COUNT
#include "../gcode.h" #include "../gcode.h"
#include "../../lcd/ultralcd.h" #include "../../lcd/ultralcd.h"
@ -37,25 +37,23 @@
*/ */
void GcodeSuite::M145() { void GcodeSuite::M145() {
const uint8_t material = (uint8_t)parser.intval('S'); const uint8_t material = (uint8_t)parser.intval('S');
if (material >= COUNT(ui.preheat_hotend_temp)) if (material >= PREHEAT_COUNT)
SERIAL_ERROR_MSG(STR_ERR_MATERIAL_INDEX); SERIAL_ERROR_MSG(STR_ERR_MATERIAL_INDEX);
else { else {
int v; preset_t &mat = ui.material_preset[material];
if (parser.seenval('H')) { #if HAS_HOTEND
v = parser.value_int(); if (parser.seenval('H'))
ui.preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT)); mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT));
} #endif
if (parser.seenval('F')) {
v = parser.value_int();
ui.preheat_fan_speed[material] = (uint8_t)constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
if (parser.seenval('B')) { if (parser.seenval('B'))
v = parser.value_int(); mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET);
ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAX_TARGET); #endif
} #if HAS_FAN
if (parser.seenval('F'))
mat.fan_speed = constrain(parser.value_int(), 0, 255);
#endif #endif
} }
} }
#endif // HOTENDS && HAS_LCD_MENU #endif // PREHEAT_COUNT

View file

@ -1859,6 +1859,10 @@
#define HAS_CONTROLLER_FAN 1 #define HAS_CONTROLLER_FAN 1
#endif #endif
#if BED_OR_CHAMBER || HAS_FAN0
#define BED_OR_CHAMBER_OR_FAN 1
#endif
// Servos // Servos
#if PIN_EXISTS(SERVO0) && NUM_SERVOS > 0 #if PIN_EXISTS(SERVO0) && NUM_SERVOS > 0
#define HAS_SERVO_0 1 #define HAS_SERVO_0 1
@ -2080,6 +2084,16 @@
#define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ HEATER_CHAMBER_INVERTING) #define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ HEATER_CHAMBER_INVERTING)
#endif #endif
#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
#define HAS_TEMPERATURE 1
#endif
#if HAS_TEMPERATURE && EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD)
#define PREHEAT_COUNT 2
#else
#undef PREHEAT_COUNT
#endif
/** /**
* Up to 3 PWM fans * Up to 3 PWM fans
*/ */

View file

@ -1404,12 +1404,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#if HAS_MESH #if HAS_MESH && HAS_CLASSIC_JERK
#if HAS_CLASSIC_JERK static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); #endif
#if ENABLED(G26_MESH_VALIDATION)
#if !EXTRUDERS
#error "G26_MESH_VALIDATION requires at least one extruder."
#elif !HAS_MESH
#error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif #endif
#elif ENABLED(G26_MESH_VALIDATION)
#error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
#endif #endif
#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_GRAPHICAL_LCD) #if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_GRAPHICAL_LCD)

View file

@ -860,8 +860,6 @@
#define STATUS_CHAMBER_WIDTH 0 #define STATUS_CHAMBER_WIDTH 0
#endif #endif
#define BED_OR_CHAMBER_OR_FAN (BED_OR_CHAMBER || HAS_FAN0)
// Can also be overridden in Configuration_adv.h // Can also be overridden in Configuration_adv.h
// If you can afford it, try the 3-frame fan animation! // If you can afford it, try the 3-frame fan animation!
// Don't compile in the fan animation with no fan // Don't compile in the fan animation with no fan

View file

@ -87,7 +87,7 @@ HMI_Flag HMI_flag{0};
millis_t Encoder_ms = 0; millis_t Encoder_ms = 0;
millis_t Wait_ms = 0; millis_t Wait_ms = 0;
millis_t heat_time = 0; millis_t dwin_heat_time = 0;
int checkkey = 0, last_checkkey = 0; int checkkey = 0, last_checkkey = 0;
@ -743,20 +743,24 @@ inline void Draw_Popup_Bkgd_60() {
DWIN_Draw_Rectangle(1, Background_window, 14, 60, 271-13, 330); DWIN_Draw_Rectangle(1, Background_window, 14, 60, 271-13, 330);
} }
void Popup_Window_ETempTooLow(void) { #if HAS_HOTEND
Clear_Main_Window();
Draw_Popup_Bkgd_60(); void Popup_Window_ETempTooLow(void) {
DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 105); Clear_Main_Window();
if (HMI_flag.language_flag) { Draw_Popup_Bkgd_60();
DWIN_Frame_AreaCopy(1, 103, 371, 136, 479-93, 69, 240); DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 105);
DWIN_Frame_AreaCopy(1, 170, 371, 271-1, 479-93, 69+33, 240); if (HMI_flag.language_flag) {
DWIN_ICON_Show(ICON, ICON_Confirm_C, 86, 280); DWIN_Frame_AreaCopy(1, 103, 371, 136, 479-93, 69, 240);
DWIN_Frame_AreaCopy(1, 170, 371, 271-1, 479-93, 69+33, 240);
DWIN_ICON_Show(ICON, ICON_Confirm_C, 86, 280);
}
else {
DWIN_Draw_String(false,true,font8x16, Font_window, Background_window, 20, 235, (char*)"Nozzle is too cold");
DWIN_ICON_Show(ICON, ICON_Confirm_E, 86, 280);
}
} }
else {
DWIN_Draw_String(false,true,font8x16, Font_window, Background_window, 20, 235, (char*)"Nozzle is too cold"); #endif
DWIN_ICON_Show(ICON, ICON_Confirm_E, 86, 280);
}
}
void Popup_Window_Resume(void) { void Popup_Window_Resume(void) {
Clear_Popup_Area(); Clear_Popup_Area();
@ -1074,134 +1078,146 @@ void HMI_Zoffset(void) {
} }
} }
void HMI_ETemp(void) { #if HAS_HOTEND
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
if (encoder_diffState != ENCODER_DIFF_NO) {
if (encoder_diffState == ENCODER_DIFF_CW)
HMI_ValueStruct.E_Temp += EncoderRate.encoderMoveValue;
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
checkkey = TemperatureID;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp);
}
else if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
HMI_ValueStruct.preheat_hotend_temp[0] = HMI_ValueStruct.E_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[0]);
return;
}
else if (HMI_ValueStruct.show_mode == -3) {
checkkey = ABSPreheat;
HMI_ValueStruct.preheat_hotend_temp[1] = HMI_ValueStruct.E_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[1]);
return;
}
else { // tune
checkkey = Tune;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2+MROWS-index_tune), HMI_ValueStruct.E_Temp);
}
thermalManager.setTargetHotend(HMI_ValueStruct.E_Temp, 0);
return;
}
// E_Temp limit
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);
else // other page
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp);
}
}
void HMI_BedTemp(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.Bed_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.Bed_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) { if (HMI_ValueStruct.show_mode == -1) { // temperature
checkkey = TemperatureID; checkkey = TemperatureID;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp);
} }
else if (HMI_ValueStruct.show_mode == -2) { else if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat; checkkey = PLAPreheat;
HMI_ValueStruct.preheat_bed_temp[0] = HMI_ValueStruct.Bed_Temp; ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[0]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp);
return;
}
else if (HMI_ValueStruct.show_mode == -3) {
checkkey = ABSPreheat;
ui.material_preset[1].hotend_temp = HMI_ValueStruct.E_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp);
return;
}
else { // tune
checkkey = Tune;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2+MROWS-index_tune), HMI_ValueStruct.E_Temp);
}
thermalManager.setTargetHotend(HMI_ValueStruct.E_Temp, 0);
return; return;
} }
else if (HMI_ValueStruct.show_mode == -3) { // E_Temp limit
checkkey = ABSPreheat; NOMORE(HMI_ValueStruct.E_Temp, max_E_Temp);
HMI_ValueStruct.preheat_bed_temp[1] = HMI_ValueStruct.Bed_Temp; NOLESS(HMI_ValueStruct.E_Temp, min_E_Temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[1]); // E_Temp value
return; 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);
else { else // other page
checkkey = Tune; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3+MROWS-index_tune), HMI_ValueStruct.Bed_Temp);
}
thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp);
return;
} }
//Bed_Temp limit
NOMORE(HMI_ValueStruct.Bed_Temp, max_Bed_Temp);
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);
else // other page
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp);
} }
}
void HMI_FanSpeed(void) { #endif
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
if (encoder_diffState != ENCODER_DIFF_NO) { #if HAS_HEATED_BED
if (encoder_diffState == ENCODER_DIFF_CW)
HMI_ValueStruct.Fan_speed += EncoderRate.encoderMoveValue; void HMI_BedTemp(void) {
else if (encoder_diffState == ENCODER_DIFF_CCW) ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
HMI_ValueStruct.Fan_speed -= EncoderRate.encoderMoveValue; if (encoder_diffState != ENCODER_DIFF_NO) {
else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return if (encoder_diffState == ENCODER_DIFF_CW)
EncoderRate.encoderRateEnabled = 0; HMI_ValueStruct.Bed_Temp += EncoderRate.encoderMoveValue;
if (HMI_ValueStruct.show_mode == -1) { else if (encoder_diffState == ENCODER_DIFF_CCW)
checkkey = TemperatureID; HMI_ValueStruct.Bed_Temp -= EncoderRate.encoderMoveValue;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed); else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return
} EncoderRate.encoderRateEnabled = 0;
else if (HMI_ValueStruct.show_mode == -2) { if (HMI_ValueStruct.show_mode == -1) {
checkkey = PLAPreheat; checkkey = TemperatureID;
HMI_ValueStruct.preheat_fan_speed[0] = HMI_ValueStruct.Fan_speed; DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[0]); }
else if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), ui.material_preset[0].bed_temp);
return;
}
else if (HMI_ValueStruct.show_mode == -3) {
checkkey = ABSPreheat;
ui.material_preset[1].bed_temp = HMI_ValueStruct.Bed_Temp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), ui.material_preset[1].bed_temp);
return;
}
else {
checkkey = Tune;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3+MROWS-index_tune), HMI_ValueStruct.Bed_Temp);
}
thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp);
return; return;
} }
else if (HMI_ValueStruct.show_mode == -3) { //Bed_Temp limit
checkkey = ABSPreheat; NOMORE(HMI_ValueStruct.Bed_Temp, max_Bed_Temp);
HMI_ValueStruct.preheat_fan_speed[1] = HMI_ValueStruct.Fan_speed; NOLESS(HMI_ValueStruct.Bed_Temp, min_Bed_Temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[1]); //Bed_Temp value
return; 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);
else { else // other page
checkkey = Tune; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(4+MROWS-index_tune), HMI_ValueStruct.Fan_speed);
}
thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed);
return;
} }
//Fan_speed limit
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);
else // other page
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed);
} }
}
#endif
#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)
HMI_ValueStruct.Fan_speed += EncoderRate.encoderMoveValue;
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) {
checkkey = TemperatureID;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed);
}
else if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
ui.material_preset[0].fan_speed = HMI_ValueStruct.Fan_speed;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), ui.material_preset[0].fan_speed);
return;
}
else if (HMI_ValueStruct.show_mode == -3) {
checkkey = ABSPreheat;
ui.material_preset[1].fan_speed = HMI_ValueStruct.Fan_speed;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed);
return;
}
else {
checkkey = Tune;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(4+MROWS-index_tune), HMI_ValueStruct.Fan_speed);
}
thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed);
return;
}
//Fan_speed limit
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);
else // other page
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed);
}
}
#endif
void HMI_PrintSpeed(void) { void HMI_PrintSpeed(void) {
ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze();
@ -1238,7 +1254,9 @@ void HMI_MaxFeedspeedXYZE(void) {
if (HMI_flag.feedspeed_flag == X_AXIS) planner.set_max_feedrate(X_AXIS, HMI_ValueStruct.Max_Feedspeed); if (HMI_flag.feedspeed_flag == X_AXIS) planner.set_max_feedrate(X_AXIS, HMI_ValueStruct.Max_Feedspeed);
else if (HMI_flag.feedspeed_flag == Y_AXIS) planner.set_max_feedrate(Y_AXIS, HMI_ValueStruct.Max_Feedspeed); else if (HMI_flag.feedspeed_flag == Y_AXIS) planner.set_max_feedrate(Y_AXIS, HMI_ValueStruct.Max_Feedspeed);
else if (HMI_flag.feedspeed_flag == Z_AXIS) planner.set_max_feedrate(Z_AXIS, HMI_ValueStruct.Max_Feedspeed); else if (HMI_flag.feedspeed_flag == Z_AXIS) planner.set_max_feedrate(Z_AXIS, HMI_ValueStruct.Max_Feedspeed);
else if (HMI_flag.feedspeed_flag == E_AXIS) planner.set_max_feedrate(E_AXIS, HMI_ValueStruct.Max_Feedspeed); #if HAS_HOTEND
else if (HMI_flag.feedspeed_flag == E_AXIS) planner.set_max_feedrate(E_AXIS, HMI_ValueStruct.Max_Feedspeed);
#endif
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed);
return; return;
} }
@ -1246,7 +1264,9 @@ void HMI_MaxFeedspeedXYZE(void) {
if (HMI_flag.feedspeed_flag == X_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[X_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[X_AXIS]*2;} if (HMI_flag.feedspeed_flag == X_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[X_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[X_AXIS]*2;}
else if (HMI_flag.feedspeed_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Y_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Y_AXIS]*2;} else if (HMI_flag.feedspeed_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Y_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Y_AXIS]*2;}
else if (HMI_flag.feedspeed_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Z_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Z_AXIS]*2;} else if (HMI_flag.feedspeed_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Z_AXIS]*2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Z_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;} #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 //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);
@ -1264,7 +1284,9 @@ void HMI_MaxAccelerationXYZE(void) {
if (HMI_flag.acc_flag == X_AXIS) planner.set_max_acceleration(X_AXIS, HMI_ValueStruct.Max_Acceleration); if (HMI_flag.acc_flag == X_AXIS) planner.set_max_acceleration(X_AXIS, HMI_ValueStruct.Max_Acceleration);
else if (HMI_flag.acc_flag == Y_AXIS) planner.set_max_acceleration(Y_AXIS, HMI_ValueStruct.Max_Acceleration); else if (HMI_flag.acc_flag == Y_AXIS) planner.set_max_acceleration(Y_AXIS, HMI_ValueStruct.Max_Acceleration);
else if (HMI_flag.acc_flag == Z_AXIS) planner.set_max_acceleration(Z_AXIS, HMI_ValueStruct.Max_Acceleration); else if (HMI_flag.acc_flag == Z_AXIS) planner.set_max_acceleration(Z_AXIS, HMI_ValueStruct.Max_Acceleration);
else if (HMI_flag.acc_flag == E_AXIS) planner.set_max_acceleration(E_AXIS, HMI_ValueStruct.Max_Acceleration); #if HAS_HOTEND
else if (HMI_flag.acc_flag == E_AXIS) planner.set_max_acceleration(E_AXIS, HMI_ValueStruct.Max_Acceleration);
#endif
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration);
return; return;
} }
@ -1272,7 +1294,9 @@ void HMI_MaxAccelerationXYZE(void) {
if (HMI_flag.acc_flag == X_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[X_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[X_AXIS]*2;} if (HMI_flag.acc_flag == X_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[X_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[X_AXIS]*2;}
else if (HMI_flag.acc_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Y_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Y_AXIS]*2;} else if (HMI_flag.acc_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Y_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Y_AXIS]*2;}
else if (HMI_flag.acc_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Z_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Z_AXIS]*2;} else if (HMI_flag.acc_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Z_AXIS]*2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Z_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;} #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 // 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);
@ -2105,14 +2129,14 @@ void HMI_Prepare(void) {
#endif #endif
break; break;
case 5: // PLA preheat case 5: // PLA preheat
thermalManager.setTargetHotend(HMI_ValueStruct.preheat_hotend_temp[0], 0); thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0);
thermalManager.setTargetBed(HMI_ValueStruct.preheat_bed_temp[0]); thermalManager.setTargetBed(ui.material_preset[0].bed_temp);
thermalManager.set_fan_speed(0, HMI_ValueStruct.preheat_fan_speed[0]); thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed);
break; break;
case 6: // ABS preheat case 6: // ABS preheat
thermalManager.setTargetHotend(HMI_ValueStruct.preheat_hotend_temp[1], 0); thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0);
thermalManager.setTargetBed(HMI_ValueStruct.preheat_bed_temp[1]); thermalManager.setTargetBed(ui.material_preset[1].bed_temp);
thermalManager.set_fan_speed(0, HMI_ValueStruct.preheat_fan_speed[1]); thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed);
break; break;
case 7: // cool case 7: // cool
thermalManager.zero_fan_speeds(); thermalManager.zero_fan_speeds();
@ -2287,20 +2311,23 @@ void HMI_AxisMove(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;
// popup window resume #if HAS_HOTEND
if (HMI_flag.ETempTooLow_flag) { // popup window resume
if (encoder_diffState == ENCODER_DIFF_ENTER) { if (HMI_flag.ETempTooLow_flag) {
HMI_flag.ETempTooLow_flag = 0; if (encoder_diffState == ENCODER_DIFF_ENTER) {
Draw_Move_Menu(); HMI_flag.ETempTooLow_flag = 0;
current_position.e = HMI_ValueStruct.Move_E_scale = 0; Draw_Move_Menu();
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); current_position.e = HMI_ValueStruct.Move_E_scale = 0;
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale);
DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale); DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale);
show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); DWIN_Draw_FloatValue(true,true,0,font8x16,White,Background_black, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale);
DWIN_UpdateLCD(); show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
DWIN_UpdateLCD();
}
return;
} }
return; #endif
}
// Avoid flicker by updating only the previous menu // Avoid flicker by updating only the previous menu
if (encoder_diffState == ENCODER_DIFF_CW) { if (encoder_diffState == ENCODER_DIFF_CW) {
if (select_axis.inc(4)) Move_Highlight(1, select_axis.now); if (select_axis.inc(4)) Move_Highlight(1, select_axis.now);
@ -2334,28 +2361,30 @@ void HMI_AxisMove(void) {
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;
case 4: // Extruder #if HAS_HOTEND
// window tips case 4: // Extruder
#ifdef PREVENT_COLD_EXTRUSION // window tips
if (thermalManager.temp_hotend[0].celsius < EXTRUDE_MINTEMP) { #ifdef PREVENT_COLD_EXTRUSION
HMI_flag.ETempTooLow_flag = 1; if (thermalManager.temp_hotend[0].celsius < EXTRUDE_MINTEMP) {
Popup_Window_ETempTooLow(); HMI_flag.ETempTooLow_flag = 1;
DWIN_UpdateLCD(); Popup_Window_ETempTooLow();
return; DWIN_UpdateLCD();
} return;
#endif }
checkkey = Extruder; #endif
HMI_ValueStruct.Move_E_scale = current_position.e*MinUnitMult; checkkey = Extruder;
show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); HMI_ValueStruct.Move_E_scale = current_position.e*MinUnitMult;
EncoderRate.encoderRateEnabled = 1; show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale);
break; EncoderRate.encoderRateEnabled = 1;
default: break;
break; #endif
} }
} }
DWIN_UpdateLCD(); DWIN_UpdateLCD();
} }
enum
/* TemperatureID */ /* TemperatureID */
void HMI_Temperature(void) { void HMI_Temperature(void) {
ENCODER_DiffState encoder_diffState = get_encoder_state(); ENCODER_DiffState encoder_diffState = get_encoder_state();
@ -2376,126 +2405,132 @@ void HMI_Temperature(void) {
index_control = MROWS; index_control = MROWS;
Draw_Control_Menu(); Draw_Control_Menu();
break; break;
case 1: // nozzle temperature #if HAS_HOTEND
checkkey = ETemp; case 1: // nozzle temperature
HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target; checkkey = ETemp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target); HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target;
EncoderRate.encoderRateEnabled = 1; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target);
break; EncoderRate.encoderRateEnabled = 1;
case 2: // bed temperature break;
checkkey = BedTemp; #endif
HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target; #if HAS_HEATED_BED
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), thermalManager.temp_bed.target); case 2: // bed temperature
EncoderRate.encoderRateEnabled = 1; checkkey = BedTemp;
break; HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target;
case 3: // fan speed DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), thermalManager.temp_bed.target);
checkkey = FanSpeed; EncoderRate.encoderRateEnabled = 1;
HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0]; break;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), thermalManager.fan_speed[0]); #endif
EncoderRate.encoderRateEnabled = 1; #if HAS_FAN
break; case 3: // fan speed
case 4: // PLA preheat setting checkkey = FanSpeed;
HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0];
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), thermalManager.fan_speed[0]);
EncoderRate.encoderRateEnabled = 1;
break;
#endif
#if HAS_HOTEND
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;
Clear_Main_Window(); Clear_Main_Window();
if (HMI_flag.language_flag) { if (HMI_flag.language_flag) {
DWIN_Frame_AreaCopy(1, 59, 16, 271-132, 479-450, 14, 8); DWIN_Frame_AreaCopy(1, 59, 16, 271-132, 479-450, 14, 8);
DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(1)); DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(1));
DWIN_Frame_AreaCopy(1, 1, 134, 271-215, 479-333, LBLX+24, MBASE(1)); // PLA nozzle temp DWIN_Frame_AreaCopy(1, 1, 134, 271-215, 479-333, LBLX+24, MBASE(1)); // PLA nozzle temp
DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(2)); DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(2));
DWIN_Frame_AreaCopy(1, 58, 134, 271-158, 479-333, LBLX+24, MBASE(2)); // PLA bed temp DWIN_Frame_AreaCopy(1, 58, 134, 271-158, 479-333, LBLX+24, MBASE(2)); // PLA bed temp
DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(3)); DWIN_Frame_AreaCopy(1, 100, 89, 124, 479-378, LBLX, MBASE(3));
DWIN_Frame_AreaCopy(1, 115, 134, 271-101, 479-333, LBLX+24, MBASE(3)); // PLA fan speed DWIN_Frame_AreaCopy(1, 115, 134, 271-101, 479-333, LBLX+24, MBASE(3)); // PLA fan speed
DWIN_Frame_AreaCopy(1, 72, 148, 271-120, 479-317, LBLX, MBASE(4)); // save PLA configuration DWIN_Frame_AreaCopy(1, 72, 148, 271-120, 479-317, LBLX, MBASE(4)); // save PLA configuration
} }
else { else {
#ifdef USE_STRING_HEADINGS #ifdef USE_STRING_HEADINGS
Draw_Title("PLA Settings"); // TODO: GET_TEXT_F Draw_Title("PLA Settings"); // TODO: GET_TEXT_F
#else #else
DWIN_Frame_AreaCopy(1, 56, 16, 271-130, 479-450-1, 14, 8); DWIN_Frame_AreaCopy(1, 56, 16, 271-130, 479-450-1, 14, 8);
#endif #endif
DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(1)); DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(1));
DWIN_Frame_AreaCopy(1, 197, 104, 271-33, 479-365, LBLX+24+3, MBASE(1)); DWIN_Frame_AreaCopy(1, 197, 104, 271-33, 479-365, LBLX+24+3, MBASE(1));
DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+41+6, MBASE(1)); // PLA nozzle temp DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+41+6, MBASE(1)); // PLA nozzle temp
DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(2)+3); DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(2)+3);
DWIN_Frame_AreaCopy(1, 240, 104, 271-7, 479-365, LBLX+24+3, MBASE(2)+3); DWIN_Frame_AreaCopy(1, 240, 104, 271-7, 479-365, LBLX+24+3, MBASE(2)+3);
DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+24+6, MBASE(2)+3); // PLA bed temp DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+24+6, MBASE(2)+3); // PLA bed temp
DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(3)); DWIN_Frame_AreaCopy(1, 157, 76, 181, 479-393, LBLX, MBASE(3));
DWIN_Frame_AreaCopy(1, 0, 119, 271-207, 479-347, LBLX+24+3, MBASE(3)); // PLA fan speed DWIN_Frame_AreaCopy(1, 0, 119, 271-207, 479-347, LBLX+24+3, MBASE(3)); // PLA fan speed
DWIN_Frame_AreaCopy(1, 97, 165, 271-42, 479-301-1, LBLX, MBASE(4)); // save PLA configuration DWIN_Frame_AreaCopy(1, 97, 165, 271-42, 479-301-1, LBLX, MBASE(4)); // save PLA configuration
} }
Draw_Back_First(); Draw_Back_First();
Draw_Menu_Line(1, ICON_SetEndTemp); Draw_Menu_Line(1, ICON_SetEndTemp);
Draw_Menu_Line(2, ICON_SetBedTemp); Draw_Menu_Line(2, ICON_SetBedTemp);
Draw_Menu_Line(3, ICON_FanSpeed); Draw_Menu_Line(3, ICON_FanSpeed);
Draw_Menu_Line(4, ICON_WriteEEPROM); Draw_Menu_Line(4, ICON_WriteEEPROM);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[0]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[0]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), ui.material_preset[0].bed_temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[0]); 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;
Clear_Main_Window(); Clear_Main_Window();
if (HMI_flag.language_flag) { if (HMI_flag.language_flag) {
DWIN_Frame_AreaCopy(1, 142, 16, 271-48, 479-450, 14, 8); DWIN_Frame_AreaCopy(1, 142, 16, 271-48, 479-450, 14, 8);
DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(1)); DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(1));
DWIN_Frame_AreaCopy(1, 1, 134, 271-215, 479-333, LBLX+24, MBASE(1)); // ABS nozzle temp DWIN_Frame_AreaCopy(1, 1, 134, 271-215, 479-333, LBLX+24, MBASE(1)); // ABS nozzle temp
DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(2)); DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(2));
DWIN_Frame_AreaCopy(1, 58, 134, 271-158, 479-333, LBLX+24, MBASE(2)); // ABS bed temp DWIN_Frame_AreaCopy(1, 58, 134, 271-158, 479-333, LBLX+24, MBASE(2)); // ABS bed temp
DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(3)); DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX, MBASE(3));
DWIN_Frame_AreaCopy(1, 115, 134, 271-101, 479-333, LBLX+24, MBASE(3)); // ABS fan speed DWIN_Frame_AreaCopy(1, 115, 134, 271-101, 479-333, LBLX+24, MBASE(3)); // ABS fan speed
DWIN_Frame_AreaCopy(1, 72, 148, 271-120, 479-317, LBLX, MBASE(4)); DWIN_Frame_AreaCopy(1, 72, 148, 271-120, 479-317, LBLX, MBASE(4));
DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX+28, MBASE(4)+2); // save ABS configuration DWIN_Frame_AreaCopy(1, 180, 89, 204, 479-379, LBLX+28, MBASE(4)+2); // save ABS configuration
} }
else { else {
#ifdef USE_STRING_HEADINGS #ifdef USE_STRING_HEADINGS
Draw_Title("ABS Settings"); // TODO: GET_TEXT_F Draw_Title("ABS Settings"); // TODO: GET_TEXT_F
#else #else
DWIN_Frame_AreaCopy(1, 56, 16, 271-130, 479-450-1, 14, 8); DWIN_Frame_AreaCopy(1, 56, 16, 271-130, 479-450-1, 14, 8);
#endif #endif
DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(1)); DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(1));
DWIN_Frame_AreaCopy(1, 197, 104, 271-33, 479-365, LBLX+24+3, MBASE(1)); DWIN_Frame_AreaCopy(1, 197, 104, 271-33, 479-365, LBLX+24+3, MBASE(1));
DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+41+6, MBASE(1)); // ABS nozzle temp DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+41+6, MBASE(1)); // ABS nozzle temp
DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(2)+3); DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(2)+3);
DWIN_Frame_AreaCopy(1, 240, 104, 271-7, 479-365, LBLX+24+3, MBASE(2)+3); DWIN_Frame_AreaCopy(1, 240, 104, 271-7, 479-365, LBLX+24+3, MBASE(2)+3);
DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+24+6, MBASE(2)+3); // ABS bed temp DWIN_Frame_AreaCopy(1, 1, 89, 271-188, 479-377-1, LBLX+24+24+6, MBASE(2)+3); // ABS bed temp
DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(3)); DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX, MBASE(3));
DWIN_Frame_AreaCopy(1, 0, 119, 271-207, 479-347, LBLX+24+3, MBASE(3)); // ABS fan speed DWIN_Frame_AreaCopy(1, 0, 119, 271-207, 479-347, LBLX+24+3, MBASE(3)); // ABS fan speed
DWIN_Frame_AreaCopy(1, 97, 165, 271-42, 479-301-1, LBLX, MBASE(4)); DWIN_Frame_AreaCopy(1, 97, 165, 271-42, 479-301-1, LBLX, MBASE(4));
DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX+33, MBASE(4)); // save ABS configuration DWIN_Frame_AreaCopy(1, 172, 76, 198, 479-393, LBLX+33, MBASE(4)); // save ABS configuration
} }
Draw_Back_First(); Draw_Back_First();
Draw_Menu_Line(1, ICON_SetEndTemp); Draw_Menu_Line(1, ICON_SetEndTemp);
Draw_Menu_Line(2, ICON_SetBedTemp); Draw_Menu_Line(2, ICON_SetBedTemp);
Draw_Menu_Line(3, ICON_FanSpeed); Draw_Menu_Line(3, ICON_FanSpeed);
Draw_Menu_Line(4, ICON_WriteEEPROM); Draw_Menu_Line(4, ICON_WriteEEPROM);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[1]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[1]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(2), ui.material_preset[1].bed_temp);
DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[1]); DWIN_Draw_IntValue(true,true,0,font8x16,White,Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed);
break; break;
default: #endif
break;
} }
} }
DWIN_UpdateLCD(); DWIN_UpdateLCD();
@ -2792,24 +2827,30 @@ void HMI_Tune(void) {
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;
case 2: // nozzle temp #if HAS_HOTEND
checkkey = ETemp; case 2: // nozzle temp
HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target; checkkey = ETemp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2+MROWS-index_tune), thermalManager.temp_hotend[0].target); HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target;
EncoderRate.encoderRateEnabled = 1; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2+MROWS-index_tune), thermalManager.temp_hotend[0].target);
break; EncoderRate.encoderRateEnabled = 1;
case 3: // bed temp break;
checkkey = BedTemp; #endif
HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target; #if HAS_HEATED_BED
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3+MROWS-index_tune), thermalManager.temp_bed.target); case 3: // bed temp
EncoderRate.encoderRateEnabled = 1; checkkey = BedTemp;
break; HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target;
case 4: // fan speed DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3+MROWS-index_tune), thermalManager.temp_bed.target);
checkkey = FanSpeed; EncoderRate.encoderRateEnabled = 1;
HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0]; break;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(4+MROWS-index_tune), thermalManager.fan_speed[0]); #endif
EncoderRate.encoderRateEnabled = 1; #if HAS_FAN
break; 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; checkkey = Homeoffset;
HMI_ValueStruct.offset_value = BABY_Z_VAR * 100; HMI_ValueStruct.offset_value = BABY_Z_VAR * 100;
@ -2860,24 +2901,30 @@ void HMI_PLAPreheatSetting(void) {
HMI_ValueStruct.show_mode = -1; HMI_ValueStruct.show_mode = -1;
Draw_Temperature_Menu(); Draw_Temperature_Menu();
break; break;
case 1: // set nozzle temperature #if HAS_HOTEND
checkkey = ETemp; case 1: // set nozzle temperature
HMI_ValueStruct.E_Temp = HMI_ValueStruct.preheat_hotend_temp[0]; checkkey = ETemp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[0]); HMI_ValueStruct.E_Temp = ui.material_preset[0].hotend_temp;
EncoderRate.encoderRateEnabled = 1; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp);
break; EncoderRate.encoderRateEnabled = 1;
case 2: // set bed temperature break;
checkkey = BedTemp; #endif
HMI_ValueStruct.Bed_Temp = HMI_ValueStruct.preheat_bed_temp[0]; #if HAS_HEATED_BED
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[0]); case 2: // set bed temperature
EncoderRate.encoderRateEnabled = 1; checkkey = BedTemp;
break; HMI_ValueStruct.Bed_Temp = ui.material_preset[0].bed_temp;
case 3: // set fan speed DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), ui.material_preset[0].bed_temp);
checkkey = FanSpeed; EncoderRate.encoderRateEnabled = 1;
HMI_ValueStruct.Fan_speed = HMI_ValueStruct.preheat_fan_speed[0]; break;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[0]); #endif
EncoderRate.encoderRateEnabled = 1; #if HAS_FAN
break; case 3: // set fan speed
checkkey = FanSpeed;
HMI_ValueStruct.Fan_speed = ui.material_preset[0].fan_speed;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), ui.material_preset[0].fan_speed);
EncoderRate.encoderRateEnabled = 1;
break;
#endif
case 4: // save PLA configuration case 4: // save PLA configuration
if (settings.save()) { if (settings.save()) {
buzzer.tone(100, 659); buzzer.tone(100, 659);
@ -2885,8 +2932,7 @@ void HMI_PLAPreheatSetting(void) {
} }
else buzzer.tone(20, 440); else buzzer.tone(20, 440);
break; break;
default: default: break;
break;
} }
} }
DWIN_UpdateLCD(); DWIN_UpdateLCD();
@ -2912,24 +2958,30 @@ void HMI_ABSPreheatSetting(void) {
HMI_ValueStruct.show_mode = -1; HMI_ValueStruct.show_mode = -1;
Draw_Temperature_Menu(); Draw_Temperature_Menu();
break; break;
case 1: // set nozzle temperature #if HAS_HOTEND
checkkey = ETemp; case 1: // set nozzle temperature
HMI_ValueStruct.E_Temp = HMI_ValueStruct.preheat_hotend_temp[1]; checkkey = ETemp;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), HMI_ValueStruct.preheat_hotend_temp[1]); HMI_ValueStruct.E_Temp = ui.material_preset[1].hotend_temp;
EncoderRate.encoderRateEnabled = 1; DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp);
break; EncoderRate.encoderRateEnabled = 1;
case 2: // set bed temperature break;
checkkey = BedTemp; #endif
HMI_ValueStruct.Bed_Temp = HMI_ValueStruct.preheat_bed_temp[1]; #if HAS_HEATED_BED
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), HMI_ValueStruct.preheat_bed_temp[1]); case 2: // set bed temperature
EncoderRate.encoderRateEnabled = 1; checkkey = BedTemp;
break; HMI_ValueStruct.Bed_Temp = ui.material_preset[1].bed_temp;
case 3: // set fan speed DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(2), ui.material_preset[1].bed_temp);
checkkey = FanSpeed; EncoderRate.encoderRateEnabled = 1;
HMI_ValueStruct.Fan_speed = HMI_ValueStruct.preheat_fan_speed[1]; break;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), HMI_ValueStruct.preheat_fan_speed[1]); #endif
EncoderRate.encoderRateEnabled = 1; #if HAS_FAN
break; case 3: // set fan speed
checkkey = FanSpeed;
HMI_ValueStruct.Fan_speed = ui.material_preset[1].fan_speed;
DWIN_Draw_IntValue(true,true,0,font8x16,White,Select_Color, 3, 216, MBASE(3), ui.material_preset[1].fan_speed);
EncoderRate.encoderRateEnabled = 1;
break;
#endif
case 4: // save PLA configuration case 4: // save PLA configuration
if (settings.save()) { if (settings.save()) {
buzzer.tone(100, 659); buzzer.tone(100, 659);
@ -3257,7 +3309,7 @@ void EachMomentUpdate(void) {
/* remain print time */ /* remain print time */
static millis_t next_remain_time_update = 0; static millis_t next_remain_time_update = 0;
if (elapsed.minute() > 5 && ELAPSED(ms, next_remain_time_update) && HMI_flag.heat_flag == 0) { // show after 5 min and 20s update if (elapsed.minute() > 5 && ELAPSED(ms, next_remain_time_update) && HMI_flag.heat_flag == 0) { // show after 5 min and 20s update
remain_time = ((elapsed.value - heat_time) * ((float)card.getFileSize() / (float)card.getIndex())) - (elapsed.value - heat_time); remain_time = ((elapsed.value - dwin_heat_time) * ((float)card.getFileSize() / (float)card.getIndex())) - (elapsed.value - dwin_heat_time);
next_remain_time_update += 20 * 1000UL; next_remain_time_update += 20 * 1000UL;
Draw_Print_ProgressRemain(); Draw_Print_ProgressRemain();
} }
@ -3365,9 +3417,15 @@ void DWIN_HandleScreen(void) {
case Move_Z: HMI_Move_Z(); break; case Move_Z: HMI_Move_Z(); break;
case Extruder: HMI_Move_E(); break; case Extruder: HMI_Move_E(); break;
case Homeoffset: HMI_Zoffset(); break; case Homeoffset: HMI_Zoffset(); break;
case ETemp: HMI_ETemp(); break; #if HAS_HOTEND
case BedTemp: HMI_BedTemp(); break; case ETemp: HMI_ETemp(); break;
case FanSpeed: HMI_FanSpeed(); break; #endif
#if HAS_HEATED_BED
case BedTemp: HMI_BedTemp(); break;
#endif
#if HAS_FAN
case FanSpeed: HMI_FanSpeed(); break;
#endif
case PrintSpeed: HMI_PrintSpeed(); break; case PrintSpeed: HMI_PrintSpeed(); break;
case MaxSpeed_value: HMI_MaxFeedspeedXYZE(); break; case MaxSpeed_value: HMI_MaxFeedspeedXYZE(); break;
case MaxAcceleration_value: HMI_MaxAccelerationXYZE(); break; case MaxAcceleration_value: HMI_MaxAccelerationXYZE(); break;

View file

@ -81,8 +81,10 @@ enum processID {
Motion, Motion,
Info, Info,
Tune, Tune,
PLAPreheat, #if HAS_HOTEND
ABSPreheat, PLAPreheat,
ABSPreheat,
#endif
MaxSpeed, MaxSpeed,
MaxSpeed_value, MaxSpeed_value,
MaxAcceleration, MaxAcceleration,
@ -105,9 +107,15 @@ enum processID {
Move_Z, Move_Z,
Extruder, Extruder,
Homeoffset, Homeoffset,
ETemp, #if HAS_HOTEND
BedTemp, ETemp,
FanSpeed, #endif
#if HAS_HEATED_BED
BedTemp,
#endif
#if HAS_FAN
FanSpeed,
#endif
PrintSpeed, PrintSpeed,
/*Window ID*/ /*Window ID*/
@ -251,26 +259,31 @@ extern int checkkey, last_checkkey;
extern float zprobe_zoffset; extern float zprobe_zoffset;
extern char print_filename[16]; extern char print_filename[16];
extern millis_t heat_time; extern millis_t dwin_heat_time;
typedef struct { typedef struct {
int16_t E_Temp = 0; #if HAS_HOTEND
int16_t Bed_Temp = 0; int16_t E_Temp = 0;
int16_t Fan_speed = 0; #endif
#if HAS_HEATED_BED
int16_t Bed_Temp = 0;
#endif
#if HAS_FAN
int16_t Fan_speed = 0;
#endif
int16_t print_speed = 100; int16_t print_speed = 100;
float Max_Feedspeed = 0; float Max_Feedspeed = 0;
float Max_Acceleration = 0; float Max_Acceleration = 0;
float Max_Corner = 0; float Max_Corner = 0;
float Max_Step = 0; float Max_Step = 0;
float Move_X_scale = 0; float Move_X_scale = 0;
float Move_Y_scale = 0; float Move_Y_scale = 0;
float Move_Z_scale = 0; float Move_Z_scale = 0;
float Move_E_scale = 0; #if EXTRUDERS
float offset_value = 0; float Move_E_scale = 0;
char show_mode = 0; // -1: Temperature control 0: Printing temperature #endif
int16_t preheat_hotend_temp[2]; float offset_value = 0;
int16_t preheat_bed_temp[2]; char show_mode = 0; // -1: Temperature control 0: Printing temperature
uint8_t preheat_fan_speed[2];
} HMI_value_t; } HMI_value_t;
typedef struct { typedef struct {
@ -281,9 +294,15 @@ typedef struct {
bool select_flag:1; bool select_flag:1;
bool home_flag:1; bool home_flag:1;
bool heat_flag:1; // 0: heating done 1: during heating bool heat_flag:1; // 0: heating done 1: during heating
bool ETempTooLow_flag:1; #if HAS_HOTEND
bool leveling_offset_flag:1; bool ETempTooLow_flag:1;
char feedspeed_flag; #endif
#if HAS_LEVELING
bool leveling_offset_flag:1;
#endif
#if HAS_FAN
char feedspeed_flag;
#endif
char acc_flag; char acc_flag;
char corner_flag; char corner_flag;
char step_flag; char step_flag;
@ -310,8 +329,11 @@ void ICON_Continue(bool show);
void ICON_Stop(bool show); void ICON_Stop(bool show);
/* Popup window tips */ /* Popup window tips */
void Popup_Window_Temperature(const bool toohigh); #if HAS_HOTEND
void Popup_Window_ETempTooLow(void); void Popup_Window_Temperature(const bool toohigh);
void Popup_Window_ETempTooLow(void);
#endif
void Popup_Window_Resume(void); void Popup_Window_Resume(void);
void Popup_Window_Home(void); void Popup_Window_Home(void);
void Popup_Window_Leveling(void); void Popup_Window_Leveling(void);
@ -326,9 +348,16 @@ void HMI_Move_Z(void);
void HMI_Move_E(void); void HMI_Move_E(void);
void HMI_Zoffset(void); void HMI_Zoffset(void);
void HMI_ETemp(void);
void HMI_BedTemp(void); #if HAS_HOTEND
void HMI_FanSpeed(void); void HMI_ETemp(void);
#endif
#if HAS_HEATED_BED
void HMI_BedTemp(void);
#endif
#if HAS_FAN
void HMI_FanSpeed(void);
#endif
void HMI_PrintSpeed(void); void HMI_PrintSpeed(void);
void HMI_MaxFeedspeedXYZE(void); void HMI_MaxFeedspeedXYZE(void);
@ -363,8 +392,12 @@ void HMI_Temperature(void); // 温度菜单
void HMI_Motion(void); // 运动菜单 void HMI_Motion(void); // 运动菜单
void HMI_Info(void); // 信息菜单 void HMI_Info(void); // 信息菜单
void HMI_Tune(void); // 调整菜单 void HMI_Tune(void); // 调整菜单
void HMI_PLAPreheatSetting(void); // PLA预热设置
void HMI_ABSPreheatSetting(void); // ABS预热设置 #if HAS_HOTEND
void HMI_PLAPreheatSetting(void); // PLA预热设置
void HMI_ABSPreheatSetting(void); // ABS预热设置
#endif
void HMI_MaxSpeed(void); // 最大速度子菜单 void HMI_MaxSpeed(void); // 最大速度子菜单
void HMI_MaxAcceleration(void); // 最大加速度子菜单 void HMI_MaxAcceleration(void); // 最大加速度子菜单
void HMI_MaxCorner(void); // 最大拐角速度子菜单 void HMI_MaxCorner(void); // 最大拐角速度子菜单

View file

@ -298,7 +298,7 @@ void menu_advanced_settings();
#endif #endif
#if DISABLED(SLIM_LCD_MENUS) #if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
void _menu_configuration_preheat_settings(const uint8_t material) { void _menu_configuration_preheat_settings(const uint8_t material) {
#define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP, #define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP,
@ -307,12 +307,12 @@ void menu_advanced_settings();
#define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0) #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
START_MENU(); START_MENU();
BACK_ITEM(MSG_CONFIGURATION); BACK_ITEM(MSG_CONFIGURATION);
EDIT_ITEM(percent, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); EDIT_ITEM(percent, MSG_FAN_SPEED, &ui.material_preset[material].fan_speed, 0, 255);
#if HAS_TEMP_HOTEND #if HAS_TEMP_HOTEND
EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - HOTEND_OVERSHOOT); EDIT_ITEM(int3, MSG_NOZZLE, &ui.material_preset[material].hotend_temp, MINTEMP_ALL, MAXTEMP_ALL - HOTEND_OVERSHOOT);
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAX_TARGET); EDIT_ITEM(int3, MSG_BED, &ui.material_preset[material].bed_temp, BED_MINTEMP, BED_MAX_TARGET);
#endif #endif
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
@ -322,6 +322,15 @@ void menu_advanced_settings();
void menu_preheat_material1_settings() { _menu_configuration_preheat_settings(0); } void menu_preheat_material1_settings() { _menu_configuration_preheat_settings(0); }
void menu_preheat_material2_settings() { _menu_configuration_preheat_settings(1); } void menu_preheat_material2_settings() { _menu_configuration_preheat_settings(1); }
#if PREHEAT_COUNT >= 3
void menu_preheat_material3_settings() { _menu_configuration_preheat_settings(3); }
#if PREHEAT_COUNT >= 4
void menu_preheat_material4_settings() { _menu_configuration_preheat_settings(4); }
#if PREHEAT_COUNT >= 5
void menu_preheat_material5_settings() { _menu_configuration_preheat_settings(5); }
#endif
#endif
#endif
#endif #endif
@ -400,10 +409,19 @@ void menu_configuration() {
EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed);
#endif #endif
#if DISABLED(SLIM_LCD_MENUS) // Preheat configurations
// Preheat configurations #if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS)
SUBMENU(MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings); SUBMENU(MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings);
SUBMENU(MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings); SUBMENU(MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings);
#if PREHEAT_COUNT >= 3
SUBMENU(MSG_PREHEAT_3_SETTINGS, menu_preheat_material3_settings);
#if PREHEAT_COUNT >= 4
SUBMENU(MSG_PREHEAT_4_SETTINGS, menu_preheat_material4_settings);
#if PREHEAT_COUNT >= 5
SUBMENU(MSG_PREHEAT_5_SETTINGS, menu_preheat_material5_settings);
#endif
#endif
#endif
#endif #endif
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)

View file

@ -81,8 +81,8 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
START_MENU(); START_MENU();
if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT); if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT);
BACK_ITEM(MSG_BACK); BACK_ITEM(MSG_BACK);
ACTION_ITEM(MSG_PREHEAT_1, []{ _change_filament(ui.preheat_hotend_temp[0]); }); ACTION_ITEM(MSG_PREHEAT_1, []{ _change_filament(ui.material_preset[0].hotend_temp); });
ACTION_ITEM(MSG_PREHEAT_2, []{ _change_filament(ui.preheat_hotend_temp[1]); }); ACTION_ITEM(MSG_PREHEAT_2, []{ _change_filament(ui.material_preset[1].hotend_temp); });
EDIT_ITEM_FAST(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, []{ EDIT_ITEM_FAST(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, []{
_change_filament(thermalManager.temp_hotend[_change_filament_extruder].target); _change_filament(thermalManager.temp_hotend[_change_filament_extruder].target);
}); });

View file

@ -243,7 +243,7 @@ void menu_info_board() {
STATIC_ITEM_P(PSTR(MACHINE_NAME)); // My3DPrinter STATIC_ITEM_P(PSTR(MACHINE_NAME)); // My3DPrinter
STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com
VALUE_ITEM_P(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2 VALUE_ITEM_P(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2
#if HAS_BED_LEVELING #if HAS_LEVELING
STATIC_ITEM( STATIC_ITEM(
TERN_(AUTO_BED_LEVELING_3POINT, MSG_3POINT_LEVELING) // 3-Point Leveling TERN_(AUTO_BED_LEVELING_3POINT, MSG_3POINT_LEVELING) // 3-Point Leveling
TERN_(AUTO_BED_LEVELING_LINEAR, MSG_LINEAR_LEVELING) // Linear Leveling TERN_(AUTO_BED_LEVELING_LINEAR, MSG_LINEAR_LEVELING) // Linear Leveling

View file

@ -157,7 +157,9 @@ void menu_main() {
SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser); SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser);
#endif #endif
SUBMENU(MSG_TEMPERATURE, menu_temperature); #if HAS_TEMPERATURE
SUBMENU(MSG_TEMPERATURE, menu_temperature);
#endif
#if HAS_POWER_MONITOR #if HAS_POWER_MONITOR
MENU_ITEM(submenu, MSG_POWER_MONITOR, menu_power_monitor); MENU_ITEM(submenu, MSG_POWER_MONITOR, menu_power_monitor);

View file

@ -24,9 +24,9 @@
// Temperature Menu // Temperature Menu
// //
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfig.h"
#if HAS_LCD_MENU #if HAS_LCD_MENU && HAS_TEMPERATURE
#include "menu.h" #include "menu.h"
#include "../../module/temperature.h" #include "../../module/temperature.h"
@ -39,23 +39,19 @@
#include "../../module/tool_change.h" #include "../../module/tool_change.h"
#endif #endif
// Initialized by settings.load()
int16_t MarlinUI::preheat_hotend_temp[2], MarlinUI::preheat_bed_temp[2];
uint8_t MarlinUI::preheat_fan_speed[2];
// //
// "Temperature" submenu items // "Temperature" submenu items
// //
void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
#if HAS_HOTEND #if HAS_HOTEND
if (indh >= 0 && ui.preheat_hotend_temp[indh] > 0) if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.preheat_hotend_temp[indh]), e); setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e);
#else #else
UNUSED(e); UNUSED(indh); UNUSED(e); UNUSED(indh);
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
if (indb >= 0 && ui.preheat_bed_temp[indb] > 0) setTargetBed(ui.preheat_bed_temp[indb]); if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
#else #else
UNUSED(indb); UNUSED(indb);
#endif #endif
@ -64,7 +60,7 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i
#if FAN_COUNT > 1 #if FAN_COUNT > 1
active_extruder < FAN_COUNT ? active_extruder : active_extruder < FAN_COUNT ? active_extruder :
#endif #endif
0), ui.preheat_fan_speed[indh] 0), ui.material_preset[indh].fan_speed
); );
#endif #endif
ui.return_to_status(); ui.return_to_status();
@ -82,68 +78,66 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i
#if HAS_TEMP_HOTEND || HAS_HEATED_BED #if HAS_TEMP_HOTEND || HAS_HEATED_BED
#define _PREHEAT_ITEMS(M,N) do{ \ #if HAS_TEMP_HOTEND && HAS_HEATED_BED
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_both(M-1, MenuItemBase::itemIndex); }); \ #define _PREHEAT_ITEMS(M,E) do{ \
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_END_E, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }); \ ACTION_ITEM_N_P(E, msg_preheat_h[M], []{ _preheat_both(M, MenuItemBase::itemIndex); }); \
}while(0) ACTION_ITEM_N_P(E, msg_preheat_end_e[M], []{ _preheat_end(M, MenuItemBase::itemIndex); }); \
#if HAS_HEATED_BED }while(0)
#define PREHEAT_ITEMS(M,N) _PREHEAT_ITEMS(M,N) #if HAS_HEATED_BED
#define PREHEAT_ITEMS(M,E) _PREHEAT_ITEMS(M,E)
#endif
#else #else
#define PREHEAT_ITEMS(M,N) \ #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N(E, msg_preheat_h[M], []{ _preheat_end(M, MenuItemBase::itemIndex); })
ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_end(M-1, MenuItemBase::itemIndex); })
#endif #endif
void menu_preheat_m1() { void menu_preheat_m(const uint8_t m) {
editable.int8 = m;
#if HOTENDS == 1
PGM_P msg_preheat[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1), GET_TEXT(MSG_PREHEAT_2), GET_TEXT(MSG_PREHEAT_3), GET_TEXT(MSG_PREHEAT_4), GET_TEXT(MSG_PREHEAT_5));
PGM_P msg_preheat_end[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1_END), GET_TEXT(MSG_PREHEAT_2_END), GET_TEXT(MSG_PREHEAT_3_END), GET_TEXT(MSG_PREHEAT_4_END), GET_TEXT(MSG_PREHEAT_5_END));
#elif HAS_MULTI_HOTEND
PGM_P msg_preheat_all[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1_ALL), GET_TEXT(MSG_PREHEAT_2_ALL), GET_TEXT(MSG_PREHEAT_3_ALL), GET_TEXT(MSG_PREHEAT_4_ALL), GET_TEXT(MSG_PREHEAT_5_ALL));
#endif
PGM_P msg_preheat_end_e[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1_END_E), GET_TEXT(MSG_PREHEAT_2_END_E), GET_TEXT(MSG_PREHEAT_3_END_E), GET_TEXT(MSG_PREHEAT_4_END_E), GET_TEXT(MSG_PREHEAT_5_END_E));
PGM_P msg_preheat_bed[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1_BEDONLY), GET_TEXT(MSG_PREHEAT_2_BEDONLY), GET_TEXT(MSG_PREHEAT_3_BEDONLY), GET_TEXT(MSG_PREHEAT_4_BEDONLY), GET_TEXT(MSG_PREHEAT_5_BEDONLY));
PGM_P msg_preheat_h[] = ARRAY_N(PREHEAT_COUNT, GET_TEXT(MSG_PREHEAT_1_H), GET_TEXT(MSG_PREHEAT_2_H), GET_TEXT(MSG_PREHEAT_3_H), GET_TEXT(MSG_PREHEAT_4_H), GET_TEXT(MSG_PREHEAT_5_H));
START_MENU(); START_MENU();
BACK_ITEM(MSG_TEMPERATURE); BACK_ITEM(MSG_TEMPERATURE);
#if HOTENDS == 1 #if HOTENDS == 1
#if HAS_HEATED_BED #if HAS_HEATED_BED
ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_both(0, 0); }); ACTION_ITEM_P(msg_preheat[m], []{ _preheat_both(editable.int8, 0); });
ACTION_ITEM(MSG_PREHEAT_1_END, []{ _preheat_end(0, 0); }); ACTION_ITEM_P(msg_preheat_end[m], []{ _preheat_end(editable.int8, 0); });
#else #else
ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); ACTION_ITEM_P(msg_preheat[m], []{ _preheat_end(editable.int8, 0); });
#endif #endif
#elif HAS_MULTI_HOTEND #elif HAS_MULTI_HOTEND
#if HAS_HEATED_BED #if HAS_HEATED_BED
_PREHEAT_ITEMS(1,0); _PREHEAT_ITEMS(editable.int8,0);
#endif #endif
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(1,n); LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(editable.int8,n);
ACTION_ITEM(MSG_PREHEAT_1_ALL, []() { ACTION_ITEM_P(msg_preheat_all[m], []() {
TERN_(HAS_HEATED_BED, _preheat_bed(0)); TERN_(HAS_HEATED_BED, _preheat_bed(editable.int8));
HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], e); HOTEND_LOOP() thermalManager.setTargetHotend(ui.material_preset[editable.int8].hotend_temp, e);
}); });
#endif // HAS_MULTI_HOTEND #endif // HAS_MULTI_HOTEND
#if HAS_HEATED_BED #if HAS_HEATED_BED
ACTION_ITEM(MSG_PREHEAT_1_BEDONLY, []{ _preheat_bed(0); }); ACTION_ITEM_P(msg_preheat_bed[m], []{ _preheat_bed(editable.int8); });
#endif #endif
END_MENU(); END_MENU();
} }
void menu_preheat_m2() { void menu_preheat_m1() { menu_preheat_m(0); }
START_MENU(); void menu_preheat_m2() { menu_preheat_m(1); }
BACK_ITEM(MSG_TEMPERATURE); #if PREHEAT_COUNT >= 3
#if HOTENDS == 1 void menu_preheat_m3() { menu_preheat_m(2); }
#if HAS_HEATED_BED #if PREHEAT_COUNT >= 4
ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_both(1, 0); }); void menu_preheat_m4() { menu_preheat_m(3); }
ACTION_ITEM(MSG_PREHEAT_2_END, []{ _preheat_end(1, 0); }); #if PREHEAT_COUNT >= 5
#else void menu_preheat_m5() { menu_preheat_m(4); }
ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); });
#endif #endif
#elif HAS_MULTI_HOTEND
#if HAS_HEATED_BED
_PREHEAT_ITEMS(2,0);
#endif
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(2,n);
ACTION_ITEM(MSG_PREHEAT_2_ALL, []() {
TERN_(HAS_HEATED_BED, _preheat_bed(1));
HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], e);
});
#endif // HAS_MULTI_HOTEND
#if HAS_HEATED_BED
ACTION_ITEM(MSG_PREHEAT_2_BEDONLY, []{ _preheat_bed(1); });
#endif #endif
END_MENU(); #endif
}
void lcd_cooldown() { void lcd_cooldown() {
thermalManager.zero_fan_speeds(); thermalManager.zero_fan_speeds();
@ -269,12 +263,30 @@ void menu_temperature() {
// //
// Preheat for Material 1 and 2 // Preheat for Material 1 and 2
// //
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || TEMP_SENSOR_6 != 0 || TEMP_SENSOR_7 != 0 || HAS_HEATED_BED #if HOTENDS > 1 || HAS_HEATED_BED
SUBMENU(MSG_PREHEAT_1, menu_preheat_m1); SUBMENU(MSG_PREHEAT_1, menu_preheat_m1);
SUBMENU(MSG_PREHEAT_2, menu_preheat_m2); SUBMENU(MSG_PREHEAT_2, menu_preheat_m2);
#if PREHEAT_COUNT >= 3
SUBMENU(MSG_PREHEAT_3, menu_preheat_m3);
#if PREHEAT_COUNT >= 4
SUBMENU(MSG_PREHEAT_4, menu_preheat_m4);
#if PREHEAT_COUNT >= 5
SUBMENU(MSG_PREHEAT_5, menu_preheat_m5);
#endif
#endif
#endif
#else #else
ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); });
ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); }); ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); });
#if PREHEAT_COUNT >= 3
ACTION_ITEM(MSG_PREHEAT_3, []{ _preheat_end(2, 0); });
#if PREHEAT_COUNT >= 3
ACTION_ITEM(MSG_PREHEAT_4, []{ _preheat_end(3, 0); });
#if PREHEAT_COUNT >= 3
ACTION_ITEM(MSG_PREHEAT_5, []{ _preheat_end(4, 0); });
#endif
#endif
#endif
#endif #endif
// //
@ -288,4 +300,4 @@ void menu_temperature() {
END_MENU(); END_MENU();
} }
#endif // HAS_LCD_MENU #endif // HAS_LCD_MENU && HAS_TEMPERATURE

View file

@ -128,7 +128,9 @@ void _lcd_ubl_build_custom_mesh() {
void _lcd_ubl_custom_mesh() { void _lcd_ubl_custom_mesh() {
START_MENU(); START_MENU();
BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT); #if HAS_HOTEND
EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT);
#endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, BED_MAX_TARGET); EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, BED_MAX_TARGET);
#endif #endif
@ -182,39 +184,48 @@ void _lcd_ubl_edit_mesh() {
END_MENU(); END_MENU();
} }
/** #if ENABLED(G26_MESH_VALIDATION)
* UBL Validate Custom Mesh Command
*/
void _lcd_ubl_validate_custom_mesh() {
char ubl_lcd_gcode[24];
const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0);
sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C B%" PRIi16 " H%" PRIi16 " P"), temp, custom_hotend_temp);
queue.inject(ubl_lcd_gcode);
}
/** /**
* UBL Validate Mesh submenu * UBL Validate Custom Mesh Command
* */
* << UBL Tools void _lcd_ubl_validate_custom_mesh() {
* Mesh Validation with Material 1 char ubl_lcd_gcode[24];
* Mesh Validation with Material 2 const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0);
* Validate Custom Mesh sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16))
* << Info Screen , custom_hotend_temp
*/ #if HAS_HEATED_BED
void _lcd_ubl_validate_mesh() { , temp
START_MENU(); #endif
BACK_ITEM(MSG_UBL_TOOLS); );
#if HAS_HEATED_BED queue.inject(ubl_lcd_gcode);
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); }
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P"));
#else /**
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); * UBL Validate Mesh submenu
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); *
#endif * << UBL Tools
ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); * Mesh Validation with Material 1
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); * Mesh Validation with Material 2
END_MENU(); * Validate Custom Mesh
} * << Info Screen
*/
void _lcd_ubl_validate_mesh() {
START_MENU();
BACK_ITEM(MSG_UBL_TOOLS);
#if HAS_HEATED_BED
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P"));
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P"));
#else
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P"));
GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P"));
#endif
ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh);
ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status);
END_MENU();
}
#endif
/** /**
* UBL Grid Leveling submenu * UBL Grid Leveling submenu
@ -530,36 +541,42 @@ void _menu_ubl_tools() {
BACK_ITEM(MSG_UBL_LEVEL_BED); BACK_ITEM(MSG_UBL_LEVEL_BED);
SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh);
GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0"));
SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); #if ENABLED(G26_MESH_VALIDATION)
SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
#endif
SUBMENU(MSG_EDIT_MESH, _lcd_ubl_edit_mesh); SUBMENU(MSG_EDIT_MESH, _lcd_ubl_edit_mesh);
SUBMENU(MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); SUBMENU(MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling);
END_MENU(); END_MENU();
} }
/** #if ENABLED(G26_MESH_VALIDATION)
* UBL Step-By-Step submenu
* /**
* << Unified Bed Leveling * UBL Step-By-Step submenu
* 1 Build Cold Mesh *
* 2 Smart Fill-in * << Unified Bed Leveling
* - 3 Validate Mesh >> * 1 Build Cold Mesh
* 4 Fine Tune All * 2 Smart Fill-in
* - 5 Validate Mesh >> * - 3 Validate Mesh >>
* 6 Fine Tune All * 4 Fine Tune All
* 7 Save Bed Mesh * - 5 Validate Mesh >>
*/ * 6 Fine Tune All
void _lcd_ubl_step_by_step() { * 7 Save Bed Mesh
START_MENU(); */
BACK_ITEM(MSG_UBL_LEVEL_BED); void _lcd_ubl_step_by_step() {
GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); START_MENU();
GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29 P3 T0")); BACK_ITEM(MSG_UBL_LEVEL_BED);
SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G28\nG29 P1"));
GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29 P3 T0"));
SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29 P4 R999 T"));
ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
END_MENU(); GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29 P4 R999 T"));
} ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
END_MENU();
}
#endif
/** /**
* UBL System submenu * UBL System submenu
@ -574,7 +591,6 @@ void _lcd_ubl_step_by_step() {
* - UBL Tools >> * - UBL Tools >>
* - Output UBL Info >> * - Output UBL Info >>
*/ */
void _lcd_ubl_level_bed() { void _lcd_ubl_level_bed() {
START_MENU(); START_MENU();
BACK_ITEM(MSG_MOTION); BACK_ITEM(MSG_MOTION);
@ -582,7 +598,9 @@ void _lcd_ubl_level_bed() {
GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D"));
else else
GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29 A"));
SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); #if ENABLED(G26_MESH_VALIDATION)
SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step);
#endif
ACTION_ITEM(MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); ACTION_ITEM(MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd);
SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh);
SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);

View file

@ -86,6 +86,10 @@ MarlinUI ui;
} }
#endif #endif
#if EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD)
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load()
#endif
#if HAS_SPI_LCD #if HAS_SPI_LCD
#if HAS_GRAPHICAL_LCD #if HAS_GRAPHICAL_LCD

View file

@ -256,6 +256,14 @@
}; };
#endif #endif
#if PREHEAT_COUNT
typedef struct {
TERN_(HAS_HOTEND, uint16_t hotend_temp);
TERN_(HAS_HEATED_BED, uint16_t bed_temp );
TERN_(HAS_FAN, uint16_t fan_speed );
} preheat_t;
#endif
//////////////////////////////////////////// ////////////////////////////////////////////
//////////// MarlinUI Singleton //////////// //////////// MarlinUI Singleton ////////////
//////////////////////////////////////////// ////////////////////////////////////////////
@ -469,6 +477,10 @@ public:
static const char * scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll); static const char * scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll);
#endif #endif
#if PREHEAT_COUNT
static preheat_t material_preset[PREHEAT_COUNT];
#endif
#if HAS_LCD_MENU #if HAS_LCD_MENU
#if ENABLED(TOUCH_BUTTONS) #if ENABLED(TOUCH_BUTTONS)
@ -494,9 +506,6 @@ public:
static constexpr int8_t manual_move_e_index = 0; static constexpr int8_t manual_move_e_index = 0;
#endif #endif
static int16_t preheat_hotend_temp[2], preheat_bed_temp[2];
static uint8_t preheat_fan_speed[2];
// Select Screen (modal NO/YES style dialog) // Select Screen (modal NO/YES style dialog)
static bool selection; static bool selection;
static void set_selection(const bool sel) { selection = sel; } static void set_selection(const bool sel) { selection = sel; }

View file

@ -37,7 +37,7 @@
*/ */
// Change EEPROM version if the structure changes // Change EEPROM version if the structure changes
#define EEPROM_VERSION "V80" #define EEPROM_VERSION "V81"
#define EEPROM_OFFSET 100 #define EEPROM_OFFSET 100
// Check the integrity of data offsets. // Check the integrity of data offsets.
@ -281,11 +281,11 @@ typedef struct SettingsDataStruct {
#endif #endif
// //
// ULTIPANEL // Material Presets
// //
int16_t ui_preheat_hotend_temp[2], // M145 S0 H #if PREHEAT_COUNT
ui_preheat_bed_temp[2]; // M145 S0 B preheat_t ui_material_preset[PREHEAT_COUNT]; // M145 S0 H B F
uint8_t ui_preheat_fan_speed[2]; // M145 S0 F #endif
// //
// PIDTEMP // PIDTEMP
@ -811,27 +811,10 @@ void MarlinSettings::postprocess() {
// //
// LCD Preheat settings // LCD Preheat settings
// //
{ #if PREHEAT_COUNT
_FIELD_TEST(ui_preheat_hotend_temp); _FIELD_TEST(ui_material_preset);
EEPROM_WRITE(ui.material_preset);
#if HAS_HOTEND && HAS_LCD_MENU #endif
const int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp,
(&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp;
const uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed;
#elif ENABLED(DWIN_CREALITY_LCD)
const int16_t (&ui_preheat_hotend_temp)[2] = HMI_ValueStruct.preheat_hotend_temp,
(&ui_preheat_bed_temp)[2] = HMI_ValueStruct.preheat_bed_temp;
const uint8_t (&ui_preheat_fan_speed)[2] = HMI_ValueStruct.preheat_fan_speed;
#else
constexpr int16_t ui_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND },
ui_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED };
constexpr uint8_t ui_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED };
#endif
EEPROM_WRITE(ui_preheat_hotend_temp);
EEPROM_WRITE(ui_preheat_bed_temp);
EEPROM_WRITE(ui_preheat_fan_speed);
}
// //
// PIDTEMP // PIDTEMP
@ -1688,25 +1671,10 @@ void MarlinSettings::postprocess() {
// //
// LCD Preheat settings // LCD Preheat settings
// //
{ #if PREHEAT_COUNT
_FIELD_TEST(ui_preheat_hotend_temp); _FIELD_TEST(ui_material_preset);
EEPROM_READ(ui.material_preset);
#if HAS_HOTEND && HAS_LCD_MENU #endif
int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp,
(&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp;
uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed;
#elif ENABLED(DWIN_CREALITY_LCD)
int16_t (&ui_preheat_hotend_temp)[2] = HMI_ValueStruct.preheat_hotend_temp,
(&ui_preheat_bed_temp)[2] = HMI_ValueStruct.preheat_bed_temp;
uint8_t (&ui_preheat_fan_speed)[2] = HMI_ValueStruct.preheat_fan_speed;
#else
int16_t ui_preheat_hotend_temp[2], ui_preheat_bed_temp[2];
uint8_t ui_preheat_fan_speed[2];
#endif
EEPROM_READ(ui_preheat_hotend_temp); // 2 floats
EEPROM_READ(ui_preheat_bed_temp); // 2 floats
EEPROM_READ(ui_preheat_fan_speed); // 2 floats
}
// //
// Hotend PID // Hotend PID
@ -2587,22 +2555,27 @@ void MarlinSettings::reset() {
// //
// Preheat parameters // Preheat parameters
// //
#if HAS_HOTEND #if PREHEAT_COUNT
#if ENABLED(DWIN_CREALITY_LCD) #if HAS_HOTEND
HMI_ValueStruct.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; constexpr uint16_t hpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND, PREHEAT_3_TEMP_HOTEND, PREHEAT_4_TEMP_HOTEND, PREHEAT_5_TEMP_HOTEND);
HMI_ValueStruct.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
HMI_ValueStruct.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED;
HMI_ValueStruct.preheat_bed_temp[1] = PREHEAT_2_TEMP_BED;
HMI_ValueStruct.preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED;
HMI_ValueStruct.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
#elif HAS_LCD_MENU
ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND;
ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
ui.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED;
ui.preheat_bed_temp[1] = PREHEAT_2_TEMP_BED;
ui.preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED;
ui.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
#endif #endif
#if HAS_HEATED_BED
constexpr uint16_t bpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED, PREHEAT_3_TEMP_BED, PREHEAT_4_TEMP_BED, PREHEAT_5_TEMP_BED);
#endif
#if HAS_FAN
constexpr uint8_t fpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED, PREHEAT_3_FAN_SPEED, PREHEAT_4_FAN_SPEED, PREHEAT_5_FAN_SPEED);
#endif
LOOP_L_N(i, PREHEAT_COUNT) {
#if HAS_HOTEND
ui.material_preset[i].hotend_temp = hpre[i];
#endif
#if HAS_HEATED_BED
ui.material_preset[i].bed_temp = bpre[i];
#endif
#if HAS_FAN
ui.material_preset[i].fan_speed = fpre[i];
#endif
}
#endif #endif
// //
@ -3131,16 +3104,22 @@ void MarlinSettings::reset() {
#endif // [XYZ]_DUAL_ENDSTOPS #endif // [XYZ]_DUAL_ENDSTOPS
#if HAS_HOTEND && HAS_LCD_MENU #if PREHEAT_COUNT
CONFIG_ECHO_HEADING("Material heatup parameters:"); CONFIG_ECHO_HEADING("Material heatup parameters:");
LOOP_L_N(i, COUNT(ui.preheat_hotend_temp)) { LOOP_L_N(i, PREHEAT_COUNT) {
CONFIG_ECHO_START(); CONFIG_ECHO_START();
SERIAL_ECHOLNPAIR( SERIAL_ECHOLNPAIR(
" M145 S", (int)i " M145 S", (int)i
, " H", TEMP_UNIT(ui.preheat_hotend_temp[i]) #if HAS_HOTEND
, " B", TEMP_UNIT(ui.preheat_bed_temp[i]) , " H", TEMP_UNIT(ui.material_preset[i].hotend_temp)
, " F", int(ui.preheat_fan_speed[i]) #endif
#if HAS_HEATED_BED
, " B", TEMP_UNIT(ui.material_preset[i].bed_temp)
#endif
#if HAS_FAN
, " F", ui.material_preset[i].fan_speed
#endif
); );
} }

View file

@ -3128,7 +3128,7 @@ void Temperature::tick() {
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
HMI_flag.heat_flag = 0; HMI_flag.heat_flag = 0;
duration_t elapsed = print_job_timer.duration(); // print timer duration_t elapsed = print_job_timer.duration(); // print timer
heat_time = elapsed.value; dwin_heat_time = elapsed.value;
#else #else
ui.reset_status(); ui.reset_status();
#endif #endif

View file

@ -797,7 +797,7 @@ class Temperature {
TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e)); TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e));
#if HAS_LCD_MENU #if HAS_LCD_MENU && HAS_TEMPERATURE
static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb); static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb);
#endif #endif