|
@ -30,10 +30,6 @@ |
|
|
|
|
|
|
|
|
#include "menu.h" |
|
|
#include "menu.h" |
|
|
#include "../../module/temperature.h" |
|
|
#include "../../module/temperature.h" |
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
|
|
|
|
|
|
#include "../../sd/cardreader.h" |
|
|
|
|
|
#include "../../gcode/queue.h" |
|
|
#include "../../gcode/queue.h" |
|
|
#include "../../module/printcounter.h" |
|
|
#include "../../module/printcounter.h" |
|
|
|
|
|
|
|
@ -41,23 +37,32 @@ |
|
|
#include "../../feature/power_loss_recovery.h" |
|
|
#include "../../feature/power_loss_recovery.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
void lcd_sdcard_pause() { |
|
|
void lcd_pause() { |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
if (recovery.enabled) recovery.save(true, false); |
|
|
if (recovery.enabled) recovery.save(true, false); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE) |
|
|
|
|
|
pause_print(PAUSE_PARK_RETRACT_LENGTH, NOZZLE_PARK_POINT, 0, true); |
|
|
|
|
|
#elif ENABLED(SDSUPPORT) |
|
|
enqueue_and_echo_commands_P(PSTR("M25")); |
|
|
enqueue_and_echo_commands_P(PSTR("M25")); |
|
|
|
|
|
#elif defined(ACTION_ON_PAUSE) |
|
|
|
|
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); |
|
|
|
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void lcd_sdcard_resume() { |
|
|
void lcd_resume() { |
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE) |
|
|
#if ENABLED(SDSUPPORT) |
|
|
enqueue_and_echo_commands_P(PSTR("M24")); |
|
|
if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24")); |
|
|
#else |
|
|
#elif ENABLED(ACTION_ON_RESUME) |
|
|
card.startFileprint(); |
|
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); |
|
|
print_job_timer.start(); |
|
|
|
|
|
ui.reset_status(); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
|
|
|
|
|
|
#include "../../sd/cardreader.h" |
|
|
|
|
|
|
|
|
void lcd_sdcard_stop() { |
|
|
void lcd_sdcard_stop() { |
|
|
wait_for_heatup = wait_for_user = false; |
|
|
wait_for_heatup = wait_for_user = false; |
|
|
card.flag.abort_sd_printing = true; |
|
|
card.flag.abort_sd_printing = true; |
|
@ -88,35 +93,18 @@ void menu_main() { |
|
|
START_MENU(); |
|
|
START_MENU(); |
|
|
MENU_BACK(MSG_WATCH); |
|
|
MENU_BACK(MSG_WATCH); |
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
const bool busy = printer_busy(); |
|
|
if (card.flag.cardOK) { |
|
|
|
|
|
if (card.isFileOpen()) { |
|
|
|
|
|
if (IS_SD_PRINTING()) |
|
|
|
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); |
|
|
|
|
|
else |
|
|
|
|
|
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); |
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_sdcard_abort_confirm); |
|
|
if (busy) { |
|
|
} |
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_pause); |
|
|
else { |
|
|
MENU_ITEM(submenu, MSG_TUNE, menu_tune); |
|
|
MENU_ITEM(submenu, MSG_CARD_MENU, menu_sdcard); |
|
|
|
|
|
#if !PIN_EXISTS(SD_DETECT) |
|
|
|
|
|
MENU_ITEM(gcode, MSG_CHANGE_SDCARD, PSTR("M21")); // SD-card changed by user
|
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
MENU_ITEM(function, MSG_NO_CARD, NULL); |
|
|
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_resume); |
|
|
#if !PIN_EXISTS(SD_DETECT) |
|
|
#if ENABLED(SDSUPPORT) |
|
|
MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
|
|
|
if (card.isFileOpen()) |
|
|
|
|
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_sdcard_abort_confirm); |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
|
|
|
#endif // SDSUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
const bool busy = printer_busy(); |
|
|
|
|
|
if (busy) |
|
|
|
|
|
MENU_ITEM(submenu, MSG_TUNE, menu_tune); |
|
|
|
|
|
else { |
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOTION, menu_motion); |
|
|
MENU_ITEM(submenu, MSG_MOTION, menu_motion); |
|
|
MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); |
|
|
MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); |
|
|
} |
|
|
} |
|
@ -164,6 +152,20 @@ void menu_main() { |
|
|
MENU_ITEM(function, MSG_AUTOSTART, card.beginautostart); |
|
|
MENU_ITEM(function, MSG_AUTOSTART, card.beginautostart); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
if (card.isDetected() && !card.isFileOpen()) { |
|
|
|
|
|
MENU_ITEM(submenu, MSG_CARD_MENU, menu_sdcard); |
|
|
|
|
|
#if !PIN_EXISTS(SD_DETECT) |
|
|
|
|
|
MENU_ITEM(gcode, MSG_CHANGE_SDCARD, PSTR("M21")); // SD-card changed by user
|
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
MENU_ITEM(function, MSG_NO_CARD, NULL); |
|
|
|
|
|
#if !PIN_EXISTS(SD_DETECT) |
|
|
|
|
|
MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
|
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
END_MENU(); |
|
|
END_MENU(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|