My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

status_screen_DOGM.cpp 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. //
  23. // status_screen_DOGM.cpp
  24. // Standard Status Screen for Graphical Display
  25. //
  26. #include "../../inc/MarlinConfigPre.h"
  27. #if HAS_GRAPHICAL_LCD && DISABLED(LIGHTWEIGHT_UI)
  28. #include "dogm_Statusscreen.h"
  29. #include "ultralcd_DOGM.h"
  30. #include "../ultralcd.h"
  31. #include "../lcdprint.h"
  32. #include "../../module/motion.h"
  33. #include "../../module/temperature.h"
  34. #if ENABLED(FILAMENT_LCD_DISPLAY)
  35. #include "../../feature/filwidth.h"
  36. #include "../../module/planner.h"
  37. #include "../../gcode/parser.h"
  38. #endif
  39. #if ENABLED(SDSUPPORT)
  40. #include "../../sd/cardreader.h"
  41. #endif
  42. #if HAS_PRINT_PROGRESS
  43. #include "../../module/printcounter.h"
  44. #endif
  45. FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t x, const uint8_t y) {
  46. const char *str = itostr3(temp);
  47. const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
  48. lcd_moveto(x - len * (INFO_FONT_WIDTH) / 2 + 1, y);
  49. lcd_put_u8str(&str[3-len]);
  50. lcd_put_wchar(LCD_STR_DEGREE[0]);
  51. }
  52. #if ENABLED(MARLIN_DEV_MODE)
  53. #define SHOW_ON_STATE READ(X_MIN_PIN)
  54. #else
  55. #define SHOW_ON_STATE false
  56. #endif
  57. FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, const bool blink) {
  58. #if !HEATER_IDLE_HANDLER
  59. UNUSED(blink);
  60. #endif
  61. #if HAS_HEATED_BED
  62. const bool isBed = heater < 0;
  63. #else
  64. constexpr bool isBed = false;
  65. #endif
  66. if (PAGE_UNDER(7)) {
  67. #if HEATER_IDLE_HANDLER
  68. const bool is_idle = (
  69. #if HAS_HEATED_BED
  70. isBed ? thermalManager.is_bed_idle() :
  71. #endif
  72. thermalManager.is_heater_idle(heater)
  73. );
  74. if (blink || !is_idle)
  75. #endif
  76. _draw_centered_temp(0.5 + (
  77. #if HAS_HEATED_BED
  78. isBed ? thermalManager.degTargetBed() :
  79. #endif
  80. thermalManager.degTargetHotend(heater)
  81. ), x, 7
  82. );
  83. }
  84. if (PAGE_CONTAINS(21, 28))
  85. _draw_centered_temp(0.5f + (
  86. #if HAS_HEATED_BED
  87. isBed ? thermalManager.degBed() :
  88. #endif
  89. thermalManager.degHotend(heater)
  90. ), x, 28
  91. );
  92. #ifndef STATUS_HOTEND_ANIM
  93. #define INDICATE_HOTEND true
  94. #define INDICATE_HOTEND_ON (thermalManager.isHeatingHotend(heater) ^ SHOW_ON_STATE)
  95. #else
  96. #define INDICATE_HOTEND false
  97. #define INDICATE_HOTEND_ON false
  98. #endif
  99. #if HAS_HEATED_BED && !defined(STATUS_BED_ANIM)
  100. #define INDICATE_BED true
  101. #define INDICATE_BED_ON (thermalManager.isHeatingBed() ^ SHOW_ON_STATE)
  102. #else
  103. #define INDICATE_BED false
  104. #define INDICATE_BED_ON false
  105. #endif
  106. if (isBed ? INDICATE_BED : INDICATE_HOTEND) {
  107. if (PAGE_CONTAINS(17, 20)) {
  108. const uint8_t y = 20 - (isBed ? 2 : 3);
  109. if (isBed ? INDICATE_BED_ON : INDICATE_HOTEND_ON) {
  110. u8g.setColorIndex(0); // set to white on black
  111. u8g.drawBox(x, y, 2, 2);
  112. u8g.setColorIndex(1); // restore black on white
  113. }
  114. else
  115. u8g.drawBox(x, y, 2, 2);
  116. }
  117. }
  118. }
  119. //
  120. // Before homing, blink '123' <-> '???'.
  121. // Homed but unknown... '123' <-> ' '.
  122. // Homed and known, display constantly.
  123. //
  124. FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) {
  125. if (blink)
  126. lcd_put_u8str(value);
  127. else {
  128. if (!TEST(axis_homed, axis))
  129. while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?');
  130. else {
  131. #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
  132. if (!TEST(axis_known_position, axis))
  133. lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" "));
  134. else
  135. #endif
  136. lcd_put_u8str(value);
  137. }
  138. }
  139. }
  140. void MarlinUI::draw_status_message(const bool blink) {
  141. // Get the UTF8 character count of the string
  142. uint8_t slen = utf8_strlen(status_message);
  143. #if ENABLED(STATUS_MESSAGE_SCROLLING)
  144. static bool last_blink = false;
  145. if (slen <= LCD_WIDTH) {
  146. // The string fits within the line. Print with no scrolling
  147. lcd_put_u8str(status_message);
  148. for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' ');
  149. }
  150. else {
  151. // String is longer than the available space
  152. // Get a pointer to the next valid UTF8 character
  153. const char *stat = status_message + status_scroll_offset;
  154. // Get the string remaining length
  155. const uint8_t rlen = utf8_strlen(stat);
  156. if (rlen >= LCD_WIDTH) {
  157. // The remaining string fills the screen - Print it
  158. lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH);
  159. }
  160. else {
  161. // The remaining string does not completely fill the screen
  162. lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); // The string leaves space
  163. uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
  164. lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot
  165. if (--chars) { // Draw a second dot if there's space
  166. lcd_put_wchar('.');
  167. if (--chars) {
  168. // Print a second copy of the message
  169. lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH - (rlen + 2) * (MENU_FONT_WIDTH));
  170. }
  171. }
  172. }
  173. if (last_blink != blink) {
  174. last_blink = blink;
  175. // Adjust by complete UTF8 characters
  176. if (status_scroll_offset < slen) {
  177. status_scroll_offset++;
  178. while (!START_OF_UTF8_CHAR(status_message[status_scroll_offset]))
  179. status_scroll_offset++;
  180. }
  181. else
  182. status_scroll_offset = 0;
  183. }
  184. }
  185. #else // !STATUS_MESSAGE_SCROLLING
  186. UNUSED(blink);
  187. // Just print the string to the LCD
  188. lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH);
  189. // Fill the rest with spaces
  190. for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' ');
  191. #endif // !STATUS_MESSAGE_SCROLLING
  192. }
  193. void MarlinUI::draw_status_screen() {
  194. #define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH)
  195. #define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && FAN_ANIM_FRAMES)
  196. #define ANIM_END (HOTENDS && defined(STATUS_HOTEND_ANIM))
  197. #define ANIM_BED (DO_DRAW_BED && defined(STATUS_BED_ANIM))
  198. #if ANIM_END || ANIM_BED
  199. static uint8_t heat_bits;
  200. #endif
  201. #if ANIM_END
  202. #define HOTEND_ALT(N) TEST(heat_bits, N)
  203. #else
  204. #define HOTEND_ALT(N) false
  205. #endif
  206. #if ANIM_BED
  207. #define BED_ALT TEST(heat_bits, 7)
  208. #else
  209. #define BED_ALT false
  210. #endif
  211. static char xstring[5], ystring[5], zstring[8];
  212. #if ENABLED(FILAMENT_LCD_DISPLAY)
  213. static char wstring[5], mstring[4];
  214. #endif
  215. // At the first page, generate new display values
  216. if (first_page) {
  217. #if ANIM_END || ANIM_BED
  218. heat_bits = 0;
  219. #if ANIM_END
  220. HOTEND_LOOP() if (thermalManager.isHeatingHotend(e) ^ SHOW_ON_STATE) SBI(heat_bits, e);
  221. #endif
  222. #if ANIM_BED
  223. if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(heat_bits, 7);
  224. #endif
  225. #endif
  226. strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])));
  227. strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
  228. strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])));
  229. #if ENABLED(FILAMENT_LCD_DISPLAY)
  230. strcpy(wstring, ftostr12ns(filament_width_meas));
  231. strcpy(mstring, itostr3(100.0 * (
  232. parser.volumetric_enabled
  233. ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
  234. : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
  235. )
  236. ));
  237. #endif
  238. }
  239. const bool blink = get_blink();
  240. // Status Menu Font
  241. set_font(FONT_STATUSMENU);
  242. #if STATUS_LOGO_WIDTH
  243. if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1))
  244. u8g.drawBitmapP(
  245. STATUS_LOGO_X, STATUS_LOGO_Y,
  246. STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT,
  247. status_logo_bmp
  248. );
  249. #endif
  250. #if STATUS_HEATERS_WIDTH || STATUS_HOTEND1_WIDTH
  251. if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)) {
  252. #if STATUS_HEATERS_WIDTH
  253. // Draw all heaters (and maybe the bed) in one go
  254. u8g.drawBitmapP(
  255. STATUS_HEATERS_X, STATUS_HEATERS_Y,
  256. STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT,
  257. status_heaters_bmp
  258. );
  259. #else
  260. #if ANIM_END && defined(STATUS_HOTEND_INVERTED)
  261. #define OFF_BMP(N) status_hotend##N##_b_bmp
  262. #define ON_BMP(N) status_hotend##N##_a_bmp
  263. #else
  264. #define OFF_BMP(N) status_hotend##N##_a_bmp
  265. #define ON_BMP(N) status_hotend##N##_b_bmp
  266. #endif
  267. #if STATUS_HOTEND_BITMAPS > 1
  268. static const unsigned char* const status_hotend_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, OFF_BMP(1), OFF_BMP(2), OFF_BMP(3), OFF_BMP(4), OFF_BMP(5), OFF_BMP(6));
  269. #if ANIM_END
  270. static const unsigned char* const status_hotend_on_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, ON_BMP(1), ON_BMP(2), ON_BMP(3), ON_BMP(4), ON_BMP(5), ON_BMP(6));
  271. #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr((S) ? &status_hotend_on_gfx[(N) % (STATUS_HOTEND_BITMAPS)] : &status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)])
  272. #else
  273. #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr(&status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)])
  274. #endif
  275. #elif ANIM_END
  276. #define HOTEND_BITMAP(N,S) ((S) ? ON_BMP() : OFF_BMP())
  277. #else
  278. #define HOTEND_BITMAP(N,S) status_hotend_a_bmp
  279. #endif
  280. #define MAX_HOTEND_DRAW MIN(HOTENDS, ((128 - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
  281. // Draw hotends from one or more individual hotend bitmaps
  282. for (uint8_t h = 0; h < MAX_HOTEND_DRAW; ++h) {
  283. u8g.drawBitmapP(
  284. STATUS_HOTEND_X(h), STATUS_HEATERS_Y,
  285. STATUS_HOTEND_BYTEWIDTH(h), STATUS_HEATERS_HEIGHT,
  286. HOTEND_BITMAP(h, HOTEND_ALT(h))
  287. );
  288. }
  289. #endif
  290. } // PAGE_CONTAINS
  291. #endif
  292. #if DO_DRAW_BED
  293. #if ANIM_BED
  294. #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp)
  295. #else
  296. #define BED_BITMAP(S) status_bed_bmp
  297. #endif
  298. const uint8_t bedy = STATUS_BED_Y(BED_ALT), bedh = STATUS_BED_HEIGHT(BED_ALT);
  299. if (PAGE_CONTAINS(bedy, bedy + bedh - 1)) {
  300. u8g.drawBitmapP(
  301. STATUS_BED_X, bedy,
  302. STATUS_BED_BYTEWIDTH, bedh,
  303. BED_BITMAP(BED_ALT)
  304. );
  305. }
  306. #endif
  307. #if DO_DRAW_FAN
  308. #if FAN_ANIM_FRAMES > 2
  309. static bool old_blink;
  310. static uint8_t fan_frame;
  311. if (old_blink != blink) {
  312. old_blink = blink;
  313. if (!fan_speed[0] || ++fan_frame >= FAN_ANIM_FRAMES) fan_frame = 0;
  314. }
  315. #endif
  316. if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1))
  317. u8g.drawBitmapP(
  318. STATUS_FAN_X, STATUS_FAN_Y,
  319. STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT,
  320. #if FAN_ANIM_FRAMES > 2
  321. fan_frame == 1 ? status_fan1_bmp :
  322. fan_frame == 2 ? status_fan2_bmp :
  323. #if FAN_ANIM_FRAMES > 3
  324. fan_frame == 3 ? status_fan3_bmp :
  325. #endif
  326. #elif FAN_ANIM_FRAMES > 1
  327. blink && fan_speed[0] ? status_fan1_bmp :
  328. #endif
  329. status_fan0_bmp
  330. );
  331. #endif
  332. //
  333. // Temperature Graphics and Info
  334. //
  335. if (PAGE_UNDER(28)) {
  336. // Extruders
  337. HOTEND_LOOP() _draw_heater_status(STATUS_HOTEND_TEXT_X(e), e, blink);
  338. // Heated bed
  339. #if HOTENDS < 4 && HAS_HEATED_BED
  340. _draw_heater_status(STATUS_BED_TEXT_X, -1, blink);
  341. #endif
  342. // Fan, if a bitmap was provided
  343. #if DO_DRAW_FAN
  344. if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y)) {
  345. const int per = ((int(fan_speed[0]) + 1) * 100) / 256;
  346. if (per) {
  347. lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
  348. lcd_put_u8str(itostr3(per));
  349. lcd_put_wchar('%');
  350. }
  351. }
  352. #endif
  353. }
  354. #if ENABLED(SDSUPPORT)
  355. //
  356. // SD Card Symbol
  357. //
  358. if (card.isFileOpen() && PAGE_CONTAINS(42, 51)) {
  359. // Upper box
  360. u8g.drawBox(42, 42, 8, 7); // 42-48 (or 41-47)
  361. // Right edge
  362. u8g.drawBox(50, 44, 2, 5); // 44-48 (or 43-47)
  363. // Bottom hollow box
  364. u8g.drawFrame(42, 49, 10, 4); // 49-52 (or 48-51)
  365. // Corner pixel
  366. u8g.drawPixel(50, 43); // 43 (or 42)
  367. }
  368. #endif // SDSUPPORT
  369. #if HAS_PRINT_PROGRESS
  370. //
  371. // Progress bar frame
  372. //
  373. #define PROGRESS_BAR_X 54
  374. #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
  375. if (PAGE_CONTAINS(49, 52)) // 49-52 (or 49-51)
  376. u8g.drawFrame(
  377. PROGRESS_BAR_X, 49,
  378. PROGRESS_BAR_WIDTH, 4
  379. );
  380. const uint8_t progress = get_progress();
  381. if (progress > 1) {
  382. //
  383. // Progress bar solid part
  384. //
  385. if (PAGE_CONTAINS(50, 51)) // 50-51 (or just 50)
  386. u8g.drawBox(
  387. PROGRESS_BAR_X + 1, 50,
  388. (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress * 0.01), 2
  389. );
  390. //
  391. // SD Percent Complete
  392. //
  393. #if ENABLED(DOGM_SD_PERCENT)
  394. if (PAGE_CONTAINS(41, 48)) {
  395. // Percent complete
  396. lcd_moveto(55, 48);
  397. lcd_put_u8str(itostr3(progress));
  398. lcd_put_wchar('%');
  399. }
  400. #endif
  401. }
  402. //
  403. // Elapsed Time
  404. //
  405. #if DISABLED(DOGM_SD_PERCENT)
  406. #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (MENU_FONT_WIDTH / 2))
  407. #else
  408. #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * MENU_FONT_WIDTH)
  409. #endif
  410. if (PAGE_CONTAINS(41, 48)) {
  411. char buffer[13];
  412. duration_t elapsed = print_job_timer.duration();
  413. bool has_days = (elapsed.value >= 60*60*24L);
  414. uint8_t len = elapsed.toDigital(buffer, has_days);
  415. lcd_moveto(SD_DURATION_X, 48);
  416. lcd_put_u8str(buffer);
  417. }
  418. #endif // HAS_PRINT_PROGRESS
  419. //
  420. // XYZ Coordinates
  421. //
  422. #define XYZ_BASELINE (30 + INFO_FONT_ASCENT)
  423. #define X_LABEL_POS 3
  424. #define X_VALUE_POS 11
  425. #define XYZ_SPACING 37
  426. #if ENABLED(XYZ_HOLLOW_FRAME)
  427. #define XYZ_FRAME_TOP 29
  428. #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3
  429. #else
  430. #define XYZ_FRAME_TOP 30
  431. #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 1
  432. #endif
  433. if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) {
  434. #if ENABLED(XYZ_HOLLOW_FRAME)
  435. u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39
  436. #else
  437. u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37
  438. #endif
  439. if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_ASCENT - 1), XYZ_BASELINE)) {
  440. #if DISABLED(XYZ_HOLLOW_FRAME)
  441. u8g.setColorIndex(0); // white on black
  442. #endif
  443. lcd_moveto(0 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
  444. lcd_put_wchar('X');
  445. lcd_moveto(0 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
  446. _draw_axis_value(X_AXIS, xstring, blink);
  447. lcd_moveto(1 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
  448. lcd_put_wchar('Y');
  449. lcd_moveto(1 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
  450. _draw_axis_value(Y_AXIS, ystring, blink);
  451. lcd_moveto(2 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
  452. lcd_put_wchar('Z');
  453. lcd_moveto(2 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
  454. _draw_axis_value(Z_AXIS, zstring, blink);
  455. #if DISABLED(XYZ_HOLLOW_FRAME)
  456. u8g.setColorIndex(1); // black on white
  457. #endif
  458. }
  459. }
  460. //
  461. // Feedrate
  462. //
  463. #define EXTRAS_BASELINE 50
  464. if (PAGE_CONTAINS(EXTRAS_BASELINE - (INFO_FONT_HEIGHT - 1), EXTRAS_BASELINE)) {
  465. set_font(FONT_MENU);
  466. lcd_moveto(3, EXTRAS_BASELINE);
  467. lcd_put_wchar(LCD_STR_FEEDRATE[0]);
  468. set_font(FONT_STATUSMENU);
  469. lcd_moveto(12, EXTRAS_BASELINE);
  470. lcd_put_u8str(itostr3(feedrate_percentage));
  471. lcd_put_wchar('%');
  472. //
  473. // Filament sensor display if SD is disabled
  474. //
  475. #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
  476. lcd_moveto(56, EXTRAS_BASELINE);
  477. lcd_put_u8str(wstring);
  478. lcd_moveto(102, EXTRAS_BASELINE);
  479. lcd_put_u8str(mstring);
  480. lcd_put_wchar('%');
  481. set_font(FONT_MENU);
  482. lcd_moveto(47, EXTRAS_BASELINE);
  483. lcd_put_wchar(LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));
  484. lcd_moveto(93, EXTRAS_BASELINE);
  485. lcd_put_wchar(LCD_STR_FILAM_MUL[0]);
  486. #endif
  487. }
  488. //
  489. // Status line
  490. //
  491. #define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT)
  492. if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_ASCENT - 1), STATUS_BASELINE)) {
  493. lcd_moveto(0, STATUS_BASELINE);
  494. #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
  495. // Alternate Status message and Filament display
  496. if (ELAPSED(millis(), next_filament_display)) {
  497. lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));
  498. lcd_put_wchar(':');
  499. lcd_put_u8str(wstring);
  500. lcd_put_u8str_P(PSTR(" " LCD_STR_FILAM_MUL));
  501. lcd_put_wchar(':');
  502. lcd_put_u8str(mstring);
  503. lcd_put_wchar('%');
  504. }
  505. else
  506. #endif
  507. draw_status_message(blink);
  508. }
  509. }
  510. #endif // HAS_GRAPHICAL_LCD && !LIGHTWEIGHT_UI