Просмотр исходного кода

Ender 3 V2 Status Line (#21369)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Miguel Risco-Castillo 4 лет назад
Родитель
Сommit
930752d46e
Аккаунт пользователя с таким Email не найден

+ 2
- 1
Marlin/src/MarlinCore.cpp Просмотреть файл

76
 
76
 
77
 #if ENABLED(DWIN_CREALITY_LCD)
77
 #if ENABLED(DWIN_CREALITY_LCD)
78
   #include "lcd/dwin/e3v2/dwin.h"
78
   #include "lcd/dwin/e3v2/dwin.h"
79
-  #include "lcd/dwin/dwin_lcd.h"
80
   #include "lcd/dwin/e3v2/rotary_encoder.h"
79
   #include "lcd/dwin/e3v2/rotary_encoder.h"
81
 #endif
80
 #endif
82
 
81
 
1476
   #if ENABLED(DWIN_CREALITY_LCD)
1475
   #if ENABLED(DWIN_CREALITY_LCD)
1477
     Encoder_Configuration();
1476
     Encoder_Configuration();
1478
     HMI_Init();
1477
     HMI_Init();
1478
+    DWIN_JPG_CacheTo1(Language_English);
1479
     HMI_StartFrame(true);
1479
     HMI_StartFrame(true);
1480
+    DWIN_StatusChanged(GET_TEXT(WELCOME_MSG));
1480
   #endif
1481
   #endif
1481
 
1482
 
1482
   #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
1483
   #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)

+ 5
- 5
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Просмотреть файл

733
 
733
 
734
       const int point_num = (GRID_MAX_POINTS) - count + 1;
734
       const int point_num = (GRID_MAX_POINTS) - count + 1;
735
       SERIAL_ECHOLNPAIR("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
735
       SERIAL_ECHOLNPAIR("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
736
-      TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)));
736
+      TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)));
737
 
737
 
738
       #if HAS_LCD_MENU
738
       #if HAS_LCD_MENU
739
         if (ui.button_pressed()) {
739
         if (ui.button_pressed()) {
1440
 
1440
 
1441
     if (do_3_pt_leveling) {
1441
     if (do_3_pt_leveling) {
1442
       SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
1442
       SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
1443
-      TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1443
+      TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1444
 
1444
 
1445
       measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
1445
       measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
1446
       if (isnan(measured_z))
1446
       if (isnan(measured_z))
1459
 
1459
 
1460
       if (!abort_flag) {
1460
       if (!abort_flag) {
1461
         SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
1461
         SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
1462
-        TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1462
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1463
 
1463
 
1464
         measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
1464
         measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
1465
         #ifdef VALIDATE_MESH_TILT
1465
         #ifdef VALIDATE_MESH_TILT
1479
 
1479
 
1480
       if (!abort_flag) {
1480
       if (!abort_flag) {
1481
         SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
1481
         SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
1482
-        TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1482
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1483
 
1483
 
1484
         measured_z = probe.probe_at_point(points[2], PROBE_PT_STOW, param.V_verbosity);
1484
         measured_z = probe.probe_at_point(points[2], PROBE_PT_STOW, param.V_verbosity);
1485
         #ifdef VALIDATE_MESH_TILT
1485
         #ifdef VALIDATE_MESH_TILT
1520
 
1520
 
1521
           if (!abort_flag) {
1521
           if (!abort_flag) {
1522
             SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n");
1522
             SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n");
1523
-            TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
1523
+            TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
1524
 
1524
 
1525
             measured_z = probe.probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
1525
             measured_z = probe.probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
1526
 
1526
 

+ 1
- 1
Marlin/src/feature/cancel_object.cpp Просмотреть файл

43
   else
43
   else
44
     skipping = false;
44
     skipping = false;
45
 
45
 
46
-  #if HAS_DISPLAY
46
+  #if HAS_STATUS_MESSAGE
47
     if (active_object >= 0)
47
     if (active_object >= 0)
48
       ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
48
       ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
49
     else
49
     else

+ 1
- 1
Marlin/src/feature/pause.cpp Просмотреть файл

652
   // Resume the print job timer if it was running
652
   // Resume the print job timer if it was running
653
   if (print_job_timer.isPaused()) print_job_timer.start();
653
   if (print_job_timer.isPaused()) print_job_timer.start();
654
 
654
 
655
-  TERN_(HAS_DISPLAY, ui.reset_status());
655
+  TERN_(HAS_STATUS_MESSAGE, ui.reset_status());
656
   TERN_(HAS_LCD_MENU, ui.return_to_status());
656
   TERN_(HAS_LCD_MENU, ui.return_to_status());
657
 }
657
 }
658
 
658
 

+ 4
- 4
Marlin/src/gcode/bedlevel/abl/G29.cpp Просмотреть файл

41
   #include "../../../module/temperature.h"
41
   #include "../../../module/temperature.h"
42
 #endif
42
 #endif
43
 
43
 
44
-#if HAS_DISPLAY
44
+#if HAS_STATUS_MESSAGE
45
   #include "../../../lcd/marlinui.h"
45
   #include "../../../lcd/marlinui.h"
46
 #endif
46
 #endif
47
 
47
 
638
           if (TERN0(IS_KINEMATIC, !probe.can_reach(probePos))) continue;
638
           if (TERN0(IS_KINEMATIC, !probe.can_reach(probePos))) continue;
639
 
639
 
640
           if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", pt_index, "/", abl_points, ".");
640
           if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", pt_index, "/", abl_points, ".");
641
-          TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(abl_points)));
641
+          TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(abl_points)));
642
 
642
 
643
           measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(probePos, raise_after, verbose_level);
643
           measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(probePos, raise_after, verbose_level);
644
 
644
 
683
 
683
 
684
       LOOP_L_N(i, 3) {
684
       LOOP_L_N(i, 3) {
685
         if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", i + 1, "/3.");
685
         if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", i + 1, "/3.");
686
-        TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i + 1)));
686
+        TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i + 1)));
687
 
