Reprint function integrated on 3.13v
This commit is contained in:
parent
8615a8dad5
commit
e8a2d4c7e1
|
|
@ -1039,4 +1039,17 @@ bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip)
|
|||
return card.readExtMemory(1, 1, 0x400+0x150, 4, ip);
|
||||
}
|
||||
|
||||
//Used for Reprint action
|
||||
bool CardReader::FileExists(const char* filename)
|
||||
{
|
||||
bool exists = false;
|
||||
|
||||
if (file.open(curDir, filename, O_READ))
|
||||
{
|
||||
exists = true;
|
||||
file.close();
|
||||
}
|
||||
return exists;
|
||||
}
|
||||
|
||||
#endif //SDSUPPORT
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ public:
|
|||
bool ToshibaFlashAir_isEnabled() const { return card.getFlashAirCompatible(); }
|
||||
void ToshibaFlashAir_enable(bool enable) { card.setFlashAirCompatible(enable); }
|
||||
bool ToshibaFlashAir_GetIP(uint8_t *ip);
|
||||
|
||||
//Reprint
|
||||
bool FileExists(const char* filename);
|
||||
|
||||
public:
|
||||
bool saving;
|
||||
|
|
|
|||
|
|
@ -657,6 +657,7 @@ 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];
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ extern const char MSG_LOAD_ALL[] PROGMEM_I1 = ISTR("Load All"); ////MSG_LOAD_ALL
|
|||
extern const char MSG_NOZZLE_CNG_MENU [] PROGMEM_I1 = ISTR("Nozzle change");////MSG_NOZZLE_CNG_MENU c=18
|
||||
extern const char MSG_NOZZLE_CNG_READ_HELP [] PROGMEM_I1 = ISTR("For a Nozzle change please read\nprusa.io/nozzle-mk3s");////MSG_NOZZLE_CNG_READ_HELP c=20 r=4
|
||||
extern const char MSG_NOZZLE_CNG_CHANGED [] PROGMEM_I1 = ISTR("Hotend at 280C! Nozzle changed and tightened to specs?");////MSG_NOZZLE_CNG_CHANGED c=20 r=6
|
||||
|
||||
extern const char MSG_REPRINT [] PROGMEM_I1 = ISTR("Reprint"); ////MSG_REPRINT c=7
|
||||
//not internationalized messages
|
||||
#if 0
|
||||
const char MSG_FW_VERSION_BETA[] PROGMEM_N1 = "You are using a BETA firmware version! It is in a development state! Use this version with CAUTION as it may DAMAGE the printer!"; ////MSG_FW_VERSION_BETA c=20 r=8
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ extern const char MSG_LOAD_ALL[];
|
|||
extern const char MSG_NOZZLE_CNG_MENU [];
|
||||
extern const char MSG_NOZZLE_CNG_READ_HELP [];
|
||||
extern const char MSG_NOZZLE_CNG_CHANGED [];
|
||||
extern const char MSG_REPRINT [];
|
||||
|
||||
//not internationalized messages
|
||||
#if 0
|
||||
|
|
|
|||
|
|
@ -255,6 +255,8 @@ uint8_t selected_sheet = 0;
|
|||
bool bMain; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
|
||||
bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
|
||||
|
||||
//action: Reprint
|
||||
bool enableReprint = false;
|
||||
static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename)
|
||||
{
|
||||
uint8_t len = LCD_WIDTH - 1;
|
||||
|
|
@ -5193,6 +5195,14 @@ static void lcd_main_menu()
|
|||
MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_);
|
||||
#endif //TMC2130_DEBUG
|
||||
|
||||
// Menu item for reprint
|
||||
if(!printer_active() && enableReprint && card.cardOK)
|
||||
{
|
||||
MENU_ITEM_SUBMENU_P(_T(MSG_REPRINT), reprint_from_eeprom);
|
||||
}else if (!card.cardOK)
|
||||
{
|
||||
enableReprint = false;
|
||||
}
|
||||
// Menu is never shown when idle
|
||||
if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal))
|
||||
MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8
|
||||
|
|
@ -7454,3 +7464,52 @@ void lcd_heat_bed_on_load_toggle()
|
|||
value = !value;
|
||||
eeprom_update_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value);
|
||||
}
|
||||
|
||||
void reprint_from_eeprom() {
|
||||
char cmd[30];
|
||||
char filename[13];
|
||||
char altfilename[13];
|
||||
uint8_t depth = 0;
|
||||
char dir_name[9];
|
||||
|
||||
enableReprint=false;
|
||||
|
||||
//cmdqueue_reset();
|
||||
|
||||
depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH);
|
||||
|
||||
MYSERIAL.println(int(depth));
|
||||
for (int i = 0; i < depth; i++) {
|
||||
for (int j = 0; j < 8; j++) {
|
||||
dir_name[j] = eeprom_read_byte((uint8_t*)EEPROM_DIRS + j + 8 * i);
|
||||
}
|
||||
dir_name[8] = '\0';
|
||||
MYSERIAL.println(dir_name);
|
||||
// strcpy(dir_names[i], dir_name);
|
||||
card.chdir(dir_name, false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
filename[i] = eeprom_read_byte((uint8_t*)EEPROM_FILENAME + i);
|
||||
}
|
||||
filename[8] = '\0';
|
||||
|
||||
strcpy(altfilename,filename);
|
||||
if (!card.FileExists(altfilename))
|
||||
{
|
||||
strcat_P(filename, PSTR(".gco"));
|
||||
if (card.FileExists(filename))
|
||||
{
|
||||
strcpy(altfilename,filename);
|
||||
}else
|
||||
{
|
||||
strcat_P(altfilename, PSTR(".g"));
|
||||
}
|
||||
}
|
||||
MYSERIAL.print(altfilename);
|
||||
sprintf_P(cmd, PSTR("M23 %s"), altfilename);
|
||||
enquecommand(cmd);
|
||||
sprintf_P(cmd, PSTR("M24"));
|
||||
enquecommand(cmd);
|
||||
lcd_return_to_status();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ void ultralcd_init();
|
|||
#define LCD_STATUS_INFO_TIMEOUT 20000
|
||||
#define LCD_STATUS_DELAYED_TIMEOUT 4000
|
||||
|
||||
// Reprint
|
||||
void reprint_from_eeprom();
|
||||
extern bool enableReprint;
|
||||
|
||||
// Set the current status message (equivalent to LCD_STATUS_NONE)
|
||||
void lcdui_print_status_line(void);
|
||||
void lcd_clearstatus();
|
||||
|
|
|
|||
|
|
@ -2470,3 +2470,7 @@ msgstr ""
|
|||
#. MSG_FW_MK3_DETECTED c=20 r=4
|
||||
msgid "MK3 firmware detected on MK3S printer"
|
||||
msgstr ""
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
msgid "Reprint"
|
||||
msgstr ""
|
||||
|
|
|
|||
|
|
@ -2565,6 +2565,11 @@ msgstr "Připravit"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Zrušit Připravena"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Reprint"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Vyjmete stary filament a stisknete tlacitko pro zavedeni noveho."
|
||||
|
||||
|
|
|
|||
|
|
@ -2593,6 +2593,11 @@ msgstr "Bereit setzen"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Nicht breit setzen"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Abdruck"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Entferne das alte Fil. und drücke den Knopf, um das neue zu laden."
|
||||
|
||||
|
|
|
|||
|
|
@ -2588,6 +2588,11 @@ msgstr "Listo"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Conjunto no listo"
|
||||
|
||||
#. MSG_REPRINT c=10
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Reimprimir"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr ""
|
||||
#~ "Retira el fil. viejo y presiona el dial para comenzar a cargar el nuevo."
|
||||
|
|
|
|||
|
|
@ -2600,6 +2600,11 @@ msgstr "Ensemble prête"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Ensemble pas prête"
|
||||
|
||||
#. MSG_REPRINT c=13
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Réimpresision"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr ""
|
||||
#~ "Retirez l'ancien fil. puis appuyez sur le bouton pour charger le nouveau."
|
||||
|
|
|
|||
|
|
@ -2582,6 +2582,11 @@ msgstr "Set spreman"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Set nije spreman"
|
||||
|
||||
#. MSG_REPRINT c=8
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Pretisak"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Uklonite stari fil. i pritisnite gumb za pocetak stavljanja novog."
|
||||
|
||||
|
|
|
|||
|
|
@ -2587,6 +2587,11 @@ msgstr "Készen áll"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Készen nem áll"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Reprint"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Vedd ki a regi fil., majd nyomd meg a gombot az uj fil. betoltesehez."
|
||||
|
||||
|
|
|
|||
|
|
@ -2588,6 +2588,11 @@ msgstr "Imposta pronta"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Imposta non pronta"
|
||||
|
||||
#. MSG_REPRINT c=10
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Ristampare"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Rimuovi il fil. precedente e premi la manopola per caricare il nuovo."
|
||||
|
||||
|
|
|
|||
|
|
@ -2590,6 +2590,11 @@ msgstr "Gereed zetten"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Niet gereed zetten"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Reprint"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr ""
|
||||
#~ "Verwijder de oude filament en druk op de knop om nieuwe filament te laden."
|
||||
|
|
|
|||
|
|
@ -2564,6 +2564,11 @@ msgstr "Gjør klar"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Sett ikke klar"
|
||||
|
||||
#. MSG_REPRINT c=8
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Opptrykk"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Ta bort det gamle filamentet og trykk valghjulet for å laste et nytt."
|
||||
|
||||
|
|
|
|||
|
|
@ -2580,6 +2580,11 @@ msgstr "Ustaw gotowość"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Cofnij gotowość"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Przedruk"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Wyciągnij poprzedni filament i naciśnij pokrętło aby załadować nowy."
|
||||
|
||||
|
|
|
|||
|
|
@ -2589,6 +2589,11 @@ msgstr "Printer pregătit"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Print. nu pregătit"
|
||||
|
||||
#. MSG_REPRINT c=10
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Retiparire"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Scoateți fil. vechi și apăsați butonul pentru a încărca unul nou."
|
||||
|
||||
|
|
|
|||
|
|
@ -2570,6 +2570,11 @@ msgstr "Pripravené"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Nie je pripravené"
|
||||
|
||||
#. MSG_REPRINT c=6
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Dotlac"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Vyberte starý filament a stlačte tlačidlo pre zavedenie nového."
|
||||
|
||||
|
|
|
|||
|
|
@ -2577,6 +2577,11 @@ msgstr "Gör klar"
|
|||
msgid "Set not Ready"
|
||||
msgstr "Set inte klart"
|
||||
|
||||
#. MSG_REPRINT c=7
|
||||
#: ../../Firmware/ultralcd.cpp:5189
|
||||
msgid "Reprint"
|
||||
msgstr "Omtryck"
|
||||
|
||||
#~ msgid "Remove old filament and press the knob to start loading new filament."
|
||||
#~ msgstr "Ta bort det gamla fil. och tryck på knappen för att börja ladda nytt."
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue