🚸 Optional Cutter/Laser status for HD44780 (#25003)

This commit is contained in:
Thomas Buck 2022-11-27 01:59:13 +01:00 committed by Scott Lahteine
parent b9bed1ca69
commit b6051fe847
19 changed files with 178 additions and 124 deletions

View File

@ -53,7 +53,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_current() {
const float amps = getAmps();
lcd_put_u8str(amps < 100 ? ftostr31ns(amps) : ui16tostr4rj((uint16_t)amps));
lcd_put_lchar('A');
lcd_put_u8str(F("A"));
}
#endif
@ -61,7 +61,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_voltage() {
const float volts = getVolts();
lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts));
lcd_put_lchar('V');
lcd_put_u8str(F("V"));
}
#endif
@ -69,7 +69,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
void PowerMonitor::draw_power() {
const float power = getPower();
lcd_put_u8str(power < 100 ? ftostr31ns(power) : ui16tostr4rj((uint16_t)power));
lcd_put_lchar('W');
lcd_put_u8str(F("W"));
}
#endif

View File

@ -56,9 +56,9 @@ typedef struct _hd44780_charmap_t {
} hd44780_charmap_t;
#ifdef __AVR__
#define IV(a) U##a
#define IV(a) lchar_t(U##a)
#else
#define IV(a) L##a
#define IV(a) lchar_t(L##a)
#endif
static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {

View File

@ -58,6 +58,10 @@
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if HAS_CUTTER
#include "../../feature/spindle_laser.h"
#endif
//
// Create LCD instance and chipset-specific information
//
@ -406,7 +410,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
void lcd_erase_line(const lcd_uint_t line) {
lcd_moveto(0, line);
for (uint8_t i = LCD_WIDTH + 1; --i;)
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
}
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
@ -414,7 +418,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
uint8_t slen = utf8_strlen(ftxt);
if (slen < len) {
lcd_put_u8str_max(col, line, ftxt, len);
for (; slen < len; ++slen) lcd_put_lchar(' ');
for (; slen < len; ++slen) lcd_put_u8str(F(" "));
safe_delay(time);
}
else {
@ -426,7 +430,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
lcd_put_u8str_max_P(col, line, p, len);
// Fill with spaces
for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_lchar(' ');
for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_u8str(F(" "));
// Delay
safe_delay(dly);
@ -440,9 +444,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
static void logo_lines(FSTR_P const extra) {
int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2;
lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x01');
lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x01"));
lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra);
lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x03');
lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_u8str(F("\x03"));
}
void MarlinUI::show_bootscreen() {
@ -522,7 +526,15 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
lcd_put_u8str(value);
}
/**
* @brief Draw current and target for a heater/cooler
* @details Print at the current LCD position the current/target for a single heater,
* blinking the target temperature of an idle heater has timed out.
*
* @param heater_id The heater ID, such as 0, 1, ..., H_BED, H_CHAMBER, etc.
* @param prefix A char to draw in front (e.g., a thermometer or icon)
* @param blink Flag to show the blink state instead of the regular state
*/
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
#if HAS_HEATED_BED
const bool isBed = TERN(HAS_HEATED_CHAMBER, heater_id == H_BED, heater_id < 0);
@ -535,43 +547,41 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1));
lcd_put_lchar('/');
lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
}
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out)
lcd_put_u8str(F(" "));
else
#endif
lcd_put_u8str(i16tostr3left(t2));
if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_lchar(' ');
if (t2 < 10) lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
}
}
#if HAS_COOLER
FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
const celsius_t t2 = thermalManager.degTargetCooler();
if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler()));
lcd_put_lchar('/');
lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (t2 >= 10) lcd_put_u8str(F(" "));
if (t2 >= 100) lcd_put_u8str(F(" "));
}
else
#endif
@ -579,31 +589,32 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
if (prefix >= 0) {
lcd_put_lchar(LCD_STR_DEGREE[0]);
lcd_put_lchar(' ');
if (t2 < 10) lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
}
}
#endif
#endif // HAS_COOLER
#if ENABLED(LASER_COOLANT_FLOW_METER)
FORCE_INLINE void _draw_flowmeter_status() {
lcd_put_u8str("~");
lcd_put_u8str(F("~"));
lcd_put_u8str(ftostr11ns(cooler.flowrate));
lcd_put_lchar('L');
lcd_put_u8str(F("L"));
}
#endif
#if ENABLED(I2C_AMMETER)
FORCE_INLINE void _draw_ammeter_status() {
lcd_put_u8str(" ");
lcd_put_u8str(F(" "));
ammeter.read();
if (ammeter.current <= 0.999f) {
lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
lcd_put_u8str("mA");
lcd_put_u8str(F("mA"));
}
else {
lcd_put_u8str(ftostr12ns(ammeter.current));
lcd_put_lchar('A');
lcd_put_u8str(F("A"));
}
}
#endif
@ -612,6 +623,36 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
_draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
}
#if HAS_CUTTER
FORCE_INLINE void _draw_cutter_status() {
lcd_put_u8str(TERN(LASER_FEATURE, GET_TEXT_F(MSG_LASER), GET_TEXT_F(MSG_CUTTER)));
lcd_put_u8str(F(": "));
#if CUTTER_UNIT_IS(RPM)
lcd_put_u8str(ftostr61rj(float(cutter.unitPower) / 1000));
lcd_put_u8str(F("K"));
#else
lcd_put_u8str(cutter_power2str(cutter.unitPower));
#if CUTTER_UNIT_IS(PERCENT)
lcd_put_u8str(F("%"));
#endif
#endif
lcd_put_u8str(F(" "));
lcd_put_u8str(cutter.enabled() ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF));
lcd_put_u8str(F(" "));
switch (cutter.cutter_mode) {
case CUTTER_MODE_STANDARD: lcd_put_u8str(F("S")); break;
case CUTTER_MODE_CONTINUOUS: lcd_put_u8str(F("C")); break;
case CUTTER_MODE_DYNAMIC: lcd_put_u8str(F("D")); break;
case CUTTER_MODE_ERROR: lcd_put_u8str(F("!")); break;
}
}
#endif // HAS_CUTTER
#if ENABLED(LCD_PROGRESS_BAR)
void MarlinUI::draw_progress_bar(const uint8_t percent) {
@ -654,7 +695,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(ftostr12ns(filwidth.measured_mm));
lcd_put_u8str(F(" V"));
lcd_put_u8str(i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled)));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
return;
}
@ -673,7 +714,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(status_message);
// Fill the rest with spaces
while (slen < LCD_WIDTH) { lcd_put_lchar(' '); ++slen; }
while (slen < LCD_WIDTH) { lcd_put_u8str(F(" ")); ++slen; }
}
else {
// String is larger than the available space in screen.
@ -687,11 +728,11 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the remaining string doesn't completely fill the screen
if (rlen < LCD_WIDTH) {
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space
lcd_put_u8str(F(" ")); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (--chars) { // Draw a third space if there's room
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
}
@ -712,10 +753,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, LCD_WIDTH);
// Fill the rest with spaces if there are missing spaces
while (slen < LCD_WIDTH) {
lcd_put_lchar(' ');
++slen;
}
for (; slen < LCD_WIDTH; ++slen) lcd_put_u8str(F(" "));
#endif
}
@ -732,7 +770,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_moveto(pc, pr);
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
}
}
#endif
@ -828,6 +866,15 @@ void MarlinUI::draw_status_screen() {
lcd_moveto(8, 0);
_draw_bed_status(blink);
#endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif
#else // LCD_WIDTH >= 20
@ -848,6 +895,15 @@ void MarlinUI::draw_status_screen() {
lcd_moveto(10, 0);
_draw_bed_status(blink);
#endif
#elif HAS_CUTTER
//
// Cutter Status
//
lcd_moveto(0, 0);
_draw_cutter_status();
#endif
TERN_(HAS_COOLER, _draw_cooler_status('*', blink));
@ -920,7 +976,7 @@ void MarlinUI::draw_status_screen() {
else {
const xy_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
}
@ -945,7 +1001,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, 2, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
#if LCD_WIDTH >= 20
@ -978,7 +1034,7 @@ void MarlinUI::draw_status_screen() {
}
lcd_put_lchar(c);
lcd_put_u8str(i16tostr3rj(per));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
#endif
#endif
@ -1017,7 +1073,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]);
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
// ========== Line 3 ==========
@ -1075,18 +1131,18 @@ void MarlinUI::draw_status_screen() {
vlen = vstr ? utf8_strlen(vstr) : 0;
if (style & SS_CENTER) {
int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
while (--pad >= 0) { lcd_put_lchar(' '); n--; }
while (--pad >= 0) { lcd_put_u8str(F(" ")); n--; }
}
if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n);
if (vlen) n -= lcd_put_u8str_max(vstr, n);
for (; n > 0; --n) lcd_put_lchar(' ');
for (; n > 0; --n) lcd_put_u8str(F(" "));
}
// Draw a generic menu item with pre_char (if selected) and post_char
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) {
lcd_put_lchar(0, row, sel ? pre_char : ' ');
uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2);
for (; n; --n) lcd_put_lchar(' ');
for (; n; --n) lcd_put_u8str(F(" "));
lcd_put_lchar(post_char);
}
@ -1096,8 +1152,8 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen);
if (vlen) {
lcd_put_lchar(':');
for (; n; --n) lcd_put_lchar(' ');
lcd_put_u8str(F(":"));
for (; n; --n) lcd_put_u8str(F(" "));
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
}
}
@ -1107,7 +1163,7 @@ void MarlinUI::draw_status_screen() {
ui.encoder_direction_normal();
uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1);
if (value) {
lcd_put_lchar(':'); n--;
lcd_put_u8str(F(":")); n--;
const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space
const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit
lcd_put_lchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space
@ -1134,7 +1190,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');
constexpr uint8_t maxlen = LCD_WIDTH - 2;
uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen);
for (; n; --n) lcd_put_lchar(' ');
for (; n; --n) lcd_put_u8str(F(" "));
lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' ');
}
@ -1466,9 +1522,9 @@ void MarlinUI::draw_status_screen() {
*/
lcd_put_lchar(_LCD_W_POS, 0, '(');
lcd_put_u8str(ui8tostr3rj(x_plot));
lcd_put_lchar(',');
lcd_put_u8str(F(","));
lcd_put_u8str(ui8tostr3rj(y_plot));
lcd_put_lchar(')');
lcd_put_u8str(F(")"));
#if LCD_HEIGHT <= 3 // 16x2 or 20x2 display

View File

@ -523,17 +523,14 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
#if !HEATER_IDLE_HANDLER
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
}
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out)
lcd_put_u8str(F(" "));
else
#endif
lcd_put_u8str(i16tostr3left(t2));
lcd_put_lchar(' ');
if (t2 < 10) lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (t2 < 10) lcd_put_u8str(F(" "));
if (t2) picBits |= ICON_TEMP1;
else picBits &= ~ICON_TEMP1;
@ -545,7 +542,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
FORCE_INLINE void _draw_flowmeter_status() {
lcd_moveto(5, 5); lcd_put_u8str(F("FLOW"));
lcd_moveto(7, 6); lcd_put_lchar('L');
lcd_moveto(7, 6); lcd_put_u8str(F("L"));
lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate));
if (cooler.flowrate) picBits |= ICON_FAN;
@ -564,7 +561,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
{
lcd_put_u8str("mA");
lcd_moveto(10, 7);
lcd_put_lchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
lcd_put_u8str(F(" ")); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
}
else {
lcd_put_u8str(" A");
@ -585,9 +582,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
#if CUTTER_UNIT_IS(RPM)
lcd_moveto(16, 6); lcd_put_u8str(F("RPM"));
lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000));
lcd_put_lchar('K');
lcd_put_u8str(F("K"));
#elif CUTTER_UNIT_IS(PERCENT)
lcd_moveto(17, 6); lcd_put_lchar('%');
lcd_moveto(17, 6); lcd_put_u8str(F("%"));
lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#else
lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));