687
 
688
         // Retain the last probe position
688
         // Retain the last probe position
689
         probePos = points[i];
689
         probePos = points[i];
706
 
706
 
707
     #endif // AUTO_BED_LEVELING_3POINT
707
     #endif // AUTO_BED_LEVELING_3POINT
708
 
708
 
709
-    TERN_(HAS_DISPLAY, ui.reset_status());
709
+    TERN_(HAS_STATUS_MESSAGE, ui.reset_status());
710
 
710
 
711
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
711
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
712
     if (probe.stow()) {
712
     if (probe.stow()) {

+ 4
- 1
Marlin/src/gcode/bedlevel/mbl/G29.cpp Просмотреть файл

122
         // After recording the last point, activate home and activate
122
         // After recording the last point, activate home and activate
123
         mbl_probe_index = -1;
123
         mbl_probe_index = -1;
124
         SERIAL_ECHOLNPGM("Mesh probing done.");
124
         SERIAL_ECHOLNPGM("Mesh probing done.");
125
+        TERN_(HAS_STATUS_MESSAGE, ui.set_status(GET_TEXT(MSG_MESH_DONE)));
125
         BUZZ(100, 659);
126
         BUZZ(100, 659);
126
         BUZZ(100, 698);
127
         BUZZ(100, 698);
127
 
128
 
180
 
181
 
181
   } // switch(state)
182
   } // switch(state)
182
 
183
 
183
-  if (state == MeshNext)
184
+  if (state == MeshNext) {
184
     SERIAL_ECHOLNPAIR("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS);
185
     SERIAL_ECHOLNPAIR("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS);
186
+    if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
187
+  }
185
 
188
 
186
   report_current_position();
189
   report_current_position();
187
 }
190
 }

+ 3
- 3
Marlin/src/gcode/calibrate/G34_M422.cpp Просмотреть файл

190
         bool adjustment_reverse = false;
190
         bool adjustment_reverse = false;
191
       #endif
191
       #endif
192
 
192
 
