name change
This commit is contained in:
@@ -564,8 +564,8 @@ void ChironTFT::panelInfo(uint8_t req) {
|
||||
} break;
|
||||
|
||||
case 8: // A8 Get SD Card list A8 S0
|
||||
if (!isMediaInserted()) safe_delay(500);
|
||||
if (!isMediaInserted()) // Make sure the card is removed
|
||||
if (!isMediaMounted()) safe_delay(500);
|
||||
if (!isMediaMounted()) // Make sure the card is removed
|
||||
tftSendLn(AC_msg_no_sd_card);
|
||||
else if (panel_command[3] == 'S')
|
||||
sendFileList( atoi( &panel_command[4] ) );
|
||||
|
||||
@@ -138,8 +138,8 @@ void AnycubicTFT::onKillTFT() {
|
||||
SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11");
|
||||
}
|
||||
|
||||
void AnycubicTFT::onSDCardStateChange(bool isInserted) {
|
||||
DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isInserted);
|
||||
void AnycubicTFT::onSDCardStateChange(bool isMounted) {
|
||||
DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isMounted);
|
||||
doSDCardStateCheck();
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ void AnycubicTFT::renderCurrentFileList() {
|
||||
|
||||
SENDLINE_PGM("FN "); // Filelist start
|
||||
|
||||
if (!isMediaInserted() && !specialMenu) {
|
||||
if (!isMediaMounted() && !specialMenu) {
|
||||
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
|
||||
|
||||
SENDLINE_PGM("<SPECI~1.GCO");
|
||||
@@ -579,7 +579,7 @@ void AnycubicTFT::getCommandFromTFT() {
|
||||
#if HAS_MEDIA
|
||||
if (isPrintingFromMedia()) {
|
||||
SEND_PGM("A6V ");
|
||||
if (isMediaInserted())
|
||||
if (isMediaMounted())
|
||||
SENDLINE(ui8tostr3rj(getProgress_percent()));
|
||||
else
|
||||
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
|
||||
@@ -632,7 +632,7 @@ void AnycubicTFT::getCommandFromTFT() {
|
||||
|
||||
case 13: // A13 SELECTION FILE
|
||||
#if HAS_MEDIA
|
||||
if (isMediaInserted()) {
|
||||
if (isMediaMounted()) {
|
||||
starpos = (strchr(tftStrchrPtr + 4, '*'));
|
||||
if (tftStrchrPtr[4] == '/') {
|
||||
strcpy(selectedDirectory, tftStrchrPtr + 5);
|
||||
@@ -831,7 +831,7 @@ void AnycubicTFT::getCommandFromTFT() {
|
||||
|
||||
case 26: // A26 refresh SD
|
||||
#if HAS_MEDIA
|
||||
if (isMediaInserted()) {
|
||||
if (isMediaMounted()) {
|
||||
if (strlen(selectedDirectory) > 0) {
|
||||
FileList currentFileList;
|
||||
if ((selectedDirectory[0] == '.') && (selectedDirectory[1] == '.')) {
|
||||
@@ -883,12 +883,12 @@ void AnycubicTFT::getCommandFromTFT() {
|
||||
}
|
||||
|
||||
void AnycubicTFT::doSDCardStateCheck() {
|
||||
#if ALL(HAS_MEDIA, HAS_SD_DETECT)
|
||||
bool isInserted = isMediaInserted();
|
||||
if (isInserted)
|
||||
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
|
||||
#if HAS_MEDIA
|
||||
const bool isMounted = isMediaMounted();
|
||||
if (isMounted)
|
||||
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isMounted");
|
||||
else
|
||||
SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted");
|
||||
SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isMounted");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1268,7 +1268,7 @@ namespace Anycubic {
|
||||
break;
|
||||
|
||||
case 4: // page refresh
|
||||
if (!isMediaInserted()) safe_delay(500);
|
||||
if (!isMediaMounted()) safe_delay(500);
|
||||
|
||||
filenavigator.reset();
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
|
||||
|
||||
void DGUSScreenHandler::screenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
// default action executed when there is a SD card, but not printing
|
||||
if (ExtUI::isMediaInserted() && !ExtUI::isPrintingFromMedia()) {
|
||||
if (ExtUI::isMediaMounted() && !ExtUI::isPrintingFromMedia()) {
|
||||
screenChangeHook(var, val_ptr);
|
||||
dgus.requestScreen(current_screenID);
|
||||
return;
|
||||
@@ -279,7 +279,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
|
||||
}
|
||||
|
||||
// Don't let the user in the dark why there is no reaction.
|
||||
if (!ExtUI::isMediaInserted()) {
|
||||
if (!ExtUI::isMediaMounted()) {
|
||||
setStatusMessage(GET_TEXT_F(MSG_NO_MEDIA));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void DGUSReturnKeyCodeHandler::Command_MenuSelect(DGUS_VP &vp, void *data) {
|
||||
break;
|
||||
|
||||
case DGUS_Data::MenuSelectCommand::Print:
|
||||
if (ExtUI::isMediaInserted()) {
|
||||
if (ExtUI::isMediaMounted()) {
|
||||
dgus_sdcard_handler.Reset();
|
||||
screen.triggerScreenChange(DGUS_ScreenID::FILE1);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void DGUSReturnKeyCodeHandler::Command_CheckOK(DGUS_VP &vp, void *data) {
|
||||
#endif // HAS_FILAMENT_SENSOR
|
||||
|
||||
case DGUS_Data::CheckOKCommand::SDCardCheck_Yes:
|
||||
if (ExtUI::isMediaInserted()) {
|
||||
if (ExtUI::isMediaMounted()) {
|
||||
dgus_sdcard_handler.Reset();
|
||||
screen.triggerScreenChange(DGUS_ScreenID::FILE1);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void DGUSTxHandler::levelingProgressIcon(DGUS_VP &vp) {
|
||||
#endif
|
||||
|
||||
void DGUSTxHandler::sdCardInsertionStatus(DGUS_VP &vp) {
|
||||
const uint16_t data = ExtUI::isMediaInserted() ? 1 : 0;
|
||||
const uint16_t data = ExtUI::isMediaMounted() ? 1 : 0;
|
||||
dgus.write((uint16_t)vp.addr, Endianness::toBE(data));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void DGUSRxHandler::screenChange(DGUS_VP &vp, void *data_ptr) {
|
||||
#if HAS_MEDIA
|
||||
IF_DISABLED(HAS_SD_DETECT, card.mount());
|
||||
|
||||
if (!ExtUI::isMediaInserted()) {
|
||||
if (!ExtUI::isMediaMounted()) {
|
||||
screen.setStatusMessage(GET_TEXT_F(MSG_NO_MEDIA));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void StatusScreen::draw_overlay_icons(draw_mode_t what) {
|
||||
void StatusScreen::draw_buttons(draw_mode_t what) {
|
||||
int16_t x, y, h, v;
|
||||
|
||||
const bool has_media = isMediaInserted() && !isPrintingFromMedia();
|
||||
const bool has_media = isMediaMounted() && !isPrintingFromMedia();
|
||||
|
||||
CommandProcessor cmd;
|
||||
PolyUI ui(cmd, what);
|
||||
|
||||
@@ -227,8 +227,8 @@ void StatusScreen::draw_buttons(draw_mode_t what) {
|
||||
if (what & FOREGROUND) {
|
||||
int16_t x, y, w, h;
|
||||
|
||||
const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected();
|
||||
const bool can_select = !isPrinting() && isMediaInserted();
|
||||
const bool can_print = !isPrinting() && isMediaMounted() && isFileSelected();
|
||||
const bool can_select = !isPrinting() && isMediaMounted();
|
||||
const bool sdOrHostPrinting = ExtUI::isPrinting();
|
||||
const bool sdOrHostPaused = ExtUI::isPrintingPaused();
|
||||
|
||||
@@ -284,7 +284,7 @@ void StatusScreen::draw_file(draw_mode_t what) {
|
||||
.cmd (BITMAP_SIZE (File_Icon_Info))
|
||||
.icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale);
|
||||
|
||||
if (!isMediaInserted())
|
||||
if (!isMediaMounted())
|
||||
draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small);
|
||||
else if (isFileSelected()) {
|
||||
FileList list;
|
||||
@@ -311,7 +311,7 @@ void StatusScreen::draw_message(draw_mode_t what, const char *message) {
|
||||
}
|
||||
|
||||
bool StatusScreen::isFileSelected() {
|
||||
if (!isMediaInserted()) return false;
|
||||
if (!isMediaMounted()) return false;
|
||||
FileList list;
|
||||
if (list.isDir()) return false;
|
||||
const char *filename = list.filename();
|
||||
|
||||
@@ -299,7 +299,7 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
|
||||
#define MENU_BTN_POS BTN_POS(3,13), BTN_SIZE(2,4)
|
||||
#endif
|
||||
|
||||
const bool has_media = isMediaInserted() && !isPrintingFromMedia();
|
||||
const bool has_media = isMediaMounted() && !isPrintingFromMedia();
|
||||
|
||||
CommandProcessor cmd;
|
||||
cmd.colors(normal_btn)
|
||||
|
||||
@@ -262,7 +262,7 @@ void RTS::onIdle() {
|
||||
delay_ms(3000); // Delay to show bootscreen
|
||||
}
|
||||
else if (startprogress < 250) {
|
||||
if (isMediaInserted()) // Re init media as it happens too early on STM32 boards often
|
||||
if (isMediaMounted()) // Re init media as it happens too early on STM32 boards often
|
||||
onMediaInserted();
|
||||
else
|
||||
injectCommands(F("M22\nM21"));
|
||||
@@ -386,7 +386,7 @@ void RTS::onIdle() {
|
||||
if (++autoHomeIconNum > 9) autoHomeIconNum = 0;
|
||||
}
|
||||
|
||||
if (isMediaInserted()) {
|
||||
if (isMediaMounted()) {
|
||||
const uint16_t currPage = fileIndex == 0 ? 1 : CEIL(float(fileIndex) / float(DISPLAY_FILES)) + 1,
|
||||
maxPageAdd = filenavigator.folderdepth ? 1 : 0,
|
||||
maxPages = CEIL(float(filenavigator.maxFiles() + maxPageAdd) / float(DISPLAY_FILES) );
|
||||
@@ -1499,7 +1499,7 @@ void RTS::handleData() {
|
||||
} break;
|
||||
|
||||
case Filename: {
|
||||
if (isMediaInserted() && recdat.addr == FilenameChs) {
|
||||
if (isMediaMounted() && recdat.addr == FilenameChs) {
|
||||
|
||||
recordcount = recdat.data[0] - 1;
|
||||
if (filenavigator.currentindex == 0 && filenavigator.folderdepth > 0 && (fileIndex + recordcount) == 0) {
|
||||
@@ -1532,7 +1532,7 @@ void RTS::handleData() {
|
||||
}
|
||||
}
|
||||
else if (recdat.addr == FilenamePlay) {
|
||||
if (recdat.data[0] == 1 && isMediaInserted()) { // for sure
|
||||
if (recdat.data[0] == 1 && isMediaMounted()) { // for sure
|
||||
printFile(filenavigator.getIndexName(fileIndex + recordcount));
|
||||
|
||||
for (int16_t j = 0; j < 10; j++) // clean screen.
|
||||
|
||||
@@ -210,8 +210,8 @@ void NextionTFT::panelInfo(uint8_t req) {
|
||||
|
||||
case 1: // Get SD Card list
|
||||
if (!isPrinting()) {
|
||||
if (!isMediaInserted()) safe_delay(500);
|
||||
if (!isMediaInserted()) { // Make sure the card is removed
|
||||
if (!isMediaMounted()) safe_delay(500);
|
||||
if (!isMediaMounted()) { // Make sure the card is removed
|
||||
//SEND_TXT("tmppage.M117", msg_no_sd_card);
|
||||
}
|
||||
else if (nextion_command[3] == 'S')
|
||||
|
||||
@@ -1159,7 +1159,7 @@ namespace ExtUI {
|
||||
return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused());
|
||||
}
|
||||
|
||||
bool isMediaInserted() { return TERN0(HAS_MEDIA, card.isMounted()); }
|
||||
bool isMediaMounted() { return TERN0(HAS_MEDIA, card.isMounted()); }
|
||||
|
||||
// Pause/Resume/Stop are implemented in MarlinUI
|
||||
void pausePrint() { ui.pause_print(); }
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace ExtUI {
|
||||
* Media access routines
|
||||
* Use these to operate on files
|
||||
*/
|
||||
bool isMediaInserted();
|
||||
bool isMediaMounted();
|
||||
bool isPrintingFromMediaPaused();
|
||||
bool isPrintingFromMedia();
|
||||
bool isPrinting();
|
||||
|
||||
Reference in New Issue
Block a user