Explorar el Código

🚸 Clear "heating/cooling" message on temp reached

Scott Lahteine hace 2 años
padre
commit
fd742616ba

+ 1
- 1
Marlin/src/gcode/temp/M104_M109.cpp Ver fichero

126
     #endif
126
     #endif
127
 
127
 
128
     if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
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
   TERN_(AUTOTEMP, planner.autotemp_M104_M109());
132
   TERN_(AUTOTEMP, planner.autotemp_M104_M109());

+ 5
- 0
Marlin/src/gcode/temp/M140_M190.cpp Ver fichero

89
 
89
 
90
   if (isM190)
90
   if (isM190)
91
     thermalManager.wait_for_bed(no_wait_for_cooling);
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
 #endif // HAS_HEATED_BED
99
 #endif // HAS_HEATED_BED

+ 6
- 0
Marlin/src/lcd/marlinui.cpp Ver fichero

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

+ 6
- 0
Marlin/src/lcd/marlinui.h Ver fichero

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

+ 9
- 1
Marlin/src/module/temperature.cpp Ver fichero

3631
   #endif
3631
   #endif
3632
 
3632
 
3633
   #if HAS_HOTEND && HAS_STATUS_MESSAGE
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
       const bool heating = isHeatingHotend(e);
3635
       const bool heating = isHeatingHotend(e);
3636
       ui.status_printf(0,
3636
       ui.status_printf(0,
3637
         #if HAS_MULTI_HOTEND
3637
         #if HAS_MULTI_HOTEND
3641
         #endif
3641
         #endif
3642
         , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING)
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
   #endif
3653
   #endif
3646
 
3654
 

+ 2
- 2
Marlin/src/module/temperature.h Ver fichero

961
     #endif
961
     #endif
962
 
962
 
963
     #if HAS_HOTEND && HAS_STATUS_MESSAGE
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
     #else
965
     #else
966
-      static void set_heating_message(const uint8_t) {}
966
+      static void set_heating_message(const uint8_t, const bool=false) {}
967
     #endif
967
     #endif
968
 
968
 
969
     #if HAS_MARLINUI_MENU && HAS_TEMPERATURE
969
     #if HAS_MARLINUI_MENU && HAS_TEMPERATURE

Loading…
Cancelar
Guardar