193
-      #if HAS_DISPLAY
193
+      #if HAS_STATUS_MESSAGE
194
         PGM_P const msg_iteration = GET_TEXT(MSG_ITERATION);
194
         PGM_P const msg_iteration = GET_TEXT(MSG_ITERATION);
195
         const uint8_t iter_str_len = strlen_P(msg_iteration);
195
         const uint8_t iter_str_len = strlen_P(msg_iteration);
196
       #endif
196
       #endif
204
 
204
 
205
         const int iter = iteration + 1;
205
         const int iter = iteration + 1;
206
         SERIAL_ECHOLNPAIR("\nG34 Iteration: ", iter);
206
         SERIAL_ECHOLNPAIR("\nG34 Iteration: ", iter);
207
-        #if HAS_DISPLAY
207
+        #if HAS_STATUS_MESSAGE
208
           char str[iter_str_len + 2 + 1];
208
           char str[iter_str_len + 2 + 1];
209
           sprintf_P(str, msg_iteration, iter);
209
           sprintf_P(str, msg_iteration, iter);
210
           ui.set_status(str);
210
           ui.set_status(str);
290
             , " Z3-Z1=", ABS(z_measured[2] - z_measured[0])
290
             , " Z3-Z1=", ABS(z_measured[2] - z_measured[0])
291
           #endif
291
           #endif
292
         );
292
         );
293
-        #if HAS_DISPLAY
293
+        #if HAS_STATUS_MESSAGE
294
           char fstr1[10];
294
           char fstr1[10];
295
           #if NUM_Z_STEPPER_DRIVERS == 2
295
           #if NUM_Z_STEPPER_DRIVERS == 2
296
             char msg[6 + (6 + 5) * 1 + 1];
296
             char msg[6 + (6 + 5) * 1 + 1];

+ 2
- 2
Marlin/src/gcode/calibrate/M48.cpp Просмотреть файл

142
     float sample_sum = 0.0;
142
     float sample_sum = 0.0;
143
 
143
 
144
     LOOP_L_N(n, n_samples) {
144
     LOOP_L_N(n, n_samples) {
145
-      #if HAS_WIRED_LCD
145
+      #if HAS_STATUS_MESSAGE
146
         // Display M48 progress in the status bar
146
         // Display M48 progress in the status bar
147
         ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
147
         ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
148
       #endif
148
       #endif
257
     SERIAL_ECHOLNPGM("Finished!");
257
     SERIAL_ECHOLNPGM("Finished!");
258
     dev_report(verbose_level > 0, mean, sigma, min, max, true);
258
     dev_report(verbose_level > 0, mean, sigma, min, max, true);
259
 
259
 
260
-    #if HAS_WIRED_LCD
260
+    #if HAS_STATUS_MESSAGE
261
       // Display M48 results in the status bar
261
       // Display M48 results in the status bar
262
       char sigma_str[8];
262
       char sigma_str[8];
263
       ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
263
       ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));

+ 1
- 1
Marlin/src/gcode/temp/M104_M109.cpp Просмотреть файл

185
       thermalManager.auto_job_check_timer(true, true);
185
       thermalManager.auto_job_check_timer(true, true);
186
     #endif
186
     #endif
187
 
187
 
188
-    #if HAS_DISPLAY
188
+    #if HAS_STATUS_MESSAGE
189
       if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
189
       if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
190
         thermalManager.set_heating_message(target_extruder);
190
         thermalManager.set_heating_message(target_extruder);
191
     #endif
191
     #endif

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Просмотреть файл

481
   #endif
481
   #endif
482
 #endif
482
 #endif
483
 
483
 
484
-#if EITHER(HAS_DISPLAY, GLOBAL_STATUS_MESSAGE)
484
+#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD, GLOBAL_STATUS_MESSAGE)
485
   #define HAS_STATUS_MESSAGE 1
485
   #define HAS_STATUS_MESSAGE 1
486
 #endif
486
 #endif
487
 
487
 

+ 8
- 1
Marlin/src/lcd/dwin/e3v2/dwin.cpp Просмотреть файл

