Restructure fileList to load faster.

This commit is contained in:
Knutwurst
2023-06-10 17:32:34 +02:00
parent 556be8126b
commit 000c489b63
2 changed files with 8 additions and 9 deletions

View File

@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
#define CUSTOM_BUILD_VERSION "1.5.1-pre" #define CUSTOM_BUILD_VERSION "1.5.1"
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-06-09" #define STRING_DISTRIBUTION_DATE "2023-06-09"

View File

@@ -646,11 +646,17 @@
void AnycubicTouchscreenClass::RenderCurrentFileList() { void AnycubicTouchscreenClass::RenderCurrentFileList() {
currentFileOrDirectory[0] = 0; currentFileOrDirectory[0] = 0;
uint16_t selectedNumber = 0;
FileList currentFileList;
if (SpecialMenu == false) { if (SpecialMenu == false) {
currentTouchscreenSelection[0] = 0; currentTouchscreenSelection[0] = 0;
} }
if (CodeSeen('S')) {
selectedNumber = CodeValue();
}
// Filelist start // Filelist start
SEND_PGM("FN "); SEND_PGM("FN ");
SENDLINE_PGM(""); SENDLINE_PGM("");
@@ -659,13 +665,6 @@ void AnycubicTouchscreenClass::RenderCurrentFileList() {
SENDLINE_PGM(SM_SPECIAL_MENU_S); SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L); SENDLINE_PGM(SM_SPECIAL_MENU_L);
} else { } else {
uint16_t selectedNumber = 0;
FileList currentFileList;
if (CodeSeen('S')) {
selectedNumber = CodeValue();
}
if (SpecialMenu) { if (SpecialMenu) {
RenderSpecialMenu(selectedNumber); RenderSpecialMenu(selectedNumber);
} else if (selectedNumber <= currentFileList.count()) { } else if (selectedNumber <= currentFileList.count()) {