@@ -165,14 +165,9 @@ typedef struct {
165165} select_t ;
166166
167167select_t select_page{0 }, select_file{0 }, select_print{0 }, select_prepare{0 }
168- , select_control{0 }, select_axis{0 }, select_temp{0 }, select_motion{0 }, select_tune{0 }
169- , select_advset{0 }, select_PLA{0 }, select_ABS{0 }
170- , select_speed{0 }
171- , select_acc{0 }
172- , select_jerk{0 }
173- , select_step{0 }
174- , select_item{0 }
175- ;
168+ , select_control{0 }, select_axis{0 }, select_temp{0 }, select_motion{0 }, select_tune{0 }
169+ , select_advset{0 }, select_PLA{0 }, select_ABS{0 }
170+ , select_speed{0 }, select_acc{0 }, select_jerk{0 }, select_step{0 }, select_item{0 };
176171
177172uint8_t index_file = MROWS,
178173 index_prepare = MROWS,
@@ -700,7 +695,7 @@ void Item_Prepare_Home(const uint8_t row) {
700695
701696#endif
702697
703- #if HAS_HOTEND
698+ #if HAS_PREHEAT
704699 void Item_Prepare_PLA (const uint8_t row) {
705700 if (HMI_IsChinese ())
706701 Item_AreaCopy (100 , 89 , 151 , 101 , row);
@@ -715,22 +710,22 @@ void Item_Prepare_Home(const uint8_t row) {
715710 Draw_Menu_Line (row, ICON_PLAPreheat);
716711 }
717712
718- void Item_Prepare_ABS (const uint8_t row) {
719- if (HMI_IsChinese ())
720- Item_AreaCopy (180 , 89 , 233 , 100 , row);
721- else {
722- #ifdef USE_STRING_TITLES
723- DWIN_Draw_Label (row, F (" Preheat " PREHEAT_2_LABEL));
724- #else
725- Item_AreaCopy (108 , 76 , 155 , 87 , row); // "Preheat"
726- say_abs_en (52 , row); // "ABS"
727- #endif
713+ #if PREHEAT_COUNT > 1
714+ void Item_Prepare_ABS (const uint8_t row) {
715+ if (HMI_IsChinese ())
716+ Item_AreaCopy (180 , 89 , 233 , 100 , row);
717+ else {
718+ #ifdef USE_STRING_TITLES
719+ DWIN_Draw_Label (row, F (" Preheat " PREHEAT_2_LABEL));
720+ #else
721+ Item_AreaCopy (108 , 76 , 155 , 87 , row); // "Preheat"
722+ say_abs_en (52 , row); // "ABS"
723+ #endif
724+ }
725+ Draw_Menu_Line (row, ICON_ABSPreheat);
728726 }
729- Draw_Menu_Line (row, ICON_ABSPreheat);
730- }
731- #endif
727+ #endif
732728
733- #if HAS_PREHEAT
734729 void Item_Prepare_Cool (const uint8_t row) {
735730 if (HMI_IsChinese ())
736731 Item_AreaCopy (1 , 104 , 56 , 117 , row);
@@ -785,11 +780,11 @@ void Draw_Prepare_Menu() {
785780 #if HAS_ZOFFSET_ITEM
786781 if (PVISI (PREPARE_CASE_ZOFF)) Item_Prepare_Offset (PSCROL (PREPARE_CASE_ZOFF)); // Edit Z-Offset / Babystep / Set Home Offset
787782 #endif
788- #if HAS_HOTEND
789- if (PVISI (PREPARE_CASE_PLA)) Item_Prepare_PLA (PSCROL (PREPARE_CASE_PLA)); // Preheat PLA
790- if (PVISI (PREPARE_CASE_ABS)) Item_Prepare_ABS (PSCROL (PREPARE_CASE_ABS)); // Preheat ABS
791- #endif
792783 #if HAS_PREHEAT
784+ if (PVISI (PREPARE_CASE_PLA)) Item_Prepare_PLA (PSCROL (PREPARE_CASE_PLA)); // Preheat PLA
785+ #if PREHEAT_COUNT > 1
786+ if (PVISI (PREPARE_CASE_ABS)) Item_Prepare_ABS (PSCROL (PREPARE_CASE_ABS)); // Preheat ABS
787+ #endif
793788 if (PVISI (PREPARE_CASE_COOL)) Item_Prepare_Cool (PSCROL (PREPARE_CASE_COOL)); // Cooldown
794789 #endif
795790 if (PVISI (PREPARE_CASE_LANG)) Item_Prepare_Lang (PSCROL (PREPARE_CASE_LANG)); // Language CN/EN
@@ -1425,25 +1420,34 @@ void HMI_Move_Z() {
14251420 uint8_t temp_line;
14261421 switch (HMI_ValueStruct.show_mode ) {
14271422 case -1 : temp_line = TEMP_CASE_TEMP; break ;
1428- case -2 : temp_line = PREHEAT_CASE_TEMP; break ;
1429- case -3 : temp_line = PREHEAT_CASE_TEMP; break ;
1423+ #if HAS_PREHEAT
1424+ case -2 : temp_line = PREHEAT_CASE_TEMP; break ;
1425+ #if PREHEAT_COUNT > 1
1426+ case -3 : temp_line = PREHEAT_CASE_TEMP; break ;
1427+ #endif
1428+ #endif
14301429 default : temp_line = TUNE_CASE_TEMP + MROWS - index_tune;
14311430 }
14321431 if (Apply_Encoder (encoder_diffState, HMI_ValueStruct.E_Temp )) {
14331432 EncoderRate.enabled = false ;
1434- if (HMI_ValueStruct.show_mode == -2 ) {
1435- checkkey = PLAPreheat;
1436- ui.material_preset [0 ].hotend_temp = HMI_ValueStruct.E_Temp ;
1437- Draw_Edit_Integer3 (temp_line, ui.material_preset [0 ].hotend_temp );
1438- return ;
1439- }
1440- else if (HMI_ValueStruct.show_mode == -3 ) {
1441- checkkey = ABSPreheat;
1442- ui.material_preset [1 ].hotend_temp = HMI_ValueStruct.E_Temp ;
1443- Draw_Edit_Integer3 (temp_line, ui.material_preset [1 ].hotend_temp );
1444- return ;
1445- }
1446- else if (HMI_ValueStruct.show_mode == -1 ) // Temperature
1433+ #if HAS_PREHEAT
1434+ if (HMI_ValueStruct.show_mode == -2 ) {
1435+ checkkey = PLAPreheat;
1436+ ui.material_preset [0 ].hotend_temp = HMI_ValueStruct.E_Temp ;
1437+ Draw_Edit_Integer3 (temp_line, ui.material_preset [0 ].hotend_temp );
1438+ return ;
1439+ }
1440+ #if PREHEAT_COUNT > 1
1441+ if (HMI_ValueStruct.show_mode == -3 ) {
1442+ checkkey = ABSPreheat;
1443+ ui.material_preset [1 ].hotend_temp = HMI_ValueStruct.E_Temp ;
1444+ Draw_Edit_Integer3 (temp_line, ui.material_preset [1 ].hotend_temp );
1445+ return ;
1446+ }
1447+ #endif
1448+ #endif
1449+
1450+ if (HMI_ValueStruct.show_mode == -1 ) // Temperature
14471451 checkkey = TemperatureID;
14481452 else
14491453 checkkey = Tune;
@@ -1467,28 +1471,33 @@ void HMI_Move_Z() {
14671471 uint8_t bed_line;
14681472 switch (HMI_ValueStruct.show_mode ) {
14691473 case -1 : bed_line = TEMP_CASE_BED; break ;
1470- case -2 : bed_line = PREHEAT_CASE_BED; break ;
1471- case -3 : bed_line = PREHEAT_CASE_BED; break ;
1474+ #if HAS_PREHEAT
1475+ case -2 : bed_line = PREHEAT_CASE_BED; break ;
1476+ #if PREHEAT_COUNT > 1
1477+ case -3 : bed_line = PREHEAT_CASE_BED; break ;
1478+ #endif
1479+ #endif
14721480 default : bed_line = TUNE_CASE_BED + MROWS - index_tune;
14731481 }
14741482 if (Apply_Encoder (encoder_diffState, HMI_ValueStruct.Bed_Temp )) {
14751483 EncoderRate.enabled = false ;
1476- if (HMI_ValueStruct.show_mode == -2 ) {
1477- checkkey = PLAPreheat;
1478- ui.material_preset [0 ].bed_temp = HMI_ValueStruct.Bed_Temp ;
1479- Draw_Edit_Integer3 (bed_line, ui.material_preset [0 ].bed_temp );
1480- return ;
1481- }
1482- else if (HMI_ValueStruct.show_mode == -3 ) {
1483- checkkey = ABSPreheat;
1484- ui.material_preset [1 ].bed_temp = HMI_ValueStruct.Bed_Temp ;
1485- Draw_Edit_Integer3 (bed_line, ui.material_preset [1 ].bed_temp );
1486- return ;
1487- }
1488- else if (HMI_ValueStruct.show_mode == -1 )
1489- checkkey = TemperatureID;
1490- else
1491- checkkey = Tune;
1484+ #if HAS_PREHEAT
1485+ if (HMI_ValueStruct.show_mode == -2 ) {
1486+ checkkey = PLAPreheat;
1487+ ui.material_preset [0 ].bed_temp = HMI_ValueStruct.Bed_Temp ;
1488+ Draw_Edit_Integer3 (bed_line, ui.material_preset [0 ].bed_temp );
1489+ return ;
1490+ }
1491+ #if PREHEAT_COUNT > 1
1492+ if (HMI_ValueStruct.show_mode == -3 ) {
1493+ checkkey = ABSPreheat;
1494+ ui.material_preset [1 ].bed_temp = HMI_ValueStruct.Bed_Temp ;
1495+ Draw_Edit_Integer3 (bed_line, ui.material_preset [1 ].bed_temp );
1496+ return ;
1497+ }
1498+ #endif
1499+ #endif
1500+ checkkey = HMI_ValueStruct.show_mode == -1 ? TemperatureID : Tune;
14921501 Draw_Edit_Integer3 (bed_line, HMI_ValueStruct.Bed_Temp );
14931502 thermalManager.setTargetBed (HMI_ValueStruct.Bed_Temp );
14941503 return ;
@@ -1522,16 +1531,15 @@ void HMI_Move_Z() {
15221531 Draw_Edit_Integer3 (fan_line, ui.material_preset [0 ].fan_speed );
15231532 return ;
15241533 }
1525- else if (HMI_ValueStruct.show_mode == -3 ) {
1526- checkkey = ABSPreheat;
1527- ui.material_preset [1 ].fan_speed = HMI_ValueStruct.Fan_speed ;
1528- Draw_Edit_Integer3 (fan_line, ui.material_preset [1 ].fan_speed );
1529- return ;
1530- }
1531- else if (HMI_ValueStruct.show_mode == -1 )
1532- checkkey = TemperatureID;
1533- else
1534- checkkey = Tune;
1534+ #if PREHEAT_COUNT > 1
1535+ if (HMI_ValueStruct.show_mode == -3 ) {
1536+ checkkey = ABSPreheat;
1537+ ui.material_preset [1 ].fan_speed = HMI_ValueStruct.Fan_speed ;
1538+ Draw_Edit_Integer3 (fan_line, ui.material_preset [1 ].fan_speed );
1539+ return ;
1540+ }
1541+ #endif
1542+ checkkey = HMI_ValueStruct.show_mode == -1 ? TemperatureID : Tune;
15351543 Draw_Edit_Integer3 (fan_line, HMI_ValueStruct.Fan_speed );
15361544 thermalManager.set_fan_speed (0 , HMI_ValueStruct.Fan_speed );
15371545 return ;
@@ -3068,7 +3076,7 @@ void HMI_Temperature() {
30683076 EncoderRate.enabled = true ;
30693077 break ;
30703078 #endif
3071- #if HAS_HOTEND
3079+ #if HAS_PREHEAT
30723080 case TEMP_CASE_PLA: {
30733081 checkkey = PLAPreheat;
30743082 select_PLA.reset ();
@@ -3145,7 +3153,8 @@ void HMI_Temperature() {
31453153 Draw_Menu_Line (++i, ICON_WriteEEPROM);
31463154 #endif
31473155 } break ;
3148-
3156+ #endif
3157+ #if PREHEAT_COUNT > 1
31493158 case TEMP_CASE_ABS: { // ABS preheat setting
31503159 checkkey = ABSPreheat;
31513160 select_ABS.reset ();
0 commit comments