Minor DOGM status screen fix (#15746)

This commit is contained in:
Robby Candra 2019-11-02 19:04:31 +07:00 committed by Scott Lahteine
parent bdb452ed81
commit 7360e9343a

View file

@ -388,17 +388,21 @@ void MarlinUI::draw_status_screen() {
#endif #endif
heat_bits = new_bits; heat_bits = new_bits;
#endif #endif
const xyz_pos_t lpos = current_position.asLogical(); const xyz_pos_t lpos = current_position.asLogical();
if (showxy) strcpy(zstring, ftostr52sp(lpos.z));
if (showxy) {
strcpy(xstring, ftostr4sign(lpos.x)); strcpy(xstring, ftostr4sign(lpos.x));
strcpy(ystring, ftostr4sign(lpos.y));
}
else { else {
#if ENABLED(LCD_SHOW_E_TOTAL) #if ENABLED(LCD_SHOW_E_TOTAL)
const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
#endif #endif
} }
strcpy(ystring, ftostr4sign(lpos.y));
strcpy(zstring, ftostr52sp( lpos.z));
#if ENABLED(FILAMENT_LCD_DISPLAY) #if ENABLED(FILAMENT_LCD_DISPLAY)
strcpy(wstring, ftostr12ns(filwidth.measured_mm)); strcpy(wstring, ftostr12ns(filwidth.measured_mm));
strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled)));