@@ -735,7 +735,7 @@ void _drawIconBlink(bool &flag, const bool sensor, const uint8_t icon1, const ui
735
735
void _drawZOffsetIcon () {
736
736
#if HAS_LEVELING
737
737
static bool _leveling_active = false ;
738
- _drawIconBlink (_leveling_active, planner.leveling_active , ICON_Zoffset, ICON_SetZOffset, 186 , 416 );
738
+ _drawIconBlink (_leveling_active, planner.leveling_active , ICON_Zoffset, ICON_SetZOffset, 187 , 416 );
739
739
#else
740
740
DWINUI::drawIcon (ICON_Zoffset, 187 , 416 );
741
741
#endif
@@ -763,9 +763,9 @@ void _drawFeedrate() {
763
763
}
764
764
765
765
void _drawXYZPosition (const bool force) {
766
- _update_axis_value (X_AXIS, 27 , 459 , force);
767
- _update_axis_value (Y_AXIS, 112 , 459 , force);
768
- _update_axis_value (Z_AXIS, 197 , 459 , force);
766
+ _update_axis_value (X_AXIS, 27 , 457 , force);
767
+ _update_axis_value (Y_AXIS, 112 , 457 , force);
768
+ _update_axis_value (Z_AXIS, 197 , 457 , force);
769
769
}
770
770
771
771
void updateVariable () {
@@ -778,7 +778,18 @@ void updateVariable() {
778
778
_new_hotend_target = _hotendtarget != ht;
779
779
if (_new_hotend_temp) _hotendtemp = hc;
780
780
if (_new_hotend_target) _hotendtarget = ht;
781
- #endif
781
+
782
+ // if hotend is near target or heating, ICON indicates hot
783
+ if (thermalManager.degHotendNear (0 , ht) || thermalManager.isHeatingHotend (0 )) {
784
+ dwinDrawBox (1 , hmiData.colorBackground , 10 , 383 , 20 , 20 );
785
+ DWINUI::drawIcon (ICON_SetEndTemp, 10 , 383 );
786
+ }
787
+ else {
788
+ dwinDrawBox (1 , hmiData.colorBackground , 10 , 383 , 20 , 20 );
789
+ DWINUI::drawIcon (ICON_HotendTemp, 10 , 383 );
790
+ }
791
+ #endif // HAS_HOTEND
792
+
782
793
#if HAS_HEATED_BED
783
794
static celsius_t _bedtemp = 0 , _bedtarget = 0 ;
784
795
const celsius_t bc = thermalManager.wholeDegBed (),
@@ -787,7 +798,18 @@ void updateVariable() {
787
798
_new_bed_target = _bedtarget != bt;
788
799
if (_new_bed_temp) _bedtemp = bc;
789
800
if (_new_bed_target) _bedtarget = bt;
790
- #endif
801
+
802
+ // if bed is near target, heating, or if degrees > 44, ICON indicates hot
803
+ if (thermalManager.degBedNear (bt) || thermalManager.isHeatingBed () || (bc > 44 )) {
804
+ dwinDrawBox (1 , hmiData.colorBackground , 10 , 416 , 20 , 20 );
805
+ DWINUI::drawIcon (ICON_BedTemp, 10 , 416 );
806
+ }
807
+ else {
808
+ dwinDrawBox (1 , hmiData.colorBackground , 10 , 416 , 20 , 20 );
809
+ DWINUI::drawIcon (ICON_SetBedTemp, 10 , 416 );
810
+ }
811
+ #endif // HAS_HEATED_BED
812
+
791
813
#if HAS_FAN
792
814
static uint8_t _fanspeed = 0 ;
793
815
const bool _new_fanspeed = _fanspeed != thermalManager.fan_speed [0 ];
@@ -1022,9 +1044,9 @@ void dwinDrawDashboard() {
1022
1044
dwinDrawRectangle (1 , hmiData.colorBackground , 0 , STATUS_Y + 21 , DWIN_WIDTH, DWIN_HEIGHT - 1 );
1023
1045
dwinDrawRectangle (1 , hmiData.colorSplitLine , 0 , 449 , DWIN_WIDTH, 451 );
1024
1046
1025
- DWINUI::drawIcon (ICON_MaxSpeedX, 10 , 456 );
1026
- DWINUI::drawIcon (ICON_MaxSpeedY, 95 , 456 );
1027
- DWINUI::drawIcon (ICON_MaxSpeedZ, 180 , 456 );
1047
+ DWINUI::drawIcon (ICON_MaxSpeedX, 10 , 454 );
1048
+ DWINUI::drawIcon (ICON_MaxSpeedY, 95 , 454 );
1049
+ DWINUI::drawIcon (ICON_MaxSpeedZ, 180 , 454 );
1028
1050
_drawXYZPosition (true );
1029
1051
1030
1052
#if HAS_HOTEND
@@ -1033,7 +1055,7 @@ void dwinDrawDashboard() {
1033
1055
DWINUI::drawString (DWIN_FONT_STAT, hmiData.colorIndicator , hmiData.colorBackground , 25 + 3 * STAT_CHR_W + 5 , 384 , F (" /" ));
1034
1056
DWINUI::drawInt (DWIN_FONT_STAT, hmiData.colorIndicator , hmiData.colorBackground , 3 , 25 + 4 * STAT_CHR_W + 6 , 384 , thermalManager.degTargetHotend (0 ));
1035
1057
1036
- DWINUI::drawIcon (ICON_StepE, 112 , 417 );
1058
+ DWINUI::drawIcon (ICON_StepE, 113 , 416 );
1037
1059
DWINUI::drawInt (DWIN_FONT_STAT, hmiData.colorIndicator , hmiData.colorBackground , 3 , 116 + 2 * STAT_CHR_W, 417 , planner.flow_percentage [0 ]);
1038
1060
DWINUI::drawString (DWIN_FONT_STAT, hmiData.colorIndicator , hmiData.colorBackground , 116 + 5 * STAT_CHR_W + 2 , 417 , F (" %" ));
1039
1061
#endif
@@ -1269,6 +1291,16 @@ void eachMomentUpdate() {
1269
1291
TERN_ (PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) plot.update (thermalManager.wholeDegBed ()));
1270
1292
}
1271
1293
TERN_ (MPCTEMP, if (checkkey == ID_MPCProcess) plot.update (thermalManager.wholeDegHotend (0 )));
1294
+ #if ENABLED(PROUI_ITEM_PLOT)
1295
+ if (checkkey == ID_PlotProcess) {
1296
+ TERN_ (PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update (thermalManager.wholeDegHotend (0 )); })
1297
+ TERN_ (PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update (thermalManager.wholeDegBed ()); })
1298
+ TERN_ (MPCTEMP, if (hmiValue.tempControl == MPCTEMP_START) { plot.update (thermalManager.wholeDegHotend (0 )); })
1299
+ if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused ()) {
1300
+ hmiReturnScreen ();
1301
+ }
1302
+ }
1303
+ #endif
1272
1304
#endif
1273
1305
}
1274
1306
@@ -1402,29 +1434,32 @@ void dwinHandleScreen() {
1402
1434
case ID_SetIntNoDraw: hmiSetNoDraw (); break ;
1403
1435
case ID_PrintProcess: hmiPrinting (); break ;
1404
1436
case ID_Popup: hmiPopup (); break ;
1405
- case ID_Leveling: break ;
1406
1437
#if HAS_LOCKSCREEN
1407
1438
case ID_Locked: hmiLockScreen (); break ;
1408
1439
#endif
1409
- case ID_PrintDone:
1440
+
1410
1441
TERN_ (HAS_ESDIAG, case ID_ESDiagProcess:)
1442
+ TERN_ (PROUI_ITEM_PLOT, case ID_PlotProcess:)
1443
+ case ID_PrintDone:
1411
1444
case ID_WaitResponse: hmiWaitForUser (); break ;
1445
+
1446
+ TERN_ (HAS_BED_PROBE, case ID_Leveling:)
1412
1447
case ID_Homing:
1413
1448
case ID_PIDProcess:
1414
- case ID_NothingToDo: break ;
1449
+ case ID_NothingToDo:
1415
1450
default : break ;
1416
1451
}
1417
1452
}
1418
1453
1419
1454
bool idIsPopUp () { // If ID is popup...
1420
1455
switch (checkkey) {
1456
+ TERN_ (HAS_BED_PROBE, case ID_Leveling:)
1457
+ TERN_ (HAS_ESDIAG, case ID_ESDiagProcess:)
1421
1458
case ID_NothingToDo:
1422
1459
case ID_WaitResponse:
1423
1460
case ID_Popup:
1424
1461
case ID_Homing:
1425
- case ID_Leveling:
1426
1462
case ID_PIDProcess:
1427
- TERN_ (HAS_ESDIAG, case ID_ESDiagProcess:)
1428
1463
return true ;
1429
1464
default : break ;
1430
1465
}
@@ -1439,8 +1474,9 @@ void hmiSaveProcessID(const uint8_t id) {
1439
1474
case ID_Popup:
1440
1475
case ID_WaitResponse:
1441
1476
case ID_PrintDone:
1442
- case ID_Leveling:
1477
+ TERN_ (HAS_BED_PROBE, case ID_Leveling:)
1443
1478
TERN_ (HAS_ESDIAG, case ID_ESDiagProcess:)
1479
+ TERN_ (PROUI_ITEM_PLOT, case ID_PlotProcess:)
1444
1480
wait_for_user = true ;
1445
1481
default : break ;
1446
1482
}
@@ -1515,68 +1551,94 @@ void dwinLevelingDone() {
1515
1551
1516
1552
celsius_t _maxtemp, _target;
1517
1553
void dwinDrawPIDMPCPopup () {
1518
- constexpr frame_rect_t gfrm = { 40 , 180 , DWIN_WIDTH - 80 , 120 };
1554
+ constexpr frame_rect_t gfrm = { 30 , 150 , DWIN_WIDTH - 60 , 160 };
1519
1555
DWINUI::clearMainArea ();
1520
1556
drawPopupBkgd ();
1521
1557
1522
1558
switch (hmiValue.tempControl ) {
1523
1559
default : return ;
1524
1560
#if ENABLED(MPC_AUTOTUNE)
1525
1561
case MPCTEMP_START:
1526
- DWINUI::drawCenteredString (hmiData.colorPopupTxt , 100 , GET_TEXT_F (MSG_MPC_AUTOTUNE));
1527
- DWINUI::drawString (hmiData.colorPopupTxt , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" MPC target: Celsius" ));
1528
- break ;
1529
- #endif
1530
- #if ANY(PIDTEMP, PIDTEMPBED)
1531
- TERN_ (PIDTEMP, case PIDTEMP_START:)
1532
- TERN_ (PIDTEMPBED, case PIDTEMPBED_START:)
1533
- DWINUI::drawCenteredString (hmiData.colorPopupTxt , 100 , GET_TEXT_F (MSG_PID_AUTOTUNE));
1534
- DWINUI::drawString (hmiData.colorPopupTxt , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" PID target: Celsius" ));
1535
- break ;
1536
- #endif
1537
- }
1538
-
1539
- switch (hmiValue.tempControl ) {
1540
- default : break ;
1541
- #if ANY(PIDTEMP, MPC_AUTOTUNE)
1542
- TERN_ (PIDTEMP, case PIDTEMP_START:)
1543
- TERN_ (MPC_AUTOTUNE, case MPCTEMP_START:)
1544
- DWINUI::drawCenteredString (hmiData.colorPopupTxt , 120 , F (" for Nozzle is running." ));
1545
- break ;
1546
- #endif
1547
- #if ENABLED(PIDTEMPBED)
1548
- case PIDTEMPBED_START:
1549
- DWINUI::drawCenteredString (hmiData.colorPopupTxt , 120 , F (" for BED is running." ));
1550
- break ;
1551
- #endif
1552
- }
1553
-
1554
- switch (hmiValue.tempControl ) {
1555
- default : break ;
1556
- #if ENABLED(MPC_AUTOTUNE)
1557
- case MPCTEMP_START:
1562
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 70 , GET_TEXT_F (MSG_MPC_AUTOTUNE));
1563
+ DWINUI::drawString (hmiData.colorPopupTxt , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" MPC target: Celsius" ));
1564
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 92 , F (" for NOZZLE is running." ));
1558
1565
_maxtemp = thermalManager.hotend_maxtemp [0 ];
1559
1566
_target = 200 ;
1560
1567
break ;
1561
1568
#endif
1562
1569
#if ENABLED(PIDTEMP)
1563
1570
case PIDTEMP_START:
1571
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 70 , GET_TEXT_F (MSG_PID_AUTOTUNE));
1572
+ DWINUI::drawString (hmiData.colorPopupTxt , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" PID target: Celsius" ));
1573
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 92 , F (" for NOZZLE is running." ));
1564
1574
_maxtemp = thermalManager.hotend_maxtemp [0 ];
1565
1575
_target = hmiData.hotendPidT ;
1566
1576
break ;
1567
1577
#endif
1568
1578
#if ENABLED(PIDTEMPBED)
1569
1579
case PIDTEMPBED_START:
1580
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 70 , GET_TEXT_F (MSG_PID_AUTOTUNE));
1581
+ DWINUI::drawString (hmiData.colorPopupTxt , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" PID target: Celsius" ));
1582
+ DWINUI::drawCenteredString (hmiData.colorPopupTxt , 92 , F (" for BED is running." ));
1570
1583
_maxtemp = BED_MAXTEMP;
1571
1584
_target = hmiData.bedPidT ;
1572
1585
break ;
1573
1586
#endif
1574
1587
}
1575
1588
1576
1589
plot.draw (gfrm, _maxtemp, _target);
1577
- DWINUI::drawInt (hmiData.colorPopupTxt , 3 , gfrm.x + 90 , gfrm.y - DWINUI::fontHeight () - 4 , _target);
1590
+ DWINUI::drawInt (false , 2 , hmiData.colorStatusTxt , hmiData. colorPopupTxt , 3 , gfrm.x + 92 , gfrm.y - DWINUI::fontHeight () - 6 , _target);
1578
1591
}
1579
1592
1593
+ // Plot Temperature Graph (PID Tuning Graph)
1594
+ #if ENABLED(PROUI_ITEM_PLOT)
1595
+
1596
+ void dwinDrawPlot (tempcontrol_t result) {
1597
+ hmiValue.tempControl = result;
1598
+ constexpr frame_rect_t gfrm = {30 , 135 , DWIN_WIDTH - 60 , 160 };
1599
+ DWINUI::clearMainArea ();
1600
+ drawPopupBkgd ();
1601
+ hmiSaveProcessID (ID_PlotProcess);
1602
+
1603
+ switch (result) {
1604
+ #if ENABLED(MPCTEMP)
1605
+ case MPCTEMP_START:
1606
+ #elif ENABLED(PIDTEMP)
1607
+ case PIDTEMP_START:
1608
+ #endif
1609
+ title.showCaption (GET_TEXT_F (MSG_HOTEND_TEMP_GRAPH));
1610
+ DWINUI::drawCenteredString (3 , hmiData.colorPopupTxt , 75 , F (" Nozzle Temperature" ));
1611
+ _maxtemp = thermalManager.hotend_max_target (0 );
1612
+ _target = thermalManager.degTargetHotend (0 );
1613
+ break ;
1614
+ #if ENABLED(PIDTEMPBED)
1615
+ case PIDTEMPBED_START:
1616
+ title.showCaption (GET_TEXT_F (MSG_BED_TEMP_GRAPH));
1617
+ DWINUI::drawCenteredString (3 , hmiData.colorPopupTxt , 75 , F (" Bed Temperature" ));
1618
+ _maxtemp = BED_MAX_TARGET;
1619
+ _target = thermalManager.degTargetBed ();
1620
+ break ;
1621
+ #endif
1622
+ default : break ;
1623
+ }
1624
+
1625
+ dwinDrawString (false , 2 , hmiData.colorPopupTxt , hmiData.colorPopupBg , gfrm.x , gfrm.y - DWINUI::fontHeight () - 4 , F (" Target: Celsius" ));
1626
+ plot.draw (gfrm, _maxtemp, _target);
1627
+ DWINUI::drawInt (false , 2 , hmiData.colorStatusTxt , hmiData.colorPopupBg , 3 , gfrm.x + 80 , gfrm.y - DWINUI::fontHeight () - 4 , _target);
1628
+ DWINUI::drawButton (BTN_Continue, 86 , 305 );
1629
+ dwinUpdateLCD ();
1630
+ }
1631
+
1632
+ void drawHPlot () {
1633
+ TERN_ (PIDTEMP, dwinDrawPlot (PIDTEMP_START);)
1634
+ TERN_ (MPCTEMP, dwinDrawPlot (MPCTEMP_START);)
1635
+ }
1636
+ void drawBPlot () {
1637
+ TERN_ (PIDTEMPBED, dwinDrawPlot (PIDTEMPBED_START);)
1638
+ }
1639
+
1640
+ #endif // PROUI_ITEM_PLOT
1641
+
1580
1642
#endif // PROUI_TUNING_GRAPH
1581
1643
1582
1644
#if PROUI_PID_TUNE
@@ -2993,7 +3055,7 @@ frame_rect_t selrect(frame_rect_t) {
2993
3055
2994
3056
void drawPrepareMenu () {
2995
3057
checkkey = ID_Menu;
2996
- if (SET_MENU_R (prepareMenu, selrect ({133 , 1 , 28 , 13 }), MSG_PREPARE, 10 + PREHEAT_COUNT)) {
3058
+ if (SET_MENU_R (prepareMenu, selrect ({133 , 1 , 28 , 13 }), MSG_PREPARE, 12 + PREHEAT_COUNT)) {
2997
3059
BACK_ITEM (gotoMainMenu);
2998
3060
MENU_ITEM (ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, drawFilamentManMenu);
2999
3061
MENU_ITEM (ICON_Axis, MSG_MOVE_AXIS, onDrawMoveSubMenu, drawMoveMenu);
@@ -3023,6 +3085,10 @@ void drawPrepareMenu() {
3023
3085
REPEAT_1 (PREHEAT_COUNT, _ITEM_PREHEAT)
3024
3086
#endif
3025
3087
MENU_ITEM (ICON_Cool, MSG_COOLDOWN, onDrawCooldown, doCoolDown);
3088
+ #if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT)
3089
+ MENU_ITEM (ICON_PIDNozzle, MSG_HOTEND_TEMP_GRAPH, onDrawMenuItem, drawHPlot);
3090
+ MENU_ITEM (ICON_PIDBed, MSG_BED_TEMP_GRAPH, onDrawMenuItem, drawBPlot);
3091
+ #endif
3026
3092
MENU_ITEM (ICON_Language, MSG_UI_LANGUAGE, onDrawLanguage, setLanguage);
3027
3093
}
3028
3094
ui.reset_status (true );
@@ -3304,7 +3370,7 @@ void drawFilSetMenu() {
3304
3370
3305
3371
void drawTuneMenu () {
3306
3372
checkkey = ID_Menu;
3307
- if (SET_MENU_R (tuneMenu, selrect ({73 , 2 , 28 , 12 }), MSG_TUNE, 18 )) {
3373
+ if (SET_MENU_R (tuneMenu, selrect ({73 , 2 , 28 , 12 }), MSG_TUNE, 20 )) {
3308
3374
BACK_ITEM (gotoPrintProcess);
3309
3375
EDIT_ITEM (ICON_Speed, MSG_SPEED, onDrawSpeedItem, setSpeed, &feedrate_percentage);
3310
3376
#if HAS_HOTEND
@@ -3350,6 +3416,10 @@ void drawTuneMenu() {
3350
3416
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
3351
3417
EDIT_ITEM (ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes );
3352
3418
#endif
3419
+ #if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT)
3420
+ MENU_ITEM (ICON_PIDNozzle, MSG_HOTEND_TEMP_GRAPH, onDrawMenuItem, drawHPlot);
3421
+ MENU_ITEM (ICON_PIDBed, MSG_BED_TEMP_GRAPH, onDrawMenuItem, drawBPlot);
3422
+ #endif
3353
3423
#if ENABLED(CASE_LIGHT_MENU)
3354
3424
EDIT_ITEM (ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on );
3355
3425
#if CASELIGHT_USES_BRIGHTNESS
0 commit comments