Skip to content

Commit

Permalink
Merge 'bugfix-2.0.x' into pr/23453
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 6, 2022
2 parents 6bce56b + 4d28c9d commit 2c8b604
Show file tree
Hide file tree
Showing 24 changed files with 266 additions and 111 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ applet/
*.rej
*.bak
*.idea
*.s
*.i
*.ii
*.swp
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
#define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
#endif
#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN)
#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN)
//#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) PSU on if the chamber is over this temperature
//#define AUTO_POWER_COOLER_TEMP 26 // (°C) PSU on if the cooler is over this temperature
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2022-01-04"
//#define STRING_DISTRIBUTION_DATE "2022-01-06"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/feature/easythreed_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ void EasythreedUI::printButton() {
print_key_flag = PF_START;
return; // Bail out
}
card.ls(); // List all files to serial output
const uint16_t filecnt = card.countFilesInWorkDir(); // Count printable files in cwd
if (filecnt == 0) return; // None are printable?
card.selectFileByIndex(filecnt); // Select the last file according to current sort options
card.openAndPrintFile(card.filename); // Start printing it
card.ls(); // List all files to serial output
const uint16_t filecnt = card.countFilesInWorkDir(); // Count printable files in cwd
if (filecnt == 0) return; // None are printable?
card.selectFileByIndex(filecnt); // Select the last file according to current sort options
card.openAndPrintFile(card.filename); // Start printing it
break;
}
case PF_PAUSE: { // Pause printing (not currently firing)
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/feature/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ void Power::power_off() {
}

void Power::checkAutoPowerOff() {
if (TERN1(POWER_OFF_TIMER, !power_off_time) && TERN1(POWER_OFF_WAIT_FOR_COOLDOWN, !power_off_on_cooldown)) return;
if (TERN0(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown && is_cooling_needed())) return;
if (TERN0(POWER_OFF_TIMER, power_off_time && PENDING(millis(), power_off_time))) return;
power_off();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Power {
static void init();
static void power_on();
static void power_off();

#if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
#if ENABLED(POWER_OFF_TIMER)
static millis_t power_off_time;
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,19 @@ G29_TYPE GcodeSuite::G29() {
ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

if (!isnan(rx) && !isnan(ry)) {
// Get nearest i / j from rx / ry
i = (rx - bilinear_start.x + 0.5 * abl.gridSpacing.x) / abl.gridSpacing.x;
j = (ry - bilinear_start.y + 0.5 * abl.gridSpacing.y) / abl.gridSpacing.y;
LIMIT(i, 0, (GRID_MAX_POINTS_X) - 1);
LIMIT(j, 0, (GRID_MAX_POINTS_Y) - 1);
}

#pragma GCC diagnostic pop

if (WITHIN(i, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(j, 0, (GRID_MAX_POINTS_Y) - 1)) {
set_bed_leveling_enabled(false);
z_values[i][j] = rz;
Expand Down
11 changes: 7 additions & 4 deletions Marlin/src/gcode/control/M80_M81.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,19 @@ void GcodeSuite::M81() {
ZERO(thermalManager.saved_fan_speed);
#endif

safe_delay(1000); // Wait 1 second before switching off

LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF ".");

bool delayed_power_off = false;

#if ENABLED(POWER_OFF_TIMER)
if (parser.seenval('D')) {
delayed_power_off = true;
powerManager.setPowerOffTimer(SEC_TO_MS(parser.value_ushort()));
uint16_t delay = parser.value_ushort();
if (delay > 1) { // skip already observed 1s delay
delayed_power_off = true;
powerManager.setPowerOffTimer(SEC_TO_MS(delay - 1));
}
}
#endif

Expand All @@ -104,8 +109,6 @@ void GcodeSuite::M81() {

if (delayed_power_off) return;

safe_delay(1000); // Wait 1 second before switching off

#if HAS_SUICIDE
suicide();
#elif ENABLED(PSU_CONTROL)
Expand Down
12 changes: 5 additions & 7 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@
#define IS_ULTIPANEL 1
#define U8GLIB_SSD1309
#define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
#define ENCODER_PULSES_PER_STEP 2
#define ENCODER_STEPS_PER_MENU_ITEM 2
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#ifndef PCA9632
#define PCA9632
#endif

#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)

Expand Down Expand Up @@ -935,11 +938,6 @@
#elif X_HOME_DIR < 0
#define X_HOME_TO_MIN 1
#endif
#if X2_HOME_DIR > 0
#define X2_HOME_TO_MAX 1
#elif X2_HOME_DIR < 0
#define X2_HOME_TO_MIN 1
#endif
#if Y_HOME_DIR > 0
#define Y_HOME_TO_MAX 1
#elif Y_HOME_DIR < 0
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,12 @@
#define POLL_JOG
#endif

#if X2_HOME_DIR > 0
#define X2_HOME_TO_MAX 1
#elif X2_HOME_DIR < 0
#define X2_HOME_TO_MIN 1
#endif

#ifndef HOMING_BUMP_MM
#define HOMING_BUMP_MM { 0, 0, 0 }
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-01-04"
#define STRING_DISTRIBUTION_DATE "2022-01-06"
#endif

/**
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,10 @@ void HMI_Prepare() {
#endif

#if HAS_HOTEND || HAS_HEATED_BED
case PREPARE_CASE_COOL: thermalManager.cooldown(); break;
case PREPARE_CASE_COOL:
thermalManager.cooldown();
ui.reset_status();
break;
#endif

case PREPARE_CASE_LANG:
Expand Down
52 changes: 26 additions & 26 deletions Marlin/src/lcd/e3v2/enhanced/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico,
DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 28) - txt.h/2);
}
else {
const uint16_t x = ico.x + (ico.w - strlen_P(caption)*DWINUI::fontWidth()) / 2,
const uint16_t x = ico.x + (ico.w - strlen_P(FTOP(caption)) * DWINUI::fontWidth()) / 2,
y = (ico.y + ico.h - 28) - DWINUI::fontHeight() / 2;
DWINUI::Draw_String(x, y, caption);
}
Expand Down Expand Up @@ -499,7 +499,7 @@ void Popup_window_PauseOrStop() {
DWIN_UpdateLCD();
}
else
DWIN_Popup_Confirm(ICON_TempTooLow, F("Nozzle is too cold"), F("Preheat the hotend"));
DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT));
}

#endif
Expand Down Expand Up @@ -613,8 +613,8 @@ void Draw_Print_Labels() {
DWIN_Frame_AreaCopy(1, 65, 72, 128, 86, 176, 173); // Remain
}
else {
DWINUI::Draw_String( 46, 173, F("Print Time"));
DWINUI::Draw_String(181, 173, F("Remain"));
DWINUI::Draw_String( 46, 173, GET_TEXT_F(MSG_INFO_PRINT_TIME));
DWINUI::Draw_String(181, 173, GET_TEXT_F(MSG_REMAINING_TIME));
}
}

Expand Down Expand Up @@ -984,7 +984,7 @@ void Redraw_SD_List() {
}
else {
DWIN_Draw_Rectangle(1, HMI_data.AlertBg_Color, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4));
DWINUI::Draw_CenteredString(font16x32, HMI_data.AlertTxt_Color, MBASE(3), F("No Media"));
DWINUI::Draw_CenteredString(font16x32, HMI_data.AlertTxt_Color, MBASE(3), GET_TEXT_F(MSG_MEDIA_NOT_INSERTED));
}
}

Expand Down Expand Up @@ -1404,7 +1404,7 @@ void HMI_PauseOrStop() {
#ifdef ACTION_ON_CANCEL
hostui.cancel();
#endif
DWIN_Draw_Popup(ICON_BLTouch, F("Stopping..."), F("Please wait until done."));
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_STOPPING), GET_TEXT_F(MSG_PLEASE_WAIT));
}
else
Goto_PrintProcess(); // cancel stop
Expand Down Expand Up @@ -1619,7 +1619,7 @@ void EachMomentUpdate() {

void Goto_PowerLossRecovery() {
recovery.dwin_flag = false;
LCD_MESSAGE_F("Recovery from power loss");
LCD_MESSAGE_F(GET_TEXT_F(MSG_CONTINUE_PRINT_JOB));
HMI_flag.select_flag = false;
Popup_PowerLossRecovery();
last_checkkey = MainMenu;
Expand Down Expand Up @@ -1704,7 +1704,7 @@ void DWIN_StartHoming() {
HMI_flag.home_flag = true;
HMI_SaveProcessID(Homing);
Title.ShowCaption(GET_TEXT_F(MSG_LEVEL_BED_HOMING));
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), F("Please wait until done."));
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT));
}

void DWIN_CompletedHoming() {
Expand All @@ -1720,7 +1720,7 @@ void DWIN_MeshLevelingStart() {
#if HAS_ONESTEP_LEVELING
HMI_SaveProcessID(Leveling);
Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING));
DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done."));
DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT));
#elif ENABLED(MESH_BED_LEVELING)
Draw_ManualMesh_Menu();
#endif
Expand Down Expand Up @@ -1894,7 +1894,7 @@ void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) {
void DWIN_RebootScreen() {
DWIN_Frame_Clear(Color_Bg_Black);
DWIN_JPG_ShowAndCache(0);
DWINUI::Draw_CenteredString(Color_White, 220, F("Please wait until reboot. "));
DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT));
DWIN_UpdateLCD();
delay(500);
}
Expand All @@ -1908,7 +1908,7 @@ void DWIN_Redraw_screen() {

void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) {
HMI_SaveProcessID(button ? WaitResponse : NothingToDo);
DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), fmsg, button);
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button);
ui.reset_status(true);
}

Expand All @@ -1918,7 +1918,7 @@ void DWIN_Redraw_screen() {
case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break;
case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break;
case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break;
case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, F("Advanced Pause"), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break;
case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break;
case PAUSE_MESSAGE_OPTION: DWIN_Popup_FilamentPurge(); break;
Expand All @@ -1931,7 +1931,7 @@ void DWIN_Redraw_screen() {
}

void Draw_Popup_FilamentPurge() {
DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), F("Purge or Continue?"));
DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?"));
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
DWINUI::Draw_Icon(ICON_Continue_E, 146, 280);
Draw_Select_Highlight(true);
Expand Down Expand Up @@ -1970,7 +1970,7 @@ void DWIN_Redraw_screen() {
#if HAS_MESH
void DWIN_MeshViewer() {
if (!leveling_is_valid())
DWIN_Popup_Continue(ICON_BLTouch, F("Mesh viewer"), F("No valid mesh"));
DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH));
else {
HMI_SaveProcessID(WaitResponse);
MeshViewer.Draw();
Expand Down Expand Up @@ -2354,7 +2354,7 @@ void DWIN_ApplyColor() {
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color);
Draw_Status_Area(false);
Draw_SelectColors_Menu();
LCD_MESSAGE_F("Colors applied");
LCD_MESSAGE_F(GET_TEXT_F(MSG_COLORS_APPLIED));
}

void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
Expand Down Expand Up @@ -3211,7 +3211,7 @@ void Draw_Prepare_Menu() {
#endif
#endif
ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown);
ADDMENUITEM(ICON_Language, PSTR("UI Language"), onDrawLanguage, SetLanguage);
ADDMENUITEM(ICON_Language, PSTR(GET_TEXT_F(MSG_UI_LANGUAGE)), onDrawLanguage, SetLanguage);
}
CurrentMenu->draw();
}
Expand Down Expand Up @@ -3285,9 +3285,9 @@ void Draw_AdvancedSettings_Menu() {
#if HAS_LCD_BRIGHTNESS
ADDMENUITEM_P(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness);
#endif
ADDMENUITEM(ICON_Scolor, F("Select Colors"), onDrawSubMenu, Draw_SelectColors_Menu);
ADDMENUITEM(ICON_Scolor, GET_TEXT_F(MSG_COLORS_SELECT), onDrawSubMenu, Draw_SelectColors_Menu);
#if ENABLED(SOUND_MENU_ITEM)
ADDMENUITEM(ICON_Sound, F("Enable Sound"), onDrawEnableSound, SetEnableSound);
ADDMENUITEM(ICON_Sound, GET_TEXT_F(MSG_SOUND_ENABLE), onDrawEnableSound, SetEnableSound);
#endif
#if HAS_MESH
ADDMENUITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer);
Expand All @@ -3299,7 +3299,7 @@ void Draw_AdvancedSettings_Menu() {
ADDMENUITEM(ICON_PrintStats, GET_TEXT_F(MSG_INFO_STATS_MENU), onDrawSubMenu, Draw_PrintStats);
ADDMENUITEM(ICON_PrintStatsReset, GET_TEXT_F(MSG_INFO_PRINT_COUNT_RESET), onDrawSubMenu, PrintStats.Reset);
#endif
ADDMENUITEM(ICON_Lock, F("Lock Screen"), onDrawMenuItem, DWIN_LockScreen);
ADDMENUITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen);
}
CurrentMenu->draw();
}
Expand Down Expand Up @@ -3398,7 +3398,7 @@ void Draw_SelectColors_Menu() {
if (!SelectColorMenu) SelectColorMenu = new MenuClass();
if (CurrentMenu != SelectColorMenu) {
CurrentMenu = SelectColorMenu;
SetMenuTitle({0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG
SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_SELECT)); // TODO: Chinese, English "Select Color" JPG
DWINUI::MenuItemsPrepare(20);
ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu);
ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors);
Expand Down Expand Up @@ -3429,13 +3429,13 @@ void Draw_GetColor_Menu() {
if (!GetColorMenu) GetColorMenu = new MenuClass();
if (CurrentMenu != GetColorMenu) {
CurrentMenu = GetColorMenu;
SetMenuTitle({0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG
SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_GET)); // TODO: Chinese, English "Get Color" JPG
DWINUI::MenuItemsPrepare(5);
ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor);
ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu);
ADDMENUITEM(0, "Red", onDrawGetColorItem, SetRGBColor);
ADDMENUITEM(1, "Green", onDrawGetColorItem, SetRGBColor);
ADDMENUITEM(2, "Blue", onDrawGetColorItem, SetRGBColor);
ADDMENUITEM(0, GET_TEXT_F(MSG_COLORS_RED), onDrawGetColorItem, SetRGBColor);
ADDMENUITEM(1, GET_TEXT_F(MSG_COLORS_GREEN), onDrawGetColorItem, SetRGBColor);
ADDMENUITEM(2, GET_TEXT_F(MSG_COLORS_BLUE), onDrawGetColorItem, SetRGBColor);
}
CurrentMenu->draw();
DWIN_Draw_Rectangle(1, *HMI_value.P_Int, 20, 315, DWIN_WIDTH - 20, 335);
Expand Down Expand Up @@ -3472,9 +3472,9 @@ void Draw_Tune_Menu() {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament);
#endif
ADDMENUITEM(ICON_Lock, F("Lock Screen"), onDrawMenuItem, DWIN_LockScreen);
ADDMENUITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen);
#if HAS_LCD_BRIGHTNESS
ADDMENUITEM_P(ICON_Brightness, F("LCD Brightness"), onDrawPInt8Menu, SetBrightness, &ui.brightness);
ADDMENUITEM_P(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness);
#endif
}
CurrentMenu->draw();
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/e3v2/enhanced/printstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ void PrintStatsClass::Draw() {
DWINUI::Draw_Icon(ICON_Continue_E, 86, 250);
printStatistics ps = print_job_timer.getStats();

sprintf_P(buf, PSTR("%s: %i"), GET_TEXT(MSG_INFO_PRINT_COUNT), ps.totalPrints);
sprintf_P(buf, PSTR(S_FMT ": %i"), GET_TEXT(MSG_INFO_PRINT_COUNT), ps.totalPrints);
DWINUI::Draw_String(MRG, 80, buf);
sprintf_P(buf, PSTR("%s: %i"), GET_TEXT(MSG_INFO_COMPLETED_PRINTS), ps.finishedPrints);
sprintf_P(buf, PSTR(S_FMT ": %i"), GET_TEXT(MSG_INFO_COMPLETED_PRINTS), ps.finishedPrints);
DWINUI::Draw_String(MRG, 100, buf);
duration_t(print_job_timer.getStats().printTime).toDigital(str, true);
sprintf_P(buf, PSTR("%s: %s"), GET_TEXT(MSG_INFO_PRINT_TIME), str);
sprintf_P(buf, PSTR(S_FMT ": %s"), GET_TEXT(MSG_INFO_PRINT_TIME), str);
DWINUI::Draw_String(MRG, 120, buf);
duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true);
sprintf_P(buf, PSTR("%s: %s"), GET_TEXT(MSG_INFO_PRINT_LONGEST), str);
sprintf_P(buf, PSTR(S_FMT ": %s"), GET_TEXT(MSG_INFO_PRINT_LONGEST), str);
DWINUI::Draw_String(MRG, 140, buf);
sprintf_P(buf, PSTR("%s: %s m"), GET_TEXT(MSG_INFO_PRINT_FILAMENT), dtostrf(ps.filamentUsed / 1000, 1, 2, str));
sprintf_P(buf, PSTR(S_FMT ": %s m"), GET_TEXT(MSG_INFO_PRINT_FILAMENT), dtostrf(ps.filamentUsed / 1000, 1, 2, str));
DWINUI::Draw_String(MRG, 160, buf);
}

Expand Down
Loading

0 comments on commit 2c8b604

Please sign in to comment.