Merge upstream changes from Marlin 2.1.2
This commit is contained in:
@@ -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));
|
||||
@@ -599,23 +596,58 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
||||
|
||||
#endif // HAS_CUTTER
|
||||
|
||||
#if HAS_PRINT_PROGRESS
|
||||
|
||||
FORCE_INLINE void _draw_print_progress() {
|
||||
if (!PanelDetected) return;
|
||||
const uint8_t progress = ui._get_progress();
|
||||
#if ENABLED(SDSUPPORT)
|
||||
lcd_put_u8str(F("SD"));
|
||||
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
lcd_put_u8str(F("P:"));
|
||||
#endif
|
||||
if (progress)
|
||||
lcd.print(ui8tostr3rj(progress));
|
||||
else
|
||||
lcd_put_u8str(F("---"));
|
||||
lcd.write('%');
|
||||
}
|
||||
#if HAS_PRINT_PROGRESS // UNTESTED!!!
|
||||
#define TPOFFSET (LCD_WIDTH - 1)
|
||||
static uint8_t timepos = TPOFFSET - 6;
|
||||
|
||||
#if ENABLED(SHOW_PROGRESS_PERCENT)
|
||||
void MarlinUI::drawPercent() {
|
||||
const uint8_t progress = ui.get_progress_percent();
|
||||
if (progress) {
|
||||
lcd_moveto(0, 2);
|
||||
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
|
||||
lcd.print(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
|
||||
lcd.write('%');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_REMAINING_TIME)
|
||||
void MarlinUI::drawRemain() {
|
||||
if (printJobOngoing()) {
|
||||
const duration_t remaint = ui.get_remaining_time();
|
||||
char buffer[10];
|
||||
timepos = TPOFFSET - remaint.toDigital(buffer);
|
||||
lcd_moveto(timepos, 1);
|
||||
lcd.write('R');
|
||||
lcd.print(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_INTERACTION_TIME)
|
||||
void MarlinUI::drawInter() {
|
||||
const duration_t interactt = ui.interaction_time;
|
||||
if (printingIsActive() && interactt.value) {
|
||||
char buffer[10];
|
||||
timepos = TPOFFSET - interactt.toDigital(buffer);
|
||||
lcd_moveto(timepos, 1);
|
||||
lcd.write('C');
|
||||
lcd.print(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(SHOW_ELAPSED_TIME)
|
||||
void MarlinUI::drawElapsed() {
|
||||
if (printJobOngoing()) {
|
||||
const duration_t elapsedt = print_job_timer.duration();
|
||||
char buffer[10];
|
||||
timepos = TPOFFSET - elapsedt.toDigital(buffer);
|
||||
lcd_moveto(timepos, 1);
|
||||
lcd.write('E');
|
||||
lcd.print(buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // HAS_PRINT_PROGRESS
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
@@ -799,23 +831,12 @@ void MarlinUI::draw_status_screen() {
|
||||
#endif
|
||||
|
||||
//
|
||||
// Line 2 - feedrate, , time
|
||||
// Line 2 - feedrate, progress %, progress time
|
||||
//
|
||||
|
||||
lcd_moveto(0, 1);
|
||||
lcd_put_u8str(F("FR")); lcd.print(i16tostr3rj(feedrate_percentage)); lcd.write('%');
|
||||
|
||||
#if BOTH(SDSUPPORT, HAS_PRINT_PROGRESS)
|
||||
lcd_moveto(LCD_WIDTH / 2 - 3, 1);
|
||||
_draw_print_progress();
|
||||
#endif
|
||||
|
||||
char buffer[10];
|
||||
duration_t elapsed = print_job_timer.duration();
|
||||
uint8_t len = elapsed.toDigital(buffer);
|
||||
|
||||
lcd_moveto((LCD_WIDTH - 1) - len, 1);
|
||||
lcd.write(LCD_STR_CLOCK[0]); lcd.print(buffer);
|
||||
ui.rotate_progress(); // UNTESTED!!!
|
||||
|
||||
//
|
||||
// Line 3 - progressbar
|
||||
|
Reference in New Issue
Block a user