View File

@ -34,7 +34,7 @@ int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) {
return u8g_GetFontBBXWidth(u8g.getU8g());
}
u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(),
ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length);
ret = uxg_DrawLchar(u8g.getU8g(), x, y, c, max_length);
u8g.setPrintPos(x + ret, y);
return ret;
}

View File

@ -372,9 +372,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
lcd_put_lchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E');
lcd_put_lchar((char)('1' + extruder));
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder)));
lcd_put_lchar('/');
lcd_put_u8str(F("/"));
if (get_blink() || !thermalManager.heater_idle[extruder].timed_out)
lcd_put_u8str(i16tostr3rj(thermalManager.degTargetHotend(extruder)));
@ -420,12 +420,12 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
vlen = vstr ? utf8_strlen(vstr) : 0;
if (style & SS_CENTER) {
int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2;
while (--pad >= 0) n -= lcd_put_lchar(' ');
while (--pad >= 0) n -= lcd_put_u8str(F(" "));
}
if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
if (vlen) n -= lcd_put_u8str_max(vstr, n);
while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" "));
}
}
@ -433,9 +433,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) {
if (mark_as_selected(row, sel)) {
pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" "));
lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
}
}
@ -448,8 +448,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH);
if (vallen) {
lcd_put_lchar(':');
while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
lcd_put_u8str(F(":"));
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" "));
lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2);
if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr);
}
@ -493,7 +493,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
// If a value is included, print a colon, then print the value right-justified
if (value) {
lcd_put_lchar(':');
lcd_put_u8str(F(":"));
if (extra_row) {
// Assume that value is numeric (with no descender)
baseline += EDIT_FONT_ASCENT + 2;
@ -535,7 +535,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]);
const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH);
pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' ');
while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" "));
}
}
@ -612,9 +612,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) {
lcd_put_lchar(5, LCD_PIXEL_HEIGHT, '(');
u8g.print(x_plot);
lcd_put_lchar(',');
lcd_put_u8str(F(","));
u8g.print(y_plot);
lcd_put_lchar(')');
lcd_put_u8str(F(")"));
// Show the location value
lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);