402
 }
402
 }
403
 
403
 
404
 void Clear_Menu_Area() {
404
 void Clear_Menu_Area() {
405
-  DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y);
405
+  DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y - 1);
406
 }
406
 }
407
 
407
 
408
 void Clear_Main_Window() {
408
 void Clear_Main_Window() {
3794
   if (checkkey == Leveling) Goto_MainMenu();
3794
   if (checkkey == Leveling) Goto_MainMenu();
3795
 }
3795
 }
3796
 
3796
 
3797
+void DWIN_StatusChanged(const char *text) {
3798
+  DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
3799
+  const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(text) * MENU_CHR_W) / 2;
3800
+  DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 2, F(text));
3801
+  DWIN_UpdateLCD();
3802
+}
3803
+
3797
 #endif // DWIN_CREALITY_LCD
3804
 #endif // DWIN_CREALITY_LCD

+ 1
- 0
Marlin/src/lcd/dwin/e3v2/dwin.h Просмотреть файл

377
 void DWIN_Update();
377
 void DWIN_Update();
378
 void EachMomentUpdate();
378
 void EachMomentUpdate();
379
 void DWIN_HandleScreen();
379
 void DWIN_HandleScreen();
380
+void DWIN_StatusChanged(const char *text);
380
 
381
 
381
 inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
382
 inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
382
 
383
 

+ 1
- 0
Marlin/src/lcd/language/language_en.h Просмотреть файл

522
   PROGMEM Language_Str MSG_BILINEAR_LEVELING               = _UxGT("Bilinear Leveling");
522
   PROGMEM Language_Str MSG_BILINEAR_LEVELING               = _UxGT("Bilinear Leveling");
523
   PROGMEM Language_Str MSG_UBL_LEVELING                    = _UxGT("Unified Bed Leveling");
523
   PROGMEM Language_Str MSG_UBL_LEVELING                    = _UxGT("Unified Bed Leveling");
524
   PROGMEM Language_Str MSG_MESH_LEVELING                   = _UxGT("Mesh Leveling");
524
   PROGMEM Language_Str MSG_MESH_LEVELING                   = _UxGT("Mesh Leveling");
525
+  PROGMEM Language_Str MSG_MESH_DONE                       = _UxGT("Mesh probing done");
525
   PROGMEM Language_Str MSG_INFO_STATS_MENU                 = _UxGT("Printer Stats");
526
   PROGMEM Language_Str MSG_INFO_STATS_MENU                 = _UxGT("Printer Stats");
526
   PROGMEM Language_Str MSG_INFO_BOARD_MENU                 = _UxGT("Board Info");
527
   PROGMEM Language_Str MSG_INFO_BOARD_MENU                 = _UxGT("Board Info");
527
   PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU            = _UxGT("Thermistors");
528
   PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU            = _UxGT("Thermistors");

+ 0
- 1
Marlin/src/lcd/lcdprint.h Просмотреть файл

105
 #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_COL_X_RJ(len), LCD_ROW_Y(row))
105
 #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_COL_X_RJ(len), LCD_ROW_Y(row))
106
 #define SETCURSOR_X(col)       SETCURSOR(col, _lcdLineNr)
106
 #define SETCURSOR_X(col)       SETCURSOR(col, _lcdLineNr)
107
 #define SETCURSOR_X_RJ(len)    SETCURSOR_RJ(len, _lcdLineNr)
107
 #define SETCURSOR_X_RJ(len)    SETCURSOR_RJ(len, _lcdLineNr)
108
-#define START_OF_UTF8_CHAR(C)  (((C) & 0xC0u) != 0x80U)
109
 
108
 
110
 int lcd_glyph_height();
109
 int lcd_glyph_height();
111
 
110
 

+ 24
- 17
Marlin/src/lcd/marlinui.cpp Просмотреть файл

44
   #include "../gcode/queue.h"
44
   #include "../gcode/queue.h"
45
   #include "fontutils.h"
45
   #include "fontutils.h"
46
   #include "../sd/cardreader.h"
46
   #include "../sd/cardreader.h"
