|
@@ -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();
|
|
@@ -75,11 +75,6 @@ int8_t FSensorStateMenu = 1;
|
|
|
bool bMenuFSDetect=false;
|
|
|
#endif //IR_SENSOR_ANALOG
|
|
|
|
|
|
-
|
|
|
-#ifdef SDCARD_SORT_ALPHA
|
|
|
-bool presort_flag = false;
|
|
|
-#endif
|
|
|
-
|
|
|
LcdCommands lcd_commands_type = LcdCommands::Idle;
|
|
|
static uint8_t lcd_commands_step = 0;
|
|
|
|
|
@@ -676,31 +671,85 @@ 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;
|
|
|
- if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)
|
|
|
- print_t = print_time_remaining();
|
|
|
- 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)))
|
|
|
- {
|
|
|
- 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
|
|
|
- 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 remaining print time estimation is available print it else print elapsed time
|
|
|
+ int chars = 0;
|
|
|
+ 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 = ' ';
|
|
|
+
|
|
|
+#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
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+//#endif //CLOCK_INTERVAL_TIME
|
|
|
+#ifdef 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';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ print_t = _millis() / 60000 - starttime / 60000;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc))
|
|
|
+ {
|
|
|
+ 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
|
|
|
+ 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
|
|
@@ -1659,8 +1708,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
|
|
@@ -1673,8 +1722,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();
|
|
|
}
|
|
|
|
|
@@ -1683,9 +1732,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.
|
|
@@ -1698,9 +1747,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();
|
|
|
}
|
|
|
|
|
@@ -1712,8 +1761,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
|
|
@@ -1728,8 +1777,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();
|
|
|
}
|
|
@@ -1739,9 +1788,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.
|
|
@@ -1756,8 +1805,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
|
|
@@ -1766,7 +1815,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
|
|
@@ -1809,9 +1858,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.
|
|
@@ -1823,9 +1872,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();
|
|
|
}
|
|
@@ -2237,18 +2286,18 @@ uint8_t nLevel;
|
|
|
|
|
|
lcd_set_cursor(0,0);
|
|
|
lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
|
|
|
-lcd_puts_at_P(0,2, _i("Press the knob")); ////MSG_ c=20 r=1
|
|
|
-lcd_set_cursor(0,3);
|
|
|
+lcd_puts_at_P(0,1, _i("Press the knob")); ////MSG_ c=20
|
|
|
+lcd_set_cursor(0,2);
|
|
|
switch(eFilamentAction)
|
|
|
{
|
|
|
case FilamentAction::Load:
|
|
|
case FilamentAction::AutoLoad:
|
|
|
case FilamentAction::MmuLoad:
|
|
|
- lcd_puts_P(_i("to load filament")); ////MSG_ c=20 r=1
|
|
|
+ lcd_puts_P(_i("to load filament")); ////MSG_ c=20
|
|
|
break;
|
|
|
case FilamentAction::UnLoad:
|
|
|
case FilamentAction::MmuUnLoad:
|
|
|
- lcd_puts_P(_i("to unload filament")); ////MSG_ c=20 r=1
|
|
|
+ lcd_puts_P(_i("to unload filament")); ////MSG_ c=20
|
|
|
break;
|
|
|
case FilamentAction::MmuEject:
|
|
|
case FilamentAction::MmuCut:
|
|
@@ -4319,7 +4368,7 @@ static void lcd_sort_type_set() {
|
|
|
default: sdSort = SD_SORT_TIME;
|
|
|
}
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_SD_SORT, sdSort);
|
|
|
- presort_flag = true;
|
|
|
+ card.presort_flag = true;
|
|
|
}
|
|
|
#endif //SDCARD_SORT_ALPHA
|
|
|
|
|
@@ -5293,16 +5342,13 @@ do\
|
|
|
else\
|
|
|
MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
\
|
|
|
- if (!farm_mode)\
|
|
|
+ uint8_t sdSort;\
|
|
|
+ EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\
|
|
|
+ switch (sdSort)\
|
|
|
{\
|
|
|
- uint8_t sdSort;\
|
|
|
- EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\
|
|
|
- switch (sdSort)\
|
|
|
- {\
|
|
|
- case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break;\
|
|
|
- case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break;\
|
|
|
- default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set);\
|
|
|
- }\
|
|
|
+ case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break;\
|
|
|
+ case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break;\
|
|
|
+ default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -7185,8 +7231,8 @@ void lcd_sdcard_menu()
|
|
|
{
|
|
|
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
|
|
|
|
|
- if (presort_flag == true) {
|
|
|
- presort_flag = false;
|
|
|
+ if (card.presort_flag == true) {
|
|
|
+ card.presort_flag = false;
|
|
|
card.presort();
|
|
|
}
|
|
|
if (lcd_draw_update == 0 && LCD_CLICKED == 0)
|
|
@@ -8399,7 +8445,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
|
|
@@ -8483,7 +8529,7 @@ static void lcd_selftest_screen_step(int _row, int _col, int _state, const char
|
|
|
|
|
|
static bool check_file(const char* filename) {
|
|
|
if (farm_mode) return true;
|
|
|
- card.openFile((char*)filename, true);
|
|
|
+ card.openFileReadFilteredGcode(filename, true);
|
|
|
bool result = false;
|
|
|
const uint32_t filesize = card.getFileSize();
|
|
|
uint32_t startPos = 0;
|
|
@@ -8550,7 +8596,7 @@ static void menu_action_sdfile(const char* filename)
|
|
|
|
|
|
for (uint_least8_t i = 0; i < depth; i++) {
|
|
|
for (uint_least8_t j = 0; j < 8; j++) {
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, card.dir_names[i][j]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -8568,12 +8614,8 @@ static void menu_action_sdfile(const char* filename)
|
|
|
|
|
|
void menu_action_sddirectory(const char* filename)
|
|
|
{
|
|
|
- uint8_t depth = (uint8_t)card.getWorkDirDepth();
|
|
|
-
|
|
|
- strcpy(dir_names[depth], filename);
|
|
|
- MYSERIAL.println(dir_names[depth]);
|
|
|
- card.chdir(filename);
|
|
|
- lcd_encoder = 0;
|
|
|
+ card.chdir(filename, true);
|
|
|
+ lcd_encoder = 0;
|
|
|
}
|
|
|
|
|
|
/** LCD API **/
|