file browse page display
This commit is contained in:
@@ -1070,9 +1070,9 @@
|
||||
#else
|
||||
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
|
||||
#if ANY(HotendMosquito, PID50W)
|
||||
#define DEFAULT_Kp 25.95
|
||||
#define DEFAULT_Ki 3.08
|
||||
#define DEFAULT_Kd 54.74
|
||||
#define DEFAULT_Kp 16.8
|
||||
#define DEFAULT_Ki 1.2
|
||||
#define DEFAULT_Kd 54.3
|
||||
#elif ENABLED(HotendStock)
|
||||
#if ANY(MachineCR10SPro, MachineCR10Max)
|
||||
#define DEFAULT_Kp 25.25
|
||||
|
||||
@@ -86,7 +86,7 @@ void onStartup()
|
||||
#else
|
||||
rtscheck.RTS_SndData(MACHINE_NAME, MacVersion);
|
||||
#endif
|
||||
rtscheck.RTS_SndData(DETAILED_BUILD_VERSION, SoftVersion);
|
||||
rtscheck.RTS_SndData(SHORT_BUILD_VERSION, SoftVersion);
|
||||
rtscheck.RTS_SndData(sizebuf, PrinterSize);
|
||||
rtscheck.RTS_SndData(WEBSITE_URL, CorpWebsite);
|
||||
|
||||
@@ -262,22 +262,25 @@ void onIdle()
|
||||
}
|
||||
rtscheck.RTS_SndData((unsigned int)getProgress_percent(), Percentage);
|
||||
}
|
||||
else if(getTargetTemp_celsius(BED)==0 && getTargetTemp_celsius(H0)==0)
|
||||
{
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) < (getTargetTemp_celsius(BED) - THERMAL_PROTECTION_BED_HYSTERESIS ) || (getActualTemp_celsius(H0) < (getTargetTemp_celsius(H0) - THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus); // Heating Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 1 : PrinterStatusKey[1]);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) > (getTargetTemp_celsius(BED) + THERMAL_PROTECTION_BED_HYSTERESIS) || (getActualTemp_celsius(H0) > (getTargetTemp_celsius(H0) + THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus); // Cooling Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 2 : PrinterStatusKey[1]);
|
||||
}
|
||||
else
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
{
|
||||
if(getTargetTemp_celsius(BED)==0 && getTargetTemp_celsius(H0)==0)
|
||||
{
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) < (getTargetTemp_celsius(BED) - THERMAL_PROTECTION_BED_HYSTERESIS ) || (getActualTemp_celsius(H0) < (getTargetTemp_celsius(H0) - THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus); // Heating Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 1 : PrinterStatusKey[1]);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) > (getTargetTemp_celsius(BED) + THERMAL_PROTECTION_BED_HYSTERESIS) || (getActualTemp_celsius(H0) > (getTargetTemp_celsius(H0) + THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus); // Cooling Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 2 : PrinterStatusKey[1]);
|
||||
}
|
||||
else
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
|
||||
|
||||
rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z);
|
||||
@@ -348,6 +351,20 @@ void onIdle()
|
||||
AutoHomeIconNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(isMediaInserted())
|
||||
{
|
||||
uint16_t currPage;
|
||||
if(fileIndex == 0)
|
||||
currPage = 1;
|
||||
else
|
||||
currPage = CEIL((float)((float)fileIndex / (float)DISPLAY_FILES)) +1;
|
||||
|
||||
uint16_t maxPages = CEIL(((float)filenavigator.maxFiles() / (float)DISPLAY_FILES));
|
||||
rtscheck.RTS_SndData(currPage, FilesCurentPage);
|
||||
rtscheck.RTS_SndData(maxPages, FilesMaxPage);
|
||||
}
|
||||
|
||||
void yield();
|
||||
if (rtscheck.RTS_RecData() > 0)
|
||||
rtscheck.RTS_HandleData();
|
||||
@@ -1768,7 +1785,7 @@ void onUserConfirmRequired(const char *const msg)
|
||||
}
|
||||
void onStatusChanged(const char *const statMsg)
|
||||
{
|
||||
for (int j = 0; j < 40; j++) // Clear old message
|
||||
for (int j = 0; j < 20; j++) // Clear old message
|
||||
rtscheck.RTS_SndData(' ', StatusMessageString+j);
|
||||
rtscheck.RTS_SndData(statMsg, StatusMessageString);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,8 @@ namespace ExtUI {
|
||||
#define FilenameIcon 0x1200
|
||||
#define FilenameIcon1 0x1220
|
||||
#define Printfilename 0x2000
|
||||
#define FilesCurentPage 0x1310
|
||||
#define FilesMaxPage 0x1312
|
||||
#define SDFILE_ADDR 0x200A
|
||||
#define FilenamePlay 0x20D2
|
||||
#define FilenameChs 0x20D3
|
||||
@@ -104,11 +106,12 @@ namespace ExtUI {
|
||||
#define FilenameCount 0x20DE
|
||||
#define FilenameNature 0x6003
|
||||
|
||||
#if ANY(MachineCR10SPro, MachineEnder5Plus, MachineCR10Max) || ENABLED(Force10SProDisplay)
|
||||
#define StatusMessageString 0x3000
|
||||
#else
|
||||
#define StatusMessageString 0x20E8
|
||||
#endif
|
||||
//#if ANY(MachineCR10SPro, MachineEnder5Plus, MachineCR10Max) || ENABLED(Force10SProDisplay)
|
||||
// #define StatusMessageString 0x3000
|
||||
//#else
|
||||
// #define StatusMessageString 0x20E8
|
||||
//#endif
|
||||
#define StatusMessageString 0x2064
|
||||
|
||||
#if defined(TARGET_STM32F4)
|
||||
#define DWIN_SERIAL Serial1
|
||||
|
||||
@@ -21,14 +21,16 @@
|
||||
*/
|
||||
|
||||
/* ****************************************
|
||||
* lcd/extui/lib/nextion/FileNavigator.cpp
|
||||
* lcd/extui/lib/Creality/FileNavigator.cpp
|
||||
* ****************************************
|
||||
* Extensible_UI implementation for Nextion
|
||||
* https://github.com/Skorpi08
|
||||
* Extensible_UI implementation for Creality DWIN
|
||||
* 10SPro, Max, CR10V2
|
||||
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
|
||||
* Written by Insanity Automation
|
||||
* ***************************************/
|
||||
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
|
||||
|
||||
#include "FileNavigator.h"
|
||||
@@ -112,7 +114,7 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
rtscheck.RTS_SndData(10, FilenameIcon1 + j);
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPAIR("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
|
||||
DEBUG_ECHOLNPAIR("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
|
||||
|
||||
if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
|
||||
files--;
|
||||
@@ -121,13 +123,10 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
}
|
||||
|
||||
for (uint16_t seek = currentindex; seek < currentindex + files; seek++) {
|
||||
SERIAL_ECHOLNPAIR("Seek", seek);
|
||||
if (filelist.seek(seek)) {
|
||||
SERIAL_ECHOLN("seek done");
|
||||
const int filelen = strlen(filelist.filename());
|
||||
if(filelen > 20)
|
||||
{
|
||||
SERIAL_ECHOLN("trunc");
|
||||
char *buf = (char *)filelist.filename();
|
||||
//char buf[filelen];
|
||||
//strcpy(&buf[filelen], filelist.filename());
|
||||
@@ -137,11 +136,16 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
else
|
||||
rtscheck.RTS_SndData(filelist.filename(), (SDFILE_ADDR + (fcnt * 20)));
|
||||
if (filelist.isDir())
|
||||
{
|
||||
rtscheck.RTS_SndData((uint8_t)4, FilenameIcon + (fcnt+1));
|
||||
rtscheck.RTS_SndData((unsigned long)0x041F, (FilenameNature + ((1+fcnt) * 16))); // Change BG of selected line to Blue
|
||||
}
|
||||
else
|
||||
{
|
||||
rtscheck.RTS_SndData((uint8_t)0, FilenameIcon + (fcnt+1));
|
||||
rtscheck.RTS_SndData((unsigned long)0xFFFF, (FilenameNature + ((1+fcnt) * 16))); // white
|
||||
rtscheck.RTS_SndData(1, FilenameIcon + (fcnt+1));
|
||||
SERIAL_ECHOLNPAIR("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
|
||||
}
|
||||
DEBUG_ECHOLNPAIR("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
|
||||
fcnt++;
|
||||
}
|
||||
}
|
||||
@@ -178,3 +182,4 @@ void FileNavigator::upDIR() {
|
||||
}
|
||||
|
||||
char* FileNavigator::getCurrentFolderName() { return currentfoldername; }
|
||||
#endif
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
#pragma once
|
||||
|
||||
/* ****************************************
|
||||
* lcd/extui/lib/nextion/FileNavigator.cpp
|
||||
* lcd/extui/lib/Creality/FileNavigator.cpp
|
||||
* ****************************************
|
||||
* Extensible_UI implementation for Nextion
|
||||
* https://github.com/Skorpi08
|
||||
* Extensible_UI implementation for Creality DWIN
|
||||
* 10SPro, Max, CR10V2
|
||||
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
|
||||
* Written by Insanity Automation
|
||||
* ***************************************/
|
||||
|
||||
#include "../../ui_api.h"
|
||||
|
||||
@@ -1067,6 +1067,8 @@ namespace ExtUI {
|
||||
void onStatusChanged_P(PGM_P const pstr) {
|
||||
char msg[strlen_P(pstr) + 1];
|
||||
strcpy_P(msg, pstr);
|
||||
if(strlen(msg) > 20)
|
||||
msg[20]="\0";
|
||||
onStatusChanged(msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user