From 5d8eb84965f94c4e0e653dbaabdcb3bcd6f338af Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 6 Jun 2019 14:24:34 +0200 Subject: [PATCH 01/58] M0/M1/M117 fix: Move M0/M1 to the top of decoder. Move M0/M1 decoding before any other command. The M0/M1 message can contain arbitrary characters and so it also can contain substrings that other decoders trigger on, like the letter 'G'. Any such substring would cause misdecoding of the M0/M1 and unpredictable behavior in addition to not making the printer stop. M117 already received the same treatment in the past, so we take the same approach for M0/M1. --- Firmware/Marlin_main.cpp | 93 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f75b141f..314514f0 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3432,6 +3432,52 @@ void process_commands() lcd_setstatus(strchr_pointer + 5); } + else if (code_seen("M0 ") || code_seen("M1 ")) { // M0 and M1 - (Un)conditional stop - Wait for user buttn press on LCD + + char *src = strchr_pointer + 2; + + codenum = 0; + + bool hasP = false, hasS = false; + if (code_seen('P')) { + codenum = code_value(); // milliseconds to wait + hasP = codenum > 0; + } + if (code_seen('S')) { + codenum = code_value() * 1000; // seconds to wait + hasS = codenum > 0; + } + starpos = strchr(src, '*'); + if (starpos != NULL) *(starpos) = '\0'; + while (*src == ' ') ++src; + if (!hasP && !hasS && *src != '\0') { + lcd_setstatus(src); + } else { + LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT + } + + lcd_ignore_click(); //call lcd_ignore_click aslo for else ??? + st_synchronize(); + previous_millis_cmd = _millis(); + if (codenum > 0){ + codenum += _millis(); // keep track of when we started waiting + KEEPALIVE_STATE(PAUSED_FOR_USER); + while(_millis() < codenum && !lcd_clicked()){ + manage_heater(); + manage_inactivity(true); + lcd_update(0); + } + KEEPALIVE_STATE(IN_HANDLER); + lcd_ignore_click(false); + }else{ + marlin_wait_for_click(); + } + if (IS_SD_PRINTING) + LCD_MESSAGERPGM(_T(MSG_RESUMING_PRINT)); + else + LCD_MESSAGERPGM(_T(WELCOME_MSG)); + } + #ifdef TMC2130 else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) { @@ -4968,53 +5014,6 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) switch(mcode_in_progress) { - case 0: // M0 - Unconditional stop - Wait for user button press on LCD - case 1: // M1 - Conditional stop - Wait for user button press on LCD - { - char *src = strchr_pointer + 2; - - codenum = 0; - - bool hasP = false, hasS = false; - if (code_seen('P')) { - codenum = code_value(); // milliseconds to wait - hasP = codenum > 0; - } - if (code_seen('S')) { - codenum = code_value() * 1000; // seconds to wait - hasS = codenum > 0; - } - starpos = strchr(src, '*'); - if (starpos != NULL) *(starpos) = '\0'; - while (*src == ' ') ++src; - if (!hasP && !hasS && *src != '\0') { - lcd_setstatus(src); - } else { - LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT - } - - lcd_ignore_click(); //call lcd_ignore_click aslo for else ??? - st_synchronize(); - previous_millis_cmd = _millis(); - if (codenum > 0){ - codenum += _millis(); // keep track of when we started waiting - KEEPALIVE_STATE(PAUSED_FOR_USER); - while(_millis() < codenum && !lcd_clicked()){ - manage_heater(); - manage_inactivity(true); - lcd_update(0); - } - KEEPALIVE_STATE(IN_HANDLER); - lcd_ignore_click(false); - }else{ - marlin_wait_for_click(); - } - if (IS_SD_PRINTING) - LCD_MESSAGERPGM(_T(MSG_RESUMING_PRINT)); - else - LCD_MESSAGERPGM(_T(WELCOME_MSG)); - } - break; case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE enable_x(); From 5494f2394286a9b177a09da02e5957e3efdf8b8a Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 6 Jun 2019 14:25:06 +0200 Subject: [PATCH 02/58] M0/M1/M117 fix: Add new CUSTOM_MSG states. When the printer prints from a SD card, the display of progress messages and filename takes precedence over CUSTOM_MSG_TYPE_STATUS messages used by M0/M1/M117. Let's introduce two new CUSTOM_MSG states, one that overrides the SD status while waiting in M0/M1 (M0WAIT) and one that ensures the message will be displayed in at least one screen update (MSGUPD). --- Firmware/ultralcd.cpp | 3 +++ Firmware/ultralcd.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 3b2be088..5d23acf6 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -794,7 +794,10 @@ void lcdui_print_status_line(void) { // Otherwise check for other special events switch (custom_message_type) { + case CUSTOM_MSG_TYPE_MSGUPD: + custom_message_type = CUSTOM_MSG_TYPE_STATUS; case CUSTOM_MSG_TYPE_STATUS: // Nothing special, print status message normally + case CUSTOM_MSG_TYPE_M0WAIT: lcd_print(lcd_status_message); break; case CUSTOM_MSG_TYPE_MESHBL: // If mesh bed leveling in progress, show the status diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 665c1233..27b1c23a 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -106,6 +106,8 @@ extern int8_t FSensorStateMenu; #define CUSTOM_MSG_TYPE_PIDCAL 3 // PID tuning in progress #define CUSTOM_MSG_TYPE_TEMCAL 4 // PINDA temp calibration #define CUSTOM_MSG_TYPE_TEMPRE 5 // Temp compensation preheat +#define CUSTOM_MSG_TYPE_M0WAIT 6 // M0/M1 Wait command working even from SD +#define CUSTOM_MSG_TYPE_MSGUPD 7 // Short message even while printing from SD extern unsigned int custom_message_type; extern unsigned int custom_message_state; From a4bc91ed2f1c8b79ca5e0cd6d629898d945fbd39 Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 6 Jun 2019 14:25:36 +0200 Subject: [PATCH 03/58] M0/M1/M117 fix: Use CUSTOM_MSG states in M0/1/M117 Now that we have the new CUSTOM_MSG states, we can use them in the M0/M1 and M117 handlers to force the user message to be displayed even when the printer is printing from a SD card and displaying a file name. --- Firmware/Marlin_main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 314514f0..586bdbe9 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3430,6 +3430,7 @@ void process_commands() if (starpos != NULL) *(starpos) = '\0'; lcd_setstatus(strchr_pointer + 5); + custom_message_type = CUSTOM_MSG_TYPE_MSGUPD; } else if (code_seen("M0 ") || code_seen("M1 ")) { // M0 and M1 - (Un)conditional stop - Wait for user buttn press on LCD @@ -3450,6 +3451,7 @@ void process_commands() starpos = strchr(src, '*'); if (starpos != NULL) *(starpos) = '\0'; while (*src == ' ') ++src; + custom_message_type = CUSTOM_MSG_TYPE_M0WAIT; if (!hasP && !hasS && *src != '\0') { lcd_setstatus(src); } else { @@ -3476,6 +3478,7 @@ void process_commands() LCD_MESSAGERPGM(_T(MSG_RESUMING_PRINT)); else LCD_MESSAGERPGM(_T(WELCOME_MSG)); + custom_message_type = CUSTOM_MSG_TYPE_MSGUPD; } #ifdef TMC2130 From dbd07c1d1c418b09a814bf542bf3439bdf714296 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 2 Apr 2020 15:11:46 +0200 Subject: [PATCH 04/58] Limited LCD output of several uint16 values to 999 --- Firmware/ultralcd.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index daf9f017..363398a9 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1741,14 +1741,18 @@ static void lcd_menu_fails_stats_mmu_total() { mmu_command(MmuCmd::S3); lcd_timeoutToStatus.stop(); //infinite timeout - uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL_TOT); - uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL_TOT); + uint16_t fails = eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT); + uint16_t load_fails = eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT); + if (fails > 999) fails = 999; + if (load_fails > 999) load_fails = 999; + uint16_t mmu_power_fails = mmu_power_failures; + if (mmu_power_fails > 999) mmu_power_fails = 999; lcd_home(); lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-16.16S%-3d"), _i("Total failures"), ////c=20 r=1 _i("MMU fails"), fails, ////c=14 r=1 _i("MMU load fails"), load_fails, ////c=14 r=1 - _i("MMU power fails"), mmu_power_failures); ////c=14 r=1 + _i("MMU power fails"), mmu_power_fails); ////c=14 r=1 menu_back_if_clicked_fb(); } @@ -1773,7 +1777,11 @@ static void lcd_menu_fails_stats_total() uint16_t filam = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT); uint16_t crashX = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); uint16_t crashY = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); - lcd_home(); + if (power > 999) power = 999; + if (filam > 999) filam = 999; + if (crashX > 999) crashX = 999; + if (crashY > 999) crashY = 999; + lcd_home(); lcd_printf_P(failStatsFmt, _i("Total failures"), ////c=20 r=1 _i("Power failures"), power, ////c=14 r=1 @@ -1792,6 +1800,17 @@ static void lcd_menu_fails_stats_total() //! | Crash X:000 Y:000| c=7 r=1 //! ---------------------- //! @endcode +//! @brief Show Last Print Failures Statistics with PAT9125 +//! +//! @code{.unparsed} +//! |01234567890123456789| +//! |Last print failures | c=20 r=1 +//! | Power failures 000| c=14 r=1 +//! | Runouts H 000 S 000| c=14 r=1 +//! | Crash X:000 Y:000| c=7 r=1 +//! ---------------------- +//! @endcode + //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. static void lcd_menu_fails_stats_print() { @@ -1868,6 +1887,7 @@ static void lcd_menu_fails_stats() lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT); + if (filamentTotal > 999) filamentTotal = 999; lcd_home(); lcd_printf_P(failStatsFmt, _i("Last print failures"), ////c=20 r=1 From ad5d068690fdc3e4a996bcb1d0fc8df5e3f98c6c Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 26 Jan 2021 12:09:35 +0100 Subject: [PATCH 05/58] Update char lengths part 1 Fix some too long translations --- Firmware/messages.c | 10 ++++----- Firmware/ultralcd.cpp | 48 +++++++++++++++++++++---------------------- lang/lang_en.txt | 10 ++++----- lang/lang_en_cz.txt | 10 ++++----- lang/lang_en_de.txt | 10 ++++----- lang/lang_en_es.txt | 12 +++++------ lang/lang_en_fr.txt | 10 ++++----- lang/lang_en_it.txt | 10 ++++----- lang/lang_en_pl.txt | 10 ++++----- 9 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index 0b1d58e0..c5d781ad 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -29,7 +29,7 @@ const char MSG_CRASHDETECT[] PROGMEM_I1 = ISTR("Crash det."); ////c=13 const char MSG_ERROR[] PROGMEM_I1 = ISTR("ERROR:"); //// const char MSG_EXTRUDER[] PROGMEM_I1 = ISTR("Extruder"); ////c=17 const char MSG_FANS_CHECK[] PROGMEM_I1 = ISTR("Fans check"); ////c=13 -const char MSG_FIL_RUNOUTS[] PROGMEM_I1 = ISTR("Fil. runouts"); ////c=14 +const char MSG_FIL_RUNOUTS[] PROGMEM_I1 = ISTR("Fil. runouts"); ////c=15 const char MSG_FILAMENT[] PROGMEM_I1 = ISTR("Filament"); ////c=17 r=1 const char MSG_FAN_SPEED[] PROGMEM_I1 = ISTR("Fan speed"); ////c=14 const char MSG_FILAMENT_CLEAN[] PROGMEM_I1 = ISTR("Filament extruding & with correct color?"); ////c=20 r=2 @@ -65,14 +65,14 @@ const char MSG_STEEL_SHEETS[] PROGMEM_I1 = ISTR("Steel sheets"); ////c=18 const char MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1[] PROGMEM_I1 = ISTR("Measuring reference height of calibration point"); ////c=60 const char MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2[] PROGMEM_I1 = ISTR(" of 9"); ////c=14 const char MSG_MENU_CALIBRATION[] PROGMEM_I1 = ISTR("Calibration"); //// -const char MSG_MMU_FAILS[] PROGMEM_I1 = ISTR("MMU fails"); ////c=14 -const char MSG_MMU_LOAD_FAILS[] PROGMEM_I1 = ISTR("MMU load fails"); ////c=14 +const char MSG_MMU_FAILS[] PROGMEM_I1 = ISTR("MMU fails"); ////c=15 +const char MSG_MMU_LOAD_FAILS[] PROGMEM_I1 = ISTR("MMU load fails"); ////c=15 const char MSG_NO[] PROGMEM_I1 = ISTR("No"); //// const char MSG_NOZZLE[] PROGMEM_I1 = ISTR("Nozzle"); //// const char MSG_PAPER[] PROGMEM_I1 = ISTR("Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."); ////c=20 r=10 const char MSG_PLACE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please place steel sheet on heatbed."); ////c=20 r=4 const char MSG_PLEASE_WAIT[] PROGMEM_I1 = ISTR("Please wait"); ////c=20 -const char MSG_POWER_FAILURES[] PROGMEM_I1 = ISTR("Power failures"); ////c=14 +const char MSG_POWER_FAILURES[] PROGMEM_I1 = ISTR("Power failures"); ////c=15 const char MSG_PREHEAT_NOZZLE[] PROGMEM_I1 = ISTR("Preheat the nozzle!"); ////c=20 const char MSG_PRESS_TO_UNLOAD[] PROGMEM_I1 = ISTR("Please press the knob to unload filament"); ////c=20 r=4 const char MSG_PRINT_ABORTED[] PROGMEM_I1 = ISTR("Print aborted"); ////c=20 @@ -131,7 +131,7 @@ const char MSG_MODEL[] PROGMEM_I1 = ISTR("Model"); //// const char MSG_FIRMWARE[] PROGMEM_I1 = ISTR("Firmware"); //// const char MSG_GCODE[] PROGMEM_I1 = ISTR("Gcode"); //// const char MSG_GCODE_DIFF_PRINTER_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different printer type. Continue?"); ////c=20 r=5 -const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again. Print cancelled."); ////c=20 r=6 +const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again. Print cancelled."); ////c=20 r=7 const char MSG_NOZZLE_DIAMETER[] PROGMEM_I1 = ISTR("Nozzle d."); //// const char MSG_MMU_MODE[] PROGMEM_I1 = ISTR("MMU Mode"); //// const char MSG_SD_CARD[] PROGMEM_I1 = ISTR("SD card"); //// diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 81bb0f3c..cee7a45a 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1657,8 +1657,8 @@ static void lcd_menu_fails_stats_mmu() //! @code{.unparsed} //! |01234567890123456789| //! |Last print failures | MSG_LAST_PRINT_FAILURES c=20 -//! | MMU fails: 000| MSG_MMU_FAILS c=14 -//! | MMU load fails: 000| MSG_MMU_LOAD_FAILS c=14 +//! | MMU fails 000| MSG_MMU_FAILS c=15 +//! | MMU load fails 000| MSG_MMU_LOAD_FAILS c=15 //! | | //! ---------------------- //! @endcode @@ -1671,8 +1671,8 @@ static void lcd_menu_fails_stats_mmu_print() lcd_home(); lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d"), _T(MSG_LAST_PRINT_FAILURES), ////c=20 - _T(MSG_MMU_FAILS), fails, ////c=14 - _T(MSG_MMU_LOAD_FAILS), load_fails); ////c=14 + _T(MSG_MMU_FAILS), fails, ////c=15 + _T(MSG_MMU_LOAD_FAILS), load_fails); ////c=15 menu_back_if_clicked_fb(); } @@ -1681,9 +1681,9 @@ static void lcd_menu_fails_stats_mmu_print() //! @code{.unparsed} //! |01234567890123456789| //! |Total failures | MSG_TOTAL_FAILURES c=20 -//! | MMU fails: 000| MSG_MMU_FAILS c=14 -//! | MMU load fails: 000| MSG_MMU_LOAD_FAILS c=14 -//! | MMU power fails:000| c=14 r=1 +//! | MMU fails 000| MSG_MMU_FAILS c=15 +//! | MMU load fails 000| MSG_MMU_LOAD_FAILS c=15 +//! | MMU power fails 000| c=15 //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. @@ -1696,9 +1696,9 @@ static void lcd_menu_fails_stats_mmu_total() lcd_home(); lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-16.16S%-3d"), _T(MSG_TOTAL_FAILURES), ////c=20 - _T(MSG_MMU_FAILS), fails, ////c=14 - _T(MSG_MMU_LOAD_FAILS), load_fails, ////c=14 - _i("MMU power fails"), mmu_power_failures); ////c=14 r=1 + _T(MSG_MMU_FAILS), fails, ////c=15 + _T(MSG_MMU_LOAD_FAILS), load_fails, ////c=15 + _i("MMU power fails"), mmu_power_failures); ////c=15 r=1 menu_back_if_clicked_fb(); } @@ -1710,8 +1710,8 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" " %-16.16S%- //! @code{.unparsed} //! |01234567890123456789| //! |Total failures | MSG_TOTAL_FAILURES c=20 -//! | Power failures: 000| MSG_POWER_FAILURES c=14 -//! | Fil. runouts : 000| MSG_FIL_RUNOUTS c=14 +//! | Power failures 000| MSG_POWER_FAILURES c=15 +//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! | Crash X:000 Y:000| MSG_CRASH c=7 //! ---------------------- //! @endcode @@ -1726,8 +1726,8 @@ static void lcd_menu_fails_stats_total() lcd_home(); lcd_printf_P(failStatsFmt, _T(MSG_TOTAL_FAILURES), ////c=20 - _T(MSG_POWER_FAILURES), power, ////c=14 - _T(MSG_FIL_RUNOUTS), filam, ////c=14 + _T(MSG_POWER_FAILURES), power, ////c=15 + _T(MSG_FIL_RUNOUTS), filam, ////c=15 _T(MSG_CRASH), crashX, crashY); ////c=7 menu_back_if_clicked_fb(); } @@ -1737,9 +1737,9 @@ static void lcd_menu_fails_stats_total() //! @code{.unparsed} //! |01234567890123456789| //! |Last print failures | MSG_LAST_PRINT_FAILURES c=20 -//! | Power failures 000| MSG_POWER_FAILURES c=14 -//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=14 -//! | Crash X:000 Y:000| MSG_CRASH c=7 +//! | Power failures 000| MSG_POWER_FAILURES c=15 +//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 +//! | Crash X 000 Y 000| MSG_CRASH c=7 //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. @@ -1754,8 +1754,8 @@ static void lcd_menu_fails_stats_print() #ifndef PAT9125 lcd_printf_P(failStatsFmt, _T(MSG_LAST_PRINT_FAILURES), ////c=20 - _T(MSG_POWER_FAILURES), power, ////c=14 - _T(MSG_FIL_RUNOUTS), filam, ////c=14 + _T(MSG_POWER_FAILURES), power, ////c=15 + _T(MSG_FIL_RUNOUTS), filam, ////c=15 _T(MSG_CRASH), crashX, crashY); ////c=7 #else // On the MK3 include detailed PAT9125 statistics about soft failures @@ -1764,7 +1764,7 @@ static void lcd_menu_fails_stats_print() " %-7.7S H %-3d S %-3d\n" " %-7.7S X %-3d Y %-3d"), _T(MSG_LAST_PRINT_FAILURES), ////c=20 - _T(MSG_POWER_FAILURES), power, ////c=14 + _T(MSG_POWER_FAILURES), power, ////c=15 _i("Runouts"), filam, fsensor_softfail, //c=7 _T(MSG_CRASH), crashX, crashY); ////c=7 #endif @@ -1807,9 +1807,9 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" "%S\n" " %-1 //! @code{.unparsed} //! |01234567890123456789| //! |Last print failures | MSG_LAST_PRINT_FAILURES c=20 -//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=14 +//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! |Total failures | MSG_TOTAL_FAILURES c=20 -//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=14 +//! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. @@ -1821,9 +1821,9 @@ static void lcd_menu_fails_stats() lcd_home(); lcd_printf_P(failStatsFmt, _T(MSG_LAST_PRINT_FAILURES), ////c=20 - _T(MSG_FIL_RUNOUTS), filamentLast, ////c=14 + _T(MSG_FIL_RUNOUTS), filamentLast, ////c=15 _T(MSG_TOTAL_FAILURES), ////c=20 - _T(MSG_FIL_RUNOUTS), filamentTotal); ////c=14 + _T(MSG_FIL_RUNOUTS), filamentTotal); ////c=15 menu_back_if_clicked(); } diff --git a/lang/lang_en.txt b/lang/lang_en.txt index bcb0a444..16374619 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -253,7 +253,7 @@ #MSG_FSENSOR "Fil. sensor" -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " #MSG_FILAMENT_CLEAN c=20 r=2 @@ -448,13 +448,13 @@ # "Measured skew" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" # "MMU load failed " -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" #MSG_MMU_OK_RESUMING c=20 r=4 @@ -625,7 +625,7 @@ #MSG_FS_PAUSE c=5 "Pause" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" #MSG_PRINT_ABORTED c=20 @@ -1048,7 +1048,7 @@ #MSG_GCODE_DIFF_PRINTER_CONTINUE c=20 r=5 "G-code sliced for a different printer type. Continue?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." # diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index 0b3d7b14..7e8666e2 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Fil. senzor" -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Vypadky filam." @@ -598,7 +598,7 @@ "Measured skew" "Merene zkoseni" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "Selhani MMU" @@ -606,7 +606,7 @@ "MMU load failed " "Zavedeni MMU selhalo" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "MMU selhani zavadeni" @@ -834,7 +834,7 @@ "Pause" "\x00" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" "Vypadky proudu" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "G-code je pripraven pro jiny typ tiskarny. Pokracovat?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "G-code je pripraven pro jiny typ tiskarny. Prosim preslicujte model znovu. Tisk zrusen." diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index 0a436a9e..063ad995 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Fil. Sensor" -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Fil. Maengel " @@ -598,7 +598,7 @@ "Measured skew" "Schraeglauf" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "MMU Fehler" @@ -606,7 +606,7 @@ "MMU load failed " "MMU Ladefehler" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "MMU Ladefehler" @@ -834,7 +834,7 @@ "Pause" "\x00" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" "Netzfehler" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "G-Code ist fuer einen anderen Drucker geslict. Fortfahren?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "G-Code ist fuer einen anderen Drucker geslict. Bitte slicen Sie das Modell erneut. Druck abgebrochen." diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index 2e29fa20..e334ddac 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Sensor Fil." -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Fil. acabado " @@ -598,7 +598,7 @@ "Measured skew" "Desviacion med:" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "Fallos MMU" @@ -606,7 +606,7 @@ "MMU load failed " "Carga MMU fallida" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "Carga MMU falla" @@ -834,9 +834,9 @@ "Pause" "Pausa" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" -"Cortes de energia" +"Fallas energia" #MSG_PRINT_ABORTED c=20 "Print aborted" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "Codigo G laminado para un tipo de impresora diferente. ?Continuar?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "Codigo G laminado para una impresora diferente. Por favor relamina el modelo de nuevo. Impresion cancelada." diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index cc0cbb95..a78c999e 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Capteur Fil." -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Fins filament " @@ -598,7 +598,7 @@ "Measured skew" "Deviat.mesuree" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "Echecs MMU" @@ -606,7 +606,7 @@ "MMU load failed " "Echec chargement MMU" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "Echecs charg. MMU" @@ -834,7 +834,7 @@ "Pause" "\x00" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" "Coup.de courant" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "Le G-code a ete prepare pour une autre version de l'imprimante. Continuer?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "Le G-code a ete prepare pour une autre version de l'imprimante. Veuillez decouper le modele a nouveau. L'impression a ete annulee." diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index 8cd93908..a442667a 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Sensore fil." -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Fil. esauriti " @@ -598,7 +598,7 @@ "Measured skew" "Deviazione mis" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "Fallimenti MMU" @@ -606,7 +606,7 @@ "MMU load failed " "Caricamento MMU fallito" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "Caricamenti MMU falliti" @@ -834,7 +834,7 @@ "Pause" "Pausa" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" "Mancanza corrente" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "G-code processato per una stampante diversa. Continuare?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "G-code processato per una stampante diversa. Per favore esegui nuovamente lo slice del modello. Stampa annullata." diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index 38d1421f..104d61d2 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -338,7 +338,7 @@ "Fil. sensor" "Czuj. filam." -#MSG_FIL_RUNOUTS c=14 +#MSG_FIL_RUNOUTS c=15 "Fil. runouts " "Konc.filamentu" @@ -598,7 +598,7 @@ "Measured skew" "Zmierzony skos" -#MSG_MMU_FAILS c=14 +#MSG_MMU_FAILS c=15 "MMU fails" "Bledy MMU" @@ -606,7 +606,7 @@ "MMU load failed " "Blad ladowania MMU" -#MSG_MMU_LOAD_FAILS c=14 +#MSG_MMU_LOAD_FAILS c=15 "MMU load fails" "Bledy ladow. MMU" @@ -834,7 +834,7 @@ "Pause" "Pauza" -#MSG_POWER_FAILURES c=14 +#MSG_POWER_FAILURES c=15 "Power failures" "Zaniki zasilania" @@ -1398,7 +1398,7 @@ "G-code sliced for a different printer type. Continue?" "G-code pociety dla innej drukarki. Kontynuowac?" -#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=6 +#MSG_GCODE_DIFF_PRINTER_CANCELLED c=20 r=7 "G-code sliced for a different printer type. Please re-slice the model again. Print cancelled." "G-code pociety dla drukarki innego typu. Potnij model ponownie. Druk anulowany." From f40c593d11f33cd88fee3e2899a2725e314b4a87 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 26 Jan 2021 14:15:34 +0100 Subject: [PATCH 06/58] Fix few translations not being used due to spaces or upper case --- Firmware/messages.c | 2 +- Firmware/ultralcd.cpp | 2 +- lang/lang_en.txt | 2 +- lang/lang_en_cz.txt | 2 +- lang/lang_en_de.txt | 4 ++-- lang/lang_en_es.txt | 4 ++-- lang/lang_en_fr.txt | 4 ++-- lang/lang_en_it.txt | 4 ++-- lang/lang_en_pl.txt | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index c5d781ad..7c397d7b 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -16,7 +16,7 @@ const char MSG_BED_DONE[] PROGMEM_I1 = ISTR("Bed done"); //// const char MSG_BED_HEATING[] PROGMEM_I1 = ISTR("Bed Heating"); //// const char MSG_BED_LEVELING_FAILED_POINT_LOW[] PROGMEM_I1 = ISTR("Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."); ////c=20 r=5 const char MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED[] PROGMEM_I1 = ISTR("XYZ calibration failed. Please consult the manual."); ////c=20 r=8 -const char MSG_BELT_STATUS[] PROGMEM_I1 = ISTR("Belt Status");////c=18 +const char MSG_BELT_STATUS[] PROGMEM_I1 = ISTR("Belt status");////c=18 const char MSG_CALIBRATE_Z_AUTO[] PROGMEM_I1 = ISTR("Calibrating Z"); ////c=20 r=2 const char MSG_CARD_MENU[] PROGMEM_I1 = ISTR("Print from SD"); //// const char MSG_CHECKING_X[] PROGMEM_I1 = ISTR("Checking X axis"); ////c=20 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index cee7a45a..020d9193 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -8381,7 +8381,7 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s if (screen == TestScreen::EndStops) lcd_puts_P(_i("Checking endstops"));////MSG_SELFTEST_CHECK_ENDSTOPS c=20 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); - if (screen == TestScreen::AxisZ) lcd_puts_P(_i("Checking Z axis "));////MSG_SELFTEST_CHECK_Z c=20 + if (screen == TestScreen::AxisZ) lcd_puts_P(_i("Checking Z axis"));////MSG_SELFTEST_CHECK_Z c=20 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_i("Checking hotend "));////MSG_SELFTEST_CHECK_HOTEND c=20 diff --git a/lang/lang_en.txt b/lang/lang_en.txt index 16374619..3367e149 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -254,7 +254,7 @@ "Fil. sensor" #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " +"Fil. runouts" #MSG_FILAMENT_CLEAN c=20 r=2 "Filament extruding & with correct color?" diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index 7e8666e2..cda08b0a 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -339,7 +339,7 @@ "Fil. senzor" #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " +"Fil. runouts" "Vypadky filam." #MSG_FILAMENT_CLEAN c=20 r=2 diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index 063ad995..7215fea4 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -339,8 +339,8 @@ "Fil. Sensor" #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " -"Fil. Maengel " +"Fil. runouts" +"Fil. Maengel" #MSG_FILAMENT_CLEAN c=20 r=2 "Filament extruding & with correct color?" diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index e334ddac..1e7ae63d 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -339,8 +339,8 @@ "Sensor Fil." #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " -"Fil. acabado " +"Fil. runouts" +"Fil. acabado" #MSG_FILAMENT_CLEAN c=20 r=2 "Filament extruding & with correct color?" diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index a78c999e..3910a2f6 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -339,8 +339,8 @@ "Capteur Fil." #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " -"Fins filament " +"Fil. runouts" +"Fins filament" #MSG_FILAMENT_CLEAN c=20 r=2 "Filament extruding & with correct color?" diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index a442667a..824442ff 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -339,8 +339,8 @@ "Sensore fil." #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " -"Fil. esauriti " +"Fil. runouts" +"Fil. esauriti" #MSG_FILAMENT_CLEAN c=20 r=2 "Filament extruding & with correct color?" diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index 104d61d2..db420bf9 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -339,7 +339,7 @@ "Czuj. filam." #MSG_FIL_RUNOUTS c=15 -"Fil. runouts " +"Fil. runouts" "Konc.filamentu" #MSG_FILAMENT_CLEAN c=20 r=2 From 2ba24fe0d459297bf03bfe81ddffaa31d880edd9 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 3 Feb 2021 10:42:25 +0100 Subject: [PATCH 07/58] Add pause/resume to USB/host prints via LCD menu Depending if SD or USB/host print the firmware sends - SD print: `// action:paused` or `// action:resumed` are send to inform USB/Host - USB/host print: `// action:pause` or `// action:resume` are send to trigger the USB/host to handle it - USB/host must handle `// action:pause` and `// action:resume` correctly to work - Tested with Octoprint - It handles every thing correctly - Any combination of Octoprint and/or LCD `pause` and `resume` working correctly - Tested with Pronterface - It pauses BUT doesn't send the printer in pause position, and so it is not possible to `resume` from LCD menu - I guess some Macros can fix that. - Repetier Host/Server documentation shows that it should work. Not tested. Could save 56 bytes in first step and additional 38 bytes adding `MSG_PAUSE_PRINT` to messages.c/.h Updated `lang_en*.txt` @todo Polish translation is 19 characters long (it still fits) BUT should be corrected to 18 chars. --- Firmware/messages.c | 3 ++ Firmware/messages.h | 3 ++ Firmware/ultralcd.cpp | 92 ++++++++++++++++++++++++++----------------- lang/lang_en.txt | 2 +- lang/lang_en_cz.txt | 2 +- lang/lang_en_de.txt | 2 +- lang/lang_en_es.txt | 2 +- lang/lang_en_fr.txt | 2 +- lang/lang_en_it.txt | 2 +- lang/lang_en_pl.txt | 2 +- 10 files changed, 68 insertions(+), 44 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index 0b1d58e0..950efcd3 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -70,6 +70,7 @@ const char MSG_MMU_LOAD_FAILS[] PROGMEM_I1 = ISTR("MMU load fails"); ////c=14 const char MSG_NO[] PROGMEM_I1 = ISTR("No"); //// const char MSG_NOZZLE[] PROGMEM_I1 = ISTR("Nozzle"); //// const char MSG_PAPER[] PROGMEM_I1 = ISTR("Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."); ////c=20 r=10 +const char MSG_PAUSE_PRINT[] PROGMEM_I1 = ISTR("Pause print");////c=18 const char MSG_PLACE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please place steel sheet on heatbed."); ////c=20 r=4 const char MSG_PLEASE_WAIT[] PROGMEM_I1 = ISTR("Please wait"); ////c=20 const char MSG_POWER_FAILURES[] PROGMEM_I1 = ISTR("Power failures"); ////c=14 @@ -188,7 +189,9 @@ const char MSG_ENDSTOP_OPEN[] PROGMEM_N1 = "open"; //// const char MSG_POWERUP[] PROGMEM_N1 = "PowerUp"; //// const char MSG_ERR_STOPPED[] PROGMEM_N1 = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"; //// const char MSG_ENDSTOP_HIT[] PROGMEM_N1 = "TRIGGERED"; //// +const char MSG_OCTOPRINT_PAUSE[] PROGMEM_N1 = "// action:pause"; //// const char MSG_OCTOPRINT_PAUSED[] PROGMEM_N1 = "// action:paused"; //// +const char MSG_OCTOPRINT_RESUME[] PROGMEM_N1 = "// action:resume"; //// const char MSG_OCTOPRINT_RESUMED[] PROGMEM_N1 = "// action:resumed"; //// const char MSG_OCTOPRINT_CANCEL[] PROGMEM_N1 = "// action:cancel"; //// const char MSG_FANCHECK_EXTRUDER[] PROGMEM_N1 = "Err: EXTR. FAN ERROR"; ////c=20 diff --git a/Firmware/messages.h b/Firmware/messages.h index 0a05c58f..c99a77d9 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -69,6 +69,7 @@ extern const char MSG_MMU_LOAD_FAILS[]; extern const char MSG_NO[]; extern const char MSG_NOZZLE[]; extern const char MSG_PAPER[]; +extern const char MSG_PAUSE_PRINT[]; extern const char MSG_PLACE_STEEL_SHEET[]; extern const char MSG_PLEASE_WAIT[]; extern const char MSG_POWER_FAILURES[]; @@ -188,7 +189,9 @@ extern const char MSG_ERR_STOPPED[]; extern const char MSG_ENDSTOP_HIT[]; extern const char MSG_EJECT_FILAMENT[]; extern const char MSG_CUT_FILAMENT[]; +extern const char MSG_OCTOPRINT_PAUSE[]; extern const char MSG_OCTOPRINT_PAUSED[]; +extern const char MSG_OCTOPRINT_RESUME[]; extern const char MSG_OCTOPRINT_RESUMED[]; extern const char MSG_OCTOPRINT_CANCEL[]; extern const char MSG_FANCHECK_EXTRUDER[]; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 0f6bc1fa..94fa0da4 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1539,6 +1539,12 @@ void lcd_pause_print() } } +//! @brief Pause USB/host print, disable nozzle heater, move to park position +void lcd_pause_usb_print() +{ + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); //pause for octoprint +} + float move_menu_scale; static void lcd_move_menu_axis(); @@ -6497,6 +6503,12 @@ void lcd_resume_print() SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint } +//! @brief Resume paused USB/host print +void lcd_resume_usb_print() +{ + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUME); //resume octoprint +} + static void change_sheet() { eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), selected_sheet); @@ -6631,44 +6643,50 @@ static void lcd_main_menu() MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT } - - if(isPrintPaused && saved_printing_type == PRINTING_TYPE_USB) + if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) { -#ifdef FANCHECK - if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 -#else - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 -#endif + if (IS_SD_PRINTING) + { + MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 + } + else if (is_usb_printing) + { + MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);////MSG_PAUSE_PRINT c=18 + } } - -#ifdef SDSUPPORT + if(isPrintPaused) + { + #ifdef FANCHECK + if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) + { + if (is_usb_printing) + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 + } + else + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 + } + } + #else + if (is_usb_printing) + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 + } + else + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 + } + #endif //FANCHECK + } + if(IS_SD_PRINTING || is_usb_printing || isPrintPaused) + { + MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); + } +#ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) { - if (card.isFileOpen()) - { - if (mesh_bed_leveling_flag == false && homing_flag == false) { - if (card.sdprinting) - { - MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);////MSG_PAUSE_PRINT - } - else if(isPrintPaused) - { - #ifdef FANCHECK - if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 - #else - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 - #endif - - } - MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); - } - } - else if (lcd_commands_type == LcdCommands::Layer1Cal && mesh_bed_leveling_flag == false && homing_flag == false) { - //MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); - } - else + if (!card.isFileOpen()) { if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { @@ -6680,7 +6698,7 @@ static void lcd_main_menu() } #if SDCARDDETECT < 1 MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD -#endif +#endif //SDCARDDETECT } } else @@ -6689,9 +6707,9 @@ static void lcd_main_menu() MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD #if SDCARDDETECT < 1 MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface////MSG_INIT_SDCARD -#endif +#endif //SDCARDDETECT } -#endif +#endif //SDSUPPORT if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { diff --git a/lang/lang_en.txt b/lang/lang_en.txt index bcb0a444..d9f606ca 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -544,7 +544,7 @@ # "Nozzle FAN" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" #MSG_PID_RUNNING c=20 r=1 diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index 0b3d7b14..f8cf4bd8 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "Vent. trysky" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Pozastavit tisk" diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index 0a436a9e..df13e1d1 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "Duesevent." -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Druck pausieren" diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index 2e29fa20..30548327 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "Vent. capa" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Pausar impresion" diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index cc0cbb95..8cbf3a67 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "Vent. buse" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Pause de l'impr." diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index 8cd93908..919c2e56 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "Ventola estrusore" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Metti in pausa" diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index 38d1421f..31cb5a41 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -726,7 +726,7 @@ "Nozzle FAN" "WentHotend" -#MSG_PAUSE_PRINT +#MSG_PAUSE_PRINT c=18 "Pause print" "Wstrzymanie wydruku" From 3668cdeb30eb95fb02f894decae2e1a95e399784 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Mon, 8 Feb 2021 17:27:32 +0100 Subject: [PATCH 08/58] Add Service prep. item into Factory reset upon request from our Service dept. - it is to do the same stuff like Shipping prep., but keep the printer's stats intact. Still, this has to be verified and may undergo some further changes. --- Firmware/Marlin_main.cpp | 191 +++++++++++++++++---------------------- Firmware/ultralcd.cpp | 6 +- 2 files changed, 84 insertions(+), 113 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6db1d277..db339124 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -711,124 +711,98 @@ void softReset() #endif +static void factory_reset_stats(){ + eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0); + eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); + + eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0); + eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0); + eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0); + eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0); + + eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0); + eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0); + eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0); + eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0); + + eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0); + eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0); + eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0); + eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0); +} + // Factory reset function // This function is used to erase parts or whole EEPROM memory which is used for storing calibration and and so on. // Level input parameter sets depth of reset -int er_progress = 0; static void factory_reset(char level) -{ +{ lcd_clear(); - switch (level) { - - // Level 0: Language reset - case 0: - Sound_MakeCustom(100,0,false); - lang_reset(); - break; - - //Level 1: Reset statistics - case 1: - Sound_MakeCustom(100,0,false); - eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0); - eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); + Sound_MakeCustom(100,0,false); + switch (level) { - eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0); - eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0); - eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0); - eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0); + case 0: // Level 0: Language reset + lang_reset(); + break; - eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0); + case 1: //Level 1: Reset statistics + factory_reset_stats(); + lcd_menu_statistics(); + break; - eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0); - eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0); - eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0); + case 2: // Level 2: Prepare for shipping + factory_reset_stats(); + // [[fallthrough]] // there is no break intentionally - - lcd_menu_statistics(); - - break; - - // Level 2: Prepare for shipping - case 2: - //lcd_puts_P(PSTR("Factory RESET")); - //lcd_puts_at_P(1,2,PSTR("Shipping prep")); - - // Force language selection at the next boot up. - lang_reset(); - // Force the "Follow calibration flow" message at the next boot up. - calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION); - eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard - farm_mode = false; - eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode); - - eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0); - eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); - - eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0); - eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0); - eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0); - eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0); - - eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0); - - eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0); - eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0); - eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0); - eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0); + case 4: // Level 4: Preparation after being serviced + // Force language selection at the next boot up. + lang_reset(); + // Force the "Follow calibration flow" message at the next boot up. + calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION); + eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard + farm_mode = false; + eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode); #ifdef FILAMENT_SENSOR - fsensor_enable(); - fsensor_autoload_set(true); + fsensor_enable(); + fsensor_autoload_set(true); #endif //FILAMENT_SENSOR - Sound_MakeCustom(100,0,false); - //_delay_ms(2000); - break; + break; - // Level 3: erase everything, whole EEPROM will be set to 0xFF + case 3:{ // Level 3: erase everything, whole EEPROM will be set to 0xFF + lcd_puts_P(PSTR("Factory RESET")); + lcd_puts_at_P(1, 2, PSTR("ERASING all data")); + uint16_t er_progress = 0; + lcd_set_cursor(3, 3); + lcd_space(6); + lcd_set_cursor(3, 3); + lcd_print(er_progress); - case 3: - lcd_puts_P(PSTR("Factory RESET")); - lcd_puts_at_P(1, 2, PSTR("ERASING all data")); - - Sound_MakeCustom(100,0,false); - er_progress = 0; - lcd_puts_at_P(3, 3, PSTR(" ")); - lcd_set_cursor(3, 3); - lcd_print(er_progress); - - // Erase EEPROM - for (int i = 0; i < 4096; i++) { - eeprom_update_byte((uint8_t*)i, 0xFF); - - if (i % 41 == 0) { - er_progress++; - lcd_puts_at_P(3, 3, PSTR(" ")); - lcd_set_cursor(3, 3); - lcd_print(er_progress); - lcd_puts_P(PSTR("%")); - } + // Erase EEPROM + for (uint16_t i = 0; i < 4096; i++) { + eeprom_update_byte((uint8_t*)i, 0xFF); + if (i % 41 == 0) { + er_progress++; + lcd_set_cursor(3, 3); + lcd_space(6); + lcd_set_cursor(3, 3); + lcd_print(er_progress); + lcd_puts_P(PSTR("%")); } - softReset(); + + } + softReset(); + }break; - break; - case 4: - bowden_menu(); - break; - - default: - break; - } - - +#ifdef SNMM + case 5: + bowden_menu(); + break; +#endif + default: + break; + } } extern "C" { @@ -859,30 +833,27 @@ void factory_reset() { lcd_clear(); - lcd_puts_P(PSTR("Factory RESET")); - SET_OUTPUT(BEEPER); - if(eSoundMode!=e_SOUND_MODE_SILENT) - WRITE(BEEPER, HIGH); + if(eSoundMode!=e_SOUND_MODE_SILENT) + WRITE(BEEPER, HIGH); while (!READ(BTN_ENC)); WRITE(BEEPER, LOW); - - _delay_ms(2000); char level = reset_menu(); factory_reset(level); switch (level) { - case 0: _delay_ms(0); break; - case 1: _delay_ms(0); break; - case 2: _delay_ms(0); break; - case 3: _delay_ms(0); break; + case 0: + case 1: + case 2: + case 3: + case 4: _delay_ms(0); break; } } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d3686509..96e494ab 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6087,15 +6087,15 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite char reset_menu() { const uint8_t items_no = #ifdef SNMM - 5; + 6; #else - 4; + 5; #endif static int8_t first = 0; int8_t enc_dif = 0; char cursor_pos = 0; - const char *const item[items_no] PROGMEM = {PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("All Data") + const char *const item[items_no] PROGMEM = {PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("All Data"), PSTR("Service prep") #ifdef SNMM , PSTR("Bowden length") #endif From 9ccda4c57f0b79bdfe2754387f25de5ab4e5c575 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 9 Feb 2021 09:10:23 +0100 Subject: [PATCH 09/58] Optimize code size ... looks like I've been able to reduce the code by 80B by using the clamp999() function. There are other spots this function can be used as well, I didn't touch those yet. --- Firmware/ultralcd.cpp | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 70b394c5..c2b6600f 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1633,6 +1633,10 @@ void lcd_menu_extruder_info() // NOT static due to using ins menu_back_if_clicked(); } +static uint16_t __attribute__((noinline)) clamp999(uint16_t v){ + return v > 999 ? 999 : v; +} + //! @brief Show Fails Statistics MMU //! //! @code{.unparsed} @@ -1666,13 +1670,11 @@ static void lcd_menu_fails_stats_mmu() static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout - uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL); - uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL); lcd_home(); lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d"), _T(MSG_LAST_PRINT_FAILURES), ////c=20 - _T(MSG_MMU_FAILS), fails, ////c=14 - _T(MSG_MMU_LOAD_FAILS), load_fails); ////c=14 + _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), ////c=14 + _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) )); ////c=14 menu_back_if_clicked_fb(); } @@ -1691,18 +1693,12 @@ static void lcd_menu_fails_stats_mmu_total() { mmu_command(MmuCmd::S3); lcd_timeoutToStatus.stop(); //infinite timeout - uint16_t fails = eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT); - uint16_t load_fails = eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT); - if (fails > 999) fails = 999; - if (load_fails > 999) load_fails = 999; - uint16_t mmu_power_fails = mmu_power_failures; - if (mmu_power_fails > 999) mmu_power_fails = 999; lcd_home(); lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-16.16S%-3d"), _T(MSG_TOTAL_FAILURES), ////c=20 - _T(MSG_MMU_FAILS), fails, ////c=14 - _T(MSG_MMU_LOAD_FAILS), load_fails, ////c=14 - _i("MMU power fails"), mmu_power_failures); ////c=14 r=1 + _T(MSG_MMU_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT) ), ////c=14 + _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT) ), ////c=14 + _i("MMU power fails"), clamp999( mmu_power_failures )); ////c=14 r=1 menu_back_if_clicked_fb(); } @@ -1723,20 +1719,14 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" " %-16.16S%- static void lcd_menu_fails_stats_total() { lcd_timeoutToStatus.stop(); //infinite timeout - uint16_t power = eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT); - uint16_t filam = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT); - uint16_t crashX = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); - uint16_t crashY = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); - if (power > 999) power = 999; - if (filam > 999) filam = 999; - if (crashX > 999) crashX = 999; - if (crashY > 999) crashY = 999; lcd_home(); lcd_printf_P(failStatsFmt, _T(MSG_TOTAL_FAILURES), ////c=20 - _T(MSG_POWER_FAILURES), power, ////c=14 - _T(MSG_FIL_RUNOUTS), filam, ////c=14 - _T(MSG_CRASH), crashX, crashY); ////c=7 + _T(MSG_POWER_FAILURES), clamp999( eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) ), ////c=14 + _T(MSG_FIL_RUNOUTS), clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ), ////c=14 + _T(MSG_CRASH), ////c=7 + clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT) ), + clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT) )); menu_back_if_clicked_fb(); } @@ -1836,8 +1826,7 @@ static void lcd_menu_fails_stats() { lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); - uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT); - if (filamentTotal > 999) filamentTotal = 999; + uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); lcd_home(); lcd_printf_P(failStatsFmt, _T(MSG_LAST_PRINT_FAILURES), ////c=20 From e5711ea84f8e590c8d3e490b3150318703698fb5 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 11:03:23 +0100 Subject: [PATCH 10/58] Indentation to 4 spaces for tabs --- Firmware/ultralcd.cpp | 275 +++++++++++++++++++++--------------------- 1 file changed, 136 insertions(+), 139 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 94fa0da4..9d2e9d0d 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6608,177 +6608,174 @@ static void lcd_sheet_menu() static void lcd_main_menu() { - MENU_BEGIN(); + MENU_BEGIN(); - // Majkl superawesome menu + // Majkl superawesome menu - MENU_ITEM_BACK_P(_T(MSG_WATCH)); + MENU_ITEM_BACK_P(_T(MSG_WATCH)); #ifdef RESUME_DEBUG - if (!saved_printing) - MENU_ITEM_FUNCTION_P(PSTR("tst - Save"), lcd_menu_test_save); - else - MENU_ITEM_FUNCTION_P(PSTR("tst - Restore"), lcd_menu_test_restore); + if (!saved_printing) + MENU_ITEM_FUNCTION_P(PSTR("tst - Save"), lcd_menu_test_save); + else + MENU_ITEM_FUNCTION_P(PSTR("tst - Restore"), lcd_menu_test_restore); #endif //RESUME_DEBUG #ifdef TMC2130_DEBUG - MENU_ITEM_FUNCTION_P(PSTR("recover print"), recover_print); - MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); + MENU_ITEM_FUNCTION_P(PSTR("recover print"), recover_print); + MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG - - if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag) - { - MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 - } - if (farm_mode) - MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 - - if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) - { - MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE - } else - { - MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT - } - - if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) - { - if (IS_SD_PRINTING) - { - MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 - } - else if (is_usb_printing) - { - MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);////MSG_PAUSE_PRINT c=18 - } - } - if(isPrintPaused) - { - #ifdef FANCHECK - if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) - { - if (is_usb_printing) - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 - } - else - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 - } - } - #else - if (is_usb_printing) - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 - } - else - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 - } - #endif //FANCHECK - } - if(IS_SD_PRINTING || is_usb_printing || isPrintPaused) - { - MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); - } -#ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code - if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) - { - if (!card.isFileOpen()) - { - if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { - //if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu); - /*else*/ { - bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function - MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); - } - } -#if SDCARDDETECT < 1 - MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD -#endif //SDCARDDETECT - } - - } else - { - bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function - MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD -#if SDCARDDETECT < 1 - MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface////MSG_INIT_SDCARD -#endif //SDCARDDETECT - } -#endif //SDSUPPORT - - if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { - if (!farm_mode) + if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag) { - const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); - const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); - if ((nextSheet >= 0) && (sheet != nextSheet)) // show menu only if we have 2 or more sheets initialized + MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 + } + + if (farm_mode) + MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 + + if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) + { + MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE + } else + { + MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT + } + + if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) + { + if (IS_SD_PRINTING) { - MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); + MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 + } + else if (is_usb_printing) + { + MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);////MSG_PAUSE_PRINT c=18 } } - } + if(isPrintPaused) + { +#ifdef FANCHECK + if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) + { + if (is_usb_printing) + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 + } + else + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 + } + } + #else + if (is_usb_printing) + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 + } + else + { + MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 + } + #endif //FANCHECK + } + if(IS_SD_PRINTING || is_usb_printing || isPrintPaused) + { + MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); + } +#ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code + if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) + { + if (!card.isFileOpen()) + { + if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + { + //if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu); + /*else*/{ + bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function + MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); + } + } +#if SDCARDDETECT < 1 + MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD +#endif //SDCARDDETECT + } + } else + { + bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function + MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD +#if SDCARDDETECT < 1 + MENU_ITEM_GCODE_P(_i("Init. SD card"), PSTR("M21")); // Manually initialize the SD-card via user interface////MSG_INIT_SDCARD +#endif //SDCARDDETECT + } +#endif //SDSUPPORT + if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + { + if (!farm_mode) + { + const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); + const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); + if ((nextSheet >= 0) && (sheet != nextSheet)) // show menu only if we have 2 or more sheets initialized + { + MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); + } + } + } - if ( ! ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) - { - if (mmu_enabled) - { - MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), fil_load_menu); - MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu); + if ( ! ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) + { + if (mmu_enabled) + { + MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), fil_load_menu); + MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu); //-// MENU_ITEM_FUNCTION_P(_T(MSG_UNLOAD_FILAMENT), extr_unload); //bFilamentFirstRun=true; - MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), mmu_unload_filament); - MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FILAMENT), mmu_fil_eject_menu); + MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), mmu_unload_filament); + MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FILAMENT), mmu_fil_eject_menu); #ifdef MMU_HAS_CUTTER - MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), mmu_cut_filament_menu); + MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), mmu_cut_filament_menu); #endif //MMU_HAS_CUTTER - } - else - { + } + else + { #ifdef SNMM - MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), fil_unload_menu); - MENU_ITEM_SUBMENU_P(_i("Change extruder"), change_extr_menu);////MSG_CHANGE_EXTR c=20 r=1 + MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), fil_unload_menu); + MENU_ITEM_SUBMENU_P(_i("Change extruder"), change_extr_menu);////MSG_CHANGE_EXTR c=20 r=1 #endif #ifdef FILAMENT_SENSOR - if ((fsensor_autoload_enabled == true) && (fsensor_enabled == true) && (mmu_enabled == false)) - MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);////MSG_AUTOLOAD_FILAMENT c=18 - else + if ((fsensor_autoload_enabled == true) && (fsensor_enabled == true) && (mmu_enabled == false)) + MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);////MSG_AUTOLOAD_FILAMENT c=18 + else #endif //FILAMENT_SENSOR - { - bFilamentFirstRun=true; - MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); - } - bFilamentFirstRun=true; - MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); - } - MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); + { + bFilamentFirstRun=true; + MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); + } + bFilamentFirstRun=true; + MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); + } + MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); if(!isPrintPaused) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); + } + + if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + { + MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS + } - } - - if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { - MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS - } - #if defined(TMC2130) || defined(FILAMENT_SENSOR) - MENU_ITEM_SUBMENU_P(_i("Fail stats"), lcd_menu_fails_stats); + MENU_ITEM_SUBMENU_P(_i("Fail stats"), lcd_menu_fails_stats); #endif - if (mmu_enabled) { - MENU_ITEM_SUBMENU_P(_i("Fail stats MMU"), lcd_menu_fails_stats_mmu); - } - MENU_ITEM_SUBMENU_P(_i("Support"), lcd_support_menu);////MSG_SUPPORT + if (mmu_enabled) { + MENU_ITEM_SUBMENU_P(_i("Fail stats MMU"), lcd_menu_fails_stats_mmu); + } + MENU_ITEM_SUBMENU_P(_i("Support"), lcd_support_menu);////MSG_SUPPORT #ifdef LCD_TEST MENU_ITEM_SUBMENU_P(_i("W25x20CL init"), lcd_test_menu);////MSG_SUPPORT #endif //LCD_TEST - MENU_END(); + MENU_END(); } From 8bc46248f6e35ed61cce93719bf4683866dfb970 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 11:09:29 +0100 Subject: [PATCH 11/58] avoid having the block body twice in the code. Thanks to @DRracer --- Firmware/ultralcd.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 9d2e9d0d..4a257fd7 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6658,6 +6658,7 @@ static void lcd_main_menu() { #ifdef FANCHECK if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) +#endif //FANCHECK { if (is_usb_printing) { @@ -6668,16 +6669,6 @@ static void lcd_main_menu() MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 } } - #else - if (is_usb_printing) - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 - } - else - { - MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 - } - #endif //FANCHECK } if(IS_SD_PRINTING || is_usb_printing || isPrintPaused) { From cb61436093238cd1a357dd248cd285e79e276542 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 7 Feb 2021 09:47:30 +0100 Subject: [PATCH 12/58] Add remaining time to change/pause/user interaction to LCD Info screen - Add parameter `C` to gcode `M73` - LCD Info screen switches to change time if last `M73` gcode contains `C` parameter - Examples: - `M73 P5 R120` will display on LCD ` SD 5% 02:00R ` if it is printing at 100% speed - `M73 P5 R120 C60` will display on LCD ` SD 5% 01:00C ` if it is printing at 100% speed Slicers can generate "Time to change/pause/user interaction" using `C` parameter to "overwrite" the remaining print time. To switch between time to change and remaining time just send in intervals `M73` with or without `C` parameter. --- Firmware/Marlin.h | 2 ++ Firmware/Marlin_main.cpp | 33 ++++++++++++++++++++++++++++----- Firmware/ultralcd.cpp | 32 ++++++++++++++++++++------------ 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index cbe03c0f..5ef7ca00 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -366,6 +366,7 @@ extern uint8_t print_percent_done_normal; extern uint16_t print_time_remaining_normal; extern uint8_t print_percent_done_silent; extern uint16_t print_time_remaining_silent; +extern uint16_t print_time_to_change; #define PRINT_TIME_REMAINING_INIT 0xffff @@ -438,6 +439,7 @@ extern void cancel_saved_printing(); //estimated time to end of the print extern uint16_t print_time_remaining(); +extern uint16_t print_time_to_change_remaining(); extern uint8_t calc_percent_done(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 0c468189..b36dd16a 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -316,6 +316,7 @@ uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT; uint16_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT; uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes +uint16_t print_time_to_change = PRINT_TIME_REMAINING_INIT; //estimated remaining time to next change in minutes uint32_t IP_address = 0; @@ -6395,13 +6396,14 @@ Sigma_Exit: ### M73 - Set/get print progress M73: Set/Get build percentage #### Usage - M73 [ P | R | Q | S ] + M73 [ P | R | Q | S | C ] #### Parameters - `P` - Percent in normal mode - `R` - Time remaining in normal mode - `Q` - Percent in silent mode - `S` - Time in silent mode + - `C` - Time to change/pause/user interaction */ case 73: //M73 show percent done and time remaining if(code_seen('P')) print_percent_done_normal = code_value(); @@ -6414,6 +6416,14 @@ Sigma_Exit: printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal); printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent); } + + print_time_to_change = PRINT_TIME_REMAINING_INIT; + if(code_seen('C')) + { + print_time_to_change = code_value(); + printf_P(_N("Time to next change in mins: %d\n"), print_time_to_change); + } + break; /*! @@ -11665,6 +11675,18 @@ uint16_t print_time_remaining() { return print_t; } +uint16_t print_time_to_change_remaining() { + uint16_t print_t = PRINT_TIME_REMAINING_INIT; +//#ifdef TMC2130 +// if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; +// else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); +//#else + print_t = print_time_to_change; +//#endif //TMC2130 + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; + return print_t; +} + uint8_t calc_percent_done() { //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize @@ -11689,10 +11711,11 @@ uint8_t calc_percent_done() static void print_time_remaining_init() { - print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; - print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; - print_percent_done_normal = PRINT_PERCENT_DONE_INIT; - print_percent_done_silent = PRINT_PERCENT_DONE_INIT; + print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; + print_percent_done_normal = PRINT_PERCENT_DONE_INIT; + print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; + print_percent_done_silent = PRINT_PERCENT_DONE_INIT; + print_time_to_change = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index f8b791b0..1854d846 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -673,22 +673,30 @@ void lcdui_print_time(void) { //if remaining print time estimation is available print it else print elapsed time uint16_t print_t = 0; - if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) + int chars = 0; + char suff = ' '; + char suff_doubt = ' '; + + if(print_time_to_change != PRINT_TIME_REMAINING_INIT) + { + print_t = print_time_to_change_remaining(); + suff = 'C'; + if (feedmultiply != 100) + suff_doubt = '?'; + } + else if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) + { print_t = print_time_remaining(); + suff = 'R'; + if (feedmultiply != 100) + suff_doubt = '?'; + } else if(starttime != 0) print_t = _millis() / 60000 - starttime / 60000; - int chars = 0; - if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (starttime != 0))) + + if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (print_time_to_change != PRINT_TIME_REMAINING_INIT) || (starttime != 0))) { - char suff = ' '; - char suff_doubt = ' '; - if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) - { - suff = 'R'; - if (feedmultiply != 100) - suff_doubt = '?'; - } - if (print_t < 6000) //time<100h + if (print_t < 6000) //time<100h chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt); else //time>=100h chars = lcd_printf_P(_N("%c%3uh %c%c"), LCD_STR_CLOCK[0], print_t / 60, suff, suff_doubt); From cca90da64bf40f671d401b5dd194a4352774b94e Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 7 Feb 2021 09:48:48 +0100 Subject: [PATCH 13/58] Include silent mode on time change - depends on difference between print time remaining NORMAL vs SILENT mode --- Firmware/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b36dd16a..333e3a30 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11677,12 +11677,12 @@ uint16_t print_time_remaining() { uint16_t print_time_to_change_remaining() { uint16_t print_t = PRINT_TIME_REMAINING_INIT; -//#ifdef TMC2130 -// if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; -// else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); -//#else +/#ifdef TMC2130 + if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; + else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); +#else print_t = print_time_to_change; -//#endif //TMC2130 +#endif //TMC2130 if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; return print_t; } From f4ca6ee59d657ec7be06938f20294e12e0acd568 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 7 Feb 2021 09:52:25 +0100 Subject: [PATCH 14/58] Fix typo --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 333e3a30..2a67e3ad 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11677,7 +11677,7 @@ uint16_t print_time_remaining() { uint16_t print_time_to_change_remaining() { uint16_t print_t = PRINT_TIME_REMAINING_INIT; -/#ifdef TMC2130 +#ifdef TMC2130 if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); #else From ae48e7c3ce5f0a1db13b22ada3e2fc6e9d7ed0f3 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 7 Feb 2021 10:37:41 +0100 Subject: [PATCH 15/58] indentation --- Firmware/Marlin_main.cpp | 101 +++++++++++++++++++++------------------ Firmware/ultralcd.cpp | 58 +++++++++++----------- 2 files changed, 83 insertions(+), 76 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2a67e3ad..c50ec029 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6392,40 +6392,41 @@ Sigma_Exit: #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING - /*! - ### M73 - Set/get print progress M73: Set/Get build percentage - #### Usage - - M73 [ P | R | Q | S | C ] - - #### Parameters + /*! + ### M73 - Set/get print progress M73: Set/Get build percentage + #### Usage + + M73 [ P | R | Q | S | C ] + + #### Parameters - `P` - Percent in normal mode - `R` - Time remaining in normal mode - `Q` - Percent in silent mode - `S` - Time in silent mode - `C` - Time to change/pause/user interaction - */ - case 73: //M73 show percent done and time remaining - if(code_seen('P')) print_percent_done_normal = code_value(); - if(code_seen('R')) print_time_remaining_normal = code_value(); - if(code_seen('Q')) print_percent_done_silent = code_value(); - if(code_seen('S')) print_time_remaining_silent = code_value(); + */ + //!@todo update RepRap Gcode wiki + case 73: //M73 show percent done and time remaining + { + if(code_seen('P')) print_percent_done_normal = code_value(); + if(code_seen('R')) print_time_remaining_normal = code_value(); + if(code_seen('Q')) print_percent_done_silent = code_value(); + if(code_seen('S')) print_time_remaining_silent = code_value(); - { - const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d\n"); - printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal); - printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent); - } + { + const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d\n"); + printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal); + printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent); + } print_time_to_change = PRINT_TIME_REMAINING_INIT; - if(code_seen('C')) + if(code_seen('C')) { print_time_to_change = code_value(); - printf_P(_N("Time to next change in mins: %d\n"), print_time_to_change); - } - - break; - + printf_P(_N("Time to next change in mins: %d\n"), print_time_to_change); + } + break; + } /*! ### M104 - Set hotend temperature M104: Set Extruder Temperature #### Usage @@ -11663,50 +11664,56 @@ void print_mesh_bed_leveling_table() SERIAL_ECHOLN(); } -uint16_t print_time_remaining() { - uint16_t print_t = PRINT_TIME_REMAINING_INIT; +uint16_t print_time_remaining() +{ + uint16_t print_t = PRINT_TIME_REMAINING_INIT; #ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; - else print_t = print_time_remaining_silent; + if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; + else print_t = print_time_remaining_silent; #else - print_t = print_time_remaining_normal; + print_t = print_time_remaining_normal; #endif //TMC2130 - if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; - return print_t; + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; + return print_t; } -uint16_t print_time_to_change_remaining() { - uint16_t print_t = PRINT_TIME_REMAINING_INIT; +uint16_t print_time_to_change_remaining() +{ + uint16_t print_t = PRINT_TIME_REMAINING_INIT; #ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; + if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); #else print_t = print_time_to_change; #endif //TMC2130 - if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; - return print_t; + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; + return print_t; } uint8_t calc_percent_done() { - //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize - uint8_t percent_done = 0; + //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize + uint8_t percent_done = 0; #ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) { - percent_done = print_percent_done_normal; - } - else if (print_percent_done_silent <= 100) { + if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) + { + percent_done = print_percent_done_normal; + } + else if (print_percent_done_silent <= 100) + { percent_done = print_percent_done_silent; } #else - if (print_percent_done_normal <= 100) { + if (print_percent_done_normal <= 100) + { percent_done = print_percent_done_normal; } #endif //TMC2130 - else { - percent_done = card.percentDone(); - } - return percent_done; + else + { + percent_done = card.percentDone(); + } + return percent_done; } static void print_time_remaining_init() diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 1854d846..cf4737cb 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -671,39 +671,39 @@ void lcdui_print_cmd_diag(void) // Print time (8 chars total) void lcdui_print_time(void) { - //if remaining print time estimation is available print it else print elapsed time - uint16_t print_t = 0; - int chars = 0; + //if remaining print time estimation is available print it else print elapsed time + uint16_t print_t = 0; + int chars = 0; char suff = ' '; char suff_doubt = ' '; - if(print_time_to_change != PRINT_TIME_REMAINING_INIT) - { - print_t = print_time_to_change_remaining(); - suff = 'C'; - if (feedmultiply != 100) - suff_doubt = '?'; - } - else if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) - { - print_t = print_time_remaining(); - suff = 'R'; - if (feedmultiply != 100) - suff_doubt = '?'; - } - else if(starttime != 0) - print_t = _millis() / 60000 - starttime / 60000; + if(print_time_to_change != PRINT_TIME_REMAINING_INIT) + { + print_t = print_time_to_change_remaining(); + suff = 'C'; + if (feedmultiply != 100) + suff_doubt = '?'; + } + else if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) + { + print_t = print_time_remaining(); + suff = 'R'; + if (feedmultiply != 100) + suff_doubt = '?'; + } + else if(starttime != 0) + print_t = _millis() / 60000 - starttime / 60000; - if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (print_time_to_change != PRINT_TIME_REMAINING_INIT) || (starttime != 0))) - { - if (print_t < 6000) //time<100h - chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt); - else //time>=100h - chars = lcd_printf_P(_N("%c%3uh %c%c"), LCD_STR_CLOCK[0], print_t / 60, suff, suff_doubt); - } - else - chars = lcd_printf_P(_N("%c--:-- "), LCD_STR_CLOCK[0]); - lcd_space(8 - chars); + if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (print_time_to_change != PRINT_TIME_REMAINING_INIT) || (starttime != 0))) + { + if (print_t < 6000) //time<100h + chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt); + else //time>=100h + chars = lcd_printf_P(_N("%c%3uh %c%c"), LCD_STR_CLOCK[0], print_t / 60, suff, suff_doubt); + } + else + chars = lcd_printf_P(_N("%c--:-- "), LCD_STR_CLOCK[0]); + lcd_space(8 - chars); } //Print status line on status screen From 91c767b0f24d9d3877a88e8588c8711375512bfa Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 8 Feb 2021 03:34:01 +0100 Subject: [PATCH 16/58] Reduce code size --- Firmware/Configuration.h | 2 +- Firmware/Marlin.h | 2 -- Firmware/Marlin_main.cpp | 28 +----------------------- Firmware/ultralcd.cpp | 47 +++++++++++++++++++++++----------------- 4 files changed, 29 insertions(+), 50 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 62688ebe..80d250bf 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -17,7 +17,7 @@ extern PGM_P sPrinterName; // Firmware version #define FW_VERSION "3.9.3" -#define FW_COMMIT_NR 3556 +#define FW_COMMIT_NR 5002 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 5ef7ca00..49201c3a 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -438,8 +438,6 @@ extern void cancel_saved_printing(); //estimated time to end of the print -extern uint16_t print_time_remaining(); -extern uint16_t print_time_to_change_remaining(); extern uint8_t calc_percent_done(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c50ec029..426a3217 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6423,7 +6423,7 @@ Sigma_Exit: if(code_seen('C')) { print_time_to_change = code_value(); - printf_P(_N("Time to next change in mins: %d\n"), print_time_to_change); + printf_P(_N("Change in mins: %d\n"), print_time_to_change); } break; } @@ -11664,32 +11664,6 @@ void print_mesh_bed_leveling_table() SERIAL_ECHOLN(); } -uint16_t print_time_remaining() -{ - uint16_t print_t = PRINT_TIME_REMAINING_INIT; -#ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; - else print_t = print_time_remaining_silent; -#else - print_t = print_time_remaining_normal; -#endif //TMC2130 - if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; - return print_t; -} - -uint16_t print_time_to_change_remaining() -{ - uint16_t print_t = PRINT_TIME_REMAINING_INIT; -#ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_to_change; - else print_t = print_time_to_change - (print_time_remaining_normal - print_time_remaining_silent); -#else - print_t = print_time_to_change; -#endif //TMC2130 - if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; - return print_t; -} - uint8_t calc_percent_done() { //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index cf4737cb..43d80799 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -672,30 +672,37 @@ void lcdui_print_cmd_diag(void) void lcdui_print_time(void) { //if remaining print time estimation is available print it else print elapsed time - uint16_t print_t = 0; int chars = 0; - char suff = ' '; - char suff_doubt = ' '; + if ((PRINTER_ACTIVE) && (starttime != 0)) + { + uint16_t print_t = 0; + char suff = ' '; + char suff_doubt = ' '; - if(print_time_to_change != PRINT_TIME_REMAINING_INIT) - { - print_t = print_time_to_change_remaining(); - suff = 'C'; + if (print_time_to_change != PRINT_TIME_REMAINING_INIT) + { + print_t = print_time_to_change; + suff = 'C'; + } + else + { + suff = 'R'; + #ifdef TMC2130 + if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT && (SilentModeMenu != SILENT_MODE_OFF)) + { + print_t = print_time_remaining_silent; + } + else + #endif //TMC2130 + print_t = print_time_remaining_normal; + } + if (feedmultiply != 100) + { suff_doubt = '?'; - } - else if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) - { - print_t = print_time_remaining(); - suff = 'R'; - if (feedmultiply != 100) - suff_doubt = '?'; - } - else if(starttime != 0) - print_t = _millis() / 60000 - starttime / 60000; - - if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (print_time_to_change != PRINT_TIME_REMAINING_INIT) || (starttime != 0))) - { + print_t = 100ul * print_t / feedmultiply; + } + if (print_t < 6000) //time<100h chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt); else //time>=100h From 83e791cbbe390730d56ad137b1b78064803cf43b Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 8 Feb 2021 04:05:01 +0100 Subject: [PATCH 17/58] Fix temp Build number --- Firmware/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 80d250bf..62688ebe 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -17,7 +17,7 @@ extern PGM_P sPrinterName; // Firmware version #define FW_VERSION "3.9.3" -#define FW_COMMIT_NR 5002 +#define FW_COMMIT_NR 3556 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN From d063ffb1413960004060c8b52229edec4bf67675 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 08:13:40 +0100 Subject: [PATCH 18/58] Add parameter `D` to gcode `M73` for silent/stealth mode --- Firmware/Marlin.h | 3 ++- Firmware/Marlin_main.cpp | 16 +++++++++----- Firmware/ultralcd.cpp | 48 +++++++++++++++++++++++++++++----------- 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 49201c3a..a1b6fe4e 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -366,7 +366,8 @@ extern uint8_t print_percent_done_normal; extern uint16_t print_time_remaining_normal; extern uint8_t print_percent_done_silent; extern uint16_t print_time_remaining_silent; -extern uint16_t print_time_to_change; +extern uint16_t print_time_to_change_normal; +extern uint16_t print_time_to_change_silent; #define PRINT_TIME_REMAINING_INIT 0xffff diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 426a3217..95acdf8f 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -316,7 +316,8 @@ uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT; uint16_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT; uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes -uint16_t print_time_to_change = PRINT_TIME_REMAINING_INIT; //estimated remaining time to next change in minutes +uint16_t print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; //estimated remaining time to next change in minutes +uint16_t print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining time to next change in minutes uint32_t IP_address = 0; @@ -6419,11 +6420,13 @@ Sigma_Exit: printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent); } - print_time_to_change = PRINT_TIME_REMAINING_INIT; - if(code_seen('C')) + if(code_seen('C')) print_time_to_change_normal = code_value(); + if(code_seen('D')) print_time_to_change_silent = code_value(); + { - print_time_to_change = code_value(); - printf_P(_N("Change in mins: %d\n"), print_time_to_change); + const char* _msg_mode_done_remain = _N("%S MODE: Change in mins: %d\n"); + printf_P(_msg_mode_done_remain, _N("NORMAL"), print_time_to_change_normal); + printf_P(_msg_mode_done_remain, _N("SILENT"), print_time_to_change_silent); } break; } @@ -11696,7 +11699,8 @@ static void print_time_remaining_init() print_percent_done_normal = PRINT_PERCENT_DONE_INIT; print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; print_percent_done_silent = PRINT_PERCENT_DONE_INIT; - print_time_to_change = PRINT_TIME_REMAINING_INIT; + print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; + print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 43d80799..5041f203 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -676,33 +676,55 @@ void lcdui_print_time(void) if ((PRINTER_ACTIVE) && (starttime != 0)) { uint16_t print_t = 0; + uint16_t print_tr = 0; + uint16_t print_tc = 0; char suff = ' '; char suff_doubt = ' '; - if (print_time_to_change != PRINT_TIME_REMAINING_INIT) + #ifdef TMC2130 + if (SilentModeMenu != SILENT_MODE_OFF) { - print_t = print_time_to_change; + if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) + { + print_tr = print_time_remaining_silent; + } + if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) + { + print_tc = print_time_to_change_silent; + } + } + else + { + #endif //TMC2130 + if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) + { + print_tr = print_time_remaining_normal; + } + if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) + { + print_tc = print_time_to_change_normal; + } + #ifdef TMC2130 + } + #endif //TMC2130 + + if (print_tc != 0) + { + print_t = print_tc; suff = 'C'; } - else + else if (print_tr != 0) { + print_t = print_tr; suff = 'R'; - #ifdef TMC2130 - if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT && (SilentModeMenu != SILENT_MODE_OFF)) - { - print_t = print_time_remaining_silent; } - else - #endif //TMC2130 - print_t = print_time_remaining_normal; - } - + if (feedmultiply != 100) { suff_doubt = '?'; print_t = 100ul * print_t / feedmultiply; } - + if (print_t < 6000) //time<100h chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt); else //time>=100h From 4998cfb70d4f8778f3f7f7c7fcb3d52a94f56d5d Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 08:59:31 +0100 Subject: [PATCH 19/58] Fix printing time being shown without `M73` gcode Adjust estimated times only if speed is changed. Printing time has to stay printing time. --- Firmware/ultralcd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5041f203..cd5705aa 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -718,8 +718,12 @@ void lcdui_print_time(void) print_t = print_tr; suff = 'R'; } + else + { + print_t = _millis() / 60000 - starttime / 60000; + } - if (feedmultiply != 100) + if (feedmultiply != 100 && (print_tc != 0 || print_tr !=0)) { suff_doubt = '?'; print_t = 100ul * print_t / feedmultiply; From b13d4b71d437962cf2b493d0f1805cfe44b8d613 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 09:29:47 +0100 Subject: [PATCH 20/58] Add Change time behind existing message --- Firmware/Marlin_main.cpp | 62 ++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 95acdf8f..2b89958c 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6393,43 +6393,37 @@ Sigma_Exit: #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING - /*! - ### M73 - Set/get print progress M73: Set/Get build percentage - #### Usage - - M73 [ P | R | Q | S | C ] - - #### Parameters - - `P` - Percent in normal mode - - `R` - Time remaining in normal mode - - `Q` - Percent in silent mode - - `S` - Time in silent mode - - `C` - Time to change/pause/user interaction - */ - //!@todo update RepRap Gcode wiki - case 73: //M73 show percent done and time remaining - { - if(code_seen('P')) print_percent_done_normal = code_value(); - if(code_seen('R')) print_time_remaining_normal = code_value(); - if(code_seen('Q')) print_percent_done_silent = code_value(); - if(code_seen('S')) print_time_remaining_silent = code_value(); - - { - const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d\n"); - printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal); - printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent); - } - - if(code_seen('C')) print_time_to_change_normal = code_value(); - if(code_seen('D')) print_time_to_change_silent = code_value(); + /*! + ### M73 - Set/get print progress M73: Set/Get build percentage + #### Usage + M73 [ P | R | Q | S | C | D ] + + #### Parameters + - `P` - Percent in normal mode + - `R` - Time remaining in normal mode + - `Q` - Percent in silent mode + - `S` - Time in silent mode + - `C` - Time to change/pause/user interaction in normal mode + - `D` - Time to change/pause/user interaction in silent mode + */ + //!@todo update RepRap Gcode wiki + case 73: //M73 show percent done, time remaining and time to change/pause { - const char* _msg_mode_done_remain = _N("%S MODE: Change in mins: %d\n"); - printf_P(_msg_mode_done_remain, _N("NORMAL"), print_time_to_change_normal); - printf_P(_msg_mode_done_remain, _N("SILENT"), print_time_to_change_silent); + if(code_seen('P')) print_percent_done_normal = code_value(); + if(code_seen('R')) print_time_remaining_normal = code_value(); + if(code_seen('Q')) print_percent_done_silent = code_value(); + if(code_seen('S')) print_time_remaining_silent = code_value(); + if(code_seen('C')) print_time_to_change_normal = code_value(); + if(code_seen('D')) print_time_to_change_silent = code_value(); + + { + const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d; Change in mins: %d\n"); + printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal, print_time_to_change_normal); + printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); + } + break; } - break; - } /*! ### M104 - Set hotend temperature M104: Set Extruder Temperature #### Usage From b9a3fa2ddd7f955ccfd0551b9980cd0d5052a4b2 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 09:31:33 +0100 Subject: [PATCH 21/58] fix time at speed --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index cd5705aa..057d7dea 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -723,7 +723,7 @@ void lcdui_print_time(void) print_t = _millis() / 60000 - starttime / 60000; } - if (feedmultiply != 100 && (print_tc != 0 || print_tr !=0)) + if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; print_t = 100ul * print_t / feedmultiply; From 14b4bf5fa5dd8906ea89895470b1ad1f56f1248f Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 10 Feb 2021 16:18:47 +0100 Subject: [PATCH 22/58] Add CLOCK_INTERVAL_TIME and ShortTimer IntervalTimer --- Firmware/Configuration_adv.h | 6 ++++++ Firmware/ultralcd.cpp | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Firmware/Configuration_adv.h b/Firmware/Configuration_adv.h index 7a9a4929..8895eef6 100644 --- a/Firmware/Configuration_adv.h +++ b/Firmware/Configuration_adv.h @@ -338,6 +338,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st // Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL +//LCD status clock interval timer to switch between +// print time +// remaining print time +// and time to change/pause/interaction +#define CLOCK_INTERVAL_TIME 5000 + //=========================================================================== //=============================Buffers ============================ //=========================================================================== diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 057d7dea..98f4dccd 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -673,6 +673,7 @@ void lcdui_print_time(void) { //if remaining print time estimation is available print it else print elapsed time int chars = 0; + ShortTimer IntervalTimer; if ((PRINTER_ACTIVE) && (starttime != 0)) { uint16_t print_t = 0; @@ -708,17 +709,18 @@ void lcdui_print_time(void) } #endif //TMC2130 - if (print_tc != 0) - { - print_t = print_tc; - suff = 'C'; - } - else if (print_tr != 0) + if (print_tr != 0) { print_t = print_tr; suff = 'R'; } - else + else if (print_tc != 0) + { + print_t = print_tc; + suff = 'C'; + } + + if (print_tr == 0) { print_t = _millis() / 60000 - starttime / 60000; } From cf982b0d4dee71cae62d0a673b8efc2f2c64ced5 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 11 Feb 2021 10:20:06 +0100 Subject: [PATCH 23/58] Fix timer issue The remaining time stays for ~5 seconds while the change time stays just for ~1 second --- Firmware/ultralcd.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 98f4dccd..1653e61a 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -673,7 +673,6 @@ void lcdui_print_time(void) { //if remaining print time estimation is available print it else print elapsed time int chars = 0; - ShortTimer IntervalTimer; if ((PRINTER_ACTIVE) && (starttime != 0)) { uint16_t print_t = 0; @@ -681,6 +680,8 @@ void lcdui_print_time(void) uint16_t print_tc = 0; char suff = ' '; char suff_doubt = ' '; + static ShortTimer IntervalTimer; + #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) @@ -714,10 +715,15 @@ void lcdui_print_time(void) print_t = print_tr; suff = 'R'; } - else if (print_tc != 0) + + if (print_tc != 0) { - print_t = print_tc; - suff = 'C'; + if (IntervalTimer.expired(5000)) + { + print_t = print_tc; + suff = 'C'; + IntervalTimer.start(); + } } if (print_tr == 0) From d2e60aee90fca67c01338ef4a49ad656a6164719 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 11 Feb 2021 10:45:26 +0100 Subject: [PATCH 24/58] Use `CLOCK_INTERVAL_TIME` --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 1653e61a..8a8f6b79 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -718,7 +718,7 @@ void lcdui_print_time(void) if (print_tc != 0) { - if (IntervalTimer.expired(5000)) + if (IntervalTimer.expired(CLOCK_INTERVAL_TIME)) { print_t = print_tc; suff = 'C'; From f810047a5c9cd4d9cbeea5947cc84183986f01fd Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Fri, 12 Feb 2021 11:29:47 +0100 Subject: [PATCH 25/58] Switch between Remaing and Change time every few seconds - If `M73` `R,S,C,D` values set the LCD Info screen clock switchs between Remaining and Change time - If Remaining time is 0 while Change time is >0 the clock switchs between Change time and actual printing time - If Change is 0 while Remaining time is >0 the clock shows the Remaining time - If both are 0 the clock shows the actual printing time - `M73 C` values are shown in "Normal" mode - `M73 D` values are shown in "Stealth" mode - Changing the speed will try to calculate the espected times and show `?` behind `R` or `C` --- Firmware/Configuration_adv.h | 3 +-- Firmware/ultralcd.cpp | 43 ++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Firmware/Configuration_adv.h b/Firmware/Configuration_adv.h index 8895eef6..ee12716e 100644 --- a/Firmware/Configuration_adv.h +++ b/Firmware/Configuration_adv.h @@ -339,10 +339,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st //#define HEATERS_PARALLEL //LCD status clock interval timer to switch between -// print time // remaining print time // and time to change/pause/interaction -#define CLOCK_INTERVAL_TIME 5000 +#define CLOCK_INTERVAL_TIME 5 //=========================================================================== //=============================Buffers ============================ diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 8a8f6b79..422566f1 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -57,7 +57,7 @@ int scrollstuff = 0; char longFilenameOLD[LONG_FILENAME_LENGTH]; - +int clock_interval = 0; static void lcd_sd_updir(); static void lcd_mesh_bed_leveling_settings(); @@ -680,53 +680,58 @@ void lcdui_print_time(void) uint16_t print_tc = 0; char suff = ' '; char suff_doubt = ' '; - static ShortTimer IntervalTimer; - - #ifdef TMC2130 +#ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) { print_tr = print_time_remaining_silent; } +//#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) { print_tc = print_time_to_change_silent; } +//#endif //CLOCK_INTERVAL_TIME } else { - #endif //TMC2130 +#endif //TMC2130 if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) { print_tr = print_time_remaining_normal; } +//#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) { print_tc = print_time_to_change_normal; } - #ifdef TMC2130 +//#endif //CLOCK_INTERVAL_TIME +#ifdef TMC2130 } - #endif //TMC2130 +#endif //TMC2130 +//#ifdef CLOCK_INTERVAL_TIME + if (clock_interval == CLOCK_INTERVAL_TIME*2) + { + clock_interval = 0; + } + clock_interval++; + + if (print_tc != 0 && clock_interval > CLOCK_INTERVAL_TIME) + { + print_t = print_tc; + suff = 'C'; + } + else +//#endif //CLOCK_INTERVAL_TIME if (print_tr != 0) { print_t = print_tr; suff = 'R'; } - - if (print_tc != 0) - { - if (IntervalTimer.expired(CLOCK_INTERVAL_TIME)) - { - print_t = print_tc; - suff = 'C'; - IntervalTimer.start(); - } - } - - if (print_tr == 0) + else { print_t = _millis() / 60000 - starttime / 60000; } From c95a8e13d76ddefe6b1c4a1bf32dcfec051e9987 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Fri, 12 Feb 2021 11:47:02 +0100 Subject: [PATCH 26/58] Fix indentations to 4 spaces per tab --- Firmware/Marlin_main.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2b89958c..c23a1c15 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11663,28 +11663,28 @@ void print_mesh_bed_leveling_table() uint8_t calc_percent_done() { - //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize - uint8_t percent_done = 0; + //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize + uint8_t percent_done = 0; #ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) - { - percent_done = print_percent_done_normal; - } - else if (print_percent_done_silent <= 100) - { - percent_done = print_percent_done_silent; - } + if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) + { + percent_done = print_percent_done_normal; + } + else if (print_percent_done_silent <= 100) + { + percent_done = print_percent_done_silent; + } #else - if (print_percent_done_normal <= 100) - { - percent_done = print_percent_done_normal; - } + if (print_percent_done_normal <= 100) + { + percent_done = print_percent_done_normal; + } #endif //TMC2130 - else - { - percent_done = card.percentDone(); - } - return percent_done; + else + { + percent_done = card.percentDone(); + } + return percent_done; } static void print_time_remaining_init() From fc270a356a4ee430656b0db12cf909a196db7839 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 12:50:40 +0100 Subject: [PATCH 27/58] Fix indentations --- Firmware/ultralcd.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 016acd61..a99e1130 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -114,14 +114,14 @@ extern int8_t FSensorStateMenu; enum class CustomMsg : uint_least8_t { - Status, //!< status message from lcd_status_message variable - MeshBedLeveling, //!< Mesh bed leveling in progress - FilamentLoading, //!< Loading filament in progress - PidCal, //!< PID tuning in progress - TempCal, //!< PINDA temperature calibration - TempCompPreheat, //!< Temperature compensation preheat - M0Wait, //!< M0/M1 Wait command working even from SD - MsgUpdate, //!< Short message even while printing from SD + Status, //!< status message from lcd_status_message variable + MeshBedLeveling, //!< Mesh bed leveling in progress + FilamentLoading, //!< Loading filament in progress + PidCal, //!< PID tuning in progress + TempCal, //!< PINDA temperature calibration + TempCompPreheat, //!< Temperature compensation preheat + M0Wait, //!< M0/M1 Wait command working even from SD + MsgUpdate, //!< Short message even while printing from SD }; extern CustomMsg custom_message_type; From 9071a9f8fd2350eb3ac1fd8ab1a66fdd7df68d44 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 12:51:12 +0100 Subject: [PATCH 28/58] Gcode `M1` must have a string while `M0` it is optional As the `M0/M1` moved to the beginning of the parser - parser would not be able to "find" `M1nn` command if the query was `M1` instead of `M1 ` - to be able to "stop/halt" without sending a string and display default message use gcode `M0` - as there are no `M0nn` gcodes the parser can query `M0` without additional space needed as in `M1 ` --- Firmware/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 316a79c5..d6602ef8 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3833,16 +3833,16 @@ void process_commands() #### Usage M0 [P] [string] - M1 [P] [S] [string] + M1 [P] [S] [string] #### Parameters - `P` - Expire time, in milliseconds - `S` - Expire time, in seconds - - `string` - An optional message to display on the LCD + - `string` - Must for M1 and optional for M0 message to display on the LCD */ - else if (code_seen_P(PSTR("M0 ")) || code_seen_P(PSTR("M1 "))) { // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD + else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) { // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD char *src = strchr_pointer + 2; From 583993b7e2ebf8c85a157fddb81248fc75efaf67 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 15:25:04 +0100 Subject: [PATCH 29/58] Back to "Status" after gcode `M0/M1` --- Firmware/Marlin_main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4f83109f..d99486ba 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3882,10 +3882,9 @@ void process_commands() marlin_wait_for_click(); } if (IS_SD_PRINTING) - LCD_MESSAGERPGM(_T(MSG_RESUMING_PRINT)); + custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(_T(WELCOME_MSG)); - custom_message_type = CustomMsg::MsgUpdate; } #ifdef TMC2130 From c07bcd172a8a8da0d63c2ad638f8a799d569299d Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 18:34:08 +0100 Subject: [PATCH 30/58] Fix NO Stop print during MBL --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 4a257fd7..8eed038a 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6670,7 +6670,7 @@ static void lcd_main_menu() } } } - if(IS_SD_PRINTING || is_usb_printing || isPrintPaused) + if((IS_SD_PRINTING || is_usb_printing || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } From c2637d9430178537dfdceb6049f5958ceabb7e96 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 18:35:04 +0100 Subject: [PATCH 31/58] Documentation Show Main Menu --- Firmware/ultralcd.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 8eed038a..0cb12f54 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6605,6 +6605,44 @@ static void lcd_sheet_menu() MENU_END(); } +//! @brief Show Main Menu +//! +//! @code{.unparsed} +//! |01234567890123456789| +//! | Info screen | allways +//! +//! | tst - Save | ifdef RESUME_DEBUG +//! | tst - Restore | ifdef RESUME_DEBUG +//! +//! | recover print | TMC2130_DEBUG +//! | power panic | TMC2130_DEBUG +//! +//! | Live adjust Z | printing + Z low +//! +//! | Change filament | farm mode +//! +//! | Tune | printing +//! | Pause print | printing + not paused +//! | Resume print | printing + paused +//! | Stop print | printing +//! | Preheat | not printing or paused +//! | Print from SD | not printing or paused +//! +//! | Switch sheet | farm mode +//! +//! | AutoLoad filament | not printing + not mmu or paused +//! | Load filament | not printing + mmu or paused +//! | Load to nozzle | not printing + mmu or paused +//! | Unload filament | not printing or paused +//! | Eject filament | not printing + mmu or paused +//! | Cut filament | not printing + mmu or paused + cut atctive +//! | Settings | not printing or paused +//! | Calibration | not printing +//! | Statistics | not printing +//! | Fail stats | allways +//! | Fail stats MMU | mmu +//! | Support | allways +//! @endcode static void lcd_main_menu() { From d6c6517fcd3884bd15e4f1b0e9b6bbc4633076db Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 16 Feb 2021 07:27:46 +0100 Subject: [PATCH 32/58] Back to Status after Resuming --- Firmware/ultralcd.cpp | 6 +++++- Firmware/ultralcd.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 03446fc3..bee49f44 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -899,6 +899,9 @@ void lcdui_print_status_line(void) lcd_print(' '); } break; + case CustomMsg::Resuming: //Resuming + lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); + break; } } @@ -6537,12 +6540,13 @@ void lcd_resume_print() lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); st_synchronize(); - lcd_setstatuspgm(_T(MSG_RESUMING_PRINT)); ////MSG_RESUMING_PRINT c=20 + custom_message_type = CustomMsg::Resuming; isPrintPaused = false; restore_print_from_ram_and_continue(default_retraction); pause_time += (_millis() - start_pause_print); //accumulate time when print is paused for correct statistics calculation refresh_cmd_timeout(); SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint + custom_message_type = CustomMsg::Status; } static void change_sheet() diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index a99e1130..ac8178cb 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -122,6 +122,7 @@ enum class CustomMsg : uint_least8_t TempCompPreheat, //!< Temperature compensation preheat M0Wait, //!< M0/M1 Wait command working even from SD MsgUpdate, //!< Short message even while printing from SD + Resuming, //!< Resuming message }; extern CustomMsg custom_message_type; From 66ea1bdfba6396bd6d0dc2db5bc23ffab63cb56f Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 16 Feb 2021 12:31:23 +0100 Subject: [PATCH 33/58] Indentations --- Firmware/Marlin_main.cpp | 151 +++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 70 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d99486ba..6b4e9da0 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3799,92 +3799,103 @@ void process_commands() float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; int8_t SilentMode; #endif - /*! - - --------------------------------------------------------------------------------- - ### M117 - Display Message M117: Display Message - This causes the given message to be shown in the status line on an attached LCD. - It is processed early as to allow printing messages that contain G, M, N or T. - - --------------------------------------------------------------------------------- - ### Special internal commands - These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user. - They are processed early as the commands are complex (strings). - These are only available on the MK3(S) as these require TMC2130 drivers: - - CRASH DETECTED - - CRASH RECOVER - - CRASH_CANCEL - - TMC_SET_WAVE - - TMC_SET_STEP - - TMC_SET_CHOP - */ - if (code_seen_P(PSTR("M117"))) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" - starpos = (strchr(strchr_pointer + 5, '*')); - if (starpos != NULL) - *(starpos) = '\0'; - lcd_setstatus(strchr_pointer + 5); - custom_message_type = CustomMsg::MsgUpdate; - } + /*! + + --------------------------------------------------------------------------------- + ### M117 - Display Message M117: Display Message + This causes the given message to be shown in the status line on an attached LCD. + It is processed early as to allow printing messages that contain G, M, N or T. + + --------------------------------------------------------------------------------- + ### Special internal commands + These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user. + They are processed early as the commands are complex (strings). + These are only available on the MK3(S) as these require TMC2130 drivers: + - CRASH DETECTED + - CRASH RECOVER + - CRASH_CANCEL + - TMC_SET_WAVE + - TMC_SET_STEP + - TMC_SET_CHOP + */ + if (code_seen_P(PSTR("M117"))) //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" + { + starpos = (strchr(strchr_pointer + 5, '*')); + if (starpos != NULL) + *(starpos) = '\0'; + lcd_setstatus(strchr_pointer + 5); + custom_message_type = CustomMsg::MsgUpdate; + } /*! - ### M0, M1 - Stop the printer M0: Stop or Unconditional stop - #### Usage + ### M0, M1 - Stop the printer M0: Stop or Unconditional stop + #### Usage M0 [P] [string] M1 [P] [S] [string] - #### Parameters + #### Parameters - `P` - Expire time, in milliseconds - `S` - Expire time, in seconds - `string` - Must for M1 and optional for M0 message to display on the LCD */ - else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) { // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD + else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD + { - char *src = strchr_pointer + 2; + char *src = strchr_pointer + 2; - codenum = 0; + codenum = 0; - bool hasP = false, hasS = false; - if (code_seen('P')) { - codenum = code_value(); // milliseconds to wait - hasP = codenum > 0; - } - if (code_seen('S')) { - codenum = code_value() * 1000; // seconds to wait - hasS = codenum > 0; - } - starpos = strchr(src, '*'); - if (starpos != NULL) *(starpos) = '\0'; - while (*src == ' ') ++src; - custom_message_type = CustomMsg::M0Wait; - if (!hasP && !hasS && *src != '\0') { - lcd_setstatus(src); - } else { - LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT - } - - lcd_ignore_click(); //call lcd_ignore_click aslo for else ??? - st_synchronize(); - previous_millis_cmd = _millis(); - if (codenum > 0){ - codenum += _millis(); // keep track of when we started waiting - KEEPALIVE_STATE(PAUSED_FOR_USER); - while(_millis() < codenum && !lcd_clicked()){ - manage_heater(); - manage_inactivity(true); - lcd_update(0); + bool hasP = false, hasS = false; + if (code_seen('P')) + { + codenum = code_value(); // milliseconds to wait + hasP = codenum > 0; } - KEEPALIVE_STATE(IN_HANDLER); - lcd_ignore_click(false); - }else{ - marlin_wait_for_click(); - } - if (IS_SD_PRINTING) - custom_message_type = CustomMsg::Status; - else - LCD_MESSAGERPGM(_T(WELCOME_MSG)); + if (code_seen('S')) + { + codenum = code_value() * 1000; // seconds to wait + hasS = codenum > 0; + } + starpos = strchr(src, '*'); + if (starpos != NULL) *(starpos) = '\0'; + while (*src == ' ') ++src; + custom_message_type = CustomMsg::M0Wait; + if (!hasP && !hasS && *src != '\0') + { + lcd_setstatus(src); + } + else + { + LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT + } + + lcd_ignore_click(); //call lcd_ignore_click aslo for else ??? + st_synchronize(); + previous_millis_cmd = _millis(); + if (codenum > 0) + { + codenum += _millis(); // keep track of when we started waiting + KEEPALIVE_STATE(PAUSED_FOR_USER); + while(_millis() < codenum && !lcd_clicked()) + { + manage_heater(); + manage_inactivity(true); + lcd_update(0); + } + KEEPALIVE_STATE(IN_HANDLER); + lcd_ignore_click(false); + } + else + { + marlin_wait_for_click(); + } + if (IS_SD_PRINTING) + custom_message_type = CustomMsg::Status; + else + LCD_MESSAGERPGM(_T(WELCOME_MSG)); } #ifdef TMC2130 From 59c2b7e79543f81089c32ca8db3aff0bb86b16bd Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 17 Feb 2021 07:42:12 +0100 Subject: [PATCH 34/58] Fix Fan error issues. --- Firmware/Marlin_main.cpp | 32 ++++++++++++++++++++------------ Firmware/ultralcd.cpp | 32 ++++++++++++++++---------------- Firmware/ultralcd.h | 1 + 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4e0511c1..da0cf737 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1857,7 +1857,7 @@ void loop() } #ifdef FANCHECK - if (fan_check_error && isPrintPaused) + if (fan_check_error && isPrintPaused && !IS_SD_PRINTING) { KEEPALIVE_STATE(PAUSED_FOR_USER); host_keepalive(); //prevent timeouts since usb processing is disabled until print is resumed. This is for a crude way of pausing a print on all hosts. @@ -3763,12 +3763,14 @@ There are reasons why some G Codes aren't in numerical order. void process_commands() { #ifdef FANCHECK - if(fan_check_error == EFCE_DETECTED){ - fan_check_error = EFCE_REPORTED; - // SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); - lcd_pause_print(); - cmdqueue_serial_disabled = true; - } + if(fan_check_error == EFCE_DETECTED) + { + fan_check_error = EFCE_REPORTED; + if (is_usb_printing) + lcd_pause_usb_print(); + else + lcd_pause_print(); + } #endif if (!buflen) return; //empty command @@ -8154,11 +8156,17 @@ Sigma_Exit: /*! ### M602 - Resume print M602: Resume print */ - case 602: { - if (isPrintPaused) - lcd_resume_print(); - } - break; + case 602: + { + if (isPrintPaused) + { + if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) + lcd_resume_print(); + else + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); //inform octoprint of pause + } + } + break; /*! ### M603 - Stop print M603: Stop print diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 0cb12f54..1fbeb83b 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1526,10 +1526,9 @@ void lcd_return_to_status() eFilamentAction = FilamentAction::None; // i.e. non-autoLoad } -//! @brief Pause print, disable nozzle heater, move to park position +//! @brief Pause print, disable nozzle heater, move to park position, send host action "paused" void lcd_pause_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); //pause for octoprint stop_and_save_print_to_ram(0.0, -default_retraction); lcd_return_to_status(); isPrintPaused = true; @@ -1537,12 +1536,13 @@ void lcd_pause_print() { lcd_commands_type = LcdCommands::LongPause; } + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); } -//! @brief Pause USB/host print, disable nozzle heater, move to park position +//! @brief Send host action "pause" void lcd_pause_usb_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); //pause for octoprint + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); } @@ -6482,7 +6482,7 @@ static bool fan_error_selftest() return 0; } -//! @brief Resume paused print +//! @brief Resume paused print, send host action "resumed" //! @todo It is not good to call restore_print_from_ram_and_continue() from function called by lcd_update(), //! as restore_print_from_ram_and_continue() calls lcd_update() internally. void lcd_resume_print() @@ -6490,23 +6490,23 @@ void lcd_resume_print() lcd_return_to_status(); lcd_reset_alert_level(); //for fan speed error if (fan_error_selftest()) return; //abort if error persists - cmdqueue_serial_disabled = false; + cmdqueue_serial_disabled = false; lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); st_synchronize(); lcd_setstatuspgm(_T(MSG_RESUMING_PRINT)); ////MSG_RESUMING_PRINT c=20 - isPrintPaused = false; restore_print_from_ram_and_continue(default_retraction); pause_time += (_millis() - start_pause_print); //accumulate time when print is paused for correct statistics calculation refresh_cmd_timeout(); - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint + isPrintPaused = false; + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //trigger octoprint to resume print } -//! @brief Resume paused USB/host print +//! @brief Resume paused USB/host print, send host action "resume" void lcd_resume_usb_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUME); //resume octoprint + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUME); //resume octoprint } static void change_sheet() @@ -6673,7 +6673,7 @@ static void lcd_main_menu() if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 - if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) + if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused) { MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE } else @@ -6683,14 +6683,14 @@ static void lcd_main_menu() if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) { - if (IS_SD_PRINTING) - { - MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 - } - else if (is_usb_printing) + if (is_usb_printing) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);////MSG_PAUSE_PRINT c=18 } + else if (IS_SD_PRINTING) + { + MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 + } } if(isPrintPaused) { diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 62aed6df..f262107d 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -44,6 +44,7 @@ void lcd_change_success(); void lcd_loading_color(); void lcd_sdcard_stop(); void lcd_pause_print(); +void lcd_pause_usb_print(); void lcd_resume_print(); void lcd_print_stop(); void prusa_statistics(int _message, uint8_t _col_nr = 0); From afc15b42bba034ce22623c6bbf8b48f3086d2483 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 17 Feb 2021 08:13:32 +0100 Subject: [PATCH 35/58] Indentations --- Firmware/Marlin_main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index da0cf737..2d456c76 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8140,9 +8140,9 @@ Sigma_Exit: /*! ### M25 - Pause SD print M25: Pause SD print */ - case 25: - case 601: - { + case 25: + case 601: + { if (!isPrintPaused) { st_synchronize(); @@ -8150,11 +8150,11 @@ Sigma_Exit: cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore lcd_pause_print(); } - } - break; + } + break; /*! - ### M602 - Resume print M602: Resume print + ### M602 - Resume print M602: Resume print */ case 602: { @@ -8171,10 +8171,10 @@ Sigma_Exit: /*! ### M603 - Stop print M603: Stop print */ - case 603: { - lcd_print_stop(); - } - break; + case 603: { + lcd_print_stop(); + } + break; #ifdef PINDA_THERMISTOR /*! From dbb0269bd4f832117c6248eb514f2cfbdd1b8122 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 17 Feb 2021 08:27:49 +0100 Subject: [PATCH 36/58] Make indentation consistent with surrounding code in factory_reset() --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index db339124..537c55cb 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -737,7 +737,7 @@ static void factory_reset_stats(){ static void factory_reset(char level) { lcd_clear(); - Sound_MakeCustom(100,0,false); + Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset From c79bce010dd0e0951d177aef86b3acacab8b107d Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 17 Feb 2021 12:18:30 +0100 Subject: [PATCH 37/58] Don't show Settings during pause --- Firmware/ultralcd.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 1fbeb83b..ed113a27 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6614,18 +6614,18 @@ static void lcd_sheet_menu() //! | tst - Save | ifdef RESUME_DEBUG //! | tst - Restore | ifdef RESUME_DEBUG //! -//! | recover print | TMC2130_DEBUG -//! | power panic | TMC2130_DEBUG +//! | recover print | ifdef TMC2130_DEBUG +//! | power panic | ifdef TMC2130_DEBUG //! //! | Live adjust Z | printing + Z low //! //! | Change filament | farm mode //! -//! | Tune | printing +//! | Tune | printing + paused //! | Pause print | printing + not paused //! | Resume print | printing + paused -//! | Stop print | printing -//! | Preheat | not printing or paused +//! | Stop print | printing or paused + NOT MBL +//! | Preheat | not printing + not paused //! | Print from SD | not printing or paused //! //! | Switch sheet | farm mode @@ -6673,7 +6673,7 @@ static void lcd_main_menu() if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 - if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused) + if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused ) { MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE } else @@ -6784,8 +6784,11 @@ static void lcd_main_menu() bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } - MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); - if(!isPrintPaused) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); + if(!isPrintPaused) + { + MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); + MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); + } } if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) From c3bea4d71ca73255883e260d29356ba51f5a4c35 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 17 Feb 2021 12:53:56 +0100 Subject: [PATCH 38/58] Make a special welcome message for shipping/service prep Another request from our Service dept. - the user shall be prevented from skipping the intro wizard, because otherwise some preset/calibrated features will look like not done - especially live-z calibration. And since there are users, who send a machine to service to perform 1st layer calibration only, they must not omit the Z-calibration at the start after shipping. --- Firmware/Marlin_main.cpp | 4 ++-- Firmware/eeprom.h | 2 +- Firmware/ultralcd.cpp | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cdde3e35..07a0c76d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -756,7 +756,7 @@ static void factory_reset(char level) lang_reset(); // Force the "Follow calibration flow" message at the next boot up. calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION); - eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard + eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); //run wizard farm_mode = false; eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode); @@ -1564,7 +1564,7 @@ void setup() lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=5 Config_StoreSettings(); } - if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) { + if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) >= 1) { lcd_wizard(WizState::Run); } if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 0) { //dont show calibration status messages if wizard is currently active diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index f9f93b7d..6fa80aa4 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -408,7 +408,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP #define EEPROM_POWER_COUNT (EEPROM_FERROR_COUNT - 1) // uint8 (orig EEPROM_UVLO_MESH_BED_LEVELING-17) #define EEPROM_XYZ_CAL_SKEW (EEPROM_POWER_COUNT - 4) // float for skew backup -#define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1) +#define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1) // 0: wizard not active, 1: wizard active, 2: wizard active without yes/no = forced calibrate Z after shipping/service prep. #define EEPROM_BELTSTATUS_X (EEPROM_WIZARD_ACTIVE - 2) // uint16 #define EEPROM_BELTSTATUS_Y (EEPROM_BELTSTATUS_X - 2) // uint16 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d5c026cb..610334e5 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4962,7 +4962,7 @@ void lcd_wizard(WizState state) { using S = WizState; bool end = false; - int wizard_event; + int8_t wizard_event; const char *msg = NULL; // Make sure EEPROM_WIZARD_ACTIVE is true if entering using different entry point // other than WizState::Run - it is useful for debugging wizard. @@ -4986,7 +4986,12 @@ void lcd_wizard(WizState state) // Btw. the flag may even trigger the viper situation on normal start this way and the user won't be able to find out why. saved_printing = false; - wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7 + if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ + lcd_show_fullscreen_message_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print."));////MSG_WIZARD_WELCOME_SHIPPING c=20 r=7 + wizard_event = 1; + } else { + wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7 + } if (wizard_event) { state = S::Restore; eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); From a456c4a52df5b78fac43455888f2c7708cc372ca Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 17 Feb 2021 13:04:46 +0100 Subject: [PATCH 39/58] Make watchdogReset() force_inline It makes no sense keeping watchdogReset as a separate function which must be called, since it only contains one instruction: "wdr". Not only was the code larger by 32 bytes in total, but also much slower (call+ret take 4 cycles together for no reason in this case). Surprisingly, doing just this on FW 3.9.3 solves issue #2954 on the one affected EINSY board, even though it makes not much sense (there must be some other timing issue). --- Firmware/optiboot_w25x20cl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/optiboot_w25x20cl.cpp b/Firmware/optiboot_w25x20cl.cpp index dce4074e..2d3a76c7 100644 --- a/Firmware/optiboot_w25x20cl.cpp +++ b/Firmware/optiboot_w25x20cl.cpp @@ -43,7 +43,7 @@ static void watchdogConfig(uint8_t x) { WDTCSR = x; } -static void watchdogReset() { +static FORCE_INLINE void watchdogReset() { __asm__ __volatile__ ( "wdr\n" ); From 2b4cf8d56e964dce43164b41dab2e2fcac0685df Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 17 Feb 2021 13:52:31 +0100 Subject: [PATCH 40/58] Fix FANCHECK build error --- Firmware/Marlin_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2d456c76..d7fc8f7d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8160,9 +8160,11 @@ Sigma_Exit: { if (isPrintPaused) { +#ifdef FANCHECK if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) lcd_resume_print(); else +#endif //FANCHECK SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); //inform octoprint of pause } } From 4e768057e7cc5449677220b5bddd41acb6ee073b Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 17 Feb 2021 15:59:52 +0100 Subject: [PATCH 41/58] Use standard wdt_reset() from AVR lib which translates to the one `wdr` instruction like before + wrap configuration of watchdog into cli/sei --- Firmware/optiboot_w25x20cl.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Firmware/optiboot_w25x20cl.cpp b/Firmware/optiboot_w25x20cl.cpp index 2d3a76c7..a18c8832 100644 --- a/Firmware/optiboot_w25x20cl.cpp +++ b/Firmware/optiboot_w25x20cl.cpp @@ -7,6 +7,7 @@ #include "w25x20cl.h" #include "stk500.h" #include "bootapp.h" +#include #define OPTIBOOT_MAJVER 6 #define OPTIBOOT_CUSTOMVER 0 @@ -39,14 +40,10 @@ static unsigned const int __attribute__((section(".version"))) #endif static void watchdogConfig(uint8_t x) { + CRITICAL_SECTION_START WDTCSR = _BV(WDCE) | _BV(WDE); WDTCSR = x; -} - -static FORCE_INLINE void watchdogReset() { - __asm__ __volatile__ ( - "wdr\n" - ); + CRITICAL_SECTION_END } #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) @@ -63,7 +60,7 @@ static uint8_t getch(void) { * the application "soon", if it keeps happening. (Note that we * don't care that an invalid char is returned...) */ - watchdogReset(); + wdt_reset(); } ch = UDR0; return ch; @@ -117,7 +114,7 @@ uint8_t optiboot_w25x20cl_enter() // Handshake sequence: Initialize the serial line, flush serial line, send magic, receive magic. // If the magic is not received on time, or it is not received correctly, continue to the application. { - watchdogReset(); + wdt_reset(); unsigned long boot_timeout = 2000000; unsigned long boot_timer = 0; const char *ptr = entry_magic_send; @@ -125,7 +122,7 @@ uint8_t optiboot_w25x20cl_enter() const uint8_t selectedSerialPort_bak = selectedSerialPort; // Flush the serial line. while (RECV_READY) { - watchdogReset(); + wdt_reset(); // Dummy register read (discard) (void)(*(char *)UDR0); } @@ -135,14 +132,14 @@ uint8_t optiboot_w25x20cl_enter() // Send the initial magic string. while (ptr != end) putch(pgm_read_byte(ptr ++)); - watchdogReset(); + wdt_reset(); // Wait for two seconds until a magic string (constant entry_magic) is received // from the serial line. ptr = entry_magic_receive; end = strlen_P(entry_magic_receive) + ptr; while (ptr != end) { while (rx_buffer.head == SerialHead) { - watchdogReset(); + wdt_reset(); delayMicroseconds(1); if (++ boot_timer > boot_timeout) { @@ -159,7 +156,7 @@ uint8_t optiboot_w25x20cl_enter() selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } - watchdogReset(); + wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt // Send the cfm magic string. From 75a385d6148eacf63091325c66bc019ba73262da Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 18 Feb 2021 09:10:28 +0100 Subject: [PATCH 42/58] Indentations --- Firmware/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6b4e9da0..a8e988c3 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8162,9 +8162,9 @@ Sigma_Exit: /*! ### M25 - Pause SD print M25: Pause SD print */ - case 25: - case 601: - { + case 25: + case 601: + { if (!isPrintPaused) { st_synchronize(); @@ -8172,8 +8172,8 @@ Sigma_Exit: cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore lcd_pause_print(); } - } - break; + } + break; /*! ### M602 - Resume print M602: Resume print From 291ee8e46dbf96b0e914946f351b7f05f57c5652 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 18 Feb 2021 09:53:14 +0100 Subject: [PATCH 43/58] Indentations --- Firmware/Marlin_main.cpp | 55 +++----- Firmware/ultralcd.cpp | 273 ++++++++++++++++++--------------------- 2 files changed, 144 insertions(+), 184 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index a8e988c3..d968d685 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3841,55 +3841,41 @@ void process_commands() - `string` - Must for M1 and optional for M0 message to display on the LCD */ - else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD - { - + else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) {// M0 and M1 - (Un)conditional stop - Wait for user button press on LCD char *src = strchr_pointer + 2; - codenum = 0; - bool hasP = false, hasS = false; - if (code_seen('P')) - { + if (code_seen('P')) { codenum = code_value(); // milliseconds to wait hasP = codenum > 0; } - if (code_seen('S')) - { + if (code_seen('S')) { codenum = code_value() * 1000; // seconds to wait hasS = codenum > 0; } starpos = strchr(src, '*'); if (starpos != NULL) *(starpos) = '\0'; while (*src == ' ') ++src; - custom_message_type = CustomMsg::M0Wait; - if (!hasP && !hasS && *src != '\0') - { + custom_message_type = CustomMsg::M0Wait; + if (!hasP && !hasS && *src != '\0') { lcd_setstatus(src); - } - else - { + } else { LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT } - lcd_ignore_click(); //call lcd_ignore_click aslo for else ??? st_synchronize(); previous_millis_cmd = _millis(); - if (codenum > 0) - { + if (codenum > 0) { codenum += _millis(); // keep track of when we started waiting KEEPALIVE_STATE(PAUSED_FOR_USER); - while(_millis() < codenum && !lcd_clicked()) - { + while(_millis() < codenum && !lcd_clicked()) { manage_heater(); manage_inactivity(true); lcd_update(0); } KEEPALIVE_STATE(IN_HANDLER); lcd_ignore_click(false); - } - else - { + } else { marlin_wait_for_click(); } if (IS_SD_PRINTING) @@ -8165,8 +8151,7 @@ Sigma_Exit: case 25: case 601: { - if (!isPrintPaused) - { + if (!isPrintPaused) { st_synchronize(); ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore @@ -8176,21 +8161,21 @@ Sigma_Exit: break; /*! - ### M602 - Resume print M602: Resume print + ### M602 - Resume print M602: Resume print */ - case 602: { - if (isPrintPaused) - lcd_resume_print(); - } - break; + case 602: { + if (isPrintPaused) + lcd_resume_print(); + } + break; /*! ### M603 - Stop print M603: Stop print */ - case 603: { - lcd_print_stop(); - } - break; + case 603: { + lcd_print_stop(); + } + break; #ifdef PINDA_THERMISTOR /*! diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index bee49f44..f5071152 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -752,163 +752,138 @@ void lcdui_print_time(void) lcd_space(8 - chars); } -//Print status line on status screen +//! @Brief Print status line on status screen void lcdui_print_status_line(void) { - if (IS_SD_PRINTING) - { - if (strcmp(longFilenameOLD, (card.longFilename[0] ? card.longFilename : card.filename)) != 0) - { - memset(longFilenameOLD, '\0', strlen(longFilenameOLD)); - sprintf_P(longFilenameOLD, PSTR("%s"), (card.longFilename[0] ? card.longFilename : card.filename)); - scrollstuff = 0; - } - } + if (IS_SD_PRINTING) { + if (strcmp(longFilenameOLD, (card.longFilename[0] ? card.longFilename : card.filename)) != 0) { + memset(longFilenameOLD, '\0', strlen(longFilenameOLD)); + sprintf_P(longFilenameOLD, PSTR("%s"), (card.longFilename[0] ? card.longFilename : card.filename)); + scrollstuff = 0; + } + } - if (heating_status) - { // If heating flag, show progress of heating - heating_status_counter++; - if (heating_status_counter > 13) - { - heating_status_counter = 0; - } - lcd_set_cursor(7, 3); - lcd_space(13); + if (heating_status) { // If heating flag, show progress of heating + heating_status_counter++; + if (heating_status_counter > 13) { + heating_status_counter = 0; + } + lcd_set_cursor(7, 3); + lcd_space(13); - for (unsigned int dots = 0; dots < heating_status_counter; dots++) - { - lcd_putc_at(7 + dots, 3, '.'); - } - switch (heating_status) - { - case 1: - lcd_puts_at_P(0, 3, _T(MSG_HEATING)); - break; - case 2: - lcd_puts_at_P(0, 3, _T(MSG_HEATING_COMPLETE)); - heating_status = 0; - heating_status_counter = 0; - break; - case 3: - lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING)); - break; - case 4: - lcd_puts_at_P(0, 3, _T(MSG_BED_DONE)); - heating_status = 0; - heating_status_counter = 0; - break; - default: - break; - } - } - else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status)) - { // If printing from SD, show what we are printing - if(strlen(longFilenameOLD) > LCD_WIDTH) - { - int inters = 0; - int gh = scrollstuff; - while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0)) - { - if (longFilenameOLD[gh] == '\0') - { - lcd_set_cursor(gh - scrollstuff, 3); - lcd_print(longFilenameOLD[gh - 1]); - scrollstuff = 0; - gh = scrollstuff; - inters = 1; - } - else - { - lcd_set_cursor(gh - scrollstuff, 3); - lcd_print(longFilenameOLD[gh - 1]); - gh++; - } - } - scrollstuff++; - } - else - { - lcd_printf_P(PSTR("%-20s"), longFilenameOLD); - } - } - else - { // Otherwise check for other special events - switch (custom_message_type) - { - case CustomMsg::MsgUpdate: //Short message even while printing from SD - case CustomMsg::Status: // Nothing special, print status message normally - case CustomMsg::M0Wait: // M0/M1 Wait command working even from SD - lcd_print(lcd_status_message); - break; - case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status - if (custom_message_state > 10) - { - lcd_set_cursor(0, 3); - lcd_space(20); - lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); - lcd_puts_P(PSTR(" : ")); - lcd_print(custom_message_state-10); - } - else - { - if (custom_message_state == 3) - { - lcd_puts_P(_T(WELCOME_MSG)); - lcd_setstatuspgm(_T(WELCOME_MSG)); - custom_message_type = CustomMsg::Status; - } - if (custom_message_state > 3 && custom_message_state <= 10 ) - { - lcd_set_cursor(0, 3); - lcd_space(19); - lcd_puts_at_P(0, 3, _i("Calibration done"));////MSG_HOMEYZ_DONE - custom_message_state--; - } - } - break; - case CustomMsg::FilamentLoading: // If loading filament, print status - lcd_print(lcd_status_message); - break; - case CustomMsg::PidCal: // PID tuning in progress - lcd_print(lcd_status_message); - if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) - { - lcd_set_cursor(10, 3); - lcd_print(itostr3(pid_cycle)); - lcd_print('/'); - lcd_print(itostr3left(pid_number_of_cycles)); - } - break; - case CustomMsg::TempCal: // PINDA temp calibration in progress - { - char statusLine[LCD_WIDTH + 1]; - sprintf_P(statusLine, PSTR("%-20S"), _T(MSG_TEMP_CALIBRATION)); - char progress[4]; - sprintf_P(progress, PSTR("%d/6"), custom_message_state); - memcpy(statusLine + 12, progress, sizeof(progress) - 1); - lcd_set_cursor(0, 3); - lcd_print(statusLine); - } - break; - case CustomMsg::TempCompPreheat: // temp compensation preheat - lcd_puts_at_P(0, 3, _i("PINDA Heating"));////MSG_PINDA_PREHEAT c=20 r=1 - if (custom_message_state <= PINDA_HEAT_T) - { - lcd_puts_P(PSTR(": ")); - lcd_print(custom_message_state); //seconds - lcd_print(' '); - } - break; + for (unsigned int dots = 0; dots < heating_status_counter; dots++) { + lcd_putc_at(7 + dots, 3, '.'); + } + switch (heating_status) { + case 1: + lcd_puts_at_P(0, 3, _T(MSG_HEATING)); + break; + case 2: + lcd_puts_at_P(0, 3, _T(MSG_HEATING_COMPLETE)); + heating_status = 0; + heating_status_counter = 0; + break; + case 3: + lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING)); + break; + case 4: + lcd_puts_at_P(0, 3, _T(MSG_BED_DONE)); + heating_status = 0; + heating_status_counter = 0; + break; + default: + break; + } + } + else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status)) { // If printing from SD, show what we are printing + if(strlen(longFilenameOLD) > LCD_WIDTH) { + int inters = 0; + int gh = scrollstuff; + while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0)) { + if (longFilenameOLD[gh] == '\0') { + lcd_set_cursor(gh - scrollstuff, 3); + lcd_print(longFilenameOLD[gh - 1]); + scrollstuff = 0; + gh = scrollstuff; + inters = 1; + } else { + lcd_set_cursor(gh - scrollstuff, 3); + lcd_print(longFilenameOLD[gh - 1]); + gh++; + } + } + scrollstuff++; + } else { + lcd_printf_P(PSTR("%-20s"), longFilenameOLD); + } + } else { // Otherwise check for other special events + switch (custom_message_type) { + case CustomMsg::MsgUpdate: //Short message even while printing from SD + case CustomMsg::Status: // Nothing special, print status message normally + case CustomMsg::M0Wait: // M0/M1 Wait command working even from SD + lcd_print(lcd_status_message); + break; + case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status + if (custom_message_state > 10) { + lcd_set_cursor(0, 3); + lcd_space(20); + lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); + lcd_puts_P(PSTR(" : ")); + lcd_print(custom_message_state-10); + } else { + if (custom_message_state == 3) + { + lcd_puts_P(_T(WELCOME_MSG)); + lcd_setstatuspgm(_T(WELCOME_MSG)); + custom_message_type = CustomMsg::Status; + } + if (custom_message_state > 3 && custom_message_state <= 10 ) { + lcd_set_cursor(0, 3); + lcd_space(19); + lcd_puts_at_P(0, 3, _i("Calibration done"));////MSG_HOMEYZ_DONE + custom_message_state--; + } + } + break; + case CustomMsg::FilamentLoading: // If loading filament, print status + lcd_print(lcd_status_message); + break; + case CustomMsg::PidCal: // PID tuning in progress + lcd_print(lcd_status_message); + if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { + lcd_set_cursor(10, 3); + lcd_print(itostr3(pid_cycle)); + lcd_print('/'); + lcd_print(itostr3left(pid_number_of_cycles)); + } + break; + case CustomMsg::TempCal: // PINDA temp calibration in progress + char statusLine[LCD_WIDTH + 1]; + sprintf_P(statusLine, PSTR("%-20S"), _T(MSG_TEMP_CALIBRATION)); + char progress[4]; + sprintf_P(progress, PSTR("%d/6"), custom_message_state); + memcpy(statusLine + 12, progress, sizeof(progress) - 1); + lcd_set_cursor(0, 3); + lcd_print(statusLine); + break; + case CustomMsg::TempCompPreheat: // temp compensation preheat + lcd_puts_at_P(0, 3, _i("PINDA Heating"));////MSG_PINDA_PREHEAT c=20 r=1 + if (custom_message_state <= PINDA_HEAT_T) { + lcd_puts_P(PSTR(": ")); + lcd_print(custom_message_state); //seconds + lcd_print(' '); + } + break; case CustomMsg::Resuming: //Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; - } - } - + } + } + // Fill the rest of line to have nice and clean output - for(int fillspace = 0; fillspace < 20; fillspace++) - if ((lcd_status_message[fillspace] <= 31 )) - lcd_print(' '); + for(int fillspace = 0; fillspace < 20; fillspace++) + if ((lcd_status_message[fillspace] <= 31 )) + lcd_print(' '); } //! @brief Show Status Screen From c1d8e6660b9224d39ab0aaa00ad58d5be65e0970 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 18 Feb 2021 10:07:40 +0100 Subject: [PATCH 44/58] Indentations --- Firmware/Marlin_main.cpp | 6 ++-- Firmware/ultralcd.cpp | 71 +++++++++++++--------------------------- 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d7fc8f7d..fd52a202 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1857,8 +1857,7 @@ void loop() } #ifdef FANCHECK - if (fan_check_error && isPrintPaused && !IS_SD_PRINTING) - { + if (fan_check_error && isPrintPaused && !IS_SD_PRINTING) { KEEPALIVE_STATE(PAUSED_FOR_USER); host_keepalive(); //prevent timeouts since usb processing is disabled until print is resumed. This is for a crude way of pausing a print on all hosts. } @@ -3763,8 +3762,7 @@ There are reasons why some G Codes aren't in numerical order. void process_commands() { #ifdef FANCHECK - if(fan_check_error == EFCE_DETECTED) - { + if(fan_check_error == EFCE_DETECTED) { fan_check_error = EFCE_REPORTED; if (is_usb_printing) lcd_pause_usb_print(); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ed113a27..bba881c7 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1532,8 +1532,7 @@ void lcd_pause_print() stop_and_save_print_to_ram(0.0, -default_retraction); lcd_return_to_status(); isPrintPaused = true; - if (LcdCommands::Idle == lcd_commands_type) - { + if (LcdCommands::Idle == lcd_commands_type) { lcd_commands_type = LcdCommands::LongPause; } SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); @@ -1542,7 +1541,7 @@ void lcd_pause_print() //! @brief Send host action "pause" void lcd_pause_usb_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); } @@ -6665,30 +6664,23 @@ static void lcd_main_menu() MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG - if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag) - { + if ( ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag) { MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 } if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 - if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused ) - { + if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused ) { MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE - } else - { + } else { MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT } - if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) - { - if (is_usb_printing) - { + if (mesh_bed_leveling_flag == false && homing_flag == false && !isPrintPaused) { + if (is_usb_printing) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print);////MSG_PAUSE_PRINT c=18 - } - else if (IS_SD_PRINTING) - { + } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print);////MSG_PAUSE_PRINT c=18 } } @@ -6698,27 +6690,20 @@ static void lcd_main_menu() if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) #endif //FANCHECK { - if (is_usb_printing) - { + if (is_usb_printing) { MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print);////MSG_RESUME_PRINT c=18 - } - else - { + } else { MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);////MSG_RESUME_PRINT c=18 } } } - if((IS_SD_PRINTING || is_usb_printing || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) - { + if((IS_SD_PRINTING || is_usb_printing || isPrintPaused) && (custom_message_type != CustomMsg::MeshBedLeveling)) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code - if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) - { - if (!card.isFileOpen()) - { - if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { + if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) { + if (!card.isFileOpen()) { + if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { //if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu); /*else*/{ bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function @@ -6729,8 +6714,7 @@ static void lcd_main_menu() MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD #endif //SDCARDDETECT } - } else - { + } else { bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function MENU_ITEM_SUBMENU_P(_i("No SD card"), lcd_sdcard_menu);////MSG_NO_CARD #if SDCARDDETECT < 1 @@ -6739,23 +6723,18 @@ static void lcd_main_menu() } #endif //SDSUPPORT - if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { - if (!farm_mode) - { + if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { + if (!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); - if ((nextSheet >= 0) && (sheet != nextSheet)) // show menu only if we have 2 or more sheets initialized - { + if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); } } } - if ( ! ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) - { - if (mmu_enabled) - { + if ( ! ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal) ) ) { + if (mmu_enabled) { MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), fil_load_menu); MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu); //-// MENU_ITEM_FUNCTION_P(_T(MSG_UNLOAD_FILAMENT), extr_unload); @@ -6765,9 +6744,7 @@ static void lcd_main_menu() #ifdef MMU_HAS_CUTTER MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), mmu_cut_filament_menu); #endif //MMU_HAS_CUTTER - } - else - { + } else { #ifdef SNMM MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), fil_unload_menu); MENU_ITEM_SUBMENU_P(_i("Change extruder"), change_extr_menu);////MSG_CHANGE_EXTR c=20 r=1 @@ -6784,15 +6761,13 @@ static void lcd_main_menu() bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } - if(!isPrintPaused) - { + if(!isPrintPaused) { MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); } } - if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - { + if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS } From 495dcee066966d9ce501917ebbd3c8d962cd14fc Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 18 Feb 2021 12:09:43 +0100 Subject: [PATCH 45/58] Show LCD Settings during pause --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5a96bfc9..32433a69 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6786,8 +6786,8 @@ static void lcd_main_menu() bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } + MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); if(!isPrintPaused) { - MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); } } From 87f416f3034969a9099b4185c68258ad4806a917 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Thu, 18 Feb 2021 15:39:29 +0100 Subject: [PATCH 46/58] Keep wizard flag==2 even when a user restarts during Z-calibration i.e. prevent jumping into the standard wizard if reset during Z- calibration --- Firmware/ultralcd.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 610334e5..09414c1b 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4988,17 +4988,16 @@ void lcd_wizard(WizState state) if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ lcd_show_fullscreen_message_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print."));////MSG_WIZARD_WELCOME_SHIPPING c=20 r=7 - wizard_event = 1; + state = S::Restore; } else { wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7 - } - if (wizard_event) { - state = S::Restore; - eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); - } - else { - eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); - end = true; + if (wizard_event) { + state = S::Restore; + eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); + } else { + eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); + end = true; + } } break; case S::Restore: From 9110ffd4aed47915a6198d71725ac26dc9fa1f99 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 22 Feb 2021 16:36:21 +0100 Subject: [PATCH 47/58] Revert `M602` --- Firmware/Marlin_main.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ee3dffde..3beb6341 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8136,14 +8136,7 @@ Sigma_Exit: */ case 602: { - if (isPrintPaused) { -#ifdef FANCHECK - if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) - lcd_resume_print(); - else -#endif //FANCHECK - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); //inform octoprint of pause - } + if (isPrintPaused) lcd_resume_print(); } break; From 5894883324a0c51d21da32033b8d2ead41cc9582 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 22 Feb 2021 16:37:01 +0100 Subject: [PATCH 48/58] Fix USB/host FAN Error resume Show Settings during Pause also for USB/host prints --- Firmware/ultralcd.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 32433a69..43f32294 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6514,8 +6514,11 @@ void lcd_resume_print() { lcd_return_to_status(); lcd_reset_alert_level(); //for fan speed error - if (fan_error_selftest()) return; //abort if error persists - cmdqueue_serial_disabled = false; + if (fan_error_selftest()) { + if (is_usb_printing) SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); + return; //abort if error persists + } + cmdqueue_serial_disabled = false; lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); st_synchronize(); custom_message_type = CustomMsg::Resuming; @@ -6786,12 +6789,11 @@ static void lcd_main_menu() bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } - MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); - if(!isPrintPaused) { - MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); - } } - + MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); + if(!isPrintPaused && (!(IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)))) { + MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); + } if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS } From fd154e4b69a06e8752da5494a03030e9131170f4 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 22 Feb 2021 18:10:43 +0100 Subject: [PATCH 49/58] Again revert Settings --- Firmware/ultralcd.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 43f32294..f9c6199c 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6789,11 +6789,10 @@ static void lcd_main_menu() bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } - } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); - if(!isPrintPaused && (!(IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)))) { - MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); + if(!isPrintPaused) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu); } + if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) { MENU_ITEM_SUBMENU_P(_i("Statistics "), lcd_menu_statistics);////MSG_STATISTICS } From 30b60e44d2e431671e60b5ad156ae3ad1b052380 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 22 Feb 2021 18:21:20 +0100 Subject: [PATCH 50/58] `|| isPrintPaused` is already in `PRINTER_ACTIVE` --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index f9c6199c..9960b0f7 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6699,7 +6699,7 @@ static void lcd_main_menu() if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 - if ( moves_planned() || PRINTER_ACTIVE || isPrintPaused ) { + if ( moves_planned() || PRINTER_ACTIVE ) { MENU_ITEM_SUBMENU_P(_i("Tune"), lcd_tune_menu);////MSG_TUNE } else { MENU_ITEM_SUBMENU_P(_i("Preheat"), lcd_preheat_menu);////MSG_PREHEAT From 8d4176a5309eb27e39e272820598d968fc4abe9f Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 23 Feb 2021 07:24:33 +0100 Subject: [PATCH 51/58] Add "Fan check [On|Off]" menu to tune User can en/disable the fan check during print. This is very useful in case of false positive fan errors to let the user to decide to finish print with "faulty" fan. --- Firmware/ultralcd.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 9960b0f7..5e5bb038 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6973,10 +6973,8 @@ static void lcd_tune_menu() SETTINGS_CUTTER; - if(farm_mode) - { - MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check); - } + MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check); + #ifdef TMC2130 if(!farm_mode) From fdff5d84b2b77ea896262089a00a197d7a029bec Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 8 Feb 2021 14:01:35 +0100 Subject: [PATCH 52/58] Move Filament sensors to Support -> Sensor Info --- Firmware/ultralcd.cpp | 97 +++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 41 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5b7b8f59..97b80fbb 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1613,8 +1613,8 @@ static void pgmtext_with_colon(const char *ipgmLabel, char *dst, uint8_t dstSize //! |01234567890123456789| //! |Nozzle FAN: 0000 RPM| FAN c=10 r=1 SPEED c=3 r=1 //! |Print FAN: 0000 RPM| FAN c=10 r=1 SPEED c=3 r=1 -//! |Fil. Xd:000 Yd:000 | Fil. c=4 r=1 -//! |Int: 000 Shut: 000 | Int: c=4 r=1 Shut: c=4 r=1 +//! | | +//! | | //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. @@ -1628,37 +1628,7 @@ void lcd_menu_extruder_info() // NOT static due to using ins char nozzle[maxChars], print[maxChars]; pgmtext_with_colon(_i("Nozzle FAN"), nozzle, maxChars); ////c=10 r=1 pgmtext_with_colon(_i("Print FAN"), print, maxChars); ////c=10 r=1 - lcd_printf_P(_N("%s %4d RPM\n" "%s %4d RPM\n"), nozzle, 60*fan_speed[0], print, 60*fan_speed[1] ); - -#ifdef PAT9125 - // Display X and Y difference from Filament sensor - // Display Light intensity from Filament sensor - // Frame_Avg register represents the average brightness of all pixels within a frame (324 pixels). This - // value ranges from 0(darkest) to 255(brightest). - // Display LASER shutter time from Filament sensor - // Shutter register is an index of LASER shutter time. It is automatically controlled by the chip's internal - // auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small. - // When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to 46. - if (mmu_enabled == false) - { - if (!fsensor_enabled) - lcd_puts_P(_N("Filament sensor\n" "is disabled.")); - else - { - if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) - pat9125_update(); - lcd_printf_P(_N( - "Fil. Xd:%3d Yd:%3d\n" ////c=4 r=1 - "Int: %3d " ////c=4 r=1 - "Shut: %3d" ////c=4 r=1 - ), - pat9125_x, pat9125_y, - pat9125_b, pat9125_s - ); - } - } -#endif //PAT9125 - + lcd_printf_P(_N("%s %4d RPM\n" "%s %4d RPM\n"), nozzle, 60*fan_speed[0], print, 60*fan_speed[1] ); menu_back_if_clicked(); } @@ -3940,6 +3910,16 @@ static void lcd_print_state(uint8_t state) } } +//! @brief Show sensor state +//! +//! @code{.unparsed} +//! |01234567890123456789| +//! |PINDA N/A FINDA N/A| MSG_PINDA c=6 MSG_FINDA c=6 +//! |Fil. sensor N/A| MSG_FSENSOR +//! |Xd 000 Yd 000| MSG_XD +//! |Int 000 Shut 000| +//! ---------------------- +//! @endcode static void lcd_show_sensors_state() { //0: N/A; 1: OFF; 2: ON @@ -3955,18 +3935,53 @@ static void lcd_show_sensors_state() if (ir_sensor_detected) { idler_state = !READ(IR_SENSOR_PIN); } - lcd_puts_at_P(0, 0, _i("Sensor state")); - lcd_puts_at_P(1, 1, _i("PINDA:")); - lcd_set_cursor(LCD_WIDTH - 4, 1); + //lcd_puts_at_P(0, 0, _i("Sensor state")); + lcd_puts_at_P(0, 0, _i("PINDA")); + lcd_set_cursor(LCD_WIDTH - 14, 0); lcd_print_state(pinda_state); - lcd_puts_at_P(1, 2, _i("FINDA:")); - lcd_set_cursor(LCD_WIDTH - 4, 2); - lcd_print_state(finda_state); + if (mmu_enabled == true) + { + lcd_puts_at_P(10, 0, _i("FINDA")); + lcd_set_cursor(LCD_WIDTH - 3, 0); + lcd_print_state(finda_state); + } - lcd_puts_at_P(1, 3, _i("IR:")); - lcd_set_cursor(LCD_WIDTH - 4, 3); + lcd_puts_at_P(0, 1, _i("Fil. sensor")); + lcd_set_cursor(LCD_WIDTH - 3, 1); lcd_print_state(idler_state); + + +#ifdef PAT9125 + // Display X and Y difference from Filament sensor + // Display Light intensity from Filament sensor + // Frame_Avg register represents the average brightness of all pixels within a frame (324 pixels). This + // value ranges from 0(darkest) to 255(brightest). + // Display LASER shutter time from Filament sensor + // Shutter register is an index of LASER shutter time. It is automatically controlled by the chip's internal + // auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small. + // When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to 46. + if (mmu_enabled == false) + { + //if (!fsensor_enabled) + // lcd_puts_P(_N("Filament sensor\n" "is disabled.")); + //else + //{ + if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal)) + pat9125_update(); + lcd_set_cursor(0, 2); + lcd_printf_P(_N( + "Xd: %3d " + "Yd: %3d\n" ////c=4 r=1 + "Int: %3d " ////c=4 r=1 + "Shut: %3d" ////c=4 r=1 + ), + pat9125_x, pat9125_y, + pat9125_b, pat9125_s + ); + //} + } +#endif //PAT9125 } void lcd_menu_show_sensors_state() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") From 95567b807237d304cb4fcb078a68435164296230 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 23 Feb 2021 11:10:18 +0100 Subject: [PATCH 53/58] Update translations of the Shipping/Service prep welcome msg --- lang/lang_en.txt | 9 +++++++++ lang/lang_en_cz.txt | 12 ++++++++++++ lang/lang_en_de.txt | 12 ++++++++++++ lang/lang_en_es.txt | 12 ++++++++++++ lang/lang_en_fr.txt | 12 ++++++++++++ lang/lang_en_it.txt | 12 ++++++++++++ lang/lang_en_pl.txt | 12 ++++++++++++ 7 files changed, 81 insertions(+) diff --git a/lang/lang_en.txt b/lang/lang_en.txt index 79848fe8..295f8c8d 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -142,6 +142,9 @@ #MSG_SD_REMOVED "Card removed" +# +"Checking file" + #MSG_NOT_COLOR "Color not correct" @@ -382,6 +385,9 @@ #MSG_LAST_PRINT_FAILURES c=20 "Last print failures" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." @@ -871,6 +877,9 @@ # "Unload" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" + #MSG_TOTAL_FAILURES c=20 "Total failures" diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index ea2dbc83..7bc1e6bb 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -190,6 +190,10 @@ "Card removed" "Karta vyjmuta" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Barva neni cista" @@ -510,6 +514,10 @@ "Last print failures" "Selhani posl. tisku" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Ahoj, jsem vase tiskarna Original Prusa i3. Provedu vas kratkym procesem nastaveni, ve kterem zkalibrujeme osu Z. Pak budete moct zacit tisknout." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Mate-li vice tiskovych platu, kalibrujte je v menu Nastaveni - HW nastaveni - Tiskove platy" @@ -1162,6 +1170,10 @@ "Unload" "Vysunout" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Celkem selhani" diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index ffc35678..402ed981 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -190,6 +190,10 @@ "Card removed" "SD Karte entfernt" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Falsche Farbe" @@ -510,6 +514,10 @@ "Last print failures" "Letzte Druckfehler" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Hallo, ich bin Ihr Original Prusa i3 Drucker. Ich werde Sie durch einen kurzen Einrichtungsprozess fuehren, bei dem die Z-Achse kalibriert wird. Danach sind Sie bereit fuer den Druck." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Wenn Sie zusaetzliche Stahlbleche haben, kalibrieren Sie deren Voreinstellungen unter Einstellungen - HW Setup - Stahlbleche." @@ -1162,6 +1170,10 @@ "Unload" "Entladen" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Gesamte Fehler" diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index b5bca765..800bf52d 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -190,6 +190,10 @@ "Card removed" "Tarjeta retirada" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Color no homogeneo" @@ -510,6 +514,10 @@ "Last print failures" "Ultimos imp. fallos" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Hola, soy tu impresora Original Prusa i3. Te guiare a traves de un breve proceso de configuracion, en el que se calibrara el eje Z. Despues, estaras listo para imprimir." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Si tienes planchas de acero adicionales, calibra sus ajustes en Ajustes - Ajustes HW - Planchas acero." @@ -1162,6 +1170,10 @@ "Unload" "Descargar" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Fallos totales" diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index 7bd47294..39808326 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -190,6 +190,10 @@ "Card removed" "Carte retiree" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Couleur incorrecte" @@ -510,6 +514,10 @@ "Last print failures" "Echecs derniere imp." +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Bonjour, je suis votre imprimante Original Prusa i3. Je vais vous accompagner au cours d'un bref processus de reglage, qui permettra de calibrer le Z-axis. Apres cela, tout sera pret pour imprimer." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Si vous avez d'autres feuilles d'acier, calibrez leurs pre-reglages dans Reglages - Config HW - Plaque en acier." @@ -1162,6 +1170,10 @@ "Unload" "Decharger" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Total des echecs" diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index d4cac762..6fae68a1 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -190,6 +190,10 @@ "Card removed" "SD rimossa" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Colore non puro" @@ -510,6 +514,10 @@ "Last print failures" "Errori ultima stampa" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Ciao, sono la tua stampante Original Prusa i3. Ti guidero attraverso un rapido processo in cui verra calibrato l'asse Z. Poi, sarai pronto a stampare." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Se hai piastre d'acciaio aggiuntive, calibra i preset in Impostazioni - Setup HW - Piastre in Acciaio." @@ -1162,6 +1170,10 @@ "Unload" "Scarica" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Totale fallimenti" diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index bbdf0aca..65f25dcd 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -190,6 +190,10 @@ "Card removed" "Karta wyjeta" +# +"Checking file" +"\x00" + #MSG_NOT_COLOR "Color not correct" "Kolor zanieczysz." @@ -510,6 +514,10 @@ "Last print failures" "Ostatnie bledy druku" +# +"Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." +"Czesc, jestem Twoja drukarka Original Prusa i3. Przeprowadze Cie przez krotka kalibracje osi Z, po ktorej mozesz rozpoczac drukowanie." + # "If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets." "Jesli masz dodatkowe plyty stalowe, to skalibruj ich ustawienia w menu Ustawienia - Ustawienia HW - Plyty stalowe." @@ -1162,6 +1170,10 @@ "Unload" "Rozladuj" +# +"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" +"\x00" + #MSG_TOTAL_FAILURES c=20 "Total failures" "Suma bledow" From 734e497cd001ba364221fb97b939125d9c4eb300 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 23 Feb 2021 15:09:19 +0100 Subject: [PATCH 54/58] Move wizard msgs into messages.h/c + add more translation markers --- Firmware/messages.c | 2 ++ Firmware/messages.h | 2 ++ Firmware/ultralcd.cpp | 4 ++-- lang/lang_en.txt | 2 +- lang/lang_en_cz.txt | 2 +- lang/lang_en_de.txt | 2 +- lang/lang_en_es.txt | 2 +- lang/lang_en_fr.txt | 2 +- lang/lang_en_it.txt | 2 +- lang/lang_en_pl.txt | 2 +- 10 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index aa05ad99..8aaa90ec 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -116,6 +116,8 @@ const char MSG_WIZARD_CALIBRATION_FAILED[] PROGMEM_I1 = ISTR("Please check our h const char MSG_WIZARD_DONE[] PROGMEM_I1 = ISTR("All is done. Happy printing!"); ////c=20 r=8 const char MSG_WIZARD_HEATING[] PROGMEM_I1 = ISTR("Preheating nozzle. Please wait."); ////c=20 r=3 const char MSG_WIZARD_QUIT[] PROGMEM_I1 = ISTR("You can always resume the Wizard from Calibration -> Wizard."); ////c=20 r=8 +const char MSG_WIZARD_WELCOME[] PROGMEM_I1 = ISTR("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"); //// c=20 r=7 +const char MSG_WIZARD_WELCOME_SHIPPING[] PROGMEM_I1 = ISTR("Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print."); ////c=20 r=16 const char MSG_YES[] PROGMEM_I1 = ISTR("Yes"); //// const char MSG_V2_CALIBRATION[] PROGMEM_I1 = ISTR("First layer cal."); ////c=18 const char WELCOME_MSG[] PROGMEM_I1 = ISTR(CUSTOM_MENDEL_NAME " OK."); ////c=20 diff --git a/Firmware/messages.h b/Firmware/messages.h index a5b672fa..9fe6da4d 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -116,6 +116,8 @@ extern const char MSG_WIZARD_CALIBRATION_FAILED[]; extern const char MSG_WIZARD_DONE[]; extern const char MSG_WIZARD_HEATING[]; extern const char MSG_WIZARD_QUIT[]; +extern const char MSG_WIZARD_WELCOME[]; +extern const char MSG_WIZARD_WELCOME_SHIPPING[]; extern const char MSG_YES[]; extern const char MSG_V2_CALIBRATION[]; extern const char WELCOME_MSG[]; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 09414c1b..15564029 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4987,10 +4987,10 @@ void lcd_wizard(WizState state) saved_printing = false; if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ - lcd_show_fullscreen_message_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print."));////MSG_WIZARD_WELCOME_SHIPPING c=20 r=7 + lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_WELCOME_SHIPPING); state = S::Restore; } else { - wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7 + wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_WELCOME, false, true); if (wizard_event) { state = S::Restore; eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); diff --git a/lang/lang_en.txt b/lang/lang_en.txt index 295f8c8d..e7e2a281 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -385,7 +385,7 @@ #MSG_LAST_PRINT_FAILURES c=20 "Last print failures" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." # diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index 7bc1e6bb..7fbdaf4b 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -514,7 +514,7 @@ "Last print failures" "Selhani posl. tisku" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Ahoj, jsem vase tiskarna Original Prusa i3. Provedu vas kratkym procesem nastaveni, ve kterem zkalibrujeme osu Z. Pak budete moct zacit tisknout." diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index 402ed981..3a92a272 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -514,7 +514,7 @@ "Last print failures" "Letzte Druckfehler" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Hallo, ich bin Ihr Original Prusa i3 Drucker. Ich werde Sie durch einen kurzen Einrichtungsprozess fuehren, bei dem die Z-Achse kalibriert wird. Danach sind Sie bereit fuer den Druck." diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index 800bf52d..967c6d10 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -514,7 +514,7 @@ "Last print failures" "Ultimos imp. fallos" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Hola, soy tu impresora Original Prusa i3. Te guiare a traves de un breve proceso de configuracion, en el que se calibrara el eje Z. Despues, estaras listo para imprimir." diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index 39808326..9c96b3b1 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -514,7 +514,7 @@ "Last print failures" "Echecs derniere imp." -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Bonjour, je suis votre imprimante Original Prusa i3. Je vais vous accompagner au cours d'un bref processus de reglage, qui permettra de calibrer le Z-axis. Apres cela, tout sera pret pour imprimer." diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index 6fae68a1..90471488 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -514,7 +514,7 @@ "Last print failures" "Errori ultima stampa" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Ciao, sono la tua stampante Original Prusa i3. Ti guidero attraverso un rapido processo in cui verra calibrato l'asse Z. Poi, sarai pronto a stampare." diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index 65f25dcd..3b2d9e88 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -514,7 +514,7 @@ "Last print failures" "Ostatnie bledy druku" -# +#MSG_WIZARD_WELCOME_SHIPPING c=20 r=16 "Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print." "Czesc, jestem Twoja drukarka Original Prusa i3. Przeprowadze Cie przez krotka kalibracje osi Z, po ktorej mozesz rozpoczac drukowanie." From 08a6a4b25e02a450ae0cb3432f8395d2031ddc1f Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 23 Feb 2021 15:19:03 +0100 Subject: [PATCH 55/58] Enable Filament sensor action during print even if in Support::Sensor info --- Firmware/Marlin_main.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2db85d01..e4350199 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9690,7 +9690,7 @@ void manage_inactivity_IR_ANALOG_Check(uint16_t &nFSCheckCount, ClFsensorPCB isV void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { #ifdef FILAMENT_SENSOR -bool bInhibitFlag; +bool bInhibitFlag = false; #ifdef IR_SENSOR_ANALOG static uint16_t nFSCheckCount=0; #endif // IR_SENSOR_ANALOG @@ -9698,16 +9698,11 @@ static uint16_t nFSCheckCount=0; if (mmu_enabled == false) { //-// if (mcode_in_progress != 600) //M600 not in progress -#ifdef PAT9125 - bInhibitFlag=(menu_menu==lcd_menu_extruder_info); // Support::ExtruderInfo menu active -#endif // PAT9125 -#ifdef IR_SENSOR - bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); // Support::SensorInfo menu active + if (!PRINTER_ACTIVE) bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); //Block Filament sensor actions if PRINTER is not active and Support::SensorInfo menu active #ifdef IR_SENSOR_ANALOG - bInhibitFlag=bInhibitFlag||bMenuFSDetect; // Settings::HWsetup::FSdetect menu active + bInhibitFlag=bInhibitFlag||bMenuFSDetect; // Block Filament sensor actions if Settings::HWsetup::FSdetect menu active #endif // IR_SENSOR_ANALOG -#endif // IR_SENSOR - if ((mcode_in_progress != 600) && (eFilamentAction != FilamentAction::AutoLoad) && (!bInhibitFlag) && (menu_menu != lcd_move_e)) //M600 not in progress, preHeat @ autoLoad menu not active, Support::ExtruderInfo/SensorInfo menu not active + if ((mcode_in_progress != 600) && (eFilamentAction != FilamentAction::AutoLoad) && (!bInhibitFlag) && (menu_menu != lcd_move_e)) //M600 not in progress, preHeat @ autoLoad menu not active { if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal) && ! eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { From 076613fd979b554cd2315424a7a06047ea1da0e0 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 23 Feb 2021 15:20:08 +0100 Subject: [PATCH 56/58] Show `Fil. sensor` in Support::Sensor info only if IR Sensor detected --- Firmware/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 97b80fbb..4e70910f 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3932,9 +3932,6 @@ static void lcd_show_sensors_state() { finda_state = mmu_finda; } - if (ir_sensor_detected) { - idler_state = !READ(IR_SENSOR_PIN); - } //lcd_puts_at_P(0, 0, _i("Sensor state")); lcd_puts_at_P(0, 0, _i("PINDA")); lcd_set_cursor(LCD_WIDTH - 14, 0); @@ -3947,9 +3944,12 @@ static void lcd_show_sensors_state() lcd_print_state(finda_state); } - lcd_puts_at_P(0, 1, _i("Fil. sensor")); - lcd_set_cursor(LCD_WIDTH - 3, 1); - lcd_print_state(idler_state); + if (ir_sensor_detected) { + idler_state = !READ(IR_SENSOR_PIN); + lcd_puts_at_P(0, 1, _i("Fil. sensor")); + lcd_set_cursor(LCD_WIDTH - 3, 1); + lcd_print_state(idler_state); + } #ifdef PAT9125 From fbca8cbe280e90f82daef9bd9bd87c7f0a6b7139 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 23 Feb 2021 15:31:36 +0100 Subject: [PATCH 57/58] Remove unrelated (but still missing) translations This needs to be fixed in 3.10 final. Rumors say some of the translation scripts even fail on a message containing both % and a backslash --- lang/lang_en_cz.txt | 4 ---- lang/lang_en_de.txt | 4 ---- lang/lang_en_es.txt | 4 ---- lang/lang_en_fr.txt | 4 ---- lang/lang_en_it.txt | 4 ---- lang/lang_en_pl.txt | 4 ---- 6 files changed, 24 deletions(-) diff --git a/lang/lang_en_cz.txt b/lang/lang_en_cz.txt index 7fbdaf4b..c17e7a25 100644 --- a/lang/lang_en_cz.txt +++ b/lang/lang_en_cz.txt @@ -1170,10 +1170,6 @@ "Unload" "Vysunout" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Celkem selhani" diff --git a/lang/lang_en_de.txt b/lang/lang_en_de.txt index 3a92a272..546d8c50 100644 --- a/lang/lang_en_de.txt +++ b/lang/lang_en_de.txt @@ -1170,10 +1170,6 @@ "Unload" "Entladen" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Gesamte Fehler" diff --git a/lang/lang_en_es.txt b/lang/lang_en_es.txt index 967c6d10..0876416e 100644 --- a/lang/lang_en_es.txt +++ b/lang/lang_en_es.txt @@ -1170,10 +1170,6 @@ "Unload" "Descargar" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Fallos totales" diff --git a/lang/lang_en_fr.txt b/lang/lang_en_fr.txt index 9c96b3b1..a5bb4852 100644 --- a/lang/lang_en_fr.txt +++ b/lang/lang_en_fr.txt @@ -1170,10 +1170,6 @@ "Unload" "Decharger" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Total des echecs" diff --git a/lang/lang_en_it.txt b/lang/lang_en_it.txt index 90471488..e57d56e9 100644 --- a/lang/lang_en_it.txt +++ b/lang/lang_en_it.txt @@ -1170,10 +1170,6 @@ "Unload" "Scarica" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Totale fallimenti" diff --git a/lang/lang_en_pl.txt b/lang/lang_en_pl.txt index 3b2d9e88..35f6215f 100644 --- a/lang/lang_en_pl.txt +++ b/lang/lang_en_pl.txt @@ -1170,10 +1170,6 @@ "Unload" "Rozladuj" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" -"\x00" - #MSG_TOTAL_FAILURES c=20 "Total failures" "Suma bledow" From 03bd9276e2cee8ef498fcec840753ba6badbd924 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 23 Feb 2021 15:33:15 +0100 Subject: [PATCH 58/58] Remove unrelated translations from master lang_en.txt as well --- lang/lang_en.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/lang/lang_en.txt b/lang/lang_en.txt index e7e2a281..4225db76 100644 --- a/lang/lang_en.txt +++ b/lang/lang_en.txt @@ -877,9 +877,6 @@ # "Unload" -# -"Sheet %.7s\x0aZ offset: %+1.3f mm\x0a%cContinue\x0a%cStart from zero" - #MSG_TOTAL_FAILURES c=20 "Total failures"