47
-  #if EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD)
48
-    #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
49
-  #endif
47
+#endif
48
+
49
+#if ENABLED(DWIN_CREALITY_LCD)
50
+  #include "../module/printcounter.h"
51
+  #include "../MarlinCore.h"
52
+  #include "dwin/e3v2/dwin.h"
53
+#endif
54
+
55
+#if HAS_STATUS_MESSAGE
56
+  #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U)
50
 #endif
57
 #endif
51
 
58
 
52
 #if LCD_HAS_WAIT_FOR_MOVE
59
 #if LCD_HAS_WAIT_FOR_MOVE
55
 
62
 
56
 constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
63
 constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
57
 
64
 
58
-#if HAS_WIRED_LCD
59
-  #if ENABLED(STATUS_MESSAGE_SCROLLING)
60
-    uint8_t MarlinUI::status_scroll_offset; // = 0
61
-    constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
65
+#if HAS_STATUS_MESSAGE
66
+  #if HAS_WIRED_LCD
67
+    #if ENABLED(STATUS_MESSAGE_SCROLLING)
68
+      uint8_t MarlinUI::status_scroll_offset; // = 0
69
+      constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
70
+    #else
71
+      constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
72
+    #endif
62
   #else
73
   #else
63
-    constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
74
+    constexpr uint8_t MAX_MESSAGE_LENGTH = 63;
64
   #endif
75
   #endif
65
-#elif EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD)
66
-  constexpr uint8_t MAX_MESSAGE_LENGTH = 63;
67
-#endif
68
-
69
-#if EITHER(HAS_WIRED_LCD, EXTENSIBLE_UI)
70
-  uint8_t MarlinUI::alert_level; // = 0
71
   char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
76
   char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
77
+  uint8_t MarlinUI::alert_level; // = 0
72
 #endif
78
 #endif
73
 
79
 
74
 #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
80
 #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
75
   MarlinUI::progress_t MarlinUI::progress_override; // = 0
81
   MarlinUI::progress_t MarlinUI::progress_override; // = 0
76
-  #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
82
+  #if ENABLED(USE_M73_REMAINING_TIME)
77
     uint32_t MarlinUI::remaining_time;
83
     uint32_t MarlinUI::remaining_time;
78
   #endif
84
   #endif
79
 #endif
85
 #endif
1461
     #endif
1467
     #endif
1462
 
1468
 
1463
     TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message));
1469
     TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message));
1470
+    TERN_(DWIN_CREALITY_LCD, DWIN_StatusChanged(status_message));
1464
   }
1471
   }
1465
 
1472
 
1466
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
1473
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
1581
 
1588
 
1582
   #endif
1589
   #endif
1583
 
1590
 
1584
-#else // !HAS_DISPLAY
1591
+#elif !HAS_STATUS_MESSAGE // && !HAS_DISPLAY
1585
 
1592
 
1586
   //
1593
   //
1587
   // Send the status line as a host notification
1594
   // Send the status line as a host notification
1596
     TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message));
1603
     TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message));
1597
   }
1604
   }
1598
 
1605
 
1599
-#endif // !HAS_DISPLAY
1606
+#endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE
1600
 
1607
 
1601
 #if ENABLED(SDSUPPORT)
1608
 #if ENABLED(SDSUPPORT)
1602
 
1609
 

+ 2
- 2
Marlin/src/module/endstops.cpp Просмотреть файл

360
   if (hit_state == prev_hit_state) return;
360
   if (hit_state == prev_hit_state) return;
361
   prev_hit_state = hit_state;
361
   prev_hit_state = hit_state;
362
   if (hit_state) {
362
   if (hit_state) {
363
-    #if HAS_WIRED_LCD
363
+    #if HAS_STATUS_MESSAGE
364
       char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
364
       char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
365
       #define _SET_STOP_CHAR(A,C) (chr## A = C)
365
       #define _SET_STOP_CHAR(A,C) (chr## A = C)
366
     #else
366
     #else
391
     #endif
391
     #endif
392
     SERIAL_EOL();
392
     SERIAL_EOL();
393
 
393
 
394
-    TERN_(HAS_WIRED_LCD, ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), GET_TEXT(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP));
394
+    TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), GET_TEXT(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP));
395
 
