Add print at position shortcuts
This commit is contained in:
@@ -100,8 +100,7 @@
|
||||
FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
|
||||
const char *str = i16tostr3(temp);
|
||||
const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
|
||||
lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty);
|
||||
lcd_put_u8str(&str[3-len]);
|
||||
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
|
||||
lcd_put_wchar(LCD_STR_DEGREE[0]);
|
||||
}
|
||||
|
||||
@@ -264,8 +263,7 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin
|
||||
//
|
||||
FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) {
|
||||
const uint8_t offs = (XYZ_SPACING) * axis;
|
||||
lcd_moveto(X_LABEL_POS + offs, XYZ_BASELINE);
|
||||
lcd_put_wchar('X' + axis);
|
||||
lcd_put_wchar(X_LABEL_POS + offs, XYZ_BASELINE, 'X' + axis);
|
||||
lcd_moveto(X_VALUE_POS + offs, XYZ_BASELINE);
|
||||
if (blink)
|
||||
lcd_put_u8str(value);
|
||||
@@ -429,8 +427,7 @@ void MarlinUI::draw_status_screen() {
|
||||
c = '*';
|
||||
}
|
||||
#endif
|
||||
lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
|
||||
lcd_put_u8str(i16tostr3(thermalManager.fanPercent(spd)));
|
||||
lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3(thermalManager.fanPercent(spd)));
|
||||
lcd_put_wchar(c);
|
||||
}
|
||||
}
|
||||
@@ -488,8 +485,7 @@ void MarlinUI::draw_status_screen() {
|
||||
#if ENABLED(DOGM_SD_PERCENT)
|
||||
if (PAGE_CONTAINS(41, 48)) {
|
||||
// Percent complete
|
||||
lcd_moveto(55, 48);
|
||||
lcd_put_u8str(ui8tostr3(progress));
|
||||
lcd_put_u8str(55, 48, ui8tostr3(progress));
|
||||
lcd_put_wchar('%');
|
||||
}
|
||||
#endif
|
||||
@@ -510,8 +506,7 @@ void MarlinUI::draw_status_screen() {
|
||||
duration_t elapsed = print_job_timer.duration();
|
||||
bool has_days = (elapsed.value >= 60*60*24L);
|
||||
uint8_t len = elapsed.toDigital(buffer, has_days);
|
||||
lcd_moveto(SD_DURATION_X, EXTRAS_BASELINE);
|
||||
lcd_put_u8str(buffer);
|
||||
lcd_put_u8str(SD_DURATION_X, EXTRAS_BASELINE, buffer);
|
||||
}
|
||||
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
@@ -546,8 +541,6 @@ void MarlinUI::draw_status_screen() {
|
||||
|
||||
// Two-component mix / gradient instead of XY
|
||||
|
||||
lcd_moveto(X_LABEL_POS, XYZ_BASELINE);
|
||||
|
||||
char mixer_messages[12];
|
||||
const char *mix_label;
|
||||
#if ENABLED(GRADIENT_MIX)
|
||||
@@ -562,7 +555,7 @@ void MarlinUI::draw_status_screen() {
|
||||
mix_label = "Mx";
|
||||
}
|
||||
sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
|
||||
lcd_put_u8str(mixer_messages);
|
||||
lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages);
|
||||
|
||||
#else
|
||||
|
||||
@@ -587,28 +580,22 @@ void MarlinUI::draw_status_screen() {
|
||||
|
||||
if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) {
|
||||
set_font(FONT_MENU);
|
||||
lcd_moveto(3, EXTRAS_2_BASELINE);
|
||||
lcd_put_wchar(LCD_STR_FEEDRATE[0]);
|
||||
lcd_put_wchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]);
|
||||
|
||||
set_font(FONT_STATUSMENU);
|
||||
lcd_moveto(12, EXTRAS_2_BASELINE);
|
||||
lcd_put_u8str(i16tostr3(feedrate_percentage));
|
||||
lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3(feedrate_percentage));
|
||||
lcd_put_wchar('%');
|
||||
|
||||
//
|
||||
// Filament sensor display if SD is disabled
|
||||
//
|
||||
#if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
|
||||
lcd_moveto(56, EXTRAS_2_BASELINE);
|
||||
lcd_put_u8str(wstring);
|
||||
lcd_moveto(102, EXTRAS_2_BASELINE);
|
||||
lcd_put_u8str(mstring);
|
||||
lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring);
|
||||
lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring);
|
||||
lcd_put_wchar('%');
|
||||
set_font(FONT_MENU);
|
||||
lcd_moveto(47, EXTRAS_2_BASELINE);
|
||||
lcd_put_wchar(LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));
|
||||
lcd_moveto(93, EXTRAS_2_BASELINE);
|
||||
lcd_put_wchar(LCD_STR_FILAM_MUL[0]);
|
||||
lcd_put_wchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));
|
||||
lcd_put_wchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user