View File

@ -455,7 +455,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
void MarlinUI::drawPercent() {
if (progress_string[0]) {
lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
}
}
#endif
@ -705,7 +705,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower));
#elif CUTTER_UNIT_IS(RPM)
lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr61rj(float(cutter.unitPower) / 1000));
lcd_put_lchar('K');
lcd_put_u8str(F("K"));
#else
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower));
#endif
@ -892,7 +892,7 @@ void MarlinUI::draw_status_screen() {
set_font(FONT_STATUSMENU);
lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage));
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
//
// Filament sensor display if SD is disabled
@ -900,7 +900,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring);
lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring);
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
set_font(FONT_MENU);
lcd_put_lchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str(F(LCD_STR_FILAM_DIA));
lcd_put_lchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]);
@ -917,12 +917,12 @@ void MarlinUI::draw_status_screen() {
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str(F(LCD_STR_FILAM_DIA));
lcd_put_lchar(':');
lcd_put_u8str(F(":"));
lcd_put_u8str(wstring);
lcd_put_u8str(F(" " LCD_STR_FILAM_MUL));
lcd_put_lchar(':');
lcd_put_u8str(F(":"));
lcd_put_u8str(mstring);
lcd_put_lchar('%');
lcd_put_u8str(F("%"));
return;
}
#endif
@ -955,7 +955,7 @@ void MarlinUI::draw_status_message(const bool blink) {
if (slen <= lcd_width) {
// The string fits within the line. Print with no scrolling
lcd_put_u8str(status_message);
while (slen < lcd_width) { lcd_put_lchar(' '); ++slen; }
while (slen < lcd_width) { lcd_put_u8str(F(" ")); ++slen; }
}
else {
// String is longer than the available space
@ -973,14 +973,14 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the remaining string doesn't completely fill the screen
if (rlen < lcd_width) {
uint8_t chars = lcd_width - rlen; // Amount of space left in characters
lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space
lcd_put_u8str(F(" ")); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (--chars) { // Draw a third space if there's room
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
if (--chars) { // Print a second copy of the message
lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH));
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
}
}
}
@ -995,7 +995,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, pixel_width);
// Fill the rest with spaces
for (; slen < lcd_width; ++slen) lcd_put_lchar(' ');
for (; slen < lcd_width; ++slen) lcd_put_u8str(F(" "));
#endif // !STATUS_MESSAGE_SCROLLING