395
 
396
     #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT)
396
     #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT)
397
       if (planner.abort_on_endstop_hit) {
397
       if (planner.abort_on_endstop_hit) {

+ 2
- 2
Marlin/src/module/motion.cpp Просмотреть файл

51
   #include "../feature/bltouch.h"
51
   #include "../feature/bltouch.h"
52
 #endif
52
 #endif
53
 
53
 
54
-#if HAS_DISPLAY
54
+#if HAS_STATUS_MESSAGE
55
   #include "../lcd/marlinui.h"
55
   #include "../lcd/marlinui.h"
56
 #endif
56
 #endif
57
 
57
 
1144
       );
1144
       );
1145
       SERIAL_ECHO_START();
1145
       SERIAL_ECHO_START();
1146
       SERIAL_ECHOLN(msg);
1146
       SERIAL_ECHOLN(msg);
1147
-      TERN_(HAS_DISPLAY, ui.set_status(msg));
1147
+      TERN_(HAS_STATUS_MESSAGE, ui.set_status(msg));
1148
       return true;
1148
       return true;
1149
     }
1149
     }
1150
     return false;
1150
     return false;

+ 2
- 2
Marlin/src/module/temperature.cpp Просмотреть файл

2495
     if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2495
     if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2496
       setTargetHotend(singlenozzle_temp[new_tool], 0);
2496
       setTargetHotend(singlenozzle_temp[new_tool], 0);
2497
       TERN_(AUTOTEMP, planner.autotemp_update());
2497
       TERN_(AUTOTEMP, planner.autotemp_update());
2498
-      TERN_(HAS_DISPLAY, set_heating_message(0));
2498
+      TERN_(HAS_STATUS_MESSAGE, set_heating_message(0));
2499
       (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2499
       (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2500
     }
2500
     }
2501
   }
2501
   }
3492
     }
3492
     }
3493
   #endif
3493
   #endif
3494
 
3494
 
3495
-  #if HAS_HOTEND && HAS_DISPLAY
3495
+  #if HAS_HOTEND && HAS_STATUS_MESSAGE
3496
     void Temperature::set_heating_message(const uint8_t e) {
3496
     void Temperature::set_heating_message(const uint8_t e) {
3497
       const bool heating = isHeatingHotend(e);
3497
       const bool heating = isHeatingHotend(e);
3498
       ui.status_printf_P(0,
3498
       ui.status_printf_P(0,

+ 1
- 1
Marlin/src/module/temperature.h Просмотреть файл

877
       #endif
877
       #endif
878
     #endif
878
     #endif
879
 
879
 
880
-    #if ENABLED(HAS_DISPLAY)
880
+    #if HAS_STATUS_MESSAGE
881
       static void set_heating_message(const uint8_t e);
881
       static void set_heating_message(const uint8_t e);
882
     #endif
882
     #endif
883
 
883
 

+ 1
- 1
Marlin/src/module/tool_change.cpp Просмотреть файл

1262
     #if HAS_MULTI_HOTEND
1262
     #if HAS_MULTI_HOTEND
1263
       thermalManager.setTargetHotend(thermalManager.temp_hotend[active_extruder].target, migration_extruder);
1263
       thermalManager.setTargetHotend(thermalManager.temp_hotend[active_extruder].target, migration_extruder);
1264
       TERN_(AUTOTEMP, planner.autotemp_update());
1264
       TERN_(AUTOTEMP, planner.autotemp_update());
1265
-      TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0));
1265
+      TERN_(HAS_STATUS_MESSAGE, thermalManager.set_heating_message(0));
1266
       thermalManager.wait_for_hotend(active_extruder);
1266
       thermalManager.wait_for_hotend(active_extruder);
1267
     #endif
1267
     #endif
1268
 
1268
 

Загрузка…
Отмена
Сохранить