File list refactoring.

This commit is contained in:
Knutwurst
2023-06-09 13:16:27 +02:00
parent ecdbf477ec
commit a253776044
2 changed files with 27 additions and 27 deletions

View File

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

View File

@@ -32,6 +32,8 @@
#include "../../../module/motion.h"
#include "../../../module/stepper.h"
//#define ANYCUBIC_TFT_DEBUG
#ifdef ANYCUBIC_TOUCHSCREEN
#include "./anycubic_touchscreen.h"
@@ -644,31 +646,28 @@
void AnycubicTouchscreenClass::RenderCurrentFileList() {
currentFileOrDirectory[0] = 0;
uint16_t selectedNumber = 0;
FileList currentFileList;
if (SpecialMenu == false) {
if (CodeSeen('S')) selectedNumber = CodeValue();
// Filelist start
SEND_PGM("FN ");
SENDLINE_PGM("");
if (SpecialMenu) {
RenderSpecialMenu(selectedNumber);
} else if (isMediaInserted() && (selectedNumber <= currentFileList.count())) {
currentTouchscreenSelection[0] = 0;
}
SENDLINE_PGM("FN "); // Filelist start
if (!isMediaInserted() && !SpecialMenu) {
RenderCurrentFolder(selectedNumber);
} else {
SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L);
} else {
uint16_t selectedNumber = 0;
FileList currentFileList;
if (CodeSeen('S')) {
selectedNumber = CodeValue();
}
if (SpecialMenu) {
RenderSpecialMenu(selectedNumber);
} else if (selectedNumber <= currentFileList.count()) {
RenderCurrentFolder(selectedNumber);
}
}
SENDLINE_PGM("END"); // Filelist stop
SEND_PGM("END");
SENDLINE_PGM("");
// Filelist stop
}
void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
@@ -1169,9 +1168,10 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
SENDLINE(ui8tostr3rj(getProgress_percent()));
else
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
} else {
SEND_PGM("A6V ---");
}
else
SENDLINE_PGM("A6V ---");
SENDLINE_PGM("");
#endif
break;
case 7: // A7 GET PRINTING TIME
@@ -1192,7 +1192,6 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
case 8: // A8 GET SD LIST
#ifdef SDSUPPORT
if (SpecialMenu == false) currentTouchscreenSelection[0] = 0;
RenderCurrentFileList();
#endif
break;
@@ -1491,7 +1490,8 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
case 33: // A33 get version info
SEND_PGM("J33 ");
SEND_PGM("KW-");
SENDLINE_PGM(MSG_MY_VERSION);
SEND_PGM(MSG_MY_VERSION);
SENDLINE_PGM("");
break;
#endif
#if ENABLED(KNUTWURST_TFT_LEVELING)