View File

@ -161,7 +161,7 @@ static int fontgroup_cb_draw_u8g(void *userdata, const font_t *fnt_current, cons
*
* Draw a UTF-8 string at the specified position
*/
unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &wc, pixel_len_t max_width) {
unsigned int uxg_DrawLchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &wc, pixel_len_t max_width) {
struct _uxg_drawu8_data_t data;
font_group_t *group = &g_fontgroup_root;
const font_t *fnt_default = uxg_GetFont(pu8g);

View File

@ -26,7 +26,7 @@ typedef struct _uxg_fontinfo_t {
int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM
unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &ch, const pixel_len_t max_length);
unsigned int uxg_DrawLchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &ch, const pixel_len_t max_length);
unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length);
unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length);

View File

@ -213,7 +213,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str(status_message);
// Fill the rest with spaces
while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; }
}
}
else {
@ -227,10 +227,10 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the string doesn't completely fill the line...
if (rlen < max_status_chars) {
lcd_put_lchar('.'); // Always at 1+ spaces left, draw a dot
lcd_put_u8str(F(".")); // Always at 1+ spaces left, draw a dot
uint8_t chars = max_status_chars - rlen; // Amount of space left in characters
if (--chars) { // Draw a second dot if there's space
lcd_put_lchar('.');
lcd_put_u8str(F("."));
if (--chars)
lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
}
@ -254,7 +254,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str_max(status_message, max_status_chars);
// Fill the rest with spaces if there are missing spaces
while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; }
while (slen < max_status_chars) { lcd_put_u8str(F(" ")); ++slen; }
}
#endif

