diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index b03d5d468..96cb302ab 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -63,6 +63,7 @@ bool cmdqueue_pop_front() // No serial communication is pending. Reset both pointers to zero. bufindw = 0; bufindr = bufindw; + enableReprint = true; } else { // There is at least one ready line in the buffer. // First skip the current command ID and iterate up to the end of the string. @@ -657,7 +658,6 @@ void get_command() // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); - enableReprint=true; SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED char time[30]; diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 651646bba..ffc93cb46 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -232,6 +232,7 @@ const char MSG_OCTOPRINT_RESUMED[] PROGMEM_N1 = "// action:resumed"; //// const char MSG_OCTOPRINT_CANCEL[] PROGMEM_N1 = "// action:cancel"; //// const char MSG_OCTOPRINT_READY[] PROGMEM_N1 = "// action:ready"; //// const char MSG_OCTOPRINT_NOT_READY[] PROGMEM_N1 = "// action:not_ready"; //// +const char MSG_OCTOPRINT_REPRINT[] PROGMEM_N1 = "// action:reprint"; //// const char MSG_FANCHECK_HOTEND[] PROGMEM_N1 = "Err:HOTEND FAN ERROR"; ////c=20 const char MSG_FANCHECK_PRINT[] PROGMEM_N1 = "Err:PRINT FAN ERROR"; ////c=20 const char MSG_M112_KILL[] PROGMEM_N1 = "M112 called. Emergency Stop."; ////c=20 diff --git a/Firmware/messages.h b/Firmware/messages.h index 3a070d1c5..7919375d5 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -236,6 +236,7 @@ extern const char MSG_OCTOPRINT_RESUMED[]; extern const char MSG_OCTOPRINT_CANCEL[]; extern const char MSG_OCTOPRINT_READY[]; extern const char MSG_OCTOPRINT_NOT_READY[]; +extern const char MSG_OCTOPRINT_REPRINT[]; extern const char MSG_FANCHECK_HOTEND[]; extern const char MSG_FANCHECK_PRINT[]; extern const char MSG_M112_KILL[]; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 6fe1b8fbb..94cccfeb5 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -45,6 +45,8 @@ #include "Prusa_farm.h" +#include "power_panic.h" + static void lcd_sd_updir(); static void lcd_mesh_bed_leveling_settings(); #ifdef LCD_BL_PIN @@ -5199,6 +5201,9 @@ static void lcd_main_menu() if(!printer_active() && enableReprint && card.cardOK) { MENU_ITEM_SUBMENU_P(_T(MSG_REPRINT), reprint_from_eeprom); + }else if(saved_printing_type == PowerPanic::PRINT_TYPE_USB) + { + lcd_reprint_usb_print(); }else if (!card.cardOK) { enableReprint = false; @@ -7500,9 +7505,18 @@ void reprint_from_eeprom() { strcat_P(altfilename, PSTR(".g")); } } - // M23: Select SD file - enquecommandf_P(MSG_M23, altfilename); - // M24: Start/resume SD print - enquecommand_P(MSG_M24); - lcd_return_to_status(); + if (lcd_show_fullscreen_message_yes_no_and_wait_P(altfilename, false, LCD_LEFT_BUTTON_CHOICE)==LCD_LEFT_BUTTON_CHOICE) + { + // M23: Select SD file + enquecommandf_P(MSG_M23, altfilename); + // M24: Start/resume SD print + enquecommand_P(MSG_M24); + } + lcd_return_to_status(); +} + +//! @brief Send host action "reprint" +void lcd_reprint_usb_print() +{ + SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_REPRINT); } diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 2129a7b80..31b927722 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -58,6 +58,7 @@ void lcd_loading_color(); void lcd_sdcard_stop(); void lcd_pause_print(); void lcd_pause_usb_print(); +void lcd_reprint_usb_print(); void lcd_resume_print(); void lcd_print_stop(); // interactive print stop void print_stop(bool interactive=false);