Pārlūkot izejas kodu

🚸 Clear "heating/cooling" message on temp reached

Scott Lahteine 2 gadus atpakaļ
vecāks
revīzija
fd742616ba

+ 1
- 1
Marlin/src/gcode/temp/M104_M109.cpp Parādīt failu

@@ -126,7 +126,7 @@ void GcodeSuite::M104_M109(const bool isM109) {
126 126
     #endif
127 127
 
128 128
     if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
129
-      thermalManager.set_heating_message(target_extruder);
129
+      thermalManager.set_heating_message(target_extruder, !isM109 && got_temp);
130 130
   }
131 131
 
132 132
   TERN_(AUTOTEMP, planner.autotemp_M104_M109());

+ 5
- 0
Marlin/src/gcode/temp/M140_M190.cpp Parādīt failu

@@ -89,6 +89,11 @@ void GcodeSuite::M140_M190(const bool isM190) {
89 89
 
90 90
   if (isM190)
91 91
     thermalManager.wait_for_bed(no_wait_for_cooling);
92
+  else
93
+    ui.set_status_reset_fn([]{
94
+      const celsius_t c = thermalManager.degTargetBed();
95
+      return c < 30 || thermalManager.degBedNear(c);
96
+    });
92 97
 }
93 98
 
94 99
 #endif // HAS_HEATED_BED

+ 6
- 0
Marlin/src/lcd/marlinui.cpp Parādīt failu

@@ -73,6 +73,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
73 73
   #endif
74 74
   char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
75 75
   uint8_t MarlinUI::alert_level; // = 0
76
+  statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr
76 77
 #endif
77 78
 
78 79
 #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
@@ -627,6 +628,9 @@ void MarlinUI::init() {
627 628
 
628 629
     #endif // BASIC_PROGRESS_BAR
629 630
 
631
+    if (status_reset_callback && (*status_reset_callback)())
632
+      reset_status();
633
+
630 634
     #if HAS_MARLINUI_MENU
631 635
       if (use_click()) {
632 636
         #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
@@ -1515,6 +1519,8 @@ void MarlinUI::init() {
1515 1519
 
1516 1520
     UNUSED(persist);
1517 1521
 
1522
+    set_status_reset_fn();
1523
+
1518 1524
     #if HAS_WIRED_LCD
1519 1525
 
1520 1526
       #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)

+ 6
- 0
Marlin/src/lcd/marlinui.h Parādīt failu

@@ -59,6 +59,8 @@
59 59
 
60 60
 #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
61 61
 
62
+typedef bool (*statusResetFunc_t)();
63
+
62 64
 #if HAS_WIRED_LCD
63 65
 
64 66
   enum LCDViewAction : uint8_t {
@@ -352,11 +354,15 @@ public:
352 354
     static void reset_status(const bool no_welcome=false);
353 355
     static void set_alert_status(FSTR_P const fstr);
354 356
     static void reset_alert_level() { alert_level = 0; }
357
+
358
+    static statusResetFunc_t status_reset_callback;
359
+    static void set_status_reset_fn(const statusResetFunc_t fn=nullptr) { status_reset_callback = fn; }
355 360
   #else
356 361
     static constexpr bool has_status() { return false; }
357 362
     static void reset_status(const bool=false) {}
358 363
     static void set_alert_status(FSTR_P const) {}
359 364
     static void reset_alert_level() {}
365
+    static void set_status_reset_fn(const statusResetFunc_t=nullptr) {}
360 366
   #endif
361 367
 
362 368
   static void set_status(const char * const cstr, const bool persist=false);

+ 9
- 1
Marlin/src/module/temperature.cpp Parādīt failu

@@ -3631,7 +3631,7 @@ void Temperature::isr() {
3631 3631
   #endif
3632 3632
 
3633 3633
   #if HAS_HOTEND && HAS_STATUS_MESSAGE
3634
-    void Temperature::set_heating_message(const uint8_t e) {
3634
+    void Temperature::set_heating_message(const uint8_t e, const bool isM104/*=false*/) {
3635 3635
       const bool heating = isHeatingHotend(e);
3636 3636
       ui.status_printf(0,
3637 3637
         #if HAS_MULTI_HOTEND
@@ -3641,6 +3641,14 @@ void Temperature::isr() {
3641 3641
         #endif
3642 3642
         , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING)
3643 3643
       );
3644
+
3645
+      if (isM104) {
3646
+        static uint8_t wait_e; wait_e = e;
3647
+        ui.set_status_reset_fn([]{
3648
+          const celsius_t c = degTargetHotend(wait_e);
3649
+          return c < 30 || degHotendNear(wait_e, c);
3650
+        });
3651
+      }
3644 3652
     }
3645 3653
   #endif
3646 3654
 

+ 2
- 2
Marlin/src/module/temperature.h Parādīt failu

@@ -961,9 +961,9 @@ class Temperature {
961 961
     #endif
962 962
 
963 963
     #if HAS_HOTEND && HAS_STATUS_MESSAGE
964
-      static void set_heating_message(const uint8_t e);
964
+      static void set_heating_message(const uint8_t e, const bool isM104=false);
965 965
     #else
966
-      static void set_heating_message(const uint8_t) {}
966
+      static void set_heating_message(const uint8_t, const bool=false) {}
967 967
     #endif
968 968
 
969 969
     #if HAS_MARLINUI_MENU && HAS_TEMPERATURE

Notiek ielāde…
Atcelt
Saglabāt