also…
This commit is contained in:
@@ -65,8 +65,8 @@ namespace ExtUI {
|
||||
void onIdle() {}
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {}
|
||||
|
||||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaMounted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
|
||||
void onHeatingError(const heater_id_t heater_id) {
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace ExtUI {
|
||||
chiron.printerKilled(error, component);
|
||||
}
|
||||
|
||||
void onMediaInserted() { chiron.mediaEvent(AC_media_inserted); }
|
||||
void onMediaError() { chiron.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
|
||||
void onMediaMounted() { chiron.mediaEvent(AC_media_inserted); }
|
||||
void onMediaError() { chiron.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
|
||||
|
||||
void onHeatingError(const heater_id_t header_id) {}
|
||||
void onMinTempError(const heater_id_t header_id) {}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace ExtUI {
|
||||
void onIdle() { anycubicTFT.onCommandScan(); }
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); }
|
||||
|
||||
void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); }
|
||||
void onMediaMounted() { anycubicTFT.onSDCardStateChange(true); }
|
||||
void onMediaError() { anycubicTFT.onSDCardError(); }
|
||||
void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); }
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace ExtUI {
|
||||
dgus.printerKilled(error, component);
|
||||
}
|
||||
|
||||
void onMediaInserted() { dgus.mediaEvent(AC_media_inserted); }
|
||||
void onMediaError() { dgus.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
|
||||
void onMediaMounted() { dgus.mediaEvent(AC_media_inserted); }
|
||||
void onMediaError() { dgus.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
|
||||
|
||||
void onHeatingError(const heater_id_t header_id) {}
|
||||
void onMinTempError(const heater_id_t header_id) {}
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace ExtUI {
|
||||
while (!screen.loop()); // Wait while anything is left to be sent
|
||||
}
|
||||
|
||||
void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
void onHeatingError(const heater_id_t header_id) {}
|
||||
void onMinTempError(const heater_id_t header_id) {}
|
||||
|
||||
@@ -55,9 +55,9 @@ namespace ExtUI {
|
||||
screen.printerKilled(error, component);
|
||||
}
|
||||
|
||||
void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
void onHeatingError(const heater_id_t header_id) {}
|
||||
void onMinTempError(const heater_id_t header_id) {}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace ExtUI {
|
||||
screen.printerKilled(error, component);
|
||||
}
|
||||
|
||||
void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
|
||||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace ExtUI {
|
||||
void onIdle() {}
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {}
|
||||
|
||||
void onMediaInserted() {}
|
||||
void onMediaMounted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ void StatusScreen::onIdle() {
|
||||
}
|
||||
}
|
||||
|
||||
void StatusScreen::onMediaInserted() {
|
||||
void StatusScreen::onMediaMounted() {
|
||||
if (AT_SCREEN(StatusScreen))
|
||||
setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED));
|
||||
}
|
||||
|
||||
@@ -58,6 +58,6 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
|
||||
static bool onTouchHeld(uint8_t tag);
|
||||
static bool onTouchEnd(uint8_t tag);
|
||||
static void onIdle();
|
||||
static void onMediaInserted();
|
||||
static void onMediaMounted();
|
||||
static void onMediaRemoved();
|
||||
};
|
||||
|
||||
@@ -44,10 +44,10 @@ namespace ExtUI {
|
||||
KillScreen::show(str);
|
||||
}
|
||||
|
||||
void onMediaInserted() {
|
||||
void onMediaMounted() {
|
||||
#if HAS_MEDIA
|
||||
sound.play(media_inserted, PLAY_ASYNCHRONOUS);
|
||||
StatusScreen::onMediaInserted();
|
||||
StatusScreen::onMediaMounted();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -453,7 +453,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void StatusScreen::onMediaInserted() {
|
||||
void StatusScreen::onMediaMounted() {
|
||||
if (AT_SCREEN(StatusScreen))
|
||||
setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED));
|
||||
}
|
||||
|
||||
@@ -42,6 +42,6 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
|
||||
static void onEntry();
|
||||
static void onIdle();
|
||||
static bool onTouchEnd(uint8_t tag);
|
||||
static void onMediaInserted();
|
||||
static void onMediaMounted();
|
||||
static void onMediaRemoved();
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
|
||||
delay_ms(10);
|
||||
}
|
||||
|
||||
void onMediaInserted() {
|
||||
void onMediaMounted() {
|
||||
filenavigator.reset();
|
||||
filenavigator.getFiles(0);
|
||||
fileIndex = 0;
|
||||
|
||||
@@ -252,7 +252,7 @@ void RTS::onIdle() {
|
||||
}
|
||||
else if (startprogress < 250) {
|
||||
if (isMediaMounted()) // Re init media as it happens too early on STM32 boards often
|
||||
onMediaInserted();
|
||||
onMediaMounted();
|
||||
else
|
||||
injectCommands(F("M22\nM21"));
|
||||
startprogress = 254;
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace ExtUI {
|
||||
// Not needed for Malyan LCD
|
||||
void onStatusChanged(const char * const) {}
|
||||
|
||||
void onMediaInserted() {}
|
||||
void onMediaMounted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace ExtUI {
|
||||
void onIdle() { nextion.idleLoop(); }
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component) { nextion.printerKilled(error, component); }
|
||||
|
||||
void onMediaInserted() {}
|
||||
void onMediaMounted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace ExtUI {
|
||||
|
||||
/**
|
||||
* The Extensible UI API is a utility class that can be used to implement:
|
||||
* - An LCD view that responds to standard events, e.g., onMediaInserted(...)
|
||||
* - An LCD view that responds to standard events, e.g., onMediaMounted(...)
|
||||
* - An LCD that polls firmware states and settings in a standard manner.
|
||||
* (e.g., With tool indexes and extruder indexes).
|
||||
* - Standard hooks to send data to a serial-based controller.
|
||||
@@ -495,7 +495,7 @@ namespace ExtUI {
|
||||
void onStartup();
|
||||
void onIdle();
|
||||
|
||||
void onMediaInserted();
|
||||
void onMediaMounted();
|
||||
void onMediaError();
|
||||
void onMediaRemoved();
|
||||
|
||||
|
||||
@@ -1821,7 +1821,7 @@ void MarlinUI::host_notify(const char * const cstr) {
|
||||
if (status) {
|
||||
if (old_status < 2) {
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMediaInserted();
|
||||
ExtUI::onMediaMounted();
|
||||
#elif ENABLED(BROWSE_MEDIA_ON_INSERT)
|
||||
clear_menu_history();
|
||||
quick_feedback();
|
||||
|
||||
Reference in New Issue
Block a user