View File

@ -332,6 +332,7 @@ namespace Language_en {
LSTR MSG_COOLER = _UxGT("Laser Coolant");
LSTR MSG_COOLER_TOGGLE = _UxGT("Toggle Cooler");
LSTR MSG_FLOWMETER_SAFETY = _UxGT("Flow Safety");
LSTR MSG_CUTTER = _UxGT("Cutter");
LSTR MSG_LASER = _UxGT("Laser");
LSTR MSG_FAN_SPEED = _UxGT("Fan Speed");
LSTR MSG_FAN_SPEED_N = _UxGT("Fan Speed ~");

View File

@ -52,7 +52,7 @@ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/
if (!wc) break;
if (wc == '=' || wc == '~' || wc == '*') {
if (ind >= 0) {
if (wc == '*') { lcd_put_lchar('E'); n--; }
if (wc == '*') { lcd_put_u8str(F("E")); n--; }
if (n) {
int8_t inum = ind + ((wc == '=') ? 0 : LCD_FIRST_TOOL);
if (inum >= 10) {

View File

@ -178,7 +178,7 @@ static void _lcd_level_bed_corners_get_next_position() {
lcd_put_u8str(GET_TEXT_F(MSG_BED_TRAMMING_GOOD_POINTS));
IF_ENABLED(TFT_COLOR_UI, lcd_moveto(12, cy));
lcd_put_u8str(GOOD_POINTS_TO_STR(good_points));
lcd_put_lchar('/');
lcd_put_u8str(F("/"));
lcd_put_u8str(GOOD_POINTS_TO_STR(nr_edge_points));
}

View File

@ -79,7 +79,7 @@ void menu_advanced_settings();
LIMIT(bar_percent, 0, 100);
ui.encoderPosition = 0;
MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_lchar('%');
lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_u8str(F("%"));
lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
}

View File

@ -61,10 +61,10 @@ void Password::menu_password_entry() {
FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT);
EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered);
MENU_ITEM_ADDON_START(utf8_strlen(label) + 1);
lcd_put_lchar(' ');
lcd_put_u8str(F(" "));
lcd_put_lchar('1' + digit_no);
SETCURSOR_X(LCD_WIDTH - 2);
lcd_put_lchar('>');
lcd_put_u8str(F(">"));
MENU_ITEM_ADDON_END();
ACTION_ITEM(MSG_START_OVER, start_over);

View File

@ -79,7 +79,7 @@
EDIT_ITEM_FAST(CUTTER_MENU_PULSE_TYPE, MSG_LASER_PULSE_MS, &cutter.testPulse, LASER_TEST_PULSE_MIN, LASER_TEST_PULSE_MAX);
ACTION_ITEM(MSG_LASER_FIRE_PULSE, cutter.test_fire_pulse);
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency);
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 65535, cutter.refresh_frequency);
#endif
#endif
END_MENU();

View File

@ -76,12 +76,12 @@
#if ENABLED(TFT_COLOR_UI)
lcd_moveto(4, 3);
lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL));
lcd_put_lchar(':');
lcd_put_u8str(F(":"));
lcd_moveto(10, 3);
#else
lcd_moveto(0, TERN(HAS_MARLINUI_U8GLIB, LCD_PIXEL_HEIGHT - MENU_FONT_DESCENT, LCD_HEIGHT - 1));
lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL));
lcd_put_lchar(':');
lcd_put_u8str(F(":"));
#endif
lcd_put_u8str(BABYSTEP_TO_STR(mps * babystep.axis_total[BS_TOTAL_IND(axis)]));
}

View File

@ -27,7 +27,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 SERIAL_PORT -1 \
SPINDLE_LASER_PWM_PIN HEATER_1_PIN SPINDLE_LASER_ENA_PIN HEATER_2_PIN \
TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13
opt_enable LASER_FEATURE LASER_SAFETY_TIMEOUT_MS REPRAP_DISCOUNT_SMART_CONTROLLER
exec_test $1 $2 "BigTreeTech SKR Pro | Laser (Percent) | Cooling | LCD" "$3"
exec_test $1 $2 "BigTreeTech SKR Pro | HD44780 | Laser (Percent) | Cooling | LCD" "$3"
# clean up
restore_configs

View File

@ -268,12 +268,12 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \
SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT SET_REMAINING_TIME SET_INTERACTION_TIME M73_REPORT \
SHOW_PROGRESS_PERCENT SHOW_ELAPSED_TIME SHOW_REMAINING_TIME SHOW_INTERACTION_TIME PRINT_PROGRESS_SHOW_DECIMALS
exec_test $1 $2 "MEGA2560 RAMPS | 12864 | progress rotation" "$3"
exec_test $1 $2 "MEGA2560 RAMPS | 128x64 | progress rotation" "$3"
opt_enable LIGHTWEIGHT_UI
exec_test $1 $2 "MEGA2560 RAMPS | 12864 LIGHTWEIGHT_UI | progress rotation" "$3"
exec_test $1 $2 "MEGA2560 RAMPS | 128x64 LIGHTWEIGHT_UI | progress rotation" "$3"
opt_disable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER
exec_test $1 $2 "MEGA2560 RAMPS | 44780 | progress rotation" "$3"
exec_test $1 $2 "MEGA2560 RAMPS | HD44780 | progress rotation" "$3"
# clean up